@@ -41,6 +41,9 @@ export interface TypedKeyframeEffectOptions
4141 easing ?: TypedEasing ;
4242}
4343
44+ /**
45+ * @internal
46+ */
4447export const getKeyframeKeys = ( keyframes : TypedKeyframe [ ] ) : string [ ] =>
4548 uniq ( keyframes . flatMap ( getKeys ) ) . reduce ( ( acc , k ) => {
4649 if ( [ "offset" , "easing" , "composite" ] . includes ( k ) ) {
@@ -55,6 +58,9 @@ export const getKeyframeKeys = (keyframes: TypedKeyframe[]): string[] =>
5558 return acc ;
5659 } , [ ] as string [ ] ) ;
5760
61+ /**
62+ * @internal
63+ */
5864export const createAnimation = (
5965 el : Element | null ,
6066 keyframes : Keyframe [ ] | null ,
@@ -83,6 +89,9 @@ export type PlayOptions = {
8389 restart ?: boolean ;
8490} ;
8591
92+ /**
93+ * @internal
94+ */
8695export const _play = ( animation : Animation , opts : PlayOptions = { } ) => {
8796 // Reset reversed playback direction if completed
8897 if ( animation . playbackRate < 0 && animation . playState === "finished" ) {
@@ -93,22 +102,41 @@ export const _play = (animation: Animation, opts: PlayOptions = {}) => {
93102 }
94103 animation . play ( ) ;
95104} ;
105+
106+ /**
107+ * @internal
108+ */
96109export const _reverse = ( animation : Animation | undefined ) => {
97110 if ( ! animation ) return ;
98111 animation . reverse ( ) ;
99112} ;
113+
114+ /**
115+ * @internal
116+ */
100117export const _cancel = ( animation : Animation | undefined ) => {
101118 if ( ! animation ) return ;
102119 animation . cancel ( ) ;
103120} ;
121+
122+ /**
123+ * @internal
124+ */
104125export const _finish = ( animation : Animation | undefined ) => {
105126 if ( ! animation ) return ;
106127 animation . finish ( ) ;
107128} ;
129+
130+ /**
131+ * @internal
132+ */
108133export const _pause = ( animation : Animation | undefined ) => {
109134 if ( ! animation ) return ;
110135 animation . pause ( ) ;
111136} ;
137+ // /**
138+ // * @internal
139+ // */
112140// export const _persist = (
113141// animation: Animation | undefined,
114142// el: Element,
@@ -127,6 +155,9 @@ export const _pause = (animation: Animation | undefined) => {
127155// }
128156// animation.cancel();
129157// };
158+ /**
159+ * @internal
160+ */
130161export const _setTime = (
131162 animation : Animation | undefined ,
132163 arg : number | ( ( endTime : number ) => number )
@@ -137,6 +168,10 @@ export const _setTime = (
137168 ? arg ( animation . effect ! . getComputedTiming ( ) . endTime ! as number )
138169 : arg ;
139170} ;
171+
172+ /**
173+ * @internal
174+ */
140175export const _setRate = (
141176 animation : Animation | undefined ,
142177 arg : number | ( ( prevRate : number ) => number )
@@ -148,6 +183,10 @@ export const _setRate = (
148183} ;
149184
150185export type WaitingAnimationEventName = "finish" | "reverseFinish" ;
186+
187+ /**
188+ * @internal
189+ */
151190export const _waitFor = (
152191 animation : Animation | undefined ,
153192 name : WaitingAnimationEventName
0 commit comments