0 | module Web.Internal.AnimationTypes
  1 |
  2 | import JS
  3 |
  4 | %default total
  5 |
  6 |
  7 | --------------------------------------------------------------------------------
  8 | --          Enums
  9 | --------------------------------------------------------------------------------
 10 |
 11 | namespace AnimationPlayState
 12 |
 13 |   public export
 14 |   data AnimationPlayState = Idle | Running | Paused | Finished
 15 |
 16 |   public export
 17 |   Show AnimationPlayState where
 18 |     show Idle = "idle"
 19 |     show Running = "running"
 20 |     show Paused = "paused"
 21 |     show Finished = "finished"
 22 |
 23 |   public export
 24 |   Eq AnimationPlayState where
 25 |     (==) = (==) `on` show
 26 |
 27 |   public export
 28 |   Ord AnimationPlayState where
 29 |     compare = compare `on` show
 30 |
 31 |   public export
 32 |   read : String -> Maybe AnimationPlayState
 33 |   read "idle" = Just Idle
 34 |   read "running" = Just Running
 35 |   read "paused" = Just Paused
 36 |   read "finished" = Just Finished
 37 |   read _ = Nothing
 38 |
 39 |   export
 40 |   ToFFI AnimationPlayState String where
 41 |     toFFI = show
 42 |
 43 |   export
 44 |   FromFFI AnimationPlayState String where
 45 |     fromFFI = read
 46 |
 47 |
 48 | namespace FillMode
 49 |
 50 |   public export
 51 |   data FillMode = None | Forwards | Backwards | Both | Auto
 52 |
 53 |   public export
 54 |   Show FillMode where
 55 |     show None = "none"
 56 |     show Forwards = "forwards"
 57 |     show Backwards = "backwards"
 58 |     show Both = "both"
 59 |     show Auto = "auto"
 60 |
 61 |   public export
 62 |   Eq FillMode where
 63 |     (==) = (==) `on` show
 64 |
 65 |   public export
 66 |   Ord FillMode where
 67 |     compare = compare `on` show
 68 |
 69 |   public export
 70 |   read : String -> Maybe FillMode
 71 |   read "none" = Just None
 72 |   read "forwards" = Just Forwards
 73 |   read "backwards" = Just Backwards
 74 |   read "both" = Just Both
 75 |   read "auto" = Just Auto
 76 |   read _ = Nothing
 77 |
 78 |   export
 79 |   ToFFI FillMode String where
 80 |     toFFI = show
 81 |
 82 |   export
 83 |   FromFFI FillMode String where
 84 |     fromFFI = read
 85 |
 86 |
 87 | namespace PlaybackDirection
 88 |
 89 |   public export
 90 |   data PlaybackDirection = Normal | Reverse | Alternate | AlternateReverse
 91 |
 92 |   public export
 93 |   Show PlaybackDirection where
 94 |     show Normal = "normal"
 95 |     show Reverse = "reverse"
 96 |     show Alternate = "alternate"
 97 |     show AlternateReverse = "alternate-reverse"
 98 |
 99 |   public export
