@idlebox/common 1.3.14 → 1.3.16
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.
- package/lib/array/arrayDiff.cjs +2 -2
- package/lib/array/arrayDiff.cjs.map +1 -1
- package/lib/array/arrayDiff.js +2 -2
- package/lib/array/arrayDiff.js.map +1 -1
- package/lib/array/arraySame.cjs.map +1 -1
- package/lib/array/arraySame.js.map +1 -1
- package/lib/array/arrayUnique.cjs.map +1 -1
- package/lib/array/arrayUnique.js.map +1 -1
- package/{dist → lib}/common-alpha.d.ts +57 -13
- package/{dist → lib}/common-beta.d.ts +57 -13
- package/{dist → lib}/common-public.d.ts +57 -13
- package/{dist → lib}/common.d.ts +57 -13
- package/lib/function/callbackList.cjs +4 -0
- package/lib/function/callbackList.cjs.map +1 -1
- package/lib/function/callbackList.js +4 -0
- package/lib/function/callbackList.js.map +1 -1
- package/lib/string/concatType.generated.cjs +8 -0
- package/lib/string/concatType.generated.cjs.map +1 -1
- package/lib/string/concatType.generated.js +8 -0
- package/lib/string/concatType.generated.js.map +1 -1
- package/{dist → lib}/tsdoc-metadata.json +1 -1
- package/lib/{typingHeler/deep.cjs → typingHelper/deep.partial.cjs} +1 -2
- package/lib/typingHelper/deep.partial.cjs.map +1 -0
- package/lib/typingHelper/deep.partial.js +2 -0
- package/lib/typingHelper/deep.partial.js.map +1 -0
- package/lib/typingHelper/deep.readonly.cjs +3 -0
- package/lib/typingHelper/deep.readonly.cjs.map +1 -0
- package/lib/typingHelper/deep.readonly.js +2 -0
- package/lib/typingHelper/deep.readonly.js.map +1 -0
- package/lib/typingHelper/deep.required.cjs +3 -0
- package/lib/typingHelper/deep.required.cjs.map +1 -0
- package/lib/typingHelper/deep.required.js +2 -0
- package/lib/typingHelper/deep.required.js.map +1 -0
- package/lib/typingHelper/deep.writable.cjs +3 -0
- package/lib/typingHelper/deep.writable.cjs.map +1 -0
- package/lib/typingHelper/deep.writable.js +2 -0
- package/lib/typingHelper/deep.writable.js.map +1 -0
- package/lib/typingHelper/literal.cjs +3 -0
- package/lib/typingHelper/literal.cjs.map +1 -0
- package/lib/typingHelper/literal.js +2 -0
- package/lib/typingHelper/literal.js.map +1 -0
- package/package.json +12 -12
- package/src/array/arrayDiff.ts +31 -0
- package/src/array/arraySame.ts +15 -0
- package/src/array/arrayUnique.ts +50 -0
- package/src/array/normalizeArray.ts +13 -0
- package/src/array/sortAlpha.ts +15 -0
- package/src/date/consts.ts +5 -0
- package/src/date/isInvalid.ts +6 -0
- package/src/date/sibling.ts +28 -0
- package/src/date/timeString.ts +150 -0
- package/src/date/unix.ts +13 -0
- package/src/debugging/serializable.ts +146 -0
- package/src/debugging/tryInspect.ts +37 -0
- package/src/error/convertUnknown.ts +10 -0
- package/src/error/getFrame.ts +13 -0
- package/src/function/asyncCallbackList.ts +75 -0
- package/src/function/callbackList.ts +88 -0
- package/src/function/delayCallbackList.ts +45 -0
- package/src/function/functionName.ts +39 -0
- package/src/index.generated.ts +289 -0
- package/src/lifecycle/dispose/bridges/rxjs.ts +6 -0
- package/src/lifecycle/dispose/disposableEvent.ts +117 -0
- package/src/lifecycle/dispose/disposedError.ts +16 -0
- package/src/lifecycle/dispose/lifecycle.async.ts +61 -0
- package/src/lifecycle/dispose/lifecycle.global.ts +61 -0
- package/src/lifecycle/dispose/lifecycle.sync.ts +79 -0
- package/src/lifecycle/dispose/lifecycle.ts +28 -0
- package/src/lifecycle/event/event.ts +81 -0
- package/src/lifecycle/event/memorized.ts +39 -0
- package/src/lifecycle/promise/cancel.ts +16 -0
- package/src/lifecycle/promise/cancellationToken/driver.browser.ts +55 -0
- package/src/lifecycle/promise/cancellationToken/driver.common.ts +43 -0
- package/src/lifecycle/promise/cancellationToken/source.ts +48 -0
- package/src/lifecycle/promise/deferredPromise.ts +104 -0
- package/src/lifecycle/timeout/timeout.ts +48 -0
- package/src/lifecycle/timeout/timeoutError.ts +16 -0
- package/src/log/logger.ts +148 -0
- package/src/mapSet/customSet.ts +91 -0
- package/src/mapSet/extendMap.ts +40 -0
- package/src/misc/assertNotNull.ts +21 -0
- package/src/object/definePublicConstant.ts +10 -0
- package/src/object/initOnRead.ts +27 -0
- package/src/object/objectPath.ts +10 -0
- package/src/object/objectSame.ts +52 -0
- package/src/path/isAbsolute.ts +11 -0
- package/src/path/normalizePath.ts +8 -0
- package/src/path/pathArray.ts +42 -0
- package/src/platform/globalObject.ts +22 -0
- package/src/platform/globalSingleton.ts +82 -0
- package/src/platform/globalSymbol.ts +36 -0
- package/src/platform/os.ts +46 -0
- package/src/promise/awaitIterator.ts +19 -0
- package/src/promise/finishAllPromise.ts +50 -0
- package/src/promise/promiseBool.ts +10 -0
- package/src/promise/promisePool.ts +40 -0
- package/src/promise/timeoutPromisePool.ts +22 -0
- package/src/reflection/classes/hookClass.ts +47 -0
- package/src/reflection/classes/singleton.ts +33 -0
- package/src/reflection/methods/bind.ts +30 -0
- package/src/reflection/methods/initOnRead.ts +11 -0
- package/src/reflection/methods/memorize.ts +33 -0
- package/src/string/castCase.ts +44 -0
- package/src/string/concatType.generated.ts +265 -0
- package/src/string/concatType.generator.ts +31 -0
- package/src/string/escapeRegexp.ts +4 -0
- package/src/string/pad2.ts +11 -0
- package/src/string/sizeString.ts +52 -0
- package/src/tsconfig.json +14 -0
- package/src/typingHelper/deep.partial.ts +16 -0
- package/src/typingHelper/deep.readonly.ts +16 -0
- package/src/typingHelper/deep.required.ts +16 -0
- package/src/typingHelper/deep.writable.ts +16 -0
- package/src/typingHelper/literal.ts +1 -0
- package/docs/common.api.json +0 -21737
- package/docs/common.api.md +0 -1139
- package/docs/package-public.d.ts +0 -952
- package/docs/tsdoc-metadata.json +0 -11
- package/lib/typingHeler/deep.cjs.map +0 -1
- package/lib/typingHeler/deep.js +0 -3
- package/lib/typingHeler/deep.js.map +0 -1
package/lib/array/arrayDiff.cjs
CHANGED
|
@@ -5,8 +5,8 @@ exports.arrayDiff = void 0;
|
|
|
5
5
|
* Compare two array, returns the difference from `before` to `after`
|
|
6
6
|
* @public
|
|
7
7
|
*/
|
|
8
|
-
function arrayDiff(
|
|
9
|
-
before =
|
|
8
|
+
function arrayDiff(_before, after) {
|
|
9
|
+
const before = _before.slice().sort();
|
|
10
10
|
const add = after.slice().sort();
|
|
11
11
|
const del = [];
|
|
12
12
|
const same = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arrayDiff.js","sourceRoot":"","sources":["../../src/array/arrayDiff.ts"],"names":[],"mappings":";;;AASA;;;GAGG;AACH,SAAgB,SAAS,CAAI,
|
|
1
|
+
{"version":3,"file":"arrayDiff.js","sourceRoot":"","sources":["../../src/array/arrayDiff.ts"],"names":[],"mappings":";;;AASA;;;GAGG;AACH,SAAgB,SAAS,CAAI,OAAqB,EAAE,KAAmB;IACtE,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,CAAC;IACtC,MAAM,GAAG,GAAQ,KAAK,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,CAAC;IACtC,MAAM,GAAG,GAAQ,EAAE,CAAC;IACpB,MAAM,IAAI,GAAQ,EAAE,CAAC;IACrB,IAAI,EAAE,OAAO,MAAM,CAAC,MAAM,EAAE;QAC3B,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,EAAG,CAAC;QAC3B,KAAK,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;YACzC,IAAI,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE;gBACpB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAChB,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;gBACjB,SAAS,IAAI,CAAC;aACd;SACD;QACD,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;KACf;IACD,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;AAC3B,CAAC;AAjBD,8BAiBC"}
|
package/lib/array/arrayDiff.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Compare two array, returns the difference from `before` to `after`
|
|
3
3
|
* @public
|
|
4
4
|
*/
|
|
5
|
-
export function arrayDiff(
|
|
6
|
-
before =
|
|
5
|
+
export function arrayDiff(_before, after) {
|
|
6
|
+
const before = _before.slice().sort();
|
|
7
7
|
const add = after.slice().sort();
|
|
8
8
|
const del = [];
|
|
9
9
|
const same = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arrayDiff.js","sourceRoot":"","sources":["../../src/array/arrayDiff.ts"],"names":[],"mappings":"AASA;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAI,
|
|
1
|
+
{"version":3,"file":"arrayDiff.js","sourceRoot":"","sources":["../../src/array/arrayDiff.ts"],"names":[],"mappings":"AASA;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAI,OAAqB,EAAE,KAAmB;IACtE,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,CAAC;IACtC,MAAM,GAAG,GAAQ,KAAK,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,CAAC;IACtC,MAAM,GAAG,GAAQ,EAAE,CAAC;IACpB,MAAM,IAAI,GAAQ,EAAE,CAAC;IACrB,IAAI,EAAE,OAAO,MAAM,CAAC,MAAM,EAAE;QAC3B,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,EAAG,CAAC;QAC3B,KAAK,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;YACzC,IAAI,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE;gBACpB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAChB,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;gBACjB,SAAS,IAAI,CAAC;aACd;SACD;QACD,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;KACf;IACD,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;AAC3B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arraySame.js","sourceRoot":"","sources":["../../src/array/arraySame.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,SAAgB,WAAW,CAAI,
|
|
1
|
+
{"version":3,"file":"arraySame.js","sourceRoot":"","sources":["../../src/array/arraySame.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,SAAgB,WAAW,CAAI,EAAgB,EAAE,EAAgB;IAChE,IAAI,EAAE,CAAC,MAAM,KAAK,EAAE,CAAC,MAAM,EAAE;QAC5B,OAAO,KAAK,CAAC;KACb;IACD,KAAK,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;QACxC,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE;YACpB,OAAO,KAAK,CAAC;SACb;KACD;IACD,OAAO,IAAI,CAAC;AACb,CAAC;AAVD,kCAUC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arraySame.js","sourceRoot":"","sources":["../../src/array/arraySame.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAI,
|
|
1
|
+
{"version":3,"file":"arraySame.js","sourceRoot":"","sources":["../../src/array/arraySame.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAI,EAAgB,EAAE,EAAgB;IAChE,IAAI,EAAE,CAAC,MAAM,KAAK,EAAE,CAAC,MAAM,EAAE;QAC5B,OAAO,KAAK,CAAC;KACb;IACD,KAAK,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;QACxC,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE;YACpB,OAAO,KAAK,CAAC;SACb;KACD;IACD,OAAO,IAAI,CAAC;AACb,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arrayUnique.js","sourceRoot":"","sources":["../../src/array/arrayUnique.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,SAAgB,WAAW,CAAI,
|
|
1
|
+
{"version":3,"file":"arrayUnique.js","sourceRoot":"","sources":["../../src/array/arrayUnique.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,SAAgB,WAAW,CAAI,GAAiB;IAC/C,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;QACjC,OAAO,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC;IACxC,CAAC,CAAC,CAAC;AACJ,CAAC;AAJD,kCAIC;AAED;;;GAGG;AACH,SAAgB,oBAAoB,CAAC,GAAU;IAC9C,KAAK,IAAI,KAAK,GAAG,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE;QACrD,IAAI,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,KAAK,KAAK,EAAE;YAC1C,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;SACrB;KACD;AACF,CAAC;AAND,oDAMC;AAMD,SAAS,cAAc,CAAC,CAAM;IAC7B,OAAO,CAAW,CAAC;AACpB,CAAC;AAED;;;;;;;GAOG;AACH,SAAgB,YAAY,CAAI,YAAiC,cAAc;IAC9E,MAAM,IAAI,GAA2B,EAAE,CAAC;IACxC,OAAO,SAAS,iBAAiB,CAAC,IAAO;QACxC,MAAM,EAAE,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;QAC3B,IAAI,IAAI,CAAC,EAAE,CAAC,EAAE;YACb,OAAO,KAAK,CAAC;SACb;aAAM;YACN,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC;YAChB,OAAO,IAAI,CAAC;SACZ;IACF,CAAC,CAAC;AACH,CAAC;AAXD,oCAWC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arrayUnique.js","sourceRoot":"","sources":["../../src/array/arrayUnique.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAI,
|
|
1
|
+
{"version":3,"file":"arrayUnique.js","sourceRoot":"","sources":["../../src/array/arrayUnique.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAI,GAAiB;IAC/C,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;QACjC,OAAO,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC;IACxC,CAAC,CAAC,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,GAAU;IAC9C,KAAK,IAAI,KAAK,GAAG,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE;QACrD,IAAI,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,KAAK,KAAK,EAAE;YAC1C,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;SACrB;KACD;AACF,CAAC;AAMD,SAAS,cAAc,CAAC,CAAM;IAC7B,OAAO,CAAW,CAAC;AACpB,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAAI,YAAiC,cAAc;IAC9E,MAAM,IAAI,GAA2B,EAAE,CAAC;IACxC,OAAO,SAAS,iBAAiB,CAAC,IAAO;QACxC,MAAM,EAAE,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;QAC3B,IAAI,IAAI,CAAC,EAAE,CAAC,EAAE;YACb,OAAO,KAAK,CAAC;SACb;aAAM;YACN,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC;YAChB,OAAO,IAAI,CAAC;SACZ;IACF,CAAC,CAAC;AACH,CAAC"}
|
|
@@ -8,7 +8,7 @@ export declare function addDisposableEventListener<T extends Function>(target: I
|
|
|
8
8
|
* Compare two array, returns the difference from `before` to `after`
|
|
9
9
|
* @public
|
|
10
10
|
*/
|
|
11
|
-
export declare function arrayDiff<T>(
|
|
11
|
+
export declare function arrayDiff<T>(_before: readonly T[], after: readonly T[]): {
|
|
12
12
|
add: T[];
|
|
13
13
|
del: T[];
|
|
14
14
|
same: T[];
|
|
@@ -18,7 +18,7 @@ export declare function arrayDiff<T>(before: T[], after: T[]): {
|
|
|
18
18
|
* Returns a new array without duplicate values
|
|
19
19
|
* @public
|
|
20
20
|
*/
|
|
21
|
-
export declare function arrayUnique<T>(arr: T[]): T[];
|
|
21
|
+
export declare function arrayUnique<T>(arr: readonly T[]): T[];
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* Removes duplicate values from an array
|
|
@@ -106,6 +106,9 @@ export declare class CallbackList<Argument extends unknown[]> {
|
|
|
106
106
|
protected stop: boolean;
|
|
107
107
|
constructor();
|
|
108
108
|
count(): number;
|
|
109
|
+
/**
|
|
110
|
+
* remove all callback
|
|
111
|
+
*/
|
|
109
112
|
reset(): void;
|
|
110
113
|
/**
|
|
111
114
|
* @param name optional name of `item` (will assign displayName to `item`)
|
|
@@ -117,6 +120,7 @@ export declare class CallbackList<Argument extends unknown[]> {
|
|
|
117
120
|
*/
|
|
118
121
|
remove(item: MyCallback<Argument>): null | MyCallback<Argument>;
|
|
119
122
|
/**
|
|
123
|
+
* in a callback, call this.stopRun() to stop remain callbacks (not by return false)
|
|
120
124
|
* @returns {boolean} true if every callback called, false if stop in middle
|
|
121
125
|
*/
|
|
122
126
|
run(...argument: Argument): boolean;
|
|
@@ -156,6 +160,12 @@ export declare enum ColorKind {
|
|
|
156
160
|
DETECT = 3
|
|
157
161
|
}
|
|
158
162
|
|
|
163
|
+
/**
|
|
164
|
+
*
|
|
165
|
+
* GENERATED FILE, DO NOT MODIFY
|
|
166
|
+
* 这是生成的文件,千万不要修改
|
|
167
|
+
*
|
|
168
|
+
*/
|
|
159
169
|
export declare function concatStringType<T0 extends string>(t0: T0): `${T0}`;
|
|
160
170
|
|
|
161
171
|
export declare function concatStringType<T0 extends string, T1 extends string>(t0: T0, t1: T1): `${T0}${T1}`;
|
|
@@ -234,18 +244,54 @@ export declare class CustomSet<Type = string> {
|
|
|
234
244
|
toArray(): Type[];
|
|
235
245
|
}
|
|
236
246
|
|
|
237
|
-
export declare type
|
|
238
|
-
|
|
247
|
+
export declare type DeepNonNullable<T> = T extends Primitive ? T : T extends ReadonlyArray<infer U> | Array<infer U> ? DeepNonNullableArray<U> : T extends ReadonlyMap<infer K, infer V> | Map<infer K, infer V> ? DeepNonNullableMap<K, V> : T extends ReadonlySet<infer M> ? DeepNonNullableSet<M> : DeepNonNullableObject<T>;
|
|
248
|
+
|
|
249
|
+
declare type DeepNonNullableArray<T> = Array<DeepNonNullable<T>>;
|
|
250
|
+
|
|
251
|
+
declare type DeepNonNullableMap<K, V> = Map<DeepNonNullable<K>, DeepNonNullable<V>>;
|
|
252
|
+
|
|
253
|
+
declare type DeepNonNullableObject<T> = {
|
|
254
|
+
[K in keyof T]-?: NonNullable<T[K]>;
|
|
239
255
|
};
|
|
240
256
|
|
|
241
|
-
|
|
242
|
-
|
|
257
|
+
declare type DeepNonNullableSet<T> = Set<DeepNonNullable<T>>;
|
|
258
|
+
|
|
259
|
+
export declare type DeepPartial<T> = T extends Primitive ? T : T extends ReadonlyArray<infer U> ? DeepPartialArray<U> : T extends ReadonlyMap<infer K, infer V> ? DeepPartialMap<K, V> : T extends ReadonlySet<infer M> ? DeepPartialSet<M> : DeepPartialObject<T>;
|
|
260
|
+
|
|
261
|
+
declare type DeepPartialArray<T> = Array<DeepPartial<T>>;
|
|
262
|
+
|
|
263
|
+
declare type DeepPartialMap<K, V> = Map<DeepPartial<K>, DeepPartial<V>>;
|
|
264
|
+
|
|
265
|
+
declare type DeepPartialObject<T> = {
|
|
266
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
243
267
|
};
|
|
244
268
|
|
|
245
|
-
|
|
246
|
-
|
|
269
|
+
declare type DeepPartialSet<T> = Set<DeepPartial<T>>;
|
|
270
|
+
|
|
271
|
+
export declare type DeepReadonly<T> = T extends Primitive ? T : T extends Array<infer U> ? DeepReadonlyArray<U> : T extends Map<infer K, infer V> ? DeepReadonlyMap<K, V> : T extends Set<infer M> ? DeepReadonlySet<M> : DeepReadonlyObject<T>;
|
|
272
|
+
|
|
273
|
+
declare type DeepReadonlyArray<T> = ReadonlyArray<DeepReadonly<T>>;
|
|
274
|
+
|
|
275
|
+
declare type DeepReadonlyMap<K, V> = ReadonlyMap<DeepReadonly<K>, DeepReadonly<V>>;
|
|
276
|
+
|
|
277
|
+
declare type DeepReadonlyObject<T> = {
|
|
278
|
+
readonly [K in keyof T]: DeepReadonly<T[K]>;
|
|
247
279
|
};
|
|
248
280
|
|
|
281
|
+
declare type DeepReadonlySet<T> = ReadonlySet<DeepReadonly<T>>;
|
|
282
|
+
|
|
283
|
+
export declare type DeepWriteable<T> = T extends Primitive ? T : T extends ReadonlyArray<infer U> ? DeepWriteableArray<U> : T extends ReadonlyMap<infer K, infer V> ? DeepWriteableMap<K, V> : T extends ReadonlySet<infer M> ? DeepWriteableSet<M> : DeepWriteableObject<T>;
|
|
284
|
+
|
|
285
|
+
declare type DeepWriteableArray<T> = Array<DeepWriteable<T>>;
|
|
286
|
+
|
|
287
|
+
declare type DeepWriteableMap<K, V> = Map<DeepWriteable<K>, DeepWriteable<V>>;
|
|
288
|
+
|
|
289
|
+
declare type DeepWriteableObject<T> = {
|
|
290
|
+
-readonly [K in keyof T]: DeepWriteable<T[K]>;
|
|
291
|
+
};
|
|
292
|
+
|
|
293
|
+
declare type DeepWriteableSet<T> = Set<DeepWriteable<T>>;
|
|
294
|
+
|
|
249
295
|
/**
|
|
250
296
|
* a promise can resolve or reject later
|
|
251
297
|
* @public
|
|
@@ -636,7 +682,7 @@ export declare function isAbsolute(path: string): boolean;
|
|
|
636
682
|
* is the two array EXACTLY same
|
|
637
683
|
* @public
|
|
638
684
|
*/
|
|
639
|
-
export declare function isArraySame<T>(a1: T[], a2: T[]): boolean;
|
|
685
|
+
export declare function isArraySame<T>(a1: readonly T[], a2: readonly T[]): boolean;
|
|
640
686
|
|
|
641
687
|
/** @public */
|
|
642
688
|
export declare function isCanceledError(error: any): boolean;
|
|
@@ -833,6 +879,8 @@ export declare class PathArray extends Set<string> {
|
|
|
833
879
|
join(part: string): string[];
|
|
834
880
|
}
|
|
835
881
|
|
|
882
|
+
export declare type Primitive = undefined | null | boolean | string | number | Function | bigint;
|
|
883
|
+
|
|
836
884
|
export declare type ProgressCallback<T = any> = (value: T) => void;
|
|
837
885
|
|
|
838
886
|
/**
|
|
@@ -1015,10 +1063,6 @@ export declare interface WrappedConsoleOptions {
|
|
|
1015
1063
|
bind?: boolean;
|
|
1016
1064
|
}
|
|
1017
1065
|
|
|
1018
|
-
export declare type Writeable<T> = {
|
|
1019
|
-
-readonly [P in keyof T]: T[P];
|
|
1020
|
-
};
|
|
1021
|
-
|
|
1022
1066
|
export declare function x(): number;
|
|
1023
1067
|
|
|
1024
1068
|
export { }
|
|
@@ -8,7 +8,7 @@ export declare function addDisposableEventListener<T extends Function>(target: I
|
|
|
8
8
|
* Compare two array, returns the difference from `before` to `after`
|
|
9
9
|
* @public
|
|
10
10
|
*/
|
|
11
|
-
export declare function arrayDiff<T>(
|
|
11
|
+
export declare function arrayDiff<T>(_before: readonly T[], after: readonly T[]): {
|
|
12
12
|
add: T[];
|
|
13
13
|
del: T[];
|
|
14
14
|
same: T[];
|
|
@@ -18,7 +18,7 @@ export declare function arrayDiff<T>(before: T[], after: T[]): {
|
|
|
18
18
|
* Returns a new array without duplicate values
|
|
19
19
|
* @public
|
|
20
20
|
*/
|
|
21
|
-
export declare function arrayUnique<T>(arr: T[]): T[];
|
|
21
|
+
export declare function arrayUnique<T>(arr: readonly T[]): T[];
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* Removes duplicate values from an array
|
|
@@ -106,6 +106,9 @@ export declare class CallbackList<Argument extends unknown[]> {
|
|
|
106
106
|
protected stop: boolean;
|
|
107
107
|
constructor();
|
|
108
108
|
count(): number;
|
|
109
|
+
/**
|
|
110
|
+
* remove all callback
|
|
111
|
+
*/
|
|
109
112
|
reset(): void;
|
|
110
113
|
/**
|
|
111
114
|
* @param name optional name of `item` (will assign displayName to `item`)
|
|
@@ -117,6 +120,7 @@ export declare class CallbackList<Argument extends unknown[]> {
|
|
|
117
120
|
*/
|
|
118
121
|
remove(item: MyCallback<Argument>): null | MyCallback<Argument>;
|
|
119
122
|
/**
|
|
123
|
+
* in a callback, call this.stopRun() to stop remain callbacks (not by return false)
|
|
120
124
|
* @returns {boolean} true if every callback called, false if stop in middle
|
|
121
125
|
*/
|
|
122
126
|
run(...argument: Argument): boolean;
|
|
@@ -156,6 +160,12 @@ export declare enum ColorKind {
|
|
|
156
160
|
DETECT = 3
|
|
157
161
|
}
|
|
158
162
|
|
|
163
|
+
/**
|
|
164
|
+
*
|
|
165
|
+
* GENERATED FILE, DO NOT MODIFY
|
|
166
|
+
* 这是生成的文件,千万不要修改
|
|
167
|
+
*
|
|
168
|
+
*/
|
|
159
169
|
export declare function concatStringType<T0 extends string>(t0: T0): `${T0}`;
|
|
160
170
|
|
|
161
171
|
export declare function concatStringType<T0 extends string, T1 extends string>(t0: T0, t1: T1): `${T0}${T1}`;
|
|
@@ -234,18 +244,54 @@ export declare class CustomSet<Type = string> {
|
|
|
234
244
|
toArray(): Type[];
|
|
235
245
|
}
|
|
236
246
|
|
|
237
|
-
export declare type
|
|
238
|
-
|
|
247
|
+
export declare type DeepNonNullable<T> = T extends Primitive ? T : T extends ReadonlyArray<infer U> | Array<infer U> ? DeepNonNullableArray<U> : T extends ReadonlyMap<infer K, infer V> | Map<infer K, infer V> ? DeepNonNullableMap<K, V> : T extends ReadonlySet<infer M> ? DeepNonNullableSet<M> : DeepNonNullableObject<T>;
|
|
248
|
+
|
|
249
|
+
declare type DeepNonNullableArray<T> = Array<DeepNonNullable<T>>;
|
|
250
|
+
|
|
251
|
+
declare type DeepNonNullableMap<K, V> = Map<DeepNonNullable<K>, DeepNonNullable<V>>;
|
|
252
|
+
|
|
253
|
+
declare type DeepNonNullableObject<T> = {
|
|
254
|
+
[K in keyof T]-?: NonNullable<T[K]>;
|
|
239
255
|
};
|
|
240
256
|
|
|
241
|
-
|
|
242
|
-
|
|
257
|
+
declare type DeepNonNullableSet<T> = Set<DeepNonNullable<T>>;
|
|
258
|
+
|
|
259
|
+
export declare type DeepPartial<T> = T extends Primitive ? T : T extends ReadonlyArray<infer U> ? DeepPartialArray<U> : T extends ReadonlyMap<infer K, infer V> ? DeepPartialMap<K, V> : T extends ReadonlySet<infer M> ? DeepPartialSet<M> : DeepPartialObject<T>;
|
|
260
|
+
|
|
261
|
+
declare type DeepPartialArray<T> = Array<DeepPartial<T>>;
|
|
262
|
+
|
|
263
|
+
declare type DeepPartialMap<K, V> = Map<DeepPartial<K>, DeepPartial<V>>;
|
|
264
|
+
|
|
265
|
+
declare type DeepPartialObject<T> = {
|
|
266
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
243
267
|
};
|
|
244
268
|
|
|
245
|
-
|
|
246
|
-
|
|
269
|
+
declare type DeepPartialSet<T> = Set<DeepPartial<T>>;
|
|
270
|
+
|
|
271
|
+
export declare type DeepReadonly<T> = T extends Primitive ? T : T extends Array<infer U> ? DeepReadonlyArray<U> : T extends Map<infer K, infer V> ? DeepReadonlyMap<K, V> : T extends Set<infer M> ? DeepReadonlySet<M> : DeepReadonlyObject<T>;
|
|
272
|
+
|
|
273
|
+
declare type DeepReadonlyArray<T> = ReadonlyArray<DeepReadonly<T>>;
|
|
274
|
+
|
|
275
|
+
declare type DeepReadonlyMap<K, V> = ReadonlyMap<DeepReadonly<K>, DeepReadonly<V>>;
|
|
276
|
+
|
|
277
|
+
declare type DeepReadonlyObject<T> = {
|
|
278
|
+
readonly [K in keyof T]: DeepReadonly<T[K]>;
|
|
247
279
|
};
|
|
248
280
|
|
|
281
|
+
declare type DeepReadonlySet<T> = ReadonlySet<DeepReadonly<T>>;
|
|
282
|
+
|
|
283
|
+
export declare type DeepWriteable<T> = T extends Primitive ? T : T extends ReadonlyArray<infer U> ? DeepWriteableArray<U> : T extends ReadonlyMap<infer K, infer V> ? DeepWriteableMap<K, V> : T extends ReadonlySet<infer M> ? DeepWriteableSet<M> : DeepWriteableObject<T>;
|
|
284
|
+
|
|
285
|
+
declare type DeepWriteableArray<T> = Array<DeepWriteable<T>>;
|
|
286
|
+
|
|
287
|
+
declare type DeepWriteableMap<K, V> = Map<DeepWriteable<K>, DeepWriteable<V>>;
|
|
288
|
+
|
|
289
|
+
declare type DeepWriteableObject<T> = {
|
|
290
|
+
-readonly [K in keyof T]: DeepWriteable<T[K]>;
|
|
291
|
+
};
|
|
292
|
+
|
|
293
|
+
declare type DeepWriteableSet<T> = Set<DeepWriteable<T>>;
|
|
294
|
+
|
|
249
295
|
/**
|
|
250
296
|
* a promise can resolve or reject later
|
|
251
297
|
* @public
|
|
@@ -636,7 +682,7 @@ export declare function isAbsolute(path: string): boolean;
|
|
|
636
682
|
* is the two array EXACTLY same
|
|
637
683
|
* @public
|
|
638
684
|
*/
|
|
639
|
-
export declare function isArraySame<T>(a1: T[], a2: T[]): boolean;
|
|
685
|
+
export declare function isArraySame<T>(a1: readonly T[], a2: readonly T[]): boolean;
|
|
640
686
|
|
|
641
687
|
/** @public */
|
|
642
688
|
export declare function isCanceledError(error: any): boolean;
|
|
@@ -823,6 +869,8 @@ export declare class PathArray extends Set<string> {
|
|
|
823
869
|
join(part: string): string[];
|
|
824
870
|
}
|
|
825
871
|
|
|
872
|
+
export declare type Primitive = undefined | null | boolean | string | number | Function | bigint;
|
|
873
|
+
|
|
826
874
|
export declare type ProgressCallback<T = any> = (value: T) => void;
|
|
827
875
|
|
|
828
876
|
/**
|
|
@@ -1005,10 +1053,6 @@ export declare interface WrappedConsoleOptions {
|
|
|
1005
1053
|
bind?: boolean;
|
|
1006
1054
|
}
|
|
1007
1055
|
|
|
1008
|
-
export declare type Writeable<T> = {
|
|
1009
|
-
-readonly [P in keyof T]: T[P];
|
|
1010
|
-
};
|
|
1011
|
-
|
|
1012
1056
|
export declare function x(): number;
|
|
1013
1057
|
|
|
1014
1058
|
export { }
|
|
@@ -6,7 +6,7 @@ export declare function addDisposableEventListener<T extends Function>(target: I
|
|
|
6
6
|
* Compare two array, returns the difference from `before` to `after`
|
|
7
7
|
* @public
|
|
8
8
|
*/
|
|
9
|
-
export declare function arrayDiff<T>(
|
|
9
|
+
export declare function arrayDiff<T>(_before: readonly T[], after: readonly T[]): {
|
|
10
10
|
add: T[];
|
|
11
11
|
del: T[];
|
|
12
12
|
same: T[];
|
|
@@ -16,7 +16,7 @@ export declare function arrayDiff<T>(before: T[], after: T[]): {
|
|
|
16
16
|
* Returns a new array without duplicate values
|
|
17
17
|
* @public
|
|
18
18
|
*/
|
|
19
|
-
export declare function arrayUnique<T>(arr: T[]): T[];
|
|
19
|
+
export declare function arrayUnique<T>(arr: readonly T[]): T[];
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* Removes duplicate values from an array
|
|
@@ -104,6 +104,9 @@ export declare class CallbackList<Argument extends unknown[]> {
|
|
|
104
104
|
protected stop: boolean;
|
|
105
105
|
constructor();
|
|
106
106
|
count(): number;
|
|
107
|
+
/**
|
|
108
|
+
* remove all callback
|
|
109
|
+
*/
|
|
107
110
|
reset(): void;
|
|
108
111
|
/**
|
|
109
112
|
* @param name optional name of `item` (will assign displayName to `item`)
|
|
@@ -115,6 +118,7 @@ export declare class CallbackList<Argument extends unknown[]> {
|
|
|
115
118
|
*/
|
|
116
119
|
remove(item: MyCallback<Argument>): null | MyCallback<Argument>;
|
|
117
120
|
/**
|
|
121
|
+
* in a callback, call this.stopRun() to stop remain callbacks (not by return false)
|
|
118
122
|
* @returns {boolean} true if every callback called, false if stop in middle
|
|
119
123
|
*/
|
|
120
124
|
run(...argument: Argument): boolean;
|
|
@@ -154,6 +158,12 @@ export declare enum ColorKind {
|
|
|
154
158
|
DETECT = 3
|
|
155
159
|
}
|
|
156
160
|
|
|
161
|
+
/**
|
|
162
|
+
*
|
|
163
|
+
* GENERATED FILE, DO NOT MODIFY
|
|
164
|
+
* 这是生成的文件,千万不要修改
|
|
165
|
+
*
|
|
166
|
+
*/
|
|
157
167
|
export declare function concatStringType<T0 extends string>(t0: T0): `${T0}`;
|
|
158
168
|
|
|
159
169
|
export declare function concatStringType<T0 extends string, T1 extends string>(t0: T0, t1: T1): `${T0}${T1}`;
|
|
@@ -232,18 +242,54 @@ export declare class CustomSet<Type = string> {
|
|
|
232
242
|
toArray(): Type[];
|
|
233
243
|
}
|
|
234
244
|
|
|
235
|
-
export declare type
|
|
236
|
-
|
|
245
|
+
export declare type DeepNonNullable<T> = T extends Primitive ? T : T extends ReadonlyArray<infer U> | Array<infer U> ? DeepNonNullableArray<U> : T extends ReadonlyMap<infer K, infer V> | Map<infer K, infer V> ? DeepNonNullableMap<K, V> : T extends ReadonlySet<infer M> ? DeepNonNullableSet<M> : DeepNonNullableObject<T>;
|
|
246
|
+
|
|
247
|
+
declare type DeepNonNullableArray<T> = Array<DeepNonNullable<T>>;
|
|
248
|
+
|
|
249
|
+
declare type DeepNonNullableMap<K, V> = Map<DeepNonNullable<K>, DeepNonNullable<V>>;
|
|
250
|
+
|
|
251
|
+
declare type DeepNonNullableObject<T> = {
|
|
252
|
+
[K in keyof T]-?: NonNullable<T[K]>;
|
|
237
253
|
};
|
|
238
254
|
|
|
239
|
-
|
|
240
|
-
|
|
255
|
+
declare type DeepNonNullableSet<T> = Set<DeepNonNullable<T>>;
|
|
256
|
+
|
|
257
|
+
export declare type DeepPartial<T> = T extends Primitive ? T : T extends ReadonlyArray<infer U> ? DeepPartialArray<U> : T extends ReadonlyMap<infer K, infer V> ? DeepPartialMap<K, V> : T extends ReadonlySet<infer M> ? DeepPartialSet<M> : DeepPartialObject<T>;
|
|
258
|
+
|
|
259
|
+
declare type DeepPartialArray<T> = Array<DeepPartial<T>>;
|
|
260
|
+
|
|
261
|
+
declare type DeepPartialMap<K, V> = Map<DeepPartial<K>, DeepPartial<V>>;
|
|
262
|
+
|
|
263
|
+
declare type DeepPartialObject<T> = {
|
|
264
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
241
265
|
};
|
|
242
266
|
|
|
243
|
-
|
|
244
|
-
|
|
267
|
+
declare type DeepPartialSet<T> = Set<DeepPartial<T>>;
|
|
268
|
+
|
|
269
|
+
export declare type DeepReadonly<T> = T extends Primitive ? T : T extends Array<infer U> ? DeepReadonlyArray<U> : T extends Map<infer K, infer V> ? DeepReadonlyMap<K, V> : T extends Set<infer M> ? DeepReadonlySet<M> : DeepReadonlyObject<T>;
|
|
270
|
+
|
|
271
|
+
declare type DeepReadonlyArray<T> = ReadonlyArray<DeepReadonly<T>>;
|
|
272
|
+
|
|
273
|
+
declare type DeepReadonlyMap<K, V> = ReadonlyMap<DeepReadonly<K>, DeepReadonly<V>>;
|
|
274
|
+
|
|
275
|
+
declare type DeepReadonlyObject<T> = {
|
|
276
|
+
readonly [K in keyof T]: DeepReadonly<T[K]>;
|
|
245
277
|
};
|
|
246
278
|
|
|
279
|
+
declare type DeepReadonlySet<T> = ReadonlySet<DeepReadonly<T>>;
|
|
280
|
+
|
|
281
|
+
export declare type DeepWriteable<T> = T extends Primitive ? T : T extends ReadonlyArray<infer U> ? DeepWriteableArray<U> : T extends ReadonlyMap<infer K, infer V> ? DeepWriteableMap<K, V> : T extends ReadonlySet<infer M> ? DeepWriteableSet<M> : DeepWriteableObject<T>;
|
|
282
|
+
|
|
283
|
+
declare type DeepWriteableArray<T> = Array<DeepWriteable<T>>;
|
|
284
|
+
|
|
285
|
+
declare type DeepWriteableMap<K, V> = Map<DeepWriteable<K>, DeepWriteable<V>>;
|
|
286
|
+
|
|
287
|
+
declare type DeepWriteableObject<T> = {
|
|
288
|
+
-readonly [K in keyof T]: DeepWriteable<T[K]>;
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
declare type DeepWriteableSet<T> = Set<DeepWriteable<T>>;
|
|
292
|
+
|
|
247
293
|
/**
|
|
248
294
|
* a promise can resolve or reject later
|
|
249
295
|
* @public
|
|
@@ -634,7 +680,7 @@ export declare function isAbsolute(path: string): boolean;
|
|
|
634
680
|
* is the two array EXACTLY same
|
|
635
681
|
* @public
|
|
636
682
|
*/
|
|
637
|
-
export declare function isArraySame<T>(a1: T[], a2: T[]): boolean;
|
|
683
|
+
export declare function isArraySame<T>(a1: readonly T[], a2: readonly T[]): boolean;
|
|
638
684
|
|
|
639
685
|
/** @public */
|
|
640
686
|
export declare function isCanceledError(error: any): boolean;
|
|
@@ -821,6 +867,8 @@ export declare class PathArray extends Set<string> {
|
|
|
821
867
|
join(part: string): string[];
|
|
822
868
|
}
|
|
823
869
|
|
|
870
|
+
export declare type Primitive = undefined | null | boolean | string | number | Function | bigint;
|
|
871
|
+
|
|
824
872
|
export declare type ProgressCallback<T = any> = (value: T) => void;
|
|
825
873
|
|
|
826
874
|
/**
|
|
@@ -1003,10 +1051,6 @@ export declare interface WrappedConsoleOptions {
|
|
|
1003
1051
|
bind?: boolean;
|
|
1004
1052
|
}
|
|
1005
1053
|
|
|
1006
|
-
export declare type Writeable<T> = {
|
|
1007
|
-
-readonly [P in keyof T]: T[P];
|
|
1008
|
-
};
|
|
1009
|
-
|
|
1010
1054
|
export declare function x(): number;
|
|
1011
1055
|
|
|
1012
1056
|
export { }
|
package/{dist → lib}/common.d.ts
RENAMED
|
@@ -8,7 +8,7 @@ export declare function addDisposableEventListener<T extends Function>(target: I
|
|
|
8
8
|
* Compare two array, returns the difference from `before` to `after`
|
|
9
9
|
* @public
|
|
10
10
|
*/
|
|
11
|
-
export declare function arrayDiff<T>(
|
|
11
|
+
export declare function arrayDiff<T>(_before: readonly T[], after: readonly T[]): {
|
|
12
12
|
add: T[];
|
|
13
13
|
del: T[];
|
|
14
14
|
same: T[];
|
|
@@ -18,7 +18,7 @@ export declare function arrayDiff<T>(before: T[], after: T[]): {
|
|
|
18
18
|
* Returns a new array without duplicate values
|
|
19
19
|
* @public
|
|
20
20
|
*/
|
|
21
|
-
export declare function arrayUnique<T>(arr: T[]): T[];
|
|
21
|
+
export declare function arrayUnique<T>(arr: readonly T[]): T[];
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* Removes duplicate values from an array
|
|
@@ -106,6 +106,9 @@ export declare class CallbackList<Argument extends unknown[]> {
|
|
|
106
106
|
protected stop: boolean;
|
|
107
107
|
constructor();
|
|
108
108
|
count(): number;
|
|
109
|
+
/**
|
|
110
|
+
* remove all callback
|
|
111
|
+
*/
|
|
109
112
|
reset(): void;
|
|
110
113
|
/**
|
|
111
114
|
* @param name optional name of `item` (will assign displayName to `item`)
|
|
@@ -117,6 +120,7 @@ export declare class CallbackList<Argument extends unknown[]> {
|
|
|
117
120
|
*/
|
|
118
121
|
remove(item: MyCallback<Argument>): null | MyCallback<Argument>;
|
|
119
122
|
/**
|
|
123
|
+
* in a callback, call this.stopRun() to stop remain callbacks (not by return false)
|
|
120
124
|
* @returns {boolean} true if every callback called, false if stop in middle
|
|
121
125
|
*/
|
|
122
126
|
run(...argument: Argument): boolean;
|
|
@@ -156,6 +160,12 @@ export declare enum ColorKind {
|
|
|
156
160
|
DETECT = 3
|
|
157
161
|
}
|
|
158
162
|
|
|
163
|
+
/**
|
|
164
|
+
*
|
|
165
|
+
* GENERATED FILE, DO NOT MODIFY
|
|
166
|
+
* 这是生成的文件,千万不要修改
|
|
167
|
+
*
|
|
168
|
+
*/
|
|
159
169
|
export declare function concatStringType<T0 extends string>(t0: T0): `${T0}`;
|
|
160
170
|
|
|
161
171
|
export declare function concatStringType<T0 extends string, T1 extends string>(t0: T0, t1: T1): `${T0}${T1}`;
|
|
@@ -234,18 +244,54 @@ export declare class CustomSet<Type = string> {
|
|
|
234
244
|
toArray(): Type[];
|
|
235
245
|
}
|
|
236
246
|
|
|
237
|
-
export declare type
|
|
238
|
-
|
|
247
|
+
export declare type DeepNonNullable<T> = T extends Primitive ? T : T extends ReadonlyArray<infer U> | Array<infer U> ? DeepNonNullableArray<U> : T extends ReadonlyMap<infer K, infer V> | Map<infer K, infer V> ? DeepNonNullableMap<K, V> : T extends ReadonlySet<infer M> ? DeepNonNullableSet<M> : DeepNonNullableObject<T>;
|
|
248
|
+
|
|
249
|
+
declare type DeepNonNullableArray<T> = Array<DeepNonNullable<T>>;
|
|
250
|
+
|
|
251
|
+
declare type DeepNonNullableMap<K, V> = Map<DeepNonNullable<K>, DeepNonNullable<V>>;
|
|
252
|
+
|
|
253
|
+
declare type DeepNonNullableObject<T> = {
|
|
254
|
+
[K in keyof T]-?: NonNullable<T[K]>;
|
|
239
255
|
};
|
|
240
256
|
|
|
241
|
-
|
|
242
|
-
|
|
257
|
+
declare type DeepNonNullableSet<T> = Set<DeepNonNullable<T>>;
|
|
258
|
+
|
|
259
|
+
export declare type DeepPartial<T> = T extends Primitive ? T : T extends ReadonlyArray<infer U> ? DeepPartialArray<U> : T extends ReadonlyMap<infer K, infer V> ? DeepPartialMap<K, V> : T extends ReadonlySet<infer M> ? DeepPartialSet<M> : DeepPartialObject<T>;
|
|
260
|
+
|
|
261
|
+
declare type DeepPartialArray<T> = Array<DeepPartial<T>>;
|
|
262
|
+
|
|
263
|
+
declare type DeepPartialMap<K, V> = Map<DeepPartial<K>, DeepPartial<V>>;
|
|
264
|
+
|
|
265
|
+
declare type DeepPartialObject<T> = {
|
|
266
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
243
267
|
};
|
|
244
268
|
|
|
245
|
-
|
|
246
|
-
|
|
269
|
+
declare type DeepPartialSet<T> = Set<DeepPartial<T>>;
|
|
270
|
+
|
|
271
|
+
export declare type DeepReadonly<T> = T extends Primitive ? T : T extends Array<infer U> ? DeepReadonlyArray<U> : T extends Map<infer K, infer V> ? DeepReadonlyMap<K, V> : T extends Set<infer M> ? DeepReadonlySet<M> : DeepReadonlyObject<T>;
|
|
272
|
+
|
|
273
|
+
declare type DeepReadonlyArray<T> = ReadonlyArray<DeepReadonly<T>>;
|
|
274
|
+
|
|
275
|
+
declare type DeepReadonlyMap<K, V> = ReadonlyMap<DeepReadonly<K>, DeepReadonly<V>>;
|
|
276
|
+
|
|
277
|
+
declare type DeepReadonlyObject<T> = {
|
|
278
|
+
readonly [K in keyof T]: DeepReadonly<T[K]>;
|
|
247
279
|
};
|
|
248
280
|
|
|
281
|
+
declare type DeepReadonlySet<T> = ReadonlySet<DeepReadonly<T>>;
|
|
282
|
+
|
|
283
|
+
export declare type DeepWriteable<T> = T extends Primitive ? T : T extends ReadonlyArray<infer U> ? DeepWriteableArray<U> : T extends ReadonlyMap<infer K, infer V> ? DeepWriteableMap<K, V> : T extends ReadonlySet<infer M> ? DeepWriteableSet<M> : DeepWriteableObject<T>;
|
|
284
|
+
|
|
285
|
+
declare type DeepWriteableArray<T> = Array<DeepWriteable<T>>;
|
|
286
|
+
|
|
287
|
+
declare type DeepWriteableMap<K, V> = Map<DeepWriteable<K>, DeepWriteable<V>>;
|
|
288
|
+
|
|
289
|
+
declare type DeepWriteableObject<T> = {
|
|
290
|
+
-readonly [K in keyof T]: DeepWriteable<T[K]>;
|
|
291
|
+
};
|
|
292
|
+
|
|
293
|
+
declare type DeepWriteableSet<T> = Set<DeepWriteable<T>>;
|
|
294
|
+
|
|
249
295
|
/**
|
|
250
296
|
* a promise can resolve or reject later
|
|
251
297
|
* @public
|
|
@@ -636,7 +682,7 @@ export declare function isAbsolute(path: string): boolean;
|
|
|
636
682
|
* is the two array EXACTLY same
|
|
637
683
|
* @public
|
|
638
684
|
*/
|
|
639
|
-
export declare function isArraySame<T>(a1: T[], a2: T[]): boolean;
|
|
685
|
+
export declare function isArraySame<T>(a1: readonly T[], a2: readonly T[]): boolean;
|
|
640
686
|
|
|
641
687
|
/** @public */
|
|
642
688
|
export declare function isCanceledError(error: any): boolean;
|
|
@@ -833,6 +879,8 @@ export declare class PathArray extends Set<string> {
|
|
|
833
879
|
join(part: string): string[];
|
|
834
880
|
}
|
|
835
881
|
|
|
882
|
+
export declare type Primitive = undefined | null | boolean | string | number | Function | bigint;
|
|
883
|
+
|
|
836
884
|
export declare type ProgressCallback<T = any> = (value: T) => void;
|
|
837
885
|
|
|
838
886
|
/**
|
|
@@ -1015,10 +1063,6 @@ export declare interface WrappedConsoleOptions {
|
|
|
1015
1063
|
bind?: boolean;
|
|
1016
1064
|
}
|
|
1017
1065
|
|
|
1018
|
-
export declare type Writeable<T> = {
|
|
1019
|
-
-readonly [P in keyof T]: T[P];
|
|
1020
|
-
};
|
|
1021
|
-
|
|
1022
1066
|
export declare function x(): number;
|
|
1023
1067
|
|
|
1024
1068
|
export { }
|
|
@@ -15,6 +15,9 @@ class CallbackList {
|
|
|
15
15
|
count() {
|
|
16
16
|
return this.list.length;
|
|
17
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* remove all callback
|
|
20
|
+
*/
|
|
18
21
|
reset() {
|
|
19
22
|
if (this.running) {
|
|
20
23
|
throw new Error("Can not reset when it's running.");
|
|
@@ -48,6 +51,7 @@ class CallbackList {
|
|
|
48
51
|
return null;
|
|
49
52
|
}
|
|
50
53
|
/**
|
|
54
|
+
* in a callback, call this.stopRun() to stop remain callbacks (not by return false)
|
|
51
55
|
* @returns {boolean} true if every callback called, false if stop in middle
|
|
52
56
|
*/
|
|
53
57
|
run(...argument) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"callbackList.js","sourceRoot":"","sources":["../../src/function/callbackList.ts"],"names":[],"mappings":";;;AAAA,qDAA8C;AAQ9C;;GAEG;AACH,MAAa,YAAY;IACd,IAAI,GAA2B,EAAE,CAAC;IAClC,OAAO,GAAY,KAAK,CAAC;IACzB,IAAI,GAAY,KAAK,CAAC;IAEhC;QACC,IAAI,CAAC,GAAG,GAAI,IAAI,CAAC,GAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;IAED,KAAK;QACJ,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;IACzB,CAAC;IAED,KAAK;QACJ,IAAI,IAAI,CAAC,OAAO,EAAE;YACjB,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;SACpD;QACD,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IACtB,CAAC;IAED;;;OAGG;IACH,GAAG,CAAC,IAA0B,EAAE,IAAa;QAC5C,IAAI,IAAI,CAAC,OAAO,EAAE;YACjB,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;SAC3D;QACD,IAAI,IAAI,EAAE;YACT,IAAA,2BAAY,EAAC,IAAI,EAAE,IAAI,CAAC,CAAC;SACzB;QACD,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,IAA0B;QAChC,IAAI,IAAI,CAAC,OAAO,EAAE;YACjB,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;SAC9D;QACD,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACtC,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE;YACjB,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SACrC;QACD,OAAO,IAAI,CAAC;IACb,CAAC;IAED
|
|
1
|
+
{"version":3,"file":"callbackList.js","sourceRoot":"","sources":["../../src/function/callbackList.ts"],"names":[],"mappings":";;;AAAA,qDAA8C;AAQ9C;;GAEG;AACH,MAAa,YAAY;IACd,IAAI,GAA2B,EAAE,CAAC;IAClC,OAAO,GAAY,KAAK,CAAC;IACzB,IAAI,GAAY,KAAK,CAAC;IAEhC;QACC,IAAI,CAAC,GAAG,GAAI,IAAI,CAAC,GAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;IAED,KAAK;QACJ,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;IACzB,CAAC;IAED;;OAEG;IACH,KAAK;QACJ,IAAI,IAAI,CAAC,OAAO,EAAE;YACjB,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;SACpD;QACD,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IACtB,CAAC;IAED;;;OAGG;IACH,GAAG,CAAC,IAA0B,EAAE,IAAa;QAC5C,IAAI,IAAI,CAAC,OAAO,EAAE;YACjB,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;SAC3D;QACD,IAAI,IAAI,EAAE;YACT,IAAA,2BAAY,EAAC,IAAI,EAAE,IAAI,CAAC,CAAC;SACzB;QACD,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,IAA0B;QAChC,IAAI,IAAI,CAAC,OAAO,EAAE;YACjB,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;SAC9D;QACD,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACtC,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE;YACjB,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SACrC;QACD,OAAO,IAAI,CAAC;IACb,CAAC;IAED;;;OAGG;IACH,GAAG,CAAC,GAAG,QAAkB;QACxB,IAAI,IAAI,CAAC,OAAO,EAAE;YACjB,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;SAC9D;QACD,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;QAElB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,KAAK,MAAM,EAAE,IAAI,IAAI,CAAC,IAAI,EAAE;YAC3B,IAAI,IAAI,CAAC,IAAI;gBAAE,MAAM;YACrB,EAAE,CAAC,GAAG,QAAQ,CAAC,CAAC;SAChB;QACD,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QAErB,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;QAClB,OAAO,GAAG,CAAC;IACZ,CAAC;IAED,OAAO;QACN,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IAClB,CAAC;CACD;AA5ED,oCA4EC"}
|
|
@@ -12,6 +12,9 @@ export class CallbackList {
|
|
|
12
12
|
count() {
|
|
13
13
|
return this.list.length;
|
|
14
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* remove all callback
|
|
17
|
+
*/
|
|
15
18
|
reset() {
|
|
16
19
|
if (this.running) {
|
|
17
20
|
throw new Error("Can not reset when it's running.");
|
|
@@ -45,6 +48,7 @@ export class CallbackList {
|
|
|
45
48
|
return null;
|
|
46
49
|
}
|
|
47
50
|
/**
|
|
51
|
+
* in a callback, call this.stopRun() to stop remain callbacks (not by return false)
|
|
48
52
|
* @returns {boolean} true if every callback called, false if stop in middle
|
|
49
53
|
*/
|
|
50
54
|
run(...argument) {
|