1 |
|
2 |
|
3 |
|
4 | export interface TraceWriter {
|
5 | write(message: any, category: string, type?: number): void;
|
6 | }
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | export interface TraceEventListener {
|
12 | filter: string;
|
13 | on(object: Object, name: string, data?: any): void;
|
14 | }
|
15 |
|
16 |
|
17 |
|
18 |
|
19 | export interface TraceErrorHandler {
|
20 | handlerError(error: Error): any;
|
21 | }
|
22 |
|
23 | export namespace Trace {
|
24 | |
25 |
|
26 |
|
27 | export function enable(): void;
|
28 |
|
29 | |
30 |
|
31 |
|
32 | export function disable(): void;
|
33 |
|
34 | |
35 |
|
36 |
|
37 |
|
38 |
|
39 | export function isEnabled(): boolean;
|
40 |
|
41 | |
42 |
|
43 |
|
44 |
|
45 | export function addWriter(writer: TraceWriter): void;
|
46 |
|
47 | |
48 |
|
49 |
|
50 |
|
51 | export function removeWriter(writer: TraceWriter): void;
|
52 |
|
53 | |
54 |
|
55 |
|
56 | export function clearWriters(): void;
|
57 |
|
58 | |
59 |
|
60 |
|
61 |
|
62 | export function setCategories(categories: string): void;
|
63 |
|
64 | |
65 |
|
66 |
|
67 |
|
68 | export function addCategories(categories: string): void;
|
69 |
|
70 | |
71 |
|
72 |
|
73 |
|
74 | export function isCategorySet(category: string): boolean;
|
75 |
|
76 | |
77 |
|
78 |
|
79 |
|
80 |
|
81 |
|
82 | export function write(message: any, category: string, type?: number): void;
|
83 |
|
84 | |
85 |
|
86 |
|
87 |
|
88 |
|
89 |
|
90 | export function notifyEvent(object: Object, name: string, data?: any): void;
|
91 |
|
92 | export function addEventListener(listener: TraceEventListener): void;
|
93 |
|
94 | export function removeEventListener(listener: TraceEventListener): void;
|
95 |
|
96 | export module messageType {
|
97 | export const log = 0;
|
98 | export const info = 1;
|
99 | export const warn = 2;
|
100 | export const error = 3;
|
101 | }
|
102 |
|
103 | |
104 |
|
105 |
|
106 | export module categories {
|
107 | export const VisualTreeEvents = 'VisualTreeEvents';
|
108 | export const Layout = 'Layout';
|
109 | export const Style = 'Style';
|
110 | export const ViewHierarchy = 'ViewHierarchy';
|
111 | export const NativeLifecycle = 'NativeLifecycle';
|
112 | export const Debug = 'Debug';
|
113 | export const Navigation = 'Navigation';
|
114 | export const Test = 'Test';
|
115 | export const Binding = 'Binding';
|
116 | export const BindingError = 'BindingError';
|
117 | export const Error = 'Error';
|
118 | export const Animation = 'Animation';
|
119 | export const Transition = 'Transition';
|
120 | export const Livesync = 'Livesync';
|
121 | export const ModuleNameResolver = 'ModuleNameResolver';
|
122 | export const MediaQuery = 'MediaQuery';
|
123 |
|
124 | export const separator = ',';
|
125 | export const All: string;
|
126 |
|
127 | export function concat(...args: any): string;
|
128 | }
|
129 |
|
130 | class ConsoleWriter implements TraceWriter {
|
131 | public write(message: any, category: string, type?: number): void;
|
132 | }
|
133 |
|
134 | export class DefaultErrorHandler implements TraceErrorHandler {
|
135 | handlerError(error: any): void;
|
136 | }
|
137 |
|
138 | export function getErrorHandler(): TraceErrorHandler;
|
139 |
|
140 | export function setErrorHandler(handler: TraceErrorHandler): void;
|
141 |
|
142 | |
143 |
|
144 |
|
145 |
|
146 | export function error(error: string | Error): void;
|
147 | }
|