Types
The types of screens and props.
ScreenDefinition
A screen with what goes with it.
interface ScreenDefinition<Props = any>
| Member | Type | Description |
|---|---|---|
| componentRequired | ComponentType<Props> | |
| options | ScreenOptionsInput<Props> | Applied when a command shows the screen, before it appears. |
| key | (props: Props) => string | number | One screen per item, such as the chat with one person: a push of this screen goes back to the screen of the same stack with the same key, closing the screens over it, instead of showing a second one. The name of the screen goes in front of the key, so two screens never share one. In another stack it shows as usual. |
| arrangement | ScreenArrangement<Props & object> | A second screen beside or under this one in a large window (iPad, iPhone Duo open, Android tablets and open foldables); anywhere else this screen shows alone, as it does without it. Shown by its own name, the screen is the primary of the pair: its bar is the pair's. For a pair with every setting, |
DefinedScreen
A screen of defineScreen: a component of its own, which renders the screen's component and carries the screen's definition. It goes right into screens of createNavigation, and rendered on its own (a test) it renders the screen.
type DefinedScreen<Props> = ComponentType<Props> & {
readonly [SCREEN_DEFINITION]: ScreenDefinition<Props>;
}
Screens
ScreenEntry
A screen: its component, its definition ({ component, options }, see defineScreen), { load } to load its module the first time a command shows it (() => import('./screens/Settings'), the screen is its default export), or a screen of the native side (nativeScreen).
type ScreenEntry =
| ScreenComponent
| ScreenDefinition
| { load: () => ScreenModule | PromiseLike<ScreenModule> }
| NativeScreen<any>
| Arrangement<any>
| Member | Type | Description |
|---|---|---|
| componentRequired | ComponentType<Props> | |
| options | ScreenOptionsInput<Props> | Applied when a command shows the screen, before it appears. |
| key | (props: Props) => string | number | One screen per item, such as the chat with one person: a push of this screen goes back to the screen of the same stack with the same key, closing the screens over it, instead of showing a second one. The name of the screen goes in front of the key, so two screens never share one. In another stack it shows as usual. |
| arrangement | ScreenArrangement<Props & object> | A second screen beside or under this one in a large window (iPad, iPhone Duo open, Android tablets and open foldables); anywhere else this screen shows alone, as it does without it. Shown by its own name, the screen is the primary of the pair: its bar is the pair's. For a pair with every setting, |
| loadRequired | () => ScreenModule | PromiseLike<ScreenModule> | |
| nativeNameRequired | string | |
| useProps | (props: Props) => object | |
| props | Props | Carries the type of the props; never set. |
| definitionRequired | ArrangementDefinition<Props> |
ScreenGroup
Screens sharing options, such as the sign-in screens without a top bar.
interface ScreenGroup
| Member | Type | Description |
|---|---|---|
| options | ScreenOptionsInput<object> | The options of every screen of the group; the screen's own options go over them. |
| screensRequired | Screens |
ScreenInfo
A screen: the id of this showing of it, and its name in screens.
interface ScreenInfo
| Member | Type | Description |
|---|---|---|
| idRequired | string | The id of this showing: two screens pushed one over the other have the same name and different ids. |
| nameRequired | string | Its name in |
Register
The app's navigation, for the types of its names and params. An app registers it once: declare module '@apexnative/navigation' { interface Register { app: typeof App } }.
interface Register
ScreenName
ScreenProps
The props a screen takes: what a command gives it.
type ScreenProps<Name extends ScreenName> = PropsOf<RegisteredScreens[Name]>
ShowArgs
The settings of a command with the props of the screen, which are required when the screen has required ones.
type ShowArgs<Name extends ScreenName, Config> =
Partial<ScreenProps<Name>> extends ScreenProps<Name>
? [config?: Config & { props?: ScreenProps<Name> }]
: [config: Config & { props: ScreenProps<Name> }]
ScreenElement
A screen of screens shown on its own, without a stack around it, or with options of this show.
class ScreenElement implements LayoutElement<Uses>
| Member | Type | Description |
|---|---|---|
| options | options(options: ScreenOptionsInput<object>): ScreenElement<Uses> | The options of this show, over those of the screen's definition. |
| id | id(id: string): ScreenElement<Uses> | The id of the screen, to address it. |
LayoutElement
An element of a layout: a screen, a stack, tabs, a side menu, a split view.
interface LayoutElement<Uses extends ScreenUse = ScreenUse> extends ShowsScreens<Uses>
LayoutContent
What a place in a layout takes: a screen by name, an element (Screen(name, props) for a screen with props), or a layout as JSON.
type LayoutContent = string | LayoutElement<any> | Layout
| Member | Type | Description |
|---|---|---|
| component | LayoutComponent | A React Native screen. |
| externalComponent | ExternalComponent | A screen created in native code. |
| stack | LayoutStack | A stack of screens. |
| bottomTabs | LayoutBottomTabs | Bottom tabs. |
| sideMenu | LayoutSideMenu | A side menu. |
| splitView | LayoutSplitView | A split view. |