# Transition subsystem

This module contains APIs related to a Transition.

See:

- TransitionService
- Transition
- HookFn, TransitionHookFn, TransitionStateHookFn, HookMatchCriteria, HookResult

## Index

### Enumerations

- RejectType
- TransitionHookPhase
- TransitionHookScope

### Classes

- HookBuilder
- RegisteredHook
- Rejection
- Transition
- TransitionEventType
- TransitionService

### Interfaces

- HookMatchCriteria
- HookRegOptions
- HookTuple
- IHookRegistry
- IMatchingNodes
- TransitionCreateHookFn
- TransitionHookFn
- TransitionHookOptions
- TransitionOptions
- TransitionServicePluginAPI
- TransitionStateHookFn
- TreeChanges

### Type aliases

- ErrorHandler
- GetErrorHandler
- GetResultHandler
- HookFn
- HookMatchCriterion
- HookResult
- IHookRegistration
- IStateMatch
- ResultHandler

### Functions

- tupleSort

### Object literals

- defaultOptions
- defaultTransOpts

## Type aliases

ErrorHandler: function

#### Type declaration

- - (error: any): Promise<any>

  - #### Parameters

    - ##### error any

    #### Returns Promise<any>

- Defined in transition/transitionHook.ts:31

GetErrorHandler: function

#### Type declaration

- - (hook: TransitionHook): ErrorHandler

  - #### Parameters

    - ##### hook TransitionHook

    #### Returns ErrorHandler

- Defined in transition/transitionHook.ts:28

GetResultHandler: function

#### Type declaration

- - (hook: TransitionHook): ResultHandler

  - #### Parameters

    - ##### hook TransitionHook

    #### Returns ResultHandler

- Defined in transition/transitionHook.ts:27

HookFn: TransitionHookFn | TransitionStateHookFn | TransitionCreateHookFn

- Defined in transition/interface.ts:240

HookMatchCriterion: string | true | false | function

Hook Criterion used to match a transition.

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) { return matches; }` which should return a boolean to indicate if a state matches.

Or, `true` to always match

- Defined in transition/interface.ts:833

HookResult: true | false | void | TargetState | Promise<true | false | void | TargetState>

The return value of a TransitionHookFn or TransitionStateHookFn

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

- Defined in transition/interface.ts:255

IHookRegistration: function

#### Type declaration

- - (matchCriteria: HookMatchCriteria, callback: HookFn, options?: HookRegOptions): Function

  - #### Parameters

    - ##### matchCriteria HookMatchCriteria

    - ##### callback HookFn

    - ##### options: Optional HookRegOptions

    #### Returns Function

- Defined in transition/interface.ts:173

IStateMatch: Predicate<StateObject>

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

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

- Defined in transition/interface.ts:719

ResultHandler: function

#### Type declaration

- - (result: HookResult): Promise<HookResult>

  - #### Parameters

    - ##### result HookResult

    #### Returns Promise<HookResult>

- Defined in transition/transitionHook.ts:30

## Functions

- tupleSort(reverseDepthSort?: boolean): nodeDepthThenPriority

- A factory for a sort function for HookTuples.

- A factory for a sort function for HookTuples.

  The sort function first compares the PathNode depth (how deep in the state tree a node is), then compares the EventHook priority.

  #### Parameters

  - ##### reverseDepthSort: Default value boolean = false

    :

    a boolean, when true, reverses the sort order for the node depth

  #### Returns nodeDepthThenPriority

  :

  a tuple sort function

  - Defined in transition/hookBuilder.ts:130

## Object literals

defaultOptions: object

- Defined in transition/transitionHook.ts:20

bind: null = null

- Defined in transition/transitionHook.ts:24

current: noop = noop

- Defined in transition/transitionHook.ts:21

traceData: object

#### Type declaration

- Defined in transition/transitionHook.ts:23

transition: null = null

- Defined in transition/transitionHook.ts:22

defaultTransOpts: object

The default Transition options.

The default Transition options.

Include this object when applying custom defaults: let reloadOpts = { reload: true, notify: true } let options = defaults(theirOpts, customDefaults, defaultOptions);

- Defined in transition/transitionService.ts:40

custom: object

#### Type declaration

- Defined in transition/transitionService.ts:46

inherit: boolean = false

- Defined in transition/transitionService.ts:43

location: boolean = true

- Defined in transition/transitionService.ts:41

notify: boolean = true

- Defined in transition/transitionService.ts:44

relative: null = null

- Defined in transition/transitionService.ts:42

reload: boolean = false

- Defined in transition/transitionService.ts:45

source: string = "unknown"

- Defined in transition/transitionService.ts:48

- current(): any

- #### Returns any

  - Defined in transition/transitionService.ts:47

Generated using TypeDoc