UNPKG

4.03 kBTypeScriptView Raw
1import { Transition } from '../transition/transition';
2import { ViewTuple } from '../view';
3import { ActiveUIView, ViewConfig, ViewContext } from '../view/interface';
4import { Resolvable } from '../resolve/resolvable';
5import { PathNode } from '../path/pathNode';
6import { PolicyWhen } from '../resolve/interface';
7import { TransitionHook } from '../transition/transitionHook';
8import { HookResult } from '../transition/interface';
9import { StateObject } from '../state/stateObject';
10/**
11 * Trace categories Enum
12 *
13 * Enable or disable a category using [[Trace.enable]] or [[Trace.disable]]
14 *
15 * `trace.enable(Category.TRANSITION)`
16 *
17 * These can also be provided using a matching string, or position ordinal
18 *
19 * `trace.enable("TRANSITION")`
20 *
21 * `trace.enable(1)`
22 */
23declare enum Category {
24 RESOLVE = 0,
25 TRANSITION = 1,
26 HOOK = 2,
27 UIVIEW = 3,
28 VIEWCONFIG = 4
29}
30export { Category };
31/**
32 * Prints UI-Router Transition trace information to the console.
33 */
34export declare class Trace {
35 /** @internal */
36 approximateDigests: number;
37 /** @internal */
38 private _enabled;
39 /** @internal */
40 constructor();
41 /** @internal */
42 private _set;
43 /**
44 * Enables a trace [[Category]]
45 *
46 * ```js
47 * trace.enable("TRANSITION");
48 * ```
49 *
50 * @param categories categories to enable. If `categories` is omitted, all categories are enabled.
51 * Also takes strings (category name) or ordinal (category position)
52 */
53 enable(...categories: (Category | string | number)[]): any;
54 /**
55 * Disables a trace [[Category]]
56 *
57 * ```js
58 * trace.disable("VIEWCONFIG");
59 * ```
60 *
61 * @param categories categories to disable. If `categories` is omitted, all categories are disabled.
62 * Also takes strings (category name) or ordinal (category position)
63 */
64 disable(...categories: (Category | string | number)[]): any;
65 /**
66 * Retrieves the enabled stateus of a [[Category]]
67 *
68 * ```js
69 * trace.enabled("VIEWCONFIG"); // true or false
70 * ```
71 *
72 * @returns boolean true if the category is enabled
73 */
74 enabled(category: Category | string | number): boolean;
75 /** @internal called by ui-router code */
76 traceTransitionStart(trans: Transition): void;
77 /** @internal called by ui-router code */
78 traceTransitionIgnored(trans: Transition): void;
79 /** @internal called by ui-router code */
80 traceHookInvocation(step: TransitionHook, trans: Transition, options: any): void;
81 /** @internal called by ui-router code */
82 traceHookResult(hookResult: HookResult, trans: Transition, transitionOptions: any): void;
83 /** @internal called by ui-router code */
84 traceResolvePath(path: PathNode[], when: PolicyWhen, trans?: Transition): void;
85 /** @internal called by ui-router code */
86 traceResolvableResolved(resolvable: Resolvable, trans?: Transition): void;
87 /** @internal called by ui-router code */
88 traceError(reason: any, trans: Transition): void;
89 /** @internal called by ui-router code */
90 traceSuccess(finalState: StateObject, trans: Transition): void;
91 /** @internal called by ui-router code */
92 traceUIViewEvent(event: string, viewData: ActiveUIView, extra?: string): void;
93 /** @internal called by ui-router code */
94 traceUIViewConfigUpdated(viewData: ActiveUIView, context: ViewContext): void;
95 /** @internal called by ui-router code */
96 traceUIViewFill(viewData: ActiveUIView, html: string): void;
97 /** @internal called by ui-router code */
98 traceViewSync(pairs: ViewTuple[]): void;
99 /** @internal called by ui-router code */
100 traceViewServiceEvent(event: string, viewConfig: ViewConfig): void;
101 /** @internal called by ui-router code */
102 traceViewServiceUIViewEvent(event: string, viewData: ActiveUIView): void;
103}
104/**
105 * The [[Trace]] singleton
106 *
107 * #### Example:
108 * ```js
109 * import {trace} from "@uirouter/core";
110 * trace.enable(1, 5);
111 * ```
112 */
113declare const trace: Trace;
114export { trace };
115
\No newline at end of file