@idlebox/common 1.3.8 → 1.3.11

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.
Files changed (126) hide show
  1. package/dist/common-alpha.d.ts +1020 -0
  2. package/dist/common-beta.d.ts +1010 -0
  3. package/dist/common-public.d.ts +1008 -0
  4. package/dist/common.d.ts +1020 -0
  5. package/dist/tsdoc-metadata.json +11 -0
  6. package/docs/common.api.json +21737 -0
  7. package/docs/common.api.md +1139 -0
  8. package/docs/tsdoc-metadata.json +11 -0
  9. package/lib/array/arrayDiff.cjs.map +1 -10
  10. package/lib/array/arraySame.cjs.map +1 -10
  11. package/lib/array/arrayUnique.cjs.map +1 -10
  12. package/lib/array/normalizeArray.cjs.map +1 -10
  13. package/lib/array/sortAlpha.cjs.map +1 -10
  14. package/lib/date/consts.cjs.map +1 -10
  15. package/lib/date/isInvalid.cjs.map +1 -10
  16. package/lib/date/sibling.cjs.map +1 -10
  17. package/lib/date/timeString.cjs +4 -4
  18. package/lib/date/timeString.cjs.map +1 -10
  19. package/lib/date/unix.cjs.map +1 -10
  20. package/lib/debugging/serializable.cjs +125 -0
  21. package/lib/debugging/serializable.cjs.map +1 -0
  22. package/lib/debugging/serializable.js +118 -0
  23. package/lib/debugging/serializable.js.map +1 -0
  24. package/lib/debugging/tryInspect.cjs +1 -1
  25. package/lib/debugging/tryInspect.cjs.map +1 -10
  26. package/lib/error/convertUnknown.cjs +2 -2
  27. package/lib/error/convertUnknown.cjs.map +1 -10
  28. package/lib/error/getFrame.cjs.map +1 -10
  29. package/lib/function/asyncCallbackList.cjs +4 -14
  30. package/lib/function/asyncCallbackList.cjs.map +1 -10
  31. package/lib/function/callbackList.cjs +5 -20
  32. package/lib/function/callbackList.cjs.map +1 -10
  33. package/lib/function/delayCallbackList.cjs +6 -24
  34. package/lib/function/delayCallbackList.cjs.map +1 -10
  35. package/lib/function/functionName.cjs.map +1 -10
  36. package/lib/index.generated.cjs +341 -0
  37. package/lib/index.generated.cjs.map +1 -0
  38. package/lib/index.generated.js +219 -0
  39. package/lib/index.generated.js.map +1 -0
  40. package/lib/lifecycle/dispose/bridges/rxjs.cjs.map +1 -10
  41. package/lib/lifecycle/dispose/disposableEvent.cjs.map +1 -10
  42. package/lib/lifecycle/dispose/disposedError.cjs +3 -3
  43. package/lib/lifecycle/dispose/disposedError.cjs.map +1 -10
  44. package/lib/lifecycle/dispose/lifecycle.async.cjs +12 -44
  45. package/lib/lifecycle/dispose/lifecycle.async.cjs.map +1 -10
  46. package/lib/lifecycle/dispose/lifecycle.cjs.map +1 -10
  47. package/lib/lifecycle/dispose/lifecycle.global.cjs +9 -9
  48. package/lib/lifecycle/dispose/lifecycle.global.cjs.map +1 -10
  49. package/lib/lifecycle/dispose/lifecycle.sync.cjs +12 -51
  50. package/lib/lifecycle/dispose/lifecycle.sync.cjs.map +1 -10
  51. package/lib/lifecycle/event/event.cjs +20 -7
  52. package/lib/lifecycle/event/event.cjs.map +1 -10
  53. package/lib/lifecycle/event/event.js +19 -1
  54. package/lib/lifecycle/event/event.js.map +1 -1
  55. package/lib/lifecycle/event/memorized.cjs +38 -0
  56. package/lib/lifecycle/event/memorized.cjs.map +1 -0
  57. package/lib/lifecycle/event/memorized.js +34 -0
  58. package/lib/lifecycle/event/memorized.js.map +1 -0
  59. package/lib/lifecycle/promise/cancel.cjs.map +1 -10
  60. package/lib/lifecycle/promise/cancellationToken/driver.browser.cjs +3 -18
  61. package/lib/lifecycle/promise/cancellationToken/driver.browser.cjs.map +1 -10
  62. package/lib/lifecycle/promise/cancellationToken/driver.common.cjs +5 -20
  63. package/lib/lifecycle/promise/cancellationToken/driver.common.cjs.map +1 -10
  64. package/lib/lifecycle/promise/cancellationToken/source.cjs +10 -20
  65. package/lib/lifecycle/promise/cancellationToken/source.cjs.map +1 -10
  66. package/lib/lifecycle/promise/deferredPromise.cjs +5 -20
  67. package/lib/lifecycle/promise/deferredPromise.cjs.map +1 -10
  68. package/lib/lifecycle/timeout/timeout.cjs +4 -4
  69. package/lib/lifecycle/timeout/timeout.cjs.map +1 -10
  70. package/lib/lifecycle/timeout/timeoutError.cjs +2 -2
  71. package/lib/lifecycle/timeout/timeoutError.cjs.map +1 -10
  72. package/lib/log/logger.cjs +9 -24
  73. package/lib/log/logger.cjs.map +1 -10
  74. package/lib/mapSet/customSet.cjs +2 -12
  75. package/lib/mapSet/customSet.cjs.map +1 -10
  76. package/lib/mapSet/extendMap.cjs.map +1 -10
  77. package/lib/misc/assertNotNull.cjs.map +1 -10
  78. package/lib/object/definePublicConstant.cjs.map +1 -10
  79. package/lib/object/initOnRead.cjs.map +1 -10
  80. package/lib/object/objectPath.cjs.map +1 -10
  81. package/lib/object/objectSame.cjs +4 -4
  82. package/lib/object/objectSame.cjs.map +1 -10
  83. package/lib/path/isAbsolute.cjs.map +1 -10
  84. package/lib/path/normalizePath.cjs.map +1 -10
  85. package/lib/path/pathArray.cjs +7 -11
  86. package/lib/path/pathArray.cjs.map +1 -10
  87. package/lib/platform/globalObject.cjs +5 -1
  88. package/lib/platform/globalObject.cjs.map +1 -10
  89. package/lib/platform/globalObject.js +3 -0
  90. package/lib/platform/globalObject.js.map +1 -1
  91. package/lib/platform/globalSingleton.cjs +5 -5
  92. package/lib/platform/globalSingleton.cjs.map +1 -10
  93. package/lib/platform/globalSymbol.cjs +2 -2
  94. package/lib/platform/globalSymbol.cjs.map +1 -10
  95. package/lib/platform/os.cjs.map +1 -10
  96. package/lib/promise/awaitIterator.cjs.map +1 -10
  97. package/lib/promise/finishAllPromise.cjs.map +1 -10
  98. package/lib/promise/promiseBool.cjs.map +1 -10
  99. package/lib/promise/promisePool.cjs +5 -12
  100. package/lib/promise/promisePool.cjs.map +1 -10
  101. package/lib/promise/timeoutPromisePool.cjs +6 -10
  102. package/lib/promise/timeoutPromisePool.cjs.map +1 -10
  103. package/lib/reflection/classes/hookClass.cjs.map +1 -10
  104. package/lib/reflection/classes/singleton.cjs +2 -2
  105. package/lib/reflection/classes/singleton.cjs.map +1 -10
  106. package/lib/reflection/methods/bind.cjs.map +1 -10
  107. package/lib/reflection/methods/initOnRead.cjs +2 -2
  108. package/lib/reflection/methods/initOnRead.cjs.map +1 -10
  109. package/lib/reflection/methods/memorize.cjs.map +1 -10
  110. package/lib/string/castCase.cjs.map +1 -10
  111. package/lib/string/concatType.generated.cjs.map +1 -10
  112. package/lib/string/escapeRegexp.cjs.map +1 -10
  113. package/lib/string/pad2.cjs.map +1 -10
  114. package/lib/string/sizeString.cjs.map +1 -10
  115. package/lib/typingHeler/deep.cjs +1 -0
  116. package/lib/typingHeler/deep.cjs.map +1 -10
  117. package/lib/typingHeler/deep.js +1 -0
  118. package/lib/typingHeler/deep.js.map +1 -1
  119. package/package.json +42 -42
  120. package/generate/main.ts +0 -56
  121. package/generate/package.json +0 -3
  122. package/generate/tsconfig.json +0 -9
  123. package/lib/_export_all_in_one_index.cjs +0 -176
  124. package/lib/_export_all_in_one_index.cjs.map +0 -10
  125. package/lib/_export_all_in_one_index.js +0 -61
  126. package/lib/_export_all_in_one_index.js.map +0 -1
