diff --git a/react-native/react-native-tests.tsx b/react-native/react-native-tests.tsx index 6079637ce6..d33918dbd6 100644 --- a/react-native/react-native-tests.tsx +++ b/react-native/react-native-tests.tsx @@ -51,7 +51,13 @@ function testDimensions() { BackAndroid.addEventListener("hardwareBackPress", () => { }); -var styles = StyleSheet.create( +interface LocalStyles { + container: React.ViewStyle; + welcome: React.TextStyle; + instructions: React.TextStyle; +} + +var styles = StyleSheet.create( { container: { flex: 1, @@ -74,13 +80,18 @@ var styles = StyleSheet.create( class Welcome extends React.Component { - + + refs: { + [key: string]: any + rootView: View + } + testNativeMethods() { - this.setNativeProps({}); + // this.setNativeProps({}); const { rootView } = this.refs; - rootView.measure((x, y, width, height) => { + rootView.measure((x: number, y: number, width: number, height: number) => { }); } diff --git a/react-native/react-native.d.ts b/react-native/react-native.d.ts index d0bbf5aea8..8be6ac8d56 100644 --- a/react-native/react-native.d.ts +++ b/react-native/react-native.d.ts @@ -5522,7 +5522,7 @@ declare namespace __React { } export interface NavigationHeaderProps { - renderTitleComponent?(props: Object): JSX.element + renderTitleComponent?(props: Object): JSX.Element } export interface NavigationHeaderStatic extends React.ComponentClass { @@ -5535,7 +5535,7 @@ declare namespace __React { style?: ViewStyle navigationState?: any onNavigate(action: Object): boolean - renderScene?(props): JSX.Element + renderScene?(props: any /* undocumented on 0.27 */): JSX.Element } export interface NavigationCardStackStatic extends React.ComponentClass { @@ -5547,6 +5547,26 @@ declare namespace __React { Header: NavigationHeaderStatic; Reducer: NavigationReducerStatic; } + + export interface NavigationContainerProps { + tabs: NavigationTab[]; + index: number; + } + + export interface NavigationContainerStatic extends React.ComponentClass { + create(inClass: any): any; + } + + export interface NavigationRootContainerProps extends React.Props { + renderNavigation: NavigationRenderer; + reducer: NavigationReducerStatic; + persistenceKey?: string; + } + + export interface NavigationRootContainerStatic extends React.ComponentClass { + getBackAction(): NavigationAction; + handleNavigation( action: NavigationAction ): boolean; + } ////////////////////////////////////////////////////////////////////////// // @@ -5618,7 +5638,7 @@ declare namespace __React { export type StyleSheet = StyleSheetStatic export var SwipeableListView: SwipeableListViewStatic - export type SwipeableListView = SwipeableListViewStatci + export type SwipeableListView = SwipeableListViewStatic export var Switch: SwitchStatic export type Switch = SwitchStatic @@ -5741,9 +5761,6 @@ declare namespace __React { export type NavigationReducer = NavigationReducerStatic; export var NavigationReducer: NavigationReducerStatic; - - export type SwipeableListView = SwipeableListViewStatic; - export var SwipeableListView: SwipeableListViewStatic; export type Easing = EasingStatic; export var Easing: EasingStatic;