@@ -169,6 +169,26 @@ const TRANSFORM_WHITELIST = {
169
169
perspective : true ,
170
170
} ;
171
171
172
+ const SUPPORTED_INTERPOLATION_PARAMS = {
173
+ inputRange : true ,
174
+ outputRange : true ,
175
+ extrapolate : true ,
176
+ extrapolateRight : true ,
177
+ extrapolateLeft : true ,
178
+ } ;
179
+
180
+ function addWhitelistedStyleProp ( prop : string ) : void {
181
+ STYLES_WHITELIST [ prop ] = true ;
182
+ }
183
+
184
+ function addWhitelistedTransformProp ( prop : string ) : void {
185
+ TRANSFORM_WHITELIST [ prop ] = true ;
186
+ }
187
+
188
+ function addWhitelistedInterpolationParam ( param : string ) : void {
189
+ SUPPORTED_INTERPOLATION_PARAMS [ param ] = true ;
190
+ }
191
+
172
192
function validateTransform ( configs : Array < Object > ) : void {
173
193
configs. forEach ( config => {
174
194
if ( ! TRANSFORM_WHITELIST . hasOwnProperty ( config . property ) ) {
@@ -192,13 +212,6 @@ function validateStyles(styles: Object): void {
192
212
}
193
213
194
214
function validateInterpolation ( config : Object ) : void {
195
- var SUPPORTED_INTERPOLATION_PARAMS = {
196
- inputRange : true ,
197
- outputRange : true ,
198
- extrapolate : true ,
199
- extrapolateRight : true ,
200
- extrapolateLeft : true ,
201
- } ;
202
215
for ( var key in config ) {
203
216
if ( ! SUPPORTED_INTERPOLATION_PARAMS . hasOwnProperty ( key ) ) {
204
217
throw new Error (
@@ -242,6 +255,9 @@ function shouldUseNativeDriver(config: AnimationConfig | EventConfig): boolean {
242
255
243
256
module . exports = {
244
257
API ,
258
+ addWhitelistedStyleProp,
259
+ addWhitelistedTransformProp,
260
+ addWhitelistedInterpolationParam,
245
261
validateStyles,
246
262
validateTransform,
247
263
validateInterpolation,
0 commit comments