@@ -0,0 +1,1008 @@
1
+ export declare function addDisposableEventListener<T extends Function>(target: IEventHostObject<T> | IEventEmitterObject<T>, type: string, options: IEventListenerOptions, handler: T): IDisposable;
2
+
3
+ export declare function addDisposableEventListener<T extends Function>(target: IEventHostObject<T> | IEventEmitterObject<T>, type: string, handler: T): IDisposable;
4
+
5
+ /**
6
+ * Compare two array, returns the difference from `before` to `after`
7
+ * @public
8
+ */
9
+ export declare function arrayDiff<T>(before: T[], after: T[]): {
10
+ add: T[];
11
+ del: T[];
12
+ same: T[];
13
+ };
14
+
15
+ /**
16
+ * Returns a new array without duplicate values
17
+ * @public
18
+ */
19
+ export declare function arrayUnique<T>(arr: T[]): T[];
20
+
21
+ /**
22
+ * Removes duplicate values from an array
23
+ * @public
24
+ */
25
+ export declare function arrayUniqueReference(arr: any[]): void;
26
+
27
+ /**
28
+ * Assert function must have oneof displayName/name property
29
+ */
30
+ export declare function assertFunctionHasName(func: MaybeNamedFunction): void;
31
+
32
+ /**
33
+ * assert value is not null or undefined or NaN
34
+ * @public
35
+ */
36
+ export declare function assertNotNull<T>(val: T | null | undefined): T;
37
+
38
+ export declare function assertSerializable(value: any): void;
39
+
40
+ /**
41
+ * like CallbackList, but async
42
+ */
43
+ export declare class AsyncCallbackList<Argument extends unknown[]> {
44
+ protected list: MyAsyncCallback<Argument>[];
45
+ protected running: boolean;
46
+ constructor();
47
+ count(): number;
48
+ reset(): void;
49
+ /**
50
+ * @param name optional name of `item` (will assign displayName to `item`)
51
+ * @returns function list length
52
+ */
53
+ add(item: MyAsyncCallback<Argument>, name?: string): number;
54
+ /**
55
+ * @returns if removed: return `item`; if did not exists: return null
56
+ */
57
+ remove(item: MyAsyncCallback<Argument>): null | MyAsyncCallback<Argument>;
58
+ /**
59
+ * Stop run if one callback return `true`
60
+ * @returns {boolean} true if one callback return true
61
+ */
62
+ run(...argument: Argument): Promise<boolean>;
63
+ }
64
+
65
+ /**
66
+ * Async version of Disposable
67
+ * @public
68
+ */
69
+ export declare class AsyncDisposable implements IAsyncDisposable, IDisposableBaseInternal {
70
+ private readonly _disposables;
71
+ protected readonly _onDisposeError: Emitter<Error>;
72
+ readonly onDisposeError: EventRegister<Error>;
73
+ protected readonly _onBeforeDispose: Emitter<void>;
74
+ readonly onBeforeDispose: EventRegister<void>;
75
+ private _disposed?;
76
+ get hasDisposed(): boolean;
77
+ /**
78
+ * @throws if already disposed
79
+ */
80
+ assertNotDisposed(): void;
81
+ /**
82
+ * register a disposable object
83
+ */
84
+ _register<T extends IAsyncDisposable>(d: T): T;
85
+ dispose(): Promise<void>;
86
+ }
87
+
88
+ /**
89
+ * Convert Iterator into Promise, resolve with the last value from Iterator
90
+ */
91
+ export declare function awaitIterator<T>(generator: Iterator<T>): Promise<T>;
92
+
93
+ /**
94
+ * Auto bind `this` to class method
95
+ */
96
+ export declare const bindThis: MethodDecorator;
97
+
98
+ /**
99
+ * Manage a list of callback
100
+ */
101
+ export declare class CallbackList<Argument extends unknown[]> {
102
+ protected list: MyCallback<Argument>[];
103
+ protected running: boolean;
104
+ protected stop: boolean;
105
+ constructor();
106
+ count(): number;
107
+ reset(): void;
108
+ /**
109
+ * @param name optional name of `item` (will assign displayName to `item`)
110
+ * @returns function list length
111
+ */
112
+ add(item: MyCallback<Argument>, name?: string): number;
113
+ /**
114
+ * @returns if removed: return `item`; if did not exists: return null
115
+ */
116
+ remove(item: MyCallback<Argument>): null | MyCallback<Argument>;
117
+ /**
118
+ * @returns {boolean} true if every callback called, false if stop in middle
119
+ */
120
+ run(...argument: Argument): boolean;
121
+ stopRun(): void;
122
+ }
123
+
124
+ /** @public */
125
+ export declare function camelCase(str: string): string;
126
+
127
+ /**
128
+ * Error when cancel() is called
129
+ * @public
130
+ */
131
+ export declare class CanceledError extends Error {
132
+ constructor();
133
+ }
134
+
135
+ /** @public */
136
+ export declare interface CancellationToken {
137
+ readonly isCancellationRequested: boolean;
138
+ onCancellationRequested(callback: EventHandler<void>): IDisposable;
139
+ }
140
+
141
+ /** @public */
142
+ export declare class CancellationTokenSource extends DisposableOnce implements IDisposable {
143
+ private readonly driver;
144
+ readonly token: CancellationToken;
145
+ constructor();
146
+ cancel(): void;
147
+ _dispose(): void;
148
+ }
149
+
150
+ export declare enum ColorKind {
151
+ DISABLE = 0,
152
+ TERMINAL = 1,
153
+ WEB = 2,
154
+ DETECT = 3
155
+ }
156
+
157
+ export declare function concatStringType<T0 extends string>(t0: T0): `${T0}`;
158
+
159
+ export declare function concatStringType<T0 extends string, T1 extends string>(t0: T0, t1: T1): `${T0}${T1}`;
160
+
161
+ export declare function concatStringType<T0 extends string, T1 extends string, T2 extends string>(t0: T0, t1: T1, t2: T2): `${T0}${T1}${T2}`;
162
+
163
+ export declare function concatStringType<T0 extends string, T1 extends string, T2 extends string, T3 extends string>(t0: T0, t1: T1, t2: T2, t3: T3): `${T0}${T1}${T2}${T3}`;
164
+
165
+ export declare function concatStringType<T0 extends string, T1 extends string, T2 extends string, T3 extends string, T4 extends string>(t0: T0, t1: T1, t2: T2, t3: T3, t4: T4): `${T0}${T1}${T2}${T3}${T4}`;
166
+
167
+ export declare function concatStringType<T0 extends string, T1 extends string, T2 extends string, T3 extends string, T4 extends string, T5 extends string>(t0: T0, t1: T1, t2: T2, t3: T3, t4: T4, t5: T5): `${T0}${T1}${T2}${T3}${T4}${T5}`;
168
+
169
+ export declare function concatStringType<T0 extends string, T1 extends string, T2 extends string, T3 extends string, T4 extends string, T5 extends string, T6 extends string>(t0: T0, t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6): `${T0}${T1}${T2}${T3}${T4}${T5}${T6}`;
170
+
171
+ export declare function concatStringType<T0 extends string, T1 extends string, T2 extends string, T3 extends string, T4 extends string, T5 extends string, T6 extends string, T7 extends string>(t0: T0, t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7): `${T0}${T1}${T2}${T3}${T4}${T5}${T6}${T7}`;
172
+
173
+ export declare function concatStringType<T0 extends string, T1 extends string, T2 extends string, T3 extends string, T4 extends string, T5 extends string, T6 extends string, T7 extends string, T8 extends string>(t0: T0, t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7, t8: T8): `${T0}${T1}${T2}${T3}${T4}${T5}${T6}${T7}${T8}`;
174
+
175
+ export declare function concatStringType<T0 extends string, T1 extends string, T2 extends string, T3 extends string, T4 extends string, T5 extends string, T6 extends string, T7 extends string, T8 extends string, T9 extends string>(t0: T0, t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7, t8: T8, t9: T9): `${T0}${T1}${T2}${T3}${T4}${T5}${T6}${T7}${T8}${T9}`;
176
+
177
+ export declare function concatStringType<T0 extends string, T1 extends string, T2 extends string, T3 extends string, T4 extends string, T5 extends string, T6 extends string, T7 extends string, T8 extends string, T9 extends string, T10 extends string>(t0: T0, t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7, t8: T8, t9: T9, t10: T10): `${T0}${T1}${T2}${T3}${T4}${T5}${T6}${T7}${T8}${T9}${T10}`;
178
+
179
+ export declare function concatStringType<T0 extends string, T1 extends string, T2 extends string, T3 extends string, T4 extends string, T5 extends string, T6 extends string, T7 extends string, T8 extends string, T9 extends string, T10 extends string, T11 extends string>(t0: T0, t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7, t8: T8, t9: T9, t10: T10, t11: T11): `${T0}${T1}${T2}${T3}${T4}${T5}${T6}${T7}${T8}${T9}${T10}${T11}`;
180
+
181
+ export declare function concatStringType<T0 extends string, T1 extends string, T2 extends string, T3 extends string, T4 extends string, T5 extends string, T6 extends string, T7 extends string, T8 extends string, T9 extends string, T10 extends string, T11 extends string, T12 extends string>(t0: T0, t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7, t8: T8, t9: T9, t10: T10, t11: T11, t12: T12): `${T0}${T1}${T2}${T3}${T4}${T5}${T6}${T7}${T8}${T9}${T10}${T11}${T12}`;
182
+
183
+ export declare function concatStringType<T0 extends string, T1 extends string, T2 extends string, T3 extends string, T4 extends string, T5 extends string, T6 extends string, T7 extends string, T8 extends string, T9 extends string, T10 extends string, T11 extends string, T12 extends string, T13 extends string>(t0: T0, t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7, t8: T8, t9: T9, t10: T10, t11: T11, t12: T12, t13: T13): `${T0}${T1}${T2}${T3}${T4}${T5}${T6}${T7}${T8}${T9}${T10}${T11}${T12}${T13}`;
184
+
185
+ export declare function concatStringType<T0 extends string, T1 extends string, T2 extends string, T3 extends string, T4 extends string, T5 extends string, T6 extends string, T7 extends string, T8 extends string, T9 extends string, T10 extends string, T11 extends string, T12 extends string, T13 extends string, T14 extends string>(t0: T0, t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7, t8: T8, t9: T9, t10: T10, t11: T11, t12: T12, t13: T13, t14: T14): `${T0}${T1}${T2}${T3}${T4}${T5}${T6}${T7}${T8}${T9}${T10}${T11}${T12}${T13}${T14}`;
186
+
187
+ export declare function concatStringType<T0 extends string, T1 extends string, T2 extends string, T3 extends string, T4 extends string, T5 extends string, T6 extends string, T7 extends string, T8 extends string, T9 extends string, T10 extends string, T11 extends string, T12 extends string, T13 extends string, T14 extends string, T15 extends string>(t0: T0, t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7, t8: T8, t9: T9, t10: T10, t11: T11, t12: T12, t13: T13, t14: T14, t15: T15): `${T0}${T1}${T2}${T3}${T4}${T5}${T6}${T7}${T8}${T9}${T10}${T11}${T12}${T13}${T14}${T15}`;
188
+
189
+ export declare function concatStringType<T0 extends string, T1 extends string, T2 extends string, T3 extends string, T4 extends string, T5 extends string, T6 extends string, T7 extends string, T8 extends string, T9 extends string, T10 extends string, T11 extends string, T12 extends string, T13 extends string, T14 extends string, T15 extends string, T16 extends string>(t0: T0, t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7, t8: T8, t9: T9, t10: T10, t11: T11, t12: T12, t13: T13, t14: T14, t15: T15, t16: T16): `${T0}${T1}${T2}${T3}${T4}${T5}${T6}${T7}${T8}${T9}${T10}${T11}${T12}${T13}${T14}${T15}${T16}`;
190
+
191
+ export declare function concatStringType<T0 extends string, T1 extends string, T2 extends string, T3 extends string, T4 extends string, T5 extends string, T6 extends string, T7 extends string, T8 extends string, T9 extends string, T10 extends string, T11 extends string, T12 extends string, T13 extends string, T14 extends string, T15 extends string, T16 extends string, T17 extends string>(t0: T0, t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7, t8: T8, t9: T9, t10: T10, t11: T11, t12: T12, t13: T13, t14: T14, t15: T15, t16: T16, t17: T17): `${T0}${T1}${T2}${T3}${T4}${T5}${T6}${T7}${T8}${T9}${T10}${T11}${T12}${T13}${T14}${T15}${T16}${T17}`;
192
+
193
+ export declare function concatStringType<T0 extends string, T1 extends string, T2 extends string, T3 extends string, T4 extends string, T5 extends string, T6 extends string, T7 extends string, T8 extends string, T9 extends string, T10 extends string, T11 extends string, T12 extends string, T13 extends string, T14 extends string, T15 extends string, T16 extends string, T17 extends string, T18 extends string>(t0: T0, t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7, t8: T8, t9: T9, t10: T10, t11: T11, t12: T12, t13: T13, t14: T14, t15: T15, t16: T16, t17: T17, t18: T18): `${T0}${T1}${T2}${T3}${T4}${T5}${T6}${T7}${T8}${T9}${T10}${T11}${T12}${T13}${T14}${T15}${T16}${T17}${T18}`;
194
+
195
+ export declare function concatStringType<T0 extends string, T1 extends string, T2 extends string, T3 extends string, T4 extends string, T5 extends string, T6 extends string, T7 extends string, T8 extends string, T9 extends string, T10 extends string, T11 extends string, T12 extends string, T13 extends string, T14 extends string, T15 extends string, T16 extends string, T17 extends string, T18 extends string, T19 extends string>(t0: T0, t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7, t8: T8, t9: T9, t10: T10, t11: T11, t12: T12, t13: T13, t14: T14, t15: T15, t16: T16, t17: T17, t18: T18, t19: T19): `${T0}${T1}${T2}${T3}${T4}${T5}${T6}${T7}${T8}${T9}${T10}${T11}${T12}${T13}${T14}${T15}${T16}${T17}${T18}${T19}`;
196
+
197
+ export declare function convertCatchedError(e: unknown): Error;
198
+
199
+ /**
200
+ * Get a symbol singleton, if not exists, create it
201
+ *
202
+ * this is very like Symbol.for, but not real global symbol
203
+ * @public
204
+ */
205
+ export declare function createSymbol(category: string, name: string): symbol;
206
+
207
+ /**
208
+ * Like a Set, but use custom compare function insteadof ===
209
+ */
210
+ export declare class CustomSet<Type = string> {
211
+ protected registry: Type[];
212
+ private finder;
213
+ constructor(finder?: Finder<Type>);
214
+ setFinder(finder: Finder<Type>): void;
215
+ has(item: Type): boolean;
216
+ add(item: Type): boolean;
217
+ /**
218
+ * @returns all added values
219
+ */
220
+ addAll(items: Type[]): Type[];
221
+ delete(item: Type): boolean;
222
+ /**
223
+ * @returns all deleted values
224
+ */
225
+ deleteAll(items: Type[]): Type[];
226
+ clear(): void;
227
+ get length(): number;
228
+ get size(): number;
229
+ [Symbol.iterator](): Iterator<Type>;
230
+ keys(): Iterator<Type>;
231
+ values(): Iterator<Type>;
232
+ toArray(): Type[];
233
+ }
234
+
235
+ export declare type DeepPartial<T> = {
236
+ [P in keyof T]?: DeepPartial<T[P]>;
237
+ };
238
+
239
+ export declare type DeepReadonly<T> = {
240
+ readonly [P in keyof T]: DeepReadonly<T[P]>;
241
+ };
242
+
243
+ export declare type DeepWriteable<T> = {
244
+ -readonly [P in keyof T]: DeepWriteable<T[P]>;
245
+ };
246
+
247
+ /**
248
+ * a promise can resolve or reject later
249
+ * @public
250
+ */
251
+ export declare class DeferredPromise<T, PT = any> {
252
+ readonly p: Promise<T> & IProgressHolder<T, PT>;
253
+ private _completeCallback;
254
+ private _errorCallback;
255
+ private _state;
256
+ private _progressList?;
257
+ constructor();
258
+ notify(progress: PT): this;
259
+ progress(fn: ProgressCallback<PT>): void;
260
+ get completed(): boolean;
261
+ get resolved(): boolean;
262
+ get rejected(): boolean;
263
+ /**
264
+ * resolve the promise
265
+ */
266
+ complete(value: T): void;
267
+ /**
268
+ * reject the promise
269
+ */
270
+ error(err: any): void;
271
+ /**
272
+ * reject the promise with CancelError
273
+ */
274
+ cancel(): void;
275
+ /**
276
+ * Convert promise into deferred
277
+ * returns a DeferredPromise, resolve when prev resolve, reject when prev reject
278
+ */
279
+ static wrap(prev: Promise<any>): DeferredPromise<unknown, any>;
280
+ }
281
+
282
+ export declare function definePublicConstant(object: any, propertyKey: string | symbol, value: any): void;
283
+
284
+ /**
285
+ * remember arguments after run
286
+ * run all later added function with memorized argument
287
+ */
288
+ export declare class DelayCallbackList<Argument extends unknown[]> {
289
+ private delayArgument?;
290
+ private delayComplete;
291
+ protected list?: MyDelayCallback<Argument>[];
292
+ count(): number;
293
+ add(item: MyDelayCallback<Argument>, name?: string): void;
294
+ run(argument: Argument): void;
295
+ }
296
+
297
+ /**
298
+ * Delete a symbol from window/global object
299
+ * @public
300
+ */
301
+ export declare function deleteSymbol(category: string, name: string): void;
302
+
303
+ /**
304
+ * Standalone disposable class, can use as instance or base class.
305
+ */
306
+ export declare class Disposable implements IDisposable, IDisposableBaseInternal {
307
+ private readonly _disposables;
308
+ protected readonly _onDisposeError: Emitter<Error>;
309
+ readonly onDisposeError: EventRegister<Error>;
310
+ protected readonly _onBeforeDispose: Emitter<void>;
311
+ readonly onBeforeDispose: EventRegister<void>;
312
+ private _disposed?;
313
+ get hasDisposed(): boolean;
314
+ /**
315
+ * @throws if already disposed
316
+ */
317
+ assertNotDisposed(): void;
318
+ _register<T extends IDisposable>(d: T): T;
319
+ dispose(): void;
320
+ }
321
+
322
+ export declare abstract class DisposableOnce implements IDisposable {
323
+ private _disposed?;
324
+ get hasDisposed(): boolean;
325
+ dispose(): void;
326
+ protected abstract _dispose(): void;
327
+ }
328
+
329
+ /**
330
+ * Error when call dispose() twice
331
+ */
332
+ export declare class DisposedError extends Error {
333
+ constructor(object: any, previous: Error);
334
+ }
335
+
336
+ /**
337
+ * Dispose the global disposable store
338
+ * this function must be manually called by user, when registerGlobalLifecycle is used
339
+ *
340
+ * @throws when call twice
341
+ */
342
+ export declare function disposeGlobal(): Promise<void>;
343
+
344
+ /**
345
+ * 事件注册对象
346
+ * @public
347
+ */
348
+ export declare class Emitter<T> implements IDisposable {
349
+ private readonly _callbacks;
350
+ constructor();
351
+ /**
352
+ * @returns 当前注册回调数量
353
+ */
354
+ listenerCount(): number;
355
+ /**
356
+ * 触发本事件
357
+ * @param data 回调数据
358
+ */
359
+ fire(data: T): void;
360
+ /**
361
+ * 与 `fire()`相同,但是忽略任何错误,并且即便出错也继续执行全部callback
362
+ */
363
+ fireNoError(data: T): void;
364
+ /**
365
+ * 获取handle()方法的引用
366
+ */
367
+ get register(): EventRegister<T>;
368
+ /**
369
+ * 注册本事件的新回调
370
+ * @param callback 回调函数
371
+ */
372
+ handle(callback: EventHandler<T>): IDisposable;
373
+ dispose(): void;
374
+ }
375
+
376
+ /**
377
+ * Same as disposeGlobal, but do not throw by duplicate call
378
+ */
379
+ export declare function ensureDisposeGlobal(): Promise<void>;
380
+
381
+ export declare function ensureGlobalObject<T>(symbol: string, constructor: () => T): T;
382
+
383
+ /** @public */
384
+ export declare function escapeRegExp(str: string): string;
385
+
386
+ export declare interface EventHandler<T> {
387
+ (data: T): void;
388
+ }
389
+
390
+ export declare interface EventRegister<T> {
391
+ (callback: EventHandler<T>): IDisposable;
392
+ }
393
+
394
+ /**
395
+ * A map, will throw error when try to get not exists key
396
+ */
397
+ export declare class ExtendMap<K, V> extends Map<K, V> {
398
+ /**
399
+ * Get value from map, if not exists, throw an error
400
+ */
401
+ get(id: K): V;
402
+ /**
403
+ * Get value from map, if not exists, return def instead (not insert it into map)
404
+ */
405
+ get(id: K, def: V): V;
406
+ /**
407
+ * Get a value, if not exists, call init() and set to map
408
+ */
409
+ entry(id: K, init: (id: K) => V): V;
410
+ }
411
+
412
+ /** Find the index of given item */
413
+ export declare interface Finder<Type> {
414
+ (this: Type[], item: Type): number;
415
+ }
416
+
417
+ /**
418
+ * @deprecated Use Promise.allSettled instead
419
+ */
420
+ export declare function finishAllPromise<T>(ps: Promise<T>[]): Promise<PromiseResultArray<T>>;
421
+
422
+ /**
423
+ * Takes ms
424
+ */
425
+ export declare function fromTimeStamp(timestamp: number): Date;
426
+
427
+ /**
428
+ * Get displayName/name of a function
429
+ */
430
+ export declare function functionName(func: Function): string;
431
+
432
+ /**
433
+ * Get nth line of Error.stack
434
+ * @returns {string} if frame greater than max, return ''
435
+ */
436
+ export declare function getErrorFrame(e: Error, frame: number): string;
437
+
438
+ /**
439
+ * Returns ms
440
+ */
441
+ export declare function getTimeStamp(date: Date): number;
442
+
443
+ export declare function getTypeOf(value: any): "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "function" | "null" | "Promise" | "Error" | "DOM" | "EventTarget" | "unknown";
444
+
445
+ /**
446
+ * globalThis when supported.
447
+ * if not, window in browser, global in nodejs
448
+ * @public
449
+ */
450
+ export declare const globalObject: any;
451
+
452
+ /**
453
+ * Same with globalSingletonStrong, but save instance in a WeakMap, so it maybe delete by gc if no reference
454
+ * @public
455
+ */
456
+ export declare function globalSingleton<T>(symbol: symbol | string, constructor: () => T): T;
457
+
458
+ /**
459
+ * Same with globalSingletonStrong, but save instance in a WeakMap, so it maybe delete by gc if no reference
460
+ * @public
461
+ */
462
+ export declare function globalSingleton<T>(symbol: symbol | string): T | undefined;
463
+
464
+ /**
465
+ * Delete a key from window/global space
466
+ * use with care
467
+ * @public
468
+ */
469
+ export declare function globalSingletonDelete(symbol: symbol | string): void;
470
+
471
+ /**
472
+ * Get an singleton instance from window/global space
473
+ * if symbol did not exists, create it and assign to window/global
474
+ * @public
475
+ */
476
+ export declare function globalSingletonStrong<T>(symbol: symbol | string, constructor: () => T): T;
477
+
478
+ /**
479
+ * Get an singleton instance from window/global space
480
+ * @public
481
+ */
482
+ export declare function globalSingletonStrong<T>(symbol: symbol | string): T | undefined;
483
+
484
+ export declare function hookClass<TC extends IConstructorOf<T>, T>(target: TC): IHooks<T, TC>;
485
+
486
+ export declare const hookClassSymbol: unique symbol;
487
+
488
+ export declare namespace humanDate {
489
+ /**
490
+ * Format: HH:mm:ss
491
+ */
492
+ export function time(date: Date | string | number): string;
493
+ /**
494
+ * Format: YYYY-MM-dd
495
+ *
496
+ * separator can change
497
+ */
498
+ export function date(date: Date | string | number, sp?: string): string;
499
+ /**
500
+ * Format: YYYY-MM-dd HH:mm:ss
501
+ */
502
+ export function datetime(date: Date | string | number): string;
503
+ export interface ITimeFormatter {
504
+ (s: number): string;
505
+ }
506
+ export interface IFormatters {
507
+ s: ITimeFormatter;
508
+ m: ITimeFormatter;
509
+ h: ITimeFormatter;
510
+ d: ITimeFormatter;
511
+ }
512
+ /**
513
+ * set format for time delta
514
+ */
515
+ export function setLocaleFormatter(formatter: Partial<IFormatters>): void;
516
+ /**
517
+ * format time delta (in ms) to string, like: '1d'
518
+ * when ms<=0, returns '0s'
519
+ *
520
+ * format can set by `setLocaleFormatter`
521
+ * day is the largest unit
522
+ */
523
+ export function deltaTiny(ms: number): string;
524
+ /**
525
+ * format time delta (in ms) to string, like: '1d10m42s'
526
+ * when ms<=0, returns '0s'
527
+ *
528
+ * format can set by `setLocaleFormatter`
529
+ * day is the largest unit
530
+ */
531
+ export function delta(ms: number): string;
532
+ }
533
+
534
+ /**
535
+ * Convert bytes to largest unit, with binary prefix unit (1024), eg: 211.293GiB
536
+ * @public
537
+ */
538
+ export declare function humanSize(bytes: number, fixed?: number): string;
539
+
540
+ /**
541
+ * Convert bytes to largest unit, with SI prefix unit (1000), eg: 211.293GB
542
+ * @public
543
+ */
544
+ export declare function humanSizeSI(bytes: number, fixed?: number): string;
545
+
546
+ /** @deprecated */
547
+ export declare function humanSpeed(bps: number): string;
548
+
549
+ /**
550
+ * @public
551
+ */
552
+ export declare interface IArrayUpdate<T> {
553
+ add: T[];
554
+ del: T[];
555
+ same: T[];
556
+ }
557
+
558
+ /** @public */
559
+ export declare interface IAsyncDisposable {
560
+ dispose(): void | Promise<void>;
561
+ }
562
+
563
+ declare interface IConstructorOf<T> extends Object {
564
+ new (...args: any[]): T;
565
+ }
566
+
567
+ /** @public */
568
+ export declare interface IDisposable {
569
+ dispose(): void;
570
+ }
571
+
572
+ /**
573
+ * @private
574
+ */
575
+ export declare interface IDisposableBaseInternal {
576
+ onDisposeError: EventRegister<Error>;
577
+ onBeforeDispose: EventRegister<void>;
578
+ readonly hasDisposed: boolean;
579
+ }
580
+
581
+ export declare interface IEventEmitterObject<T extends Function> {
582
+ addListener(type: string, handler: T): any;
583
+ removeListener(type: string, handler: T): any;
584
+ }
585
+
586
+ export declare interface IEventHostObject<T extends Function> {
587
+ addEventListener(type: string, handler: T, options?: IEventListenerOptions): any;
588
+ removeEventListener(type: string, handler: T, options?: IEventListenerOptions): any;
589
+ }
590
+
591
+ export declare interface IEventListenerOptions {
592
+ capture?: boolean;
593
+ once?: boolean;
594
+ passive?: boolean;
595
+ }
596
+
597
+ declare interface IHooks<T, TC> {
598
+ afterConstruct?: ((obj: T) => void)[];
599
+ beforeConstruct?: ((obj: TC) => T | void)[];
600
+ }
601
+
602
+ /**
603
+ * Decorater version of `initOnRead`
604
+ * @see initOnRead
605
+ */
606
+ export declare function init<O, T extends keyof O>(init: InitFunc<O, O[T]>): PropertyDecorator;
607
+
608
+ /** @public */
609
+ export declare interface InitFunc<O, T> {
610
+ (this: O): T;
611
+ }
612
+
613
+ /**
614
+ * Define property on target, call init it when first use, them memorize
615
+ * @public
616
+ */
617
+ export declare function initOnRead<O, T extends keyof O>(target: any, propertyKey: T, init: InitFunc<O, O[T]>): void;
618
+
619
+ export declare interface IProgressHolder<T, PT> {
620
+ progress(fn: ProgressCallback<PT>): Promise<T> & IProgressHolder<T, PT>;
621
+ }
622
+
623
+ /**
624
+ * return true if a path is absolute:
625
+ * - /xxxx
626
+ * - \xxxx
627
+ * - c:/
628
+ * - c:\
629
+ * - http://
630
+ */
631
+ export declare function isAbsolute(path: string): boolean;
632
+
633
+ /**
634
+ * is the two array EXACTLY same
635
+ * @public
636
+ */
637
+ export declare function isArraySame<T>(a1: T[], a2: T[]): boolean;
638
+
639
+ /** @public */
640
+ export declare function isCanceledError(error: any): boolean;
641
+
642
+ /**
643
+ * Check if a date is NaN
644
+ */
645
+ export declare function isDateInvalid(date: Date): boolean;
646
+
647
+ export declare function isDisposedError(error: any): boolean;
648
+
649
+ export declare const isElectron: boolean;
650
+
651
+ export declare const isElectronMain: boolean;
652
+
653
+ export declare const isElectronRenderer: boolean;
654
+
655
+ export declare const isLinux: boolean;
656
+
657
+ export declare const isMacintosh: boolean;
658
+
659
+ export declare const isNative: boolean;
660
+
661
+ /**
662
+ * Should ensure a and b is none-null before call this
663
+ * @returns true when a and b has EXACTLY same keys and values
664
+ */
665
+ export declare function isObjectSame(a: any, b: any): boolean;
666
+
667
+ /**
668
+ * Should ensure a and b is none-null before call this
669
+ * @returns true when a and b has EXACTLY same keys and values, recursive compare all object values
670
+ */
671
+ export declare function isObjectSameRecursive(a: any, b: any): boolean;
672
+
673
+ export declare function isScalar(value: any): value is bigint | number | boolean | string | symbol | undefined | null | Date;
674
+
675
+ export declare function isSerializable(value: any): SerializableKind;
676
+
677
+ /** @public */
678
+ export declare function isTimeoutError(error: Error): error is TimeoutError;
679
+
680
+ export declare const isWeb: boolean;
681
+
682
+ export declare const isWindows: boolean;
683
+
684
+ export declare interface IUniqueIdFactory<T> {
685
+ (item: T): string;
686
+ }
687
+
688
+ /**
689
+ * lowercase first char
690
+ * @public
691
+ */
692
+ export declare function lcfirst<T extends string>(str: T): Uncapitalize<T>;
693
+
694
+ /** @public */
695
+ export declare function linux_case(str: string): string;
696
+
697
+ /** @public */
698
+ export declare function linux_case_hyphen(str: string): string;
699
+
700
+ export declare interface MapLike<V> {
701
+ [id: string]: V;
702
+ }
703
+
704
+ export declare interface MaybeNamedFunction extends Function {
705
+ displayName?: string;
706
+ }
707
+
708
+ /**
709
+ * Decorate class method/getter
710
+ *
711
+ * remember first return value of method/getter, directlly return memorized value when call it again
712
+ */
713
+ export declare const memo: MethodDecorator;
714
+
715
+ /**
716
+ * 会记住上次fire的内容,并在每个新的handler注册时立即调用一次的Emitter
717
+ * 显然,这会对fire的内容保留一个引用,可以调用forget()取消
718
+ * @public
719
+ */
720
+ export declare class MemorizedEmitter<T> extends Emitter<T> {
721
+ private _memo?;
722
+ private _is_memo;
723
+ fire(data: T): void;
724
+ fireNoError(data: T): void;
725
+ handle(callback: EventHandler<T>): IDisposable;
726
+ forget(): void;
727
+ dispose(): void;
728
+ }
729
+
730
+ export declare const memorizeValueSymbol: unique symbol;
731
+
732
+ export declare interface MyAsyncCallback<Argument extends unknown[]> {
733
+ displayName?: string;
734
+ (...param: Argument): Promise<void | undefined | boolean> | void | undefined | boolean;
735
+ }
736
+
737
+ export declare interface MyCallback<Argument extends unknown[]> {
738
+ displayName?: string;
739
+ (...param: Argument): any;
740
+ }
741
+
742
+ export declare interface MyDelayCallback<Argument extends unknown[]> {
743
+ displayName?: string;
744
+ (...param: Argument): void;
745
+ }
746
+
747
+ /**
748
+ * Function with displayName
749
+ */
750
+ export declare interface NamedFunction extends Function {
751
+ displayName: string;
752
+ }
753
+
754
+ /**
755
+ * Set displayName of a function
756
+ */
757
+ export declare function nameFunction<T extends Function>(name: string, func: T): T & NamedFunction;
758
+
759
+ export declare function nextDay(d: Date, n?: number): Date;
760
+
761
+ export declare function nextHour(d: Date, n?: number): Date;
762
+
763
+ export declare function nextMinute(d: Date, n?: number): Date;
764
+
765
+ export declare function nextMonth(d: Date, n?: number): Date;
766
+
767
+ export declare function nextSecond(d: Date, n?: number): Date;
768
+
769
+ export declare function nextWeek(d: Date, n?: number): Date;
770
+
771
+ export declare function nextYear(d: Date, n?: number): Date;
772
+
773
+ /**
774
+ * ensure a value is an array
775
+ * @public
776
+ */
777
+ export declare function normalizeArray<T>(input: T | T[]): T[];
778
+
779
+ /**
780
+ * replace // to /
781
+ * replace \ to /
782
+ * remove ending /
783
+ */
784
+ export declare function normalizePath(p: string): string;
785
+
786
+ /**
787
+ * Get deep child property of an object
788
+ * @param path object path seprate by "."
789
+ */
790
+ export declare function objectPath(obj: object, path: string): any;
791
+
792
+ export declare const oneDay = 86400000;
793
+
794
+ export declare const oneHour = 1440000;
795
+
796
+ export declare const oneMinute = 60000;
797
+
798
+ export declare const oneSecond = 1000;
799
+
800
+ export declare const oneWeek = 604800000;
801
+
802
+ /**
803
+ * Pad number to two digits string, used in time format
804
+ * @public
805
+ */
806
+ export declare function pad2(s: number): string;
807
+
808
+ /**
809
+ * Work on "PATH"-like values
810
+ */
811
+ export declare class PathArray extends Set<string> {
812
+ private readonly sep;
813
+ constructor(init: string, sep: ':' | ';');
814
+ add(paths: string): this;
815
+ delete(paths: string): boolean;
816
+ has(path: string): boolean;
817
+ toString(): string;
818
+ /**
819
+ * @returns an array with `part` append to every element
820
+ */
821
+ join(part: string): string[];
822
+ }
823
+
824
+ export declare type ProgressCallback<T = any> = (value: T) => void;
825
+
826
+ /**
827
+ * resolve with true when `p` resolve
828
+ * resolve with false when `p` reject (and drop error)
829
+ */
830
+ export declare function promiseBool(p: Promise<any>): Promise<boolean>;
831
+
832
+ export declare class PromisePool {
833
+ protected readonly promiseList: Record<string, DeferredPromise<any>>;
834
+ size(): number;
835
+ create(id: string): Promise<any> & IProgressHolder<any, any>;
836
+ has(id: string): boolean;
837
+ done(id: string, data: any): void;
838
+ error(id: string, e: Error): void;
839
+ dispose(): void;
840
+ }
841
+
842
+ /** @deprecated */
843
+ export declare interface PromiseResultArray<T> {
844
+ count: number;
845
+ fulfilledResult: T[];
846
+ fulfilled: number[];
847
+ rejectedResult: Error[];
848
+ rejected: number[];
849
+ }
850
+
851
+ export declare function RegexpFinder(this: RegExp[], item: RegExp): number;
852
+
853
+ /**
854
+ * Add object into global disposable store, it will be dispose when call to `disposeGlobal`
855
+ */
856
+ export declare function registerGlobalLifecycle(object: IDisposable): void;
857
+
858
+ export declare enum SerializableKind {
859
+ Invalid = 0,
860
+ Primitive = 1,
861
+ Manual = 2,
862
+ Other = 3
863
+ }
864
+
865
+ export declare function singleton(type?: SingletonType): ClassDecorator;
866
+
867
+ export declare const singletonSymbol: unique symbol;
868
+
869
+ export declare enum SingletonType {
870
+ Throw = 0,
871
+ Return = 1
872
+ }
873
+
874
+ /**
875
+ * @returns promise resolve after specific time
876
+ */
877
+ export declare function sleep(ms: number): Promise<void>;
878
+
879
+ /**
880
+ * Sort string array alphabet order
881
+ *
882
+ * to be used in <arr>.sort()
883
+ * @public
884
+ */
885
+ export declare function sortByString(a: string, b: string): number;
886
+
887
+ /**
888
+ * assert value is not null or undefined or NaN
889
+ * @throws Value is null or undefined
890
+ * @public
891
+ */
892
+ export declare function throwNull<T>(val: T): NonNullable<T>;
893
+
894
+ /**
895
+ * @returns promise reject with TimeoutError after specific time
896
+ */
897
+ export declare function timeout(ms: number, error?: string): Promise<never>;
898
+
899
+ /**
900
+ * Error when timeout() done
901
+ * @public
902
+ */
903
+ export declare class TimeoutError extends Error {
904
+ constructor(time: number, what?: string);
905
+ }
906
+
907
+ export declare function timeoutPromise<T>(ms: number, p: Promise<T>): Promise<T>;
908
+
909
+ export declare function timeoutPromise<T>(ms: number, message: string, p: Promise<T>): Promise<T>;
910
+
911
+ export declare function timeoutPromise<T, PT = any>(ms: number, p: DeferredPromise<T, PT>): DeferredPromise<T, PT>;
912
+
913
+ export declare function timeoutPromise<T, PT = any>(ms: number, message: string, p: DeferredPromise<T, PT>): DeferredPromise<T, PT>;
914
+
915
+ export declare class TimeoutPromisePool extends PromisePool {
916
+ private readonly defaultTimeoutMs;
917
+ constructor(defaultTimeoutMs?: number);
918
+ create(id: string, timeoutMs?: number, timeoutMsg?: string): Promise<any> & IProgressHolder<any, any>;
919
+ }
920
+
921
+ /**
922
+ * Convert "dispose function" to disposable object
923
+ * @public
924
+ */
925
+ export declare function toDisposable(fn: () => void): IDisposable;
926
+
927
+ /**
928
+ * try to call `inspect` method of an object, if not exists, call `toString`.
929
+ * @returns {string}
930
+ */
931
+ export declare function tryInspect(object: any): any;
932
+
933
+ /**
934
+ * Uppercase first char
935
+ * @public
936
+ */
937
+ export declare function ucfirst<T extends string>(str: T): Capitalize<T>;
938
+
939
+ /**
940
+ * Returns a function to be used in <arr>.filter()
941
+ *
942
+ * the returned function can use multiple times, it will remember all values inter multiple arrays
943
+ *
944
+ * @param {IUniqueIdFactory} idFactory function takes an array element, return it's id to be compare with each other
945
+ * @public
946
+ */
947
+ export declare function uniqueFilter<T>(idFactory?: IUniqueIdFactory<T>): (item: T) => boolean;
948
+
949
+ declare interface Unsubscribable {
950
+ unsubscribe(): void;
951
+ }
952
+
953
+ export declare function unsubscribableToDisposable(subscription: Unsubscribable): {
954
+ dispose: () => void;
955
+ };
956
+
957
+ export declare const userAgent: string;
958
+
959
+ export declare type ValueCallback<T = any> = (value: T | Promise<T>) => void;
960
+
961
+ export declare abstract class WrappedConsole {
962
+ info: Console['info'];
963
+ log: Console['log'];
964
+ success: Console['log'];
965
+ debug: Console['debug'];
966
+ error: Console['error'];
967
+ trace: Console['trace'];
968
+ warn: Console['warn'];
969
+ assert: Console['assert'];
970
+ time: Console['time'];
971
+ timeEnd: Console['timeEnd'];
972
+ timeLog: Console['timeLog'];
973
+ count: Console['count'];
974
+ countReset: Console['countReset'];
975
+ group: Console['group'];
976
+ groupCollapsed: Console['groupCollapsed'];
977
+ groupEnd: Console['groupEnd'];
978
+ table: Console['table'];
979
+ dir: Console['dir'];
980
+ clear: Console['clear'];
981
+ protected readonly title: string;
982
+ protected readonly parent: Console;
983
+ protected readonly bind: boolean;
984
+ constructor(title: string, { parent, bind }?: WrappedConsoleOptions);
985
+ protected wrap<T extends keyof Omit<Console & {
986
+ Console: any;
987
+ }, 'Console'>>(original: T): Function;
988
+ private wrapSimple;
989
+ private wrapExtra;
990
+ protected createPrefix(message: string): string;
991
+ private wrapMessageAt;
992
+ private convertObjectArg;
993
+ protected abstract processColorLabel(normalizedArguments: any[], messageLoc: number, level: string, prefix: string): void;
994
+ protected uncolor(args: any[], pos: number, prefix: string, postfix: string): void;
995
+ }
996
+
997
+ export declare interface WrappedConsoleOptions {
998
+ parent?: Console;
999
+ bind?: boolean;
1000
+ }
1001
+
1002
+ export declare type Writeable<T> = {
1003
+ -readonly [P in keyof T]: T[P];
1004
+ };
1005
+
1006
+ export declare function x(): number;
1007
+
1008
+ export { }