Class GouterNavigation<T, K>

Provides tools for navigation.

Type Parameters

  • T

  • K

Constructors

  • Creates tools for navigation.

    Type Parameters

    Parameters

    • routes: Routes<T>

      map of names to route configurations

    • rootName: K

      root state name

    • rootParams: T[K]

      root state parameters

    Returns GouterNavigation<T, K>

Properties

rootState: GouterState<T, K>

root state

routes: Routes<T>

map of names to route configurations

Methods

  • 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>

  • Secondary navigation tool. It's behavior is defined by navigator option in route but usually it undoes goTo changes.

    Returns 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

  • Replaces current innermost focused state by new one. If current state has no parent then nothing happens.

    Parameters

    Returns void

Generated using TypeDoc