Interface RouteHelpers<T, N>

interface RouteHelpers<T, N> {
    builder: undefined | ((state, create) => GouterState<T, keyof T>[]);
    redirector: undefined | ((state, goTo) => void);
}

Type Parameters

  • T extends state

  • N extends keyof T

Properties

Properties

builder: undefined | ((state, create) => GouterState<T, keyof T>[])

Type declaration

    • (state, create): GouterState<T, keyof T>[]
    • Parameters

      • state: GouterState<T, N>
      • create: (<N>(name, params, stack?, focusedIndex?) => GouterState<T, N>)
          • <N>(name, params, stack?, focusedIndex?): GouterState<T, N>
          • Creates state using required name, params and optional stack. When stack is not passed and routes has appropriate builder, new stack is generated using that builder.

            Type Parameters

            • N extends string | number | symbol

            Parameters

            • name: N

              string to distinguish states

            • params: T[N]

              collection of parameters to customize states

            • Optional stack: GouterState<T, keyof T>[]

              optional list of inner states

            • Optional focusedIndex: number

              optional index of focused state in stack

            Returns GouterState<T, N>

      Returns GouterState<T, keyof T>[]

redirector: undefined | ((state, goTo) => void)

Type declaration

    • (state, goTo): void
    • Parameters

      • state: GouterState<T, N>
      • goTo: (<N>(name, params, options?) => void)
          • <N>(name, params, options?): void
          • Main navigation tool. By default it searches for nearest state with passed name (and matches passed keys if any) in stacks of focused states. If existing state not found then new state is created if it is allowed in current stack. Params are replaced by passed ones by default, however merge option may modify this behavior. When navigation is successful optional update callback is called for further state modification.

            Type Parameters

            • N extends string | number | symbol

            Parameters

            Returns void

      Returns void

Generated using TypeDoc