-
Notifications
You must be signed in to change notification settings - Fork 12
refactor: extract Document, Animation, and XPath interfaces #287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
7d22c35
6a409ca
159b966
069f6df
ada3356
3e3b707
4eaffe2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,58 +1,149 @@ | ||
| type animationPlayState = | ||
| | @as("finished") Finished | ||
| | @as("idle") Idle | ||
| | @as("paused") Paused | ||
| | @as("running") Running | ||
|
|
||
| type animationReplaceState = | ||
| | @as("active") Active | ||
| | @as("persisted") Persisted | ||
| | @as("removed") Removed | ||
|
|
||
| /** | ||
| [See AnimationTimeline on MDN](https://developer.mozilla.org/docs/Web/API/AnimationTimeline) | ||
| */ | ||
| type animationTimeline = private { | ||
| /** | ||
| [Read more on MDN](https://developer.mozilla.org/docs/Web/API/AnimationTimeline/currentTime) | ||
| */ | ||
| currentTime: Null.t<float>, | ||
| } | ||
|
|
||
| /** | ||
| [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Animation) | ||
| */ | ||
| type rec t = { | ||
| ...DOM.eventTarget, | ||
| /** | ||
| [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Animation/id) | ||
| */ | ||
| mutable id: string, | ||
| /** | ||
| [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Animation/effect) | ||
| */ | ||
| mutable effect: Null.t<AnimationEffect.t>, | ||
| /** | ||
| [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Animation/timeline) | ||
| */ | ||
| mutable timeline: Null.t<animationTimeline>, | ||
| /** | ||
| [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Animation/playbackRate) | ||
| */ | ||
| mutable playbackRate: float, | ||
| /** | ||
| [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Animation/playState) | ||
| */ | ||
| playState: animationPlayState, | ||
| /** | ||
| [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Animation/replaceState) | ||
| */ | ||
| replaceState: animationReplaceState, | ||
| /** | ||
| [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Animation/pending) | ||
| */ | ||
| pending: bool, | ||
| /** | ||
| [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Animation/ready) | ||
| */ | ||
| ready: promise<t>, | ||
| /** | ||
| [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Animation/finished) | ||
| */ | ||
| finished: promise<t>, | ||
| /** | ||
| [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Animation/startTime) | ||
| */ | ||
| mutable startTime: Null.t<float>, | ||
| /** | ||
| [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Animation/currentTime) | ||
| */ | ||
| mutable currentTime: Null.t<float>, | ||
| } | ||
|
|
||
| /** | ||
| [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Animation) | ||
| */ | ||
| @new | ||
| external make: ( | ||
| ~effect: DomTypes.animationEffect=?, | ||
| ~timeline: DomTypes.animationTimeline=?, | ||
| ) => DomTypes.animation = "Animation" | ||
| external make: (~effect: AnimationEffect.t=?, ~timeline: animationTimeline=?) => t = "Animation" | ||
|
|
||
| include EventTarget.Impl({type t = DomTypes.animation}) | ||
| include EventTarget.Impl({type t = t}) | ||
|
|
||
| /** | ||
| [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Animation/cancel) | ||
| */ | ||
| @send | ||
| external cancel: DomTypes.animation => unit = "cancel" | ||
| external cancel: t => unit = "cancel" | ||
|
|
||
| /** | ||
| [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Animation/finish) | ||
| */ | ||
| @send | ||
| external finish: DomTypes.animation => unit = "finish" | ||
| external finish: t => unit = "finish" | ||
|
|
||
| /** | ||
| [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Animation/play) | ||
| */ | ||
| @send | ||
| external play: DomTypes.animation => unit = "play" | ||
| external play: t => unit = "play" | ||
|
|
||
| /** | ||
| [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Animation/pause) | ||
| */ | ||
| @send | ||
| external pause: DomTypes.animation => unit = "pause" | ||
| external pause: t => unit = "pause" | ||
|
|
||
| /** | ||
| [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Animation/updatePlaybackRate) | ||
| */ | ||
| @send | ||
| external updatePlaybackRate: (DomTypes.animation, float) => unit = "updatePlaybackRate" | ||
| external updatePlaybackRate: (t, float) => unit = "updatePlaybackRate" | ||
|
|
||
| /** | ||
| [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Animation/reverse) | ||
| */ | ||
| @send | ||
| external reverse: DomTypes.animation => unit = "reverse" | ||
| external reverse: t => unit = "reverse" | ||
|
|
||
| /** | ||
| [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Animation/persist) | ||
| */ | ||
| @send | ||
| external persist: DomTypes.animation => unit = "persist" | ||
| external persist: t => unit = "persist" | ||
|
|
||
| /** | ||
| [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Animation/commitStyles) | ||
| */ | ||
| @send | ||
| external commitStyles: DomTypes.animation => unit = "commitStyles" | ||
| external commitStyles: t => unit = "commitStyles" | ||
|
|
||
| type compositeOperation = | ||
| | @as("accumulate") Accumulate | ||
| | @as("add") Add | ||
| | @as("replace") Replace | ||
|
|
||
| type iterationCompositeOperation = | ||
| | @as("accumulate") Accumulate | ||
| | @as("replace") Replace | ||
|
|
||
| type keyframeEffectOptions = { | ||
| ...DomTypes.effectTiming, | ||
| mutable composite?: compositeOperation, | ||
| mutable pseudoElement?: Null.t<string>, | ||
| mutable iterationComposite?: iterationCompositeOperation, | ||
| } | ||
|
|
||
| type keyframeAnimationOptions = { | ||
| ...keyframeEffectOptions, | ||
| mutable id?: string, | ||
| mutable timeline?: Null.t<animationTimeline>, | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,21 +1,22 @@ | ||
| /** | ||
| [See AnimationEffect on MDN](https://developer.mozilla.org/docs/Web/API/AnimationEffect) | ||
| */ | ||
| type t = private {} | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we add comments to explain this and the other empty record types?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tracking the documentation audit for these intentionally empty types in the parent issue follow-up checklist. |
||
|
|
||
| /** | ||
| [Read more on MDN](https://developer.mozilla.org/docs/Web/API/AnimationEffect/getTiming) | ||
| */ | ||
| @send | ||
| external getTiming: DomTypes.animationEffect => DomTypes.effectTiming = "getTiming" | ||
| external getTiming: t => DomTypes.effectTiming = "getTiming" | ||
|
|
||
| /** | ||
| [Read more on MDN](https://developer.mozilla.org/docs/Web/API/AnimationEffect/getComputedTiming) | ||
| */ | ||
| @send | ||
| external getComputedTiming: DomTypes.animationEffect => DomTypes.computedEffectTiming = | ||
| "getComputedTiming" | ||
| external getComputedTiming: t => DomTypes.computedEffectTiming = "getComputedTiming" | ||
|
|
||
| /** | ||
| [Read more on MDN](https://developer.mozilla.org/docs/Web/API/AnimationEffect/updateTiming) | ||
| */ | ||
| @send | ||
| external updateTiming: ( | ||
| DomTypes.animationEffect, | ||
| ~timing: DomTypes.optionalEffectTiming=?, | ||
| ) => unit = "updateTiming" | ||
| external updateTiming: (t, ~timing: DomTypes.optionalEffectTiming=?) => unit = "updateTiming" | ||
Uh oh!
There was an error while loading. Please reload this page.