-
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
Open
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,58 +1,128 @@ | ||
| 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: DomTypes.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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 {} | ||
|
|
||
| /** | ||
| [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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this URL does not exist?