import { Options , LayoutStackChildren , LayoutStack } from 'react-native-navigation' ; import createLayout from './createLayout' ; /**
 * Creates navigation LayoutStack exposing multiple function types for the same function as a list of overloads.
 * [more info](https://wix.github.io/react-native-navigation/api/layout-stack)
 */ function createStack ( layoutStackChildren , id ? , options ? ) ; function createStack ( layoutStackChildrenArray , id ? , options ? ) ; function createStack ( name ) ; function createStack < P = { } > ( name , passProps ? ) ; function createStack < P = { } > ( name , passProps ? , options ? ) ; function createStack < P = { } > ( nameOrLayoutStackChildren , passPropsOrId ? , options ? ) { let stackOptions ; let id ; let layoutStackChildren ; if ( typeof nameOrLayoutStackChildren === 'string' ) { const layoutComponent = createLayout < P > ( nameOrLayoutStackChildren , passPropsOrId as P , options ) as LayoutStackChildren ; layoutStackChildren = [ layoutComponent ] ; } else { stackOptions = options ; id = passPropsOrId as string ; layoutStackChildren = Array . isArray ( nameOrLayoutStackChildren ) ? nameOrLayoutStackChildren : [ nameOrLayoutStackChildren ] ; } return { id , children : layoutStackChildren , options : stackOptions } ; } export default createStack ;