Add typescript definitions

This commit is contained in:
Cameron Knight
2018-09-19 16:04:22 -07:00
parent 18e13ec5e9
commit 7a1668abca
2 changed files with 20 additions and 0 deletions

View File

@@ -11,6 +11,7 @@
"precommit": "lint-staged"
},
"main": "src/screens.js",
"types": "src/screens.d.ts",
"files": [
"src/",
"android/src/main/AndroidManifest.xml",

19
src/screens.d.ts vendored Normal file
View File

@@ -0,0 +1,19 @@
// Project: https://github.com/kmagiera/react-native-screens
// TypeScript Version: 2.8
declare module 'react-native-screens' {
import { ComponentClass } from 'react';
import { ViewProps } from 'react-native';
export function useScreens(shouldUseScreens?: boolean): void;
export function screensEnabled(): boolean;
export interface ScreenProps extends ViewProps {
active?: boolean;
onComponentRef?: (view: any) => void;
}
export const Screen: ComponentClass<ScreenProps>;
export type ScreenContainerProps = ViewProps;
export const ScreenContainer: ComponentClass<ScreenContainerProps>;
}