1 | import { IHookRegistry } from './interface';
|
2 | import { HookRegOptions, HookMatchCriteria, TreeChanges, HookMatchCriterion, IMatchingNodes, HookFn } from './interface';
|
3 | import { Transition } from './transition';
|
4 | import { StateObject } from '../state/stateObject';
|
5 | import { TransitionEventType } from './transitionEventType';
|
6 | import { TransitionService } from './transitionService';
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 | export declare function matchState(state: StateObject, criterion: HookMatchCriterion, transition: Transition): boolean;
|
21 |
|
22 |
|
23 |
|
24 | export declare class RegisteredHook {
|
25 | tranSvc: TransitionService;
|
26 | eventType: TransitionEventType;
|
27 | callback: HookFn;
|
28 | matchCriteria: HookMatchCriteria;
|
29 | removeHookFromRegistry: (hook: RegisteredHook) => void;
|
30 | priority: number;
|
31 | bind: any;
|
32 | invokeCount: number;
|
33 | invokeLimit: number;
|
34 | _deregistered: boolean;
|
35 | constructor(tranSvc: TransitionService, eventType: TransitionEventType, callback: HookFn, matchCriteria: HookMatchCriteria, removeHookFromRegistry: (hook: RegisteredHook) => void, options?: HookRegOptions);
|
36 | /**
|
37 | * Gets the matching [[PathNode]]s
|
38 | *
|
39 | * Given an array of [[PathNode]]s, and a [[HookMatchCriterion]], returns an array containing
|
40 | * the [[PathNode]]s that the criteria matches, or `null` if there were no matching nodes.
|
41 | *
|
42 | * Returning `null` is significant to distinguish between the default
|
43 | * "match-all criterion value" of `true` compared to a `() => true` function,
|
44 | * when the nodes is an empty array.
|
45 | *
|
46 | * This is useful to allow a transition match criteria of `entering: true`
|
47 | * to still match a transition, even when `entering === []`. Contrast that
|
48 | * with `entering: (state) => true` which only matches when a state is actually
|
49 | * being entered.
|
50 | */
|
51 | private _matchingNodes;
|
52 | /**
|
53 | * Gets the default match criteria (all `true`)
|
54 | *
|
55 | * Returns an object which has all the criteria match paths as keys and `true` as values, i.e.:
|
56 | *
|
57 | * ```js
|
58 | * {
|
59 | * to: true,
|
60 | * from: true,
|
61 | * entering: true,
|
62 | * exiting: true,
|
63 | * retained: true,
|
64 | * }
|
65 | */
|
66 | private _getDefaultMatchCriteria;
|
67 | |
68 |
|
69 |
|
70 |
|
71 |
|
72 |
|
73 |
|
74 |
|
75 |
|
76 |
|
77 |
|
78 |
|
79 |
|
80 |
|
81 |
|
82 | private _getMatchingNodes;
|
83 | |
84 |
|
85 |
|
86 |
|
87 |
|
88 |
|
89 | matches(treeChanges: TreeChanges, transition: Transition): IMatchingNodes;
|
90 | deregister(): void;
|
91 | }
|
92 |
|
93 | export declare function makeEvent(registry: IHookRegistry, transitionService: TransitionService, eventType: TransitionEventType): (matchObject: any, callback: any, options?: {}) => any;
|