From 0cf2cb05c8209a4791295d9c2d08f84e6549e249 Mon Sep 17 00:00:00 2001 From: Adam Sajko Date: Tue, 21 Aug 2018 17:45:56 +0200 Subject: [PATCH] Add types for flow and typescript --- SplashScreen.d.ts | 20 ++++++++++++++++++++ flow/react-native-smart-splash-screen.js | 20 ++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 SplashScreen.d.ts create mode 100644 flow/react-native-smart-splash-screen.js diff --git a/SplashScreen.d.ts b/SplashScreen.d.ts new file mode 100644 index 0000000..124905a --- /dev/null +++ b/SplashScreen.d.ts @@ -0,0 +1,20 @@ +declare module 'react-native-smart-splash-screen' { + type UIAnimationNone = 0; + type UIAnimationFade = 1; + type UIAnimationScale = 2; + + type AnimationType = + | UIAnimationNone + | UIAnimationFade + | UIAnimationScale; + + export interface Options { + animationType: AnimationType, + duration: number, + delay: number, + }; + + export class SplashScreen { + static close(options: Options): void; + } +} diff --git a/flow/react-native-smart-splash-screen.js b/flow/react-native-smart-splash-screen.js new file mode 100644 index 0000000..648955b --- /dev/null +++ b/flow/react-native-smart-splash-screen.js @@ -0,0 +1,20 @@ +declare module 'react-native-smart-splash-screen' { + declare type UIAnimationNone = 0; + declare type UIAnimationFade = 1; + declare type UIAnimationScale = 2; + + declare type AnimationType = + | UIAnimationNone + | UIAnimationFade + | UIAnimationScale; + + declare export type Options = { + animationType: AnimationType, + duration: number, + delay: number, + }; + + declare export class SplashScreen { + static close(options: Options): void; + } +}