@idlebox/common 1.3.7 → 1.3.10

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