100 |   Eq PlaybackDirection where
101 |     (==) = (==) `on` show
102 |
103 |   public export
104 |   Ord PlaybackDirection where
105 |     compare = compare `on` show
106 |
107 |   public export
108 |   read : String -> Maybe PlaybackDirection
109 |   read "normal" = Just Normal
110 |   read "reverse" = Just Reverse
111 |   read "alternate" = Just Alternate
112 |   read "alternate-reverse" = Just AlternateReverse
113 |   read _ = Nothing
114 |
115 |   export
116 |   ToFFI PlaybackDirection String where
117 |     toFFI = show
118 |
119 |   export
120 |   FromFFI PlaybackDirection String where
121 |     fromFFI = read
122 |
123 |
124 | namespace IterationCompositeOperation
125 |
126 |   public export
127 |   data IterationCompositeOperation = Replace | Accumulate
128 |
129 |   public export
130 |   Show IterationCompositeOperation where
131 |     show Replace = "replace"
132 |     show Accumulate = "accumulate"
133 |
134 |   public export
135 |   Eq IterationCompositeOperation where
136 |     (==) = (==) `on` show
137 |
138 |   public export
139 |   Ord IterationCompositeOperation where
140 |     compare = compare `on` show
141 |
142 |   public export
143 |   read : String -> Maybe IterationCompositeOperation
144 |   read "replace" = Just Replace
145 |   read "accumulate" = Just Accumulate
146 |   read _ = Nothing
147 |
148 |   export
149 |   ToFFI IterationCompositeOperation String where
150 |     toFFI = show
151 |
152 |   export
153 |   FromFFI IterationCompositeOperation String where
154 |     fromFFI = read
155 |
156 |
157 | namespace CompositeOperation
158 |
159 |   public export
160 |   data CompositeOperation = Replace | Add | Accumulate
161 |
162 |   public export
163 |   Show CompositeOperation where
164 |     show Replace = "replace"
165 |     show Add = "add"
166 |     show Accumulate = "accumulate"
167 |
168 |   public export
169 |   Eq CompositeOperation where
170 |     (==) = (==) `on` show
171 |
172 |   public export
173 |   Ord CompositeOperation where
174 |     compare = compare `on` show
175 |
176 |   public export
177 |   read : String -> Maybe CompositeOperation
178 |   read "replace" = Just Replace
179 |   read "add" = Just Add
180 |   read "accumulate" = Just Accumulate
181 |   read _ = Nothing
182 |
183 |   export
184 |   ToFFI CompositeOperation String where
185 |     toFFI = show
186 |
187 |   export
188 |   FromFFI CompositeOperation String where
189 |     fromFFI = read
190 |
191 |
192 | namespace CompositeOperationOrAuto
193 |
194 |   public export
195 |   data CompositeOperationOrAuto = Replace | Add | Accumulate | Auto
196 |
197 |   public export
198 |   Show CompositeOperationOrAuto where
199 |     show Replace = "replace"
200 |     show Add = "add"
201 |     show Accumulate = "accumulate"
202 |     show Auto = "auto"
203 |
204 |   public export
205 |   Eq CompositeOperationOrAuto where
206 |     (==) = (==) `on` show
207 |
208 |   public export
209 |   Ord CompositeOperationOrAuto where
210 |     compare = compare `on` show
211 |
212 |   public export
213 |   read : String -> Maybe CompositeOperationOrAuto
214 |   read "replace" = Just Replace
215 |   read "add" = Just Add
216 |   read "accumulate" = Just Accumulate
217 |   read "auto" = Just Auto
218 |   read _ = Nothing
219 |
220 |   export
221 |   ToFFI CompositeOperationOrAuto String where
222 |     toFFI = show
223 |
224 |   export
225 |   FromFFI CompositeOperationOrAuto String where
226 |     fromFFI = read
227 |
228 |
229 |
230 | --------------------------------------------------------------------------------
231 | --          Interfaces
232 | --------------------------------------------------------------------------------
233 |
234 | export data Animation : Type where [external]
235 |
236 | export
237 | ToFFI Animation Animation where toFFI = id
238 |
239 | export
240 | FromFFI Animation Animation where fromFFI = Just
241 |
242 | export
243 | SafeCast Animation where
244 |   safeCast = unsafeCastOnPrototypeName "Animation"
245 |
246 | export data AnimationEffect : Type where [external]
247 |
248 | export
249 | ToFFI AnimationEffect AnimationEffect where toFFI = id
250 |
251 | export
252 | FromFFI AnimationEffect AnimationEffect where fromFFI = Just
253 |
254 | export
255 | SafeCast AnimationEffect where
256 |   safeCast = unsafeCastOnPrototypeName "AnimationEffect"
257 |
258 | export data AnimationPlaybackEvent : Type where [external]
259 |
260 | export
261 | ToFFI AnimationPlaybackEvent AnimationPlaybackEvent where toFFI = id
262 |
263 | export
264 | FromFFI AnimationPlaybackEvent AnimationPlaybackEvent where fromFFI = Just
265 |
266 | export
267 | SafeCast AnimationPlaybackEvent where
268 |   safeCast = unsafeCastOnPrototypeName "AnimationPlaybackEvent"
269 |
270 | export data AnimationTimeline : Type where [external]
271 |
272 | export
273 | ToFFI AnimationTimeline AnimationTimeline where toFFI = id
274 |
275 | export
276 | FromFFI AnimationTimeline AnimationTimeline where fromFFI = Just
277 |
278 | export
279 | SafeCast AnimationTimeline where
280 |   safeCast = unsafeCastOnPrototypeName "AnimationTimeline"
281 |
282 | export data DocumentTimeline : Type where [external]
283 |
284 | export
285 | ToFFI DocumentTimeline DocumentTimeline where toFFI = id
286 |
287 | export
288 | FromFFI DocumentTimeline DocumentTimeline where fromFFI = Just
289 |
290 | export
291 | SafeCast DocumentTimeline where
292 |   safeCast = unsafeCastOnPrototypeName "DocumentTimeline"
293 |
294 | export data KeyframeEffect : Type where [external]
295 |
296 | export
297 | ToFFI KeyframeEffect KeyframeEffect where toFFI = id
298 |
299 | export
300 | FromFFI KeyframeEffect KeyframeEffect where fromFFI = Just
301 |
302 | export
303 | SafeCast KeyframeEffect where
304 |   safeCast = unsafeCastOnPrototypeName "KeyframeEffect"
305 |
306 |
307 | --------------------------------------------------------------------------------
308 | --          Dictionaries
309 | --------------------------------------------------------------------------------
310 |
311 | export data AnimationPlaybackEventInit : Type where [external]
312 |
313 | export
314 | ToFFI AnimationPlaybackEventInit AnimationPlaybackEventInit where toFFI = id
315 |
316 | export
317 | FromFFI AnimationPlaybackEventInit AnimationPlaybackEventInit where fromFFI = Just
318 |
319 | export data BaseComputedKeyframe : Type where [external]
320 |
321 | export
322 | ToFFI BaseComputedKeyframe BaseComputedKeyframe where toFFI = id
323 |
324 | export
325 | FromFFI BaseComputedKeyframe BaseComputedKeyframe where fromFFI = Just
326 |
327 | export data BaseKeyframe : Type where [external]
328 |
329 | export
330 | ToFFI BaseKeyframe BaseKeyframe where toFFI = id
331 |
332 | export
333 | FromFFI BaseKeyframe BaseKeyframe where fromFFI = Just
334 |
335 | export data BasePropertyIndexedKeyframe : Type where [external]
336 |
337 | export
338 | ToFFI BasePropertyIndexedKeyframe BasePropertyIndexedKeyframe where toFFI = id
339 |
340 | export
341 | FromFFI BasePropertyIndexedKeyframe BasePropertyIndexedKeyframe where fromFFI = Just
342 |
343 | export data ComputedEffectTiming : Type where [external]
344 |
345 | export
346 | ToFFI ComputedEffectTiming ComputedEffectTiming where toFFI = id
347 |
348 | export
349 | FromFFI ComputedEffectTiming ComputedEffectTiming where fromFFI = Just
350 |
351 | export data DocumentTimelineOptions : Type where [external]
352 |
353 | export
354 | ToFFI DocumentTimelineOptions DocumentTimelineOptions where toFFI = id
355 |
356 | export
357 | FromFFI DocumentTimelineOptions DocumentTimelineOptions where fromFFI = Just
358 |
359 | export data EffectTiming : Type where [external]
360 |
361 | export
362 | ToFFI EffectTiming EffectTiming where toFFI = id
363 |
364 | export
365 | FromFFI EffectTiming EffectTiming where fromFFI = Just
366 |
367 | export data KeyframeAnimationOptions : Type where [external]
368 |
369 | export
370 | ToFFI KeyframeAnimationOptions KeyframeAnimationOptions where toFFI = id
371 |
372 | export
373 | FromFFI KeyframeAnimationOptions KeyframeAnimationOptions where fromFFI = Just
374 |
375 | export data KeyframeEffectOptions : Type where [external]
376 |
377 | export
378 | ToFFI KeyframeEffectOptions KeyframeEffectOptions where toFFI = id
379 |
380 | export
381 | FromFFI KeyframeEffectOptions KeyframeEffectOptions where fromFFI = Just
382 |
383 | export data OptionalEffectTiming : Type where [external]
384 |
385 | export
386 | ToFFI OptionalEffectTiming OptionalEffectTiming where toFFI = id
387 |
388 | export
389 | FromFFI OptionalEffectTiming OptionalEffectTiming where fromFFI = Just
390 |
391 |
392 | --------------------------------------------------------------------------------
393 | --          Mixins
394 | --------------------------------------------------------------------------------
395 |
396 | export data Animatable : Type where [external]
397 |
398 | export
399 | ToFFI Animatable Animatable where toFFI = id
400 |
401 | export
402 | FromFFI Animatable Animatable where fromFFI = Just
403 |