@uirouter/core/transition/interface | @uirouter/react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Module @uirouter/core/transition/interface

Index

Type aliases

HookFn

HookMatchCriterion

HookMatchCriterion: string | IStateMatch | boolean

Hook Criterion used to match a transition.

A Glob string that matches the name of a state.

Or, a function with the signature function(state, transition) { return matches; } which should return a boolean to indicate if a state matches.

Or, true to always match

HookResult

HookResult: boolean | TargetState | void | Promise<boolean | TargetState | void>

The return value of a TransitionHookFn or TransitionStateHookFn

When returned from a TransitionHookFn or TransitionStateHookFn, these values alter the running Transition:

  • false: the transition will be cancelled.
  • TargetState: the transition will be redirected to the new target state (see: StateService.target)
  • Promise: the transition will wait for the promise to resolve or reject
    • If the promise is rejected (or resolves to false), the transition will be cancelled
    • If the promise resolves to a TargetState, the transition will be redirected
    • If the promise resolves to anything else, the transition will resume
  • Anything else: the transition will resume

IHookRegistration

IHookRegistration: (matchCriteria: HookMatchCriteria, callback: HookFn, options?: HookRegOptions) => Function

Type declaration

IStateMatch

A predicate type which tests if a StateObject and Transition passes some test. Returns a boolean.

Generated using TypeDoc