Skip to content

Commit

Permalink
Fix in Typescript definitions (aksonov#823)
Browse files Browse the repository at this point in the history
Some fix in Typescript definitions:
- prop 'initial' in 'Scene' should be optional
- all props of scenes that could be used in 'Router' should be optional there
- optional wrapBy in 'Scene'
- optional props in Action.pop
  • Loading branch information
dalcib authored and aksonov committed Jun 15, 2016
1 parent e825d46 commit f818f19
Showing 1 changed file with 47 additions and 4 deletions.
51 changes: 47 additions & 4 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ declare namespace RNRF {
/**
* Set to true if this is the initial scene
*/
initial: boolean,
initial?: boolean,
/**
* Defines how the new screen is added to the navigator stack. One of push, jump, replace, reset. If parent container is tabbar (tabs=true), jump will be automatically set.
*/
Expand Down Expand Up @@ -196,7 +196,10 @@ declare namespace RNRF {
* optional style override for the right title element
*/
rightButtonTextStyle?: React.TextStyle,

/**
* optional wrappert
*/
wrapBy?: ()=>any,
}

/**
Expand All @@ -212,7 +215,47 @@ declare namespace RNRF {
reducer?: Function,
createReducer?: Function,
scenes?: any,
getSceneStyle?: Function
getSceneStyle?: Function,
/**
* optional Scene's props that can be used in Router
*/
type?: 'push' | 'jump' | string,
clone?: boolean,
passProps?: boolean,
duration?: number,
direction?: 'vertical' | 'horizontal',
applyAnimation?: Function,
sceneStyle?: React.ViewStyle,
getSceneStyle?: Function,
tabs?: boolean,
tabBarStyle?: React.ViewStyle,
hideTabBar?: boolean,
hideNavBar?: boolean,
navigationBarStyle?: React.ViewStyle,
navBar?: React.ReactNode,
drawerImage?: React.Image,
title?: string,
getTitle?: Function,
renderTitle?: Function,
titleStyle?: React.TextStyle,
backTitle?: string,
renderBackButton?: Function,
backButtonImage?: React.Image,
backButtonTextStyle?: React.TextStyle,
leftTitle?: string,
renderLeftButton?: Function,
onLeft?: Function,
leftButtonImage?: React.Image,
leftButtonIconStyle?: React.ViewStyle,
leftButtonStyle?: React.ViewStyle,
leftButtonTextStyle?: React.TextStyle,
rightTitle?: string,
renderRightButton?: Function,
onRight?: Function,
rightButtonImage?: React.Image,
rightButtonIconStyle?: React.ViewStyle,
rightButtonStyle?: React.ViewStyle,
rightButtonTextStyle?: React.TextStyle
}
export class Router extends React.Component<RouterProps, {}>{ }

Expand All @@ -226,7 +269,7 @@ declare namespace RNRF {
type props = Object;

interface RNRFActions {
pop(props: props): void,
pop(props?: props): void,
jump(props: props): void,
refresh(props: props): void,
focus(props: props): void,
Expand Down

0 comments on commit f818f19

Please sign in to comment.