From aa27c9de750a109994efa0568b0bf3f36caa3408 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sondre=20M=C3=A6re=20Overskaug?= Date: Wed, 8 Nov 2017 14:44:46 +0100 Subject: [PATCH] fix(typings): add missing properties and in general fix typings Significant change is that TabProps no longer extend SceneProps, as Tabs do not need to have a component set. Was unable to add which properties should be inherited from SceneProps to TabProps due to the fact that there is no code in Tabs.js --- index.d.ts | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/index.d.ts b/index.d.ts index 015715be8..cffc3fa6d 100644 --- a/index.d.ts +++ b/index.d.ts @@ -7,9 +7,10 @@ import { StyleProp, Image, ViewStyle, TextStyle, ImageStyle } from "react-native export var Router: RouterStatic; export type Router = RouterStatic; -// Router +// Router interface RouterProps extends React.Props { sceneStyle?: StyleProp; + backAndroidHandler?: () => void; } interface RouterStatic extends React.ComponentClass { } @@ -77,7 +78,7 @@ interface TabsProps extends React.Props { showLabel?: boolean; swipeEnabled?: boolean; } -interface TabsStatic extends React.ComponentClass { } +interface TabsStatic extends React.ComponentClass { } export type TabBarPositionType = "top" | "bottom"; // Drawer @@ -106,13 +107,18 @@ interface LighboxStatic extends React.ComponentClass { } // Stack export var Stack: StackStatic; export type Stack = StackStatic; -interface StackProps extends React.Props { } -interface StackStatic extends React.ComponentClass { } +interface StackProps extends React.Props { + icon?: any; + tintColor?: string; + hideNavBar?: boolean; +} +interface StackStatic extends React.ComponentClass { +} -export var Actions: ActionsStatic & ActionsGenericStatic; -export type Actions = ActionsStatic & ActionsGenericStatic; +export var Actions: ActionsGenericStatic; +export type Actions = ActionsGenericStatic; interface ActionsStatic { - currentScene: () => string; + currentScene: string; jump: (sceneKey: string, props?: any) => void; pop: () => void; popAndPush: (sceneKey: string, props?: any) => void; @@ -125,7 +131,7 @@ interface ActionsStatic { drawerClose?: () => void; } -interface ActionsGenericStatic { +interface ActionsGenericStatic extends ActionsStatic { [key: string]: (props?: any) => void; } @@ -135,4 +141,4 @@ export type ActionConst = { JUMP: string; PUSH: string; PUSH_OR_POP: string; REPLACE: string; BACK: string; BACK_ACTION: string; POP_TO: string; REFRESH: string; RESET: string; FOCUS: string; BLUR: string; ANDROID_BACK: string; -} \ No newline at end of file +}