Skip to main content
‹ Screens and props
Types

Types

The types of screens and props.

SectionScreens and propsDraftDocumented, not reviewed yet: the API can change.

ScreenDefinition​

Interface

A screen with what goes with it.

interface ScreenDefinition<Props = any>
MemberTypeDescription
componentRequiredComponentType<Props>
optionsScreenOptionsInput<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.

arrangementScreenArrangement<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, defineArrangement.

Defined in src/api/screens/defineScreen.ts ↗

DefinedScreen​

Type

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>;
}
Defined in src/api/screens/defineScreen.ts ↗

Screens​

Type
type Screens = Record<string, ScreenEntry>
Defined in src/api/screens/registerScreens.tsx ↗

ScreenEntry​

Type

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>
MemberTypeDescription
componentRequiredComponentType<Props>
optionsScreenOptionsInput<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.

arrangementScreenArrangement<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, defineArrangement.

loadRequired() => ScreenModule | PromiseLike<ScreenModule>
nativeNameRequiredstring
useProps(props: Props) => object
propsProps

Carries the type of the props; never set.

definitionRequiredArrangementDefinition<Props>
Defined in src/api/screens/registerScreens.tsx ↗

ScreenGroup​

Interface

Screens sharing options, such as the sign-in screens without a top bar.

interface ScreenGroup
MemberTypeDescription
optionsScreenOptionsInput<object>

The options of every screen of the group; the screen's own options go over them.

screensRequiredScreens
Defined in src/api/screens/registerScreens.tsx ↗

ScreenInfo​

Interface

A screen: the id of this showing of it, and its name in screens.

interface ScreenInfo
MemberTypeDescription
idRequiredstring

The id of this showing: two screens pushed one over the other have the same name and different ids.

nameRequiredstring

Its name in screens.

Defined in src/api/screens/registerScreens.tsx ↗

Register​

Interface

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
Defined in src/api/types.ts ↗

ScreenName​

Type
type ScreenName = keyof RegisteredScreens & string
Defined in src/api/types.ts ↗

ScreenProps​

Type

The props a screen takes: what a command gives it.

type ScreenProps<Name extends ScreenName> = PropsOf<RegisteredScreens[Name]>
Defined in src/api/types.ts ↗

ShowArgs​

Type

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> }]
Defined in src/api/types.ts ↗

ScreenElement​

Class

A screen of screens shown on its own, without a stack around it, or with options of this show.

class ScreenElement implements LayoutElement<Uses>
MemberTypeDescription
optionsoptions(options: ScreenOptionsInput<object>): ScreenElement<Uses>

The options of this show, over those of the screen's definition.

idid(id: string): ScreenElement<Uses>

The id of the screen, to address it.

Defined in src/api/layout/Screen.ts ↗

LayoutElement​

Interface

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>
Defined in src/api/layout/element.ts ↗

LayoutContent​

Type

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
MemberTypeDescription
componentLayoutComponent

A React Native screen.

externalComponentExternalComponent

A screen created in native code.

stackLayoutStack

A stack of screens.

bottomTabsLayoutBottomTabs

Bottom tabs.

sideMenuLayoutSideMenu

A side menu.

splitViewLayoutSplitView

A split view.

Defined in src/api/layout/element.ts ↗