Skip to content

Commit 140f1dd

Browse files
sgnycknitt
authored andcommitted
LayoutAnimation API (#479)
1 parent 400b215 commit 140f1dd

3 files changed

Lines changed: 178 additions & 0 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
'use strict';
2+
3+
4+
var Presets = /* module */[];
5+
6+
exports.Presets = Presets;
7+
/* No side effect */
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
---
2+
id: apis/LayoutAnimation
3+
title: LayoutAnimation
4+
wip: true
5+
---
6+
7+
```reason
8+
type animationConfig;
9+
[@bs.obj]
10+
external animationConfig:
11+
(
12+
~duration: float=?,
13+
~delay: float=?,
14+
~springDamping: float=?,
15+
~initialVelocity: float=?,
16+
~_type: [@bs.string] [
17+
| `spring
18+
| `linear
19+
| `easeInEaseOut
20+
| `easeIn
21+
| `easeOut
22+
| `keyboard
23+
]
24+
=?,
25+
~property: [@bs.string] [ | `opacity | `scaleX | `scaleY | `scaleXY]=?,
26+
unit
27+
) =>
28+
animationConfig =
29+
"";
30+
31+
type layoutAnimationConfig;
32+
[@bs.obj]
33+
external layoutAnimationConfig:
34+
(
35+
~duration: float,
36+
~create: animationConfig=?,
37+
~update: animationConfig=?,
38+
~delete: animationConfig=?,
39+
unit
40+
) =>
41+
layoutAnimationConfig =
42+
"";
43+
44+
[@bs.module "react-native"] [@bs.scope "LayoutAnimation"]
45+
external configureNext: layoutAnimationConfig => unit = "";
46+
47+
[@bs.module "react-native"] [@bs.scope "LayoutAnimation"]
48+
external configureNextWithEndCallback:
49+
(layoutAnimationConfig, unit => unit) => unit =
50+
"configureNext";
51+
52+
[@bs.module "react-native"] [@bs.scope "LayoutAnimation"]
53+
external create:
54+
(
55+
~duration: float,
56+
~_type: [@bs.string] [
57+
| `spring
58+
| `linear
59+
| `easeInEaseOut
60+
| `easeIn
61+
| `easeOut
62+
| `keyboard
63+
],
64+
~property: [@bs.string] [ | `opacity | `scaleX | `scaleY | `scaleXY]
65+
) =>
66+
layoutAnimationConfig =
67+
"";
68+
69+
[@bs.module "react-native"] [@bs.scope "LayoutAnimation"]
70+
external easeInEaseOut: unit => unit = "";
71+
72+
[@bs.module "react-native"] [@bs.scope "LayoutAnimation"]
73+
external linear: unit => unit = "";
74+
75+
[@bs.module "react-native"] [@bs.scope "LayoutAnimation"]
76+
external spring: unit => unit = "";
77+
78+
79+
module Presets = {
80+
[@bs.module "react-native"] [@bs.scope ("LayoutAnimation", "Presets")]
81+
external easeInEaseOut: layoutAnimationConfig = "";
82+
83+
[@bs.module "react-native"] [@bs.scope ("LayoutAnimation", "Presets")]
84+
external linear: layoutAnimationConfig = "";
85+
86+
[@bs.module "react-native"] [@bs.scope ("LayoutAnimation", "Presets")]
87+
external spring: layoutAnimationConfig = "";
88+
};
89+
90+
```
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
type animationConfig;
2+
[@bs.obj]
3+
external animationConfig:
4+
(
5+
~duration: float=?,
6+
~delay: float=?,
7+
~springDamping: float=?,
8+
~initialVelocity: float=?,
9+
~_type: [@bs.string] [
10+
| `spring
11+
| `linear
12+
| `easeInEaseOut
13+
| `easeIn
14+
| `easeOut
15+
| `keyboard
16+
]
17+
=?,
18+
~property: [@bs.string] [ | `opacity | `scaleX | `scaleY | `scaleXY]=?,
19+
unit
20+
) =>
21+
animationConfig =
22+
"";
23+
24+
type layoutAnimationConfig;
25+
[@bs.obj]
26+
external layoutAnimationConfig:
27+
(
28+
~duration: float,
29+
~create: animationConfig=?,
30+
~update: animationConfig=?,
31+
~delete: animationConfig=?,
32+
unit
33+
) =>
34+
layoutAnimationConfig =
35+
"";
36+
37+
[@bs.module "react-native"] [@bs.scope "LayoutAnimation"]
38+
external configureNext: layoutAnimationConfig => unit = "";
39+
40+
[@bs.module "react-native"] [@bs.scope "LayoutAnimation"]
41+
external configureNextWithEndCallback:
42+
(layoutAnimationConfig, unit => unit) => unit =
43+
"configureNext";
44+
45+
[@bs.module "react-native"] [@bs.scope "LayoutAnimation"]
46+
external create:
47+
(
48+
~duration: float,
49+
~_type: [@bs.string] [
50+
| `spring
51+
| `linear
52+
| `easeInEaseOut
53+
| `easeIn
54+
| `easeOut
55+
| `keyboard
56+
],
57+
~property: [@bs.string] [ | `opacity | `scaleX | `scaleY | `scaleXY]
58+
) =>
59+
layoutAnimationConfig =
60+
"";
61+
62+
[@bs.module "react-native"] [@bs.scope "LayoutAnimation"]
63+
external easeInEaseOut: unit => unit = "";
64+
65+
[@bs.module "react-native"] [@bs.scope "LayoutAnimation"]
66+
external linear: unit => unit = "";
67+
68+
[@bs.module "react-native"] [@bs.scope "LayoutAnimation"]
69+
external spring: unit => unit = "";
70+
71+
72+
module Presets = {
73+
[@bs.module "react-native"] [@bs.scope ("LayoutAnimation", "Presets")]
74+
external easeInEaseOut: layoutAnimationConfig = "";
75+
76+
[@bs.module "react-native"] [@bs.scope ("LayoutAnimation", "Presets")]
77+
external linear: layoutAnimationConfig = "";
78+
79+
[@bs.module "react-native"] [@bs.scope ("LayoutAnimation", "Presets")]
80+
external spring: layoutAnimationConfig = "";
81+
};

0 commit comments

Comments
 (0)