@embedpdf/models 1.0.10 → 1.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,172 @@
1
+ /**
2
+ * logger for logging
3
+ *
4
+ * @public
5
+ */
6
+ export interface Logger {
7
+ /**
8
+ * Log debug message
9
+ * @param source - source of log
10
+ * @param category - category of log
11
+ * @param args - parameters of log
12
+ * @returns
13
+ *
14
+ * @public
15
+ */
16
+ debug: (source: string, category: string, ...args: any) => void;
17
+ /**
18
+ * Log infor message
19
+ * @param source - source of log
20
+ * @param category - category of log
21
+ * @param args - parameters of log
22
+ * @returns
23
+ *
24
+ * @public
25
+ */
26
+ info: (source: string, category: string, ...args: any) => void;
27
+ /**
28
+ * Log warning message
29
+ * @param source - source of log
30
+ * @param category - category of log
31
+ * @param args - parameters of log
32
+ * @returns
33
+ *
34
+ * @public
35
+ */
36
+ warn: (source: string, category: string, ...args: any) => void;
37
+ /**
38
+ * Log error message
39
+ * @param source - source of log
40
+ * @param category - category of log
41
+ * @param args - parameters of log
42
+ * @returns
43
+ *
44
+ * @public
45
+ */
46
+ error: (source: string, category: string, ...args: any) => void;
47
+ /**
48
+ * Log performance log
49
+ * @param source - source of log
50
+ * @param category - category of log
51
+ * @param event - event of log
52
+ * @param phase - event phase of log
53
+ * @param args - parameters of log
54
+ * @returns
55
+ *
56
+ * @public
57
+ */
58
+ perf: (source: string, category: string, event: string, phase: 'Begin' | 'End', ...args: any) => void;
59
+ }
60
+ /**
61
+ * Logger that log nothing, it will ignore all the logs
62
+ *
63
+ * @public
64
+ */
65
+ export declare class NoopLogger implements Logger {
66
+ /** {@inheritDoc Logger.debug} */
67
+ debug(): void;
68
+ /** {@inheritDoc Logger.info} */
69
+ info(): void;
70
+ /** {@inheritDoc Logger.warn} */
71
+ warn(): void;
72
+ /** {@inheritDoc Logger.error} */
73
+ error(): void;
74
+ /** {@inheritDoc Logger.perf} */
75
+ perf(): void;
76
+ }
77
+ /**
78
+ * Logger that use console as the output
79
+ *
80
+ * @public
81
+ */
82
+ export declare class ConsoleLogger implements Logger {
83
+ /** {@inheritDoc Logger.debug} */
84
+ debug(source: string, category: string, ...args: any): void;
85
+ /** {@inheritDoc Logger.info} */
86
+ info(source: string, category: string, ...args: any): void;
87
+ /** {@inheritDoc Logger.warn} */
88
+ warn(source: string, category: string, ...args: any): void;
89
+ /** {@inheritDoc Logger.error} */
90
+ error(source: string, category: string, ...args: any): void;
91
+ /** {@inheritDoc Logger.perf} */
92
+ perf(source: string, category: string, event: string, phase: 'Begin' | 'End', ...args: any): void;
93
+ }
94
+ /**
95
+ * Level of log
96
+ *
97
+ * @public
98
+ */
99
+ export declare enum LogLevel {
100
+ Debug = 0,
101
+ Info = 1,
102
+ Warn = 2,
103
+ Error = 3
104
+ }
105
+ /**
106
+ * Logger that support filtering by log level
107
+ *
108
+ * @public
109
+ */
110
+ export declare class LevelLogger implements Logger {
111
+ private logger;
112
+ private level;
113
+ /**
114
+ * create new LevelLogger
115
+ * @param logger - the original logger
116
+ * @param level - log level that used for filtering, all logs lower than this level will be filtered out
117
+ */
118
+ constructor(logger: Logger, level: LogLevel);
119
+ /** {@inheritDoc Logger.debug} */
120
+ debug(source: string, category: string, ...args: any): void;
121
+ /** {@inheritDoc Logger.info} */
122
+ info(source: string, category: string, ...args: any): void;
123
+ /** {@inheritDoc Logger.warn} */
124
+ warn(source: string, category: string, ...args: any): void;
125
+ /** {@inheritDoc Logger.error} */
126
+ error(source: string, category: string, ...args: any): void;
127
+ /** {@inheritDoc Logger.perf} */
128
+ perf(source: string, category: string, event: string, phase: 'Begin' | 'End', ...args: any): void;
129
+ }
130
+ /**
131
+ * Logger for performance tracking
132
+ *
133
+ * @public
134
+ */
135
+ export declare class PerfLogger implements Logger {
136
+ /**
137
+ * create new PerfLogger
138
+ */
139
+ constructor();
140
+ /** {@inheritDoc Logger.debug} */
141
+ debug(source: string, category: string, ...args: any): void;
142
+ /** {@inheritDoc Logger.info} */
143
+ info(source: string, category: string, ...args: any): void;
144
+ /** {@inheritDoc Logger.warn} */
145
+ warn(source: string, category: string, ...args: any): void;
146
+ /** {@inheritDoc Logger.error} */
147
+ error(source: string, category: string, ...args: any): void;
148
+ /** {@inheritDoc Logger.perf} */
149
+ perf(source: string, category: string, event: string, phase: 'Begin' | 'End', identifier: string, ...args: any): void;
150
+ }
151
+ /**
152
+ * Logger that will track and call child loggers
153
+ *
154
+ * @public
155
+ */
156
+ export declare class AllLogger implements Logger {
157
+ private loggers;
158
+ /**
159
+ * create new PerfLogger
160
+ */
161
+ constructor(loggers: Logger[]);
162
+ /** {@inheritDoc Logger.debug} */
163
+ debug(source: string, category: string, ...args: any): void;
164
+ /** {@inheritDoc Logger.info} */
165
+ info(source: string, category: string, ...args: any): void;
166
+ /** {@inheritDoc Logger.warn} */
167
+ warn(source: string, category: string, ...args: any): void;
168
+ /** {@inheritDoc Logger.error} */
169
+ error(source: string, category: string, ...args: any): void;
170
+ /** {@inheritDoc Logger.perf} */
171
+ perf(source: string, category: string, event: string, phase: 'Begin' | 'End', ...args: any): void;
172
+ }
@@ -0,0 +1 @@
1
+ export {};