ts-type 2.1.10 → 3.0.1

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 (75) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/index.js +0 -2
  3. package/lib/_build-in.d.ts +11 -10
  4. package/lib/_build-in.js.map +1 -1
  5. package/lib/generic.d.ts +2 -2
  6. package/lib/helper/array/readonly.d.ts +2 -2
  7. package/lib/helper/filter.d.ts +10 -10
  8. package/lib/helper/infer.d.ts +2 -2
  9. package/lib/helper/intersection.d.ts +1 -1
  10. package/lib/helper/key-value.d.ts +9 -5
  11. package/lib/helper/key-value.js.map +1 -1
  12. package/lib/helper/number.d.ts +4 -4
  13. package/lib/helper/overwrite.d.ts +1 -1
  14. package/lib/helper/promise.d.ts +3 -0
  15. package/lib/helper/{unpacked.js → promise.js} +1 -1
  16. package/lib/helper/promise.js.map +1 -0
  17. package/lib/helper/readonly.d.ts +10 -10
  18. package/lib/helper/readonly.js.map +1 -1
  19. package/lib/helper/record/enum.d.ts +7 -3
  20. package/lib/helper/record/enum.js.map +1 -1
  21. package/lib/helper/record/member.d.ts +2 -2
  22. package/lib/helper/record/omit-index.d.ts +7 -2
  23. package/lib/helper/record/omit-index.js.map +1 -1
  24. package/lib/helper/record/partial.d.ts +1 -1
  25. package/lib/helper/record/pick-one.d.ts +9 -0
  26. package/lib/{type/bluebird.js → helper/record/pick-one.js} +1 -4
  27. package/lib/helper/record/pick-one.js.map +1 -0
  28. package/lib/helper/record/pick-type.d.ts +16 -16
  29. package/lib/helper/record.d.ts +5 -5
  30. package/lib/helper/record.js.map +1 -1
  31. package/lib/helper/string/infer.d.ts +6 -0
  32. package/lib/helper/string/infer.js +3 -0
  33. package/lib/helper/string/infer.js.map +1 -0
  34. package/lib/helper/string/literal-string.d.ts +2 -2
  35. package/lib/helper/string.d.ts +5 -5
  36. package/lib/helper/tuple.d.ts +1 -1
  37. package/lib/helper/typeof.d.ts +2 -3
  38. package/lib/helper/typeof.js.map +1 -1
  39. package/lib/helper.d.ts +6 -8
  40. package/lib/helper.js.map +1 -1
  41. package/lib/index.d.ts +5 -2
  42. package/lib/index.js +0 -2
  43. package/lib/internal/logic/string-literal.d.ts +2 -2
  44. package/lib/logic/any.d.ts +2 -2
  45. package/lib/logic/any.js.map +1 -1
  46. package/lib/logic/never.d.ts +1 -1
  47. package/lib/logic/record/empty.d.ts +1 -1
  48. package/lib/logic/union/index.d.ts +15 -0
  49. package/lib/logic/union/index.js +3 -0
  50. package/lib/logic/union/index.js.map +1 -0
  51. package/lib/type/base.d.ts +9 -9
  52. package/lib/type/iterator.d.ts +2 -0
  53. package/lib/type/iterator.js +3 -0
  54. package/lib/type/iterator.js.map +1 -0
  55. package/lib/type/promise.d.ts +2 -2
  56. package/lib/type/proxy.d.ts +1 -1
  57. package/lib/type/record/empty.d.ts +2 -2
  58. package/lib/type/record/enum.d.ts +17 -1
  59. package/lib/type/record/enum.js.map +1 -1
  60. package/lib/type/record/partial.d.ts +2 -2
  61. package/lib/type/record/readonly.d.ts +4 -1
  62. package/lib/type/record/readonly.js.map +1 -1
  63. package/lib/type/record.d.ts +20 -20
  64. package/lib/type/record.js.map +1 -1
  65. package/lib/type/tuple/empty.d.ts +1 -1
  66. package/package.json +29 -11
  67. package/ts-toolbelt.js +0 -2
  68. package/lib/helper/unpacked.d.ts +0 -13
  69. package/lib/helper/unpacked.js.map +0 -1
  70. package/lib/type/bluebird.d.ts +0 -19
  71. package/lib/type/bluebird.js.map +0 -1
  72. package/tsconfig.check.json +0 -17
  73. package/tsconfig.check.tsbuildinfo +0 -1
  74. package/tsconfig.json.tpl +0 -3
  75. package/tsconfig.tsbuildinfo +0 -3148
package/lib/helper.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"helper.js","sourceRoot":"","sources":["helper.ts"],"names":[],"mappings":"","sourcesContent":["import { ITSArrayListMaybeReadonly } from './type/base';\nimport { ITSUnpackedReturnType } from './helper/unpacked';\n\n/**\n * copy current function with Parameters and return to new value\n *\n * not support overload\n *\n * @example\n * declare function f(a: number): number\n * declare let c: ITSOverwriteReturnType<typeof f, string>;\n * // c = (a: number) => string\n */\nexport type ITSOverwriteReturnType<T extends (...args: any[]) => any, R extends unknown> =\n\t(...args: Parameters<T>) => R;\n\nexport type ITSWrapFunctionPromiseLike<T extends (...args: any[]) => any> =\n\t(...args: Parameters<T>) => PromiseLike<ITSUnpackedReturnType<T>>;\nexport type ITSWrapFunctionPromise<T extends (...args: any[]) => any> =\n\t(...args: Parameters<T>) => Promise<ITSUnpackedReturnType<T>>;\n\n/**\n * @deprecated\n */\nexport type ITSExtendsOf<T, U> = Extract<T, U>;\n\nexport type ITSKeyOfArray<T extends ITSArrayListMaybeReadonly<any>> = Exclude<keyof T, symbol | string>;\n\nexport type ITSValueOfArray<T extends ITSArrayListMaybeReadonly<any>> = T extends (infer U)[] ? U : never;\n\nexport type ITSValueOfRecord<T extends Record<any, any>> = T[keyof T];\n"]}
1
+ {"version":3,"file":"helper.js","sourceRoot":"","sources":["helper.ts"],"names":[],"mappings":"","sourcesContent":["import { ITSArrayListMaybeReadonly } from './type/base';\nimport { ITSAwaitedReturnType } from './helper/promise';\n\n\n\n/**\n * copy current function with Parameters and return to new value\n *\n * not support overload\n *\n * @example\n * declare function f(a: number): number\n * declare let c: ITSOverwriteReturnType<typeof f, string>;\n * // c = (a: number) => string\n */\nexport type ITSOverwriteReturnType<T extends (...args: any[]) => any, R extends unknown> =\n\t(...args: Parameters<T>) => R;\n\nexport type ITSWrapFunctionPromiseLike<T extends (...args: any[]) => any> =\n\t(...args: Parameters<T>) => PromiseLike<ITSAwaitedReturnType<T>>;\nexport type ITSWrapFunctionPromise<T extends (...args: any[]) => any> =\n\t(...args: Parameters<T>) => Promise<ITSAwaitedReturnType<T>>;\n\n/**\n * @deprecated\n */\nexport type ITSExtendsOf<T, U> = Extract<T, U>;\n\nexport type ITSKeyOfArray<T extends ITSArrayListMaybeReadonly<any>> = Exclude<keyof T, symbol | string>;\n"]}
package/lib/index.d.ts CHANGED
@@ -7,26 +7,29 @@ export * from './helper/intersection';
7
7
  export * from './helper/key-value';
8
8
  export * from './helper/number';
9
9
  export * from './helper/overwrite';
10
+ export * from './helper/promise';
10
11
  export * from './helper/readonly';
11
12
  export * from './helper/record';
12
13
  export * from './helper/record/enum';
13
14
  export * from './helper/record/member';
14
15
  export * from './helper/record/omit-index';
15
16
  export * from './helper/record/partial';
17
+ export * from './helper/record/pick-one';
16
18
  export * from './helper/record/pick-type';
17
19
  export * from './helper/string';
20
+ export * from './helper/string/infer';
18
21
  export * from './helper/string/literal-string';
19
22
  export * from './helper/tuple';
20
23
  export * from './helper/typeof';
21
- export * from './helper/unpacked';
22
24
  export * from './internal/filter';
23
25
  export * from './internal/logic/string-literal';
24
26
  export * from './logic/any';
25
27
  export * from './logic/never';
26
28
  export * from './logic/record/empty';
29
+ export * from './logic/union/index';
27
30
  export * from './type/base';
28
- export * from './type/bluebird';
29
31
  export * from './type/decorators';
32
+ export * from './type/iterator';
30
33
  export * from './type/promise';
31
34
  export * from './type/proxy';
32
35
  export * from './type/record';
package/lib/index.js CHANGED
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * detect if T is a union
3
3
  */
4
- export declare type IsAUnion<T, Y = true, N = false, U = T> = U extends any ? ([T] extends [U] ? N : Y) : never;
4
+ export type IsAUnion<T, Y = true, N = false, U = T> = U extends any ? ([T] extends [U] ? N : Y) : never;
5
5
  /**
6
6
  * detect if T is a single string literal
7
7
  */
8
- export declare type IsASingleStringLiteral<T extends string, Y = true, N = false> = string extends T ? N : [T] extends [never] ? N : IsAUnion<T, N, Y>;
8
+ export type IsASingleStringLiteral<T extends string, Y = true, N = false> = string extends T ? N : [T] extends [never] ? N : IsAUnion<T, N, Y>;
@@ -1,5 +1,5 @@
1
1
  /**
2
2
  * @see https://stackoverflow.com/questions/49927523/disallow-call-with-any/49928360#49928360
3
3
  */
4
- export declare type ITSLogicIsAny<T> = 0 extends (1 & T) ? true : false;
5
- export declare type ITSLogicNotAny<T> = true extends ITSLogicIsAny<T> ? false : true;
4
+ export type ITSLogicIsAny<T, Y = true, N = false> = 0 extends (1 & T) ? Y : N;
5
+ export type ITSLogicNotAny<T, Y = true, N = false> = ITSLogicIsAny<T, N, Y>;
@@ -1 +1 @@
1
- {"version":3,"file":"any.js","sourceRoot":"","sources":["any.ts"],"names":[],"mappings":"","sourcesContent":["\n/**\n * @see https://stackoverflow.com/questions/49927523/disallow-call-with-any/49928360#49928360\n */\nexport type ITSLogicIsAny<T> = 0 extends (1 & T) ? true : false\n\nexport type ITSLogicNotAny<T> = true extends ITSLogicIsAny<T> ? false : true\n"]}
1
+ {"version":3,"file":"any.js","sourceRoot":"","sources":["any.ts"],"names":[],"mappings":"","sourcesContent":["\n/**\n * @see https://stackoverflow.com/questions/49927523/disallow-call-with-any/49928360#49928360\n */\nexport type ITSLogicIsAny<T, Y = true, N = false> = 0 extends (1 & T) ? Y : N\n\nexport type ITSLogicNotAny<T, Y = true, N = false> = ITSLogicIsAny<T, N, Y>\n"]}
@@ -1 +1 @@
1
- export declare type ITSLogicIsNever<T, Y = true, N = false> = [T] extends [never] ? Y : N;
1
+ export type ITSLogicIsNever<T, Y = true, N = false> = [T] extends [never] ? Y : N;
@@ -1,2 +1,2 @@
1
1
  import { ITSEmptyRecord } from '../../type/record/empty';
2
- export declare type ITSLogicIsEmptyRecord<T, Y = true, N = false> = T extends ITSEmptyRecord ? Y : N;
2
+ export type ITSLogicIsEmptyRecord<T, Y = true, N = false> = T extends ITSEmptyRecord ? Y : N;
@@ -0,0 +1,15 @@
1
+ import { ITSUnionToIntersection } from '../../helper/intersection';
2
+ import { ITSLogicIsNever } from '../never';
3
+ export type ITSLogicIsUnion<T, Y = true, N = false> = [T] extends [ITSUnionToIntersection<T>] ? N : Y;
4
+ /**
5
+ * @see https://stackoverflow.com/a/49982981/4563339
6
+ * @example
7
+ * let a: ITSLogicIsSingleNonUnion01<'' | '4' | any, string>
8
+ * let b: ITSLogicIsSingleNonUnion01<'' & '4' & any, string>
9
+ * let c: ITSLogicIsSingleNonUnion01<'', string>
10
+ *
11
+ * expectType<false>(a);
12
+ * expectType<false>(b);
13
+ * expectType<true>(c);
14
+ */
15
+ export type ITSLogicIsSingleNonUnion01<T, U extends any, Y = true, N = false> = U extends T ? N : ITSLogicIsNever<T, N, ITSLogicIsUnion<T, N, Y>>;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"","sourcesContent":["import { ITSUnionToIntersection } from '../../helper/intersection';\nimport { ITSLogicIsNever } from '../never';\n\nexport type ITSLogicIsUnion<T, Y = true, N = false> = [T] extends [ITSUnionToIntersection<T>] ? N : Y\n\n/**\n * @see https://stackoverflow.com/a/49982981/4563339\n * @example\n * let a: ITSLogicIsSingleNonUnion01<'' | '4' | any, string>\n * let b: ITSLogicIsSingleNonUnion01<'' & '4' & any, string>\n * let c: ITSLogicIsSingleNonUnion01<'', string>\n *\n * expectType<false>(a);\n * expectType<false>(b);\n * expectType<true>(c);\n */\nexport type ITSLogicIsSingleNonUnion01<\n\tT,\n\tU extends any,\n\tY = true,\n\tN = false\n> = U extends T ?\n\tN : ITSLogicIsNever<T, N, ITSLogicIsUnion<T, N, Y>>\n\t;\n\n\n"]}
@@ -2,12 +2,12 @@
2
2
  * Created by user on 2019/5/17.
3
3
  */
4
4
  import { ITSTypeFunction } from '../generic';
5
- export declare type ITSArrayListMaybeReadonly<T> = T[] | readonly T[];
6
- export declare type ITSKeys = symbol | string | number;
7
- export declare type ITSConstructorLike<T extends any = any> = new (...args: any) => T;
8
- export declare type ITSValueOrArray<T> = T | T[];
9
- export declare type ITSValueOrArrayMaybeReadonly<T> = T | ITSArrayListMaybeReadonly<T>;
10
- export declare type ITSPropertyKey = string | symbol;
11
- export declare type ITSAnyFunction = ITSTypeFunction<any>;
12
- export declare type ITSBasicPrimitive = number | string | boolean;
13
- export declare type ITSNullPrimitive = null | undefined;
5
+ export type ITSArrayListMaybeReadonly<T> = T[] | readonly T[];
6
+ export type ITSKeys = symbol | string | number;
7
+ export type ITSConstructorLike<T extends any = any> = new (...args: any) => T;
8
+ export type ITSValueOrArray<T> = T | T[];
9
+ export type ITSValueOrArrayMaybeReadonly<T> = T | ITSArrayListMaybeReadonly<T>;
10
+ export type ITSPropertyKey = string | symbol;
11
+ export type ITSAnyFunction = ITSTypeFunction<any>;
12
+ export type ITSBasicPrimitive = number | string | boolean;
13
+ export type ITSNullPrimitive = null | undefined;
@@ -0,0 +1,2 @@
1
+ export type ITSIterator<T, TReturn = void, TNext = undefined> = Iterator<T, TReturn, TNext>;
2
+ export type ITSIteratorResult<T, TReturn = void> = IteratorResult<T, TReturn>;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=iterator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iterator.js","sourceRoot":"","sources":["iterator.ts"],"names":[],"mappings":"","sourcesContent":["\nexport type ITSIterator<T, TReturn = void, TNext = undefined> = Iterator<T, TReturn, TNext>;\n\nexport type ITSIteratorResult<T, TReturn = void> = IteratorResult<T, TReturn>;\n"]}
@@ -5,7 +5,7 @@
5
5
  * Same property names, but make the value a promise instead of a concrete one
6
6
  * @see https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-1.html
7
7
  */
8
- export declare type ITSDeferred<T> = {
8
+ export type ITSDeferred<T> = {
9
9
  [P in keyof T]: Promise<T[P]>;
10
10
  };
11
11
  export interface ITSPromiseFulfilledResult<T> {
@@ -18,4 +18,4 @@ export interface ITSPromiseRejectedResult<E = any> {
18
18
  reason: E;
19
19
  value?: never;
20
20
  }
21
- export declare type ITSPromiseSettledResult<T, E = any> = ITSPromiseFulfilledResult<T> | ITSPromiseRejectedResult<E>;
21
+ export type ITSPromiseSettledResult<T, E = any> = ITSPromiseFulfilledResult<T> | ITSPromiseRejectedResult<E>;
@@ -5,7 +5,7 @@
5
5
  * Wrap proxies around properties of T
6
6
  * @see https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-1.html
7
7
  */
8
- export declare type ITSProxify<T> = {
8
+ export type ITSProxify<T> = {
9
9
  [P in keyof T]: {
10
10
  get(): T[P];
11
11
  set(v: T[P]): void;
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @see https://juejin.cn/post/7116327095118069773
3
3
  */
4
- export declare type ITSEmptyRecordByKeys<K extends PropertyKey> = Record<K, never>;
4
+ export type ITSEmptyRecordByKeys<K extends PropertyKey> = Record<K, never>;
5
5
  /**
6
6
  * @see https://juejin.cn/post/7116327095118069773
7
7
  */
8
- export declare type ITSEmptyRecord = ITSEmptyRecordByKeys<PropertyKey>;
8
+ export type ITSEmptyRecord = ITSEmptyRecordByKeys<PropertyKey>;
@@ -1,2 +1,18 @@
1
1
  import { ITSReadonlyRecord } from './readonly';
2
- export declare type ITSEnumLike<K extends string = string> = ITSReadonlyRecord<K, string | number>;
2
+ import { ITSTypeAndStringLiteral } from '../../helper/string';
3
+ export type ITSEnumLike<K extends string = string, V extends string | number = string | number> = ITSReadonlyRecord<K, V> | (V extends number ? ITSNumberEnumLikeReverse<K, Exclude<V, string>> : ITSEnumLikeReverseExcludeNumber);
4
+ export type ITSStringEnumLike<K extends string = string, V extends string = string> = (ITSReadonlyRecord<K, V> | ITSStringEnumLikeReverse<K, V>) & ITSEnumLikeReverseExcludeNumber;
5
+ export type ITSNumberEnumLike<K extends string = string, V extends number = number> = ITSReadonlyRecord<K, V> | ITSNumberEnumLikeReverse<K, V>;
6
+ /**
7
+ * @internal
8
+ */
9
+ export type ITSStringEnumLikeReverse<K extends string = string, V extends string = string> = ITSReadonlyRecord<V, K>;
10
+ /**
11
+ * @internal
12
+ * @see https://github.com/microsoft/TypeScript/issues/51105
13
+ */
14
+ export type ITSNumberEnumLikeReverse<K extends string = string, V extends number = number> = ITSReadonlyRecord<Exclude<ITSTypeAndStringLiteral<V>, K>, K>;
15
+ /**
16
+ * @internal
17
+ */
18
+ export type ITSEnumLikeReverseExcludeNumber = ITSReadonlyRecord<number, void | never>;
@@ -1 +1 @@
1
- {"version":3,"file":"enum.js","sourceRoot":"","sources":["enum.ts"],"names":[],"mappings":"","sourcesContent":["import { ITSReadonlyRecord } from './readonly';\n\nexport type ITSEnumLike<K extends string = string> = ITSReadonlyRecord<K, string | number>;\n"]}
1
+ {"version":3,"file":"enum.js","sourceRoot":"","sources":["enum.ts"],"names":[],"mappings":"","sourcesContent":["import { ITSReadonlyRecord } from './readonly';\nimport { ITSTypeAndStringLiteral } from '../../helper/string';\n\nexport type ITSEnumLike<K extends string = string, V extends string | number = string | number> = ITSReadonlyRecord<K, V> | (V extends number ? ITSNumberEnumLikeReverse<K, Exclude<V, string>> : ITSEnumLikeReverseExcludeNumber);\n\nexport type ITSStringEnumLike<K extends string = string, V extends string = string> = (ITSReadonlyRecord<K, V> | ITSStringEnumLikeReverse<K, V>) & ITSEnumLikeReverseExcludeNumber;\n\nexport type ITSNumberEnumLike<K extends string = string, V extends number = number> = ITSReadonlyRecord<K, V> | ITSNumberEnumLikeReverse<K, V>;\n\n/**\n * @internal\n */\nexport type ITSStringEnumLikeReverse<K extends string = string, V extends string = string> =\n\tITSReadonlyRecord<V, K>;\n\n/**\n * @internal\n * @see https://github.com/microsoft/TypeScript/issues/51105\n */\nexport type ITSNumberEnumLikeReverse<K extends string = string, V extends number = number> = ITSReadonlyRecord<Exclude<ITSTypeAndStringLiteral<V>, K>, K>;\n\n/**\n * @internal\n */\nexport type ITSEnumLikeReverseExcludeNumber = ITSReadonlyRecord<number, void | never>;\n"]}
@@ -1,6 +1,6 @@
1
- export declare type ITSPartialRecord<K extends keyof any, T> = {
1
+ export type ITSPartialRecord<K extends keyof any, T> = {
2
2
  [P in K]?: T;
3
3
  };
4
- export declare type ITSRequireRecord<K extends keyof any, T> = {
4
+ export type ITSRequireRecord<K extends keyof any, T> = {
5
5
  [P in K]-?: T;
6
6
  };
@@ -1,3 +1,6 @@
1
- export declare type ITSReadonlyRecord<K extends keyof any, T> = {
1
+ export type ITSReadonlyRecord<K extends keyof any, T> = {
2
2
  readonly [P in K]: T;
3
3
  };
4
+ export type ITSWriteableRecord<K extends keyof any, T> = {
5
+ -readonly [P in K]: T;
6
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"readonly.js","sourceRoot":"","sources":["readonly.ts"],"names":[],"mappings":"","sourcesContent":["\nexport type ITSReadonlyRecord<K extends keyof any, T> = {\n\treadonly [P in K]: T;\n};\n"]}
1
+ {"version":3,"file":"readonly.js","sourceRoot":"","sources":["readonly.ts"],"names":[],"mappings":"","sourcesContent":["\nexport type ITSReadonlyRecord<K extends keyof any, T> = {\n\treadonly [P in K]: T;\n};\n\nexport type ITSWriteableRecord<K extends keyof any, T> = {\n\t-readonly [P in K]: T;\n};\n"]}
@@ -1,38 +1,38 @@
1
1
  /**
2
2
  * Created by user on 2019/6/11.
3
3
  */
4
- import { ITSKeyofBothDiff, ITSKeyofBothSame, ITSKeyofDiff, ITSKeyofSame } from '../helper/filter';
5
- export { ITSRequireRecord, ITSPartialRecord } from '../type/record/partial';
4
+ import type { ITSKeyofBothDiff, ITSKeyofBothSame, ITSKeyofDiff, ITSKeyofSame } from '../helper/filter';
5
+ export type { ITSRequireRecord, ITSPartialRecord } from '../type/record/partial';
6
6
  /**
7
7
  * @deprecated
8
8
  */
9
- export declare type ITSDiff<T extends keyof any, U extends keyof any> = ({
9
+ export type ITSDiff<T extends keyof any, U extends keyof any> = ({
10
10
  [P in T]: P;
11
11
  } & {
12
12
  [P in U]: never;
13
13
  } & {
14
14
  [x: string]: never;
15
15
  })[T];
16
- export declare type ITSPickSame<T, U> = Pick<T, ITSKeyofSame<T, U>>;
17
- export declare type ITSPickDiff<T, U> = Pick<T, ITSKeyofDiff<T, U>>;
16
+ export type ITSPickSame<T, U> = Pick<T, ITSKeyofSame<T, U>>;
17
+ export type ITSPickDiff<T, U> = Pick<T, ITSKeyofDiff<T, U>>;
18
18
  /**
19
19
  * 生成一個新類型 具有 T 與 U 當中同時存在的 KEY
20
20
  */
21
- export declare type ITSPickBothSame<T, U> = Pick<T & U, ITSKeyofBothSame<T, U>>;
21
+ export type ITSPickBothSame<T, U> = Pick<T & U, ITSKeyofBothSame<T, U>>;
22
22
  /**
23
23
  * 生成一個新類型 不具有 T 與 U 當中同時存在的 KEY
24
24
  */
25
- export declare type ITSPickBothDiff<T, U> = Pick<T & U, ITSKeyofBothDiff<T, U>>;
26
- export declare type ITSPickBoth<T, U, K extends ITSKeyofBothSame<T, U> = ITSKeyofBothSame<T, U>> = Pick<T & U, K>;
25
+ export type ITSPickBothDiff<T, U> = Pick<T & U, ITSKeyofBothDiff<T, U>>;
26
+ export type ITSPickBoth<T, U, K extends ITSKeyofBothSame<T, U> = ITSKeyofBothSame<T, U>> = Pick<T & U, K>;
27
27
  /**
28
28
  * @see https://stackoverflow.com/questions/49198713/override-the-properties-of-an-interface-in-typescript
29
29
  */
30
- export declare type ITSPickMember<T, K extends keyof T> = T[K];
30
+ export type ITSPickMember<T, K extends keyof T> = T[K];
31
31
  /**
32
32
  * exclude all key in K at T
33
33
  * @deprecated
34
34
  */
35
- export declare type ITSPickNot<T, K extends keyof T> = Omit<T, K>;
35
+ export type ITSPickNot<T, K extends keyof T> = Omit<T, K>;
36
36
  /**
37
37
  * @see https://stackoverflow.com/questions/49198713/override-the-properties-of-an-interface-in-typescript
38
38
  *
@@ -41,7 +41,7 @@ export declare type ITSPickNot<T, K extends keyof T> = Omit<T, K>;
41
41
  * export declare type A2 = ITSOverwrite<A1, { s: number; }>;
42
42
  * export declare let a2: A2;
43
43
  */
44
- export declare type ITSOverwrite<T, U> = Omit<T, keyof U> & U;
44
+ export type ITSOverwrite<T, U> = Omit<T, keyof U> & U;
45
45
  /**
46
46
  * @example
47
47
  * type Test1 = { id: number, code: string }
@@ -50,38 +50,38 @@ export declare type ITSOverwrite<T, U> = Omit<T, keyof U> & U;
50
50
  * export const x: Test3 = { id: "bob", code: "bob" }
51
51
  * @see https://github.com/microsoft/TypeScript/issues/35627
52
52
  */
53
- export declare type ITSMergeBoth<T, U> = ITSPickBothDiff<T, U> & Pick<T | U, ITSKeyofBothSame<T, U>>;
53
+ export type ITSMergeBoth<T, U> = ITSPickBothDiff<T, U> & Pick<T | U, ITSKeyofBothSame<T, U>>;
54
54
  /**
55
55
  * pick K and mark as Required
56
56
  */
57
- export declare type ITSRequiredPick<T, K extends keyof T = keyof T> = {
57
+ export type ITSRequiredPick<T, K extends keyof T = keyof T> = {
58
58
  [P in K]-?: T[P];
59
59
  };
60
60
  /**
61
61
  * pick K and mark as Partial
62
62
  */
63
- export declare type ITSPartialPick<T, K extends keyof T = keyof T> = {
63
+ export type ITSPartialPick<T, K extends keyof T = keyof T> = {
64
64
  [P in K]?: T[P];
65
65
  };
66
66
  /**
67
67
  * clone a type and mark all RK is Required, PK is Partial
68
68
  */
69
- export declare type ITSPickExtra<T, RK extends keyof T, PK extends Exclude<keyof T, RK> = Exclude<keyof T, RK>> = ITSRequiredPick<T, RK> & ITSPartialPick<T, PK>;
69
+ export type ITSPickExtra<T, RK extends keyof T, PK extends Exclude<keyof T, RK> = Exclude<keyof T, RK>> = ITSRequiredPick<T, RK> & ITSPartialPick<T, PK>;
70
70
  /**
71
71
  * clone a type and mark all RK is Required, PK is Partial
72
72
  */
73
- export declare type ITSPickExtra2<T, PK extends keyof T, RK extends Exclude<keyof T, PK> = Exclude<keyof T, PK>> = ITSRequiredPick<T, RK> & ITSPartialPick<T, PK>;
74
- export declare type ITSRequiredWith<T, K extends keyof T> = Omit<T, K> & ITSRequiredPick<T, K>;
75
- export declare type ITSPartialWith<T, K extends keyof T> = Omit<T, K> & ITSPartialPick<T, K>;
73
+ export type ITSPickExtra2<T, PK extends keyof T, RK extends Exclude<keyof T, PK> = Exclude<keyof T, PK>> = ITSRequiredPick<T, RK> & ITSPartialPick<T, PK>;
74
+ export type ITSRequiredWith<T, K extends keyof T> = Omit<T, K> & ITSRequiredPick<T, K>;
75
+ export type ITSPartialWith<T, K extends keyof T> = Omit<T, K> & ITSPartialPick<T, K>;
76
76
  /**
77
77
  * https://stackoverflow.com/questions/40510611/typescript-interface-require-one-of-two-properties-to-exist
78
78
  */
79
- export declare type ITSRequireAtLeastOne<T, Keys extends keyof T = keyof T> = Omit<T, Keys> & {
79
+ export type ITSRequireAtLeastOne<T, Keys extends keyof T = keyof T> = Omit<T, Keys> & {
80
80
  [K in Keys]-?: ITSRequiredPick<T, K> & ITSPartialPick<T, Exclude<Keys, K>>;
81
81
  }[Keys];
82
82
  /**
83
83
  * https://stackoverflow.com/questions/40510611/typescript-interface-require-one-of-two-properties-to-exist
84
84
  */
85
- export declare type ITSRequireOnlyOne<T, Keys extends keyof T = keyof T> = Omit<T, Keys> & {
85
+ export type ITSRequireOnlyOne<T, Keys extends keyof T = keyof T> = Omit<T, Keys> & {
86
86
  [K in Keys]-?: ITSRequiredPick<T, K> & Partial<Record<Exclude<Keys, K>, never>>;
87
87
  }[Keys];
@@ -1 +1 @@
1
- {"version":3,"file":"record.js","sourceRoot":"","sources":["record.ts"],"names":[],"mappings":";AAAA;;GAEG","sourcesContent":["/**\n * Created by user on 2019/6/11.\n */\n\nimport { ITSKeyofBothDiff, ITSKeyofBothSame, ITSKeyofDiff, ITSKeyofSame } from '../helper/filter';\n\nexport { ITSRequireRecord, ITSPartialRecord } from '../type/record/partial';\n\n/**\n * @deprecated\n */\nexport type ITSDiff<T extends keyof any, U extends keyof any> = (\n\t{ [P in T]: P }\n\t&\n\t{ [P in U]: never }\n\t&\n\t{ [x: string]: never }\n\t)[T];\n\nexport type ITSPickSame<T, U> = Pick<T, ITSKeyofSame<T, U>>;\nexport type ITSPickDiff<T, U> = Pick<T, ITSKeyofDiff<T, U>>;\n\n/**\n * 生成一個新類型 具有 T 與 U 當中同時存在的 KEY\n */\nexport type ITSPickBothSame<T, U> = Pick<T & U, ITSKeyofBothSame<T, U>>;\n/**\n * 生成一個新類型 不具有 T 與 U 當中同時存在的 KEY\n */\nexport type ITSPickBothDiff<T, U> = Pick<T & U, ITSKeyofBothDiff<T, U>>;\n\nexport type ITSPickBoth<T, U, K extends ITSKeyofBothSame<T, U> = ITSKeyofBothSame<T, U>> = Pick<T & U, K>;\n\n/**\n * @see https://stackoverflow.com/questions/49198713/override-the-properties-of-an-interface-in-typescript\n */\nexport type ITSPickMember<T, K extends keyof T> = T[K];\n\n/**\n * exclude all key in K at T\n * @deprecated\n */\nexport type ITSPickNot<T, K extends keyof T> = Omit<T, K>;\n\n/**\n * @see https://stackoverflow.com/questions/49198713/override-the-properties-of-an-interface-in-typescript\n *\n * @example\n * export interface A1 { s: string;}\n * export declare type A2 = ITSOverwrite<A1, { s: number; }>;\n * export declare let a2: A2;\n */\nexport type ITSOverwrite<T, U> = Omit<T, keyof U> & U;\n\n/**\n * @example\n * type Test1 = { id: number, code: string }\n * type Test2 = { id: string, code: number }\n * type Test3 = ITSMergeBoth<Test1, Test2>\n * export const x: Test3 = { id: \"bob\", code: \"bob\" }\n * @see https://github.com/microsoft/TypeScript/issues/35627\n */\nexport type ITSMergeBoth<T, U> = ITSPickBothDiff<T, U> & Pick<T | U, ITSKeyofBothSame<T, U>>;\n\n/**\n * pick K and mark as Required\n */\nexport type ITSRequiredPick<T, K extends keyof T = keyof T> = {\n\t[P in K]-?: T[P];\n};\n\n/**\n * pick K and mark as Partial\n */\nexport type ITSPartialPick<T, K extends keyof T = keyof T> = {\n\t[P in K]?: T[P];\n};\n\n/**\n * clone a type and mark all RK is Required, PK is Partial\n */\nexport type ITSPickExtra<T, RK extends keyof T, PK extends Exclude<keyof T, RK> = Exclude<keyof T, RK>> =\n\tITSRequiredPick<T, RK>\n\t& ITSPartialPick<T, PK>;\n\n/**\n * clone a type and mark all RK is Required, PK is Partial\n */\nexport type ITSPickExtra2<T, PK extends keyof T, RK extends Exclude<keyof T, PK> = Exclude<keyof T, PK>> =\n\tITSRequiredPick<T, RK>\n\t& ITSPartialPick<T, PK>;\n\nexport type ITSRequiredWith<T, K extends keyof T> = Omit<T, K> & ITSRequiredPick<T, K>;\nexport type ITSPartialWith<T, K extends keyof T> = Omit<T, K> & ITSPartialPick<T, K>;\n\n/**\n * https://stackoverflow.com/questions/40510611/typescript-interface-require-one-of-two-properties-to-exist\n */\nexport type ITSRequireAtLeastOne<T, Keys extends keyof T = keyof T> =\n\tOmit<T, Keys>\n\t& {\n\t[K in Keys]-?: ITSRequiredPick<T, K>\n\t& ITSPartialPick<T, Exclude<Keys, K>>\n}[Keys];\n\n/**\n * https://stackoverflow.com/questions/40510611/typescript-interface-require-one-of-two-properties-to-exist\n */\nexport type ITSRequireOnlyOne<T, Keys extends keyof T = keyof T> =\n\tOmit<T, Keys>\n\t& {\n\t[K in Keys]-?: ITSRequiredPick<T, K>\n\t& Partial<Record<Exclude<Keys, K>, never>>\n}[Keys];\n\n"]}
1
+ {"version":3,"file":"record.js","sourceRoot":"","sources":["record.ts"],"names":[],"mappings":";AAAA;;GAEG","sourcesContent":["/**\n * Created by user on 2019/6/11.\n */\n\nimport type { ITSKeyofBothDiff, ITSKeyofBothSame, ITSKeyofDiff, ITSKeyofSame } from '../helper/filter';\n\nexport type { ITSRequireRecord, ITSPartialRecord } from '../type/record/partial';\n\n/**\n * @deprecated\n */\nexport type ITSDiff<T extends keyof any, U extends keyof any> = (\n\t{ [P in T]: P }\n\t&\n\t{ [P in U]: never }\n\t&\n\t{ [x: string]: never }\n\t)[T];\n\nexport type ITSPickSame<T, U> = Pick<T, ITSKeyofSame<T, U>>;\nexport type ITSPickDiff<T, U> = Pick<T, ITSKeyofDiff<T, U>>;\n\n/**\n * 生成一個新類型 具有 T 與 U 當中同時存在的 KEY\n */\nexport type ITSPickBothSame<T, U> = Pick<T & U, ITSKeyofBothSame<T, U>>;\n/**\n * 生成一個新類型 不具有 T 與 U 當中同時存在的 KEY\n */\nexport type ITSPickBothDiff<T, U> = Pick<T & U, ITSKeyofBothDiff<T, U>>;\n\nexport type ITSPickBoth<T, U, K extends ITSKeyofBothSame<T, U> = ITSKeyofBothSame<T, U>> = Pick<T & U, K>;\n\n/**\n * @see https://stackoverflow.com/questions/49198713/override-the-properties-of-an-interface-in-typescript\n */\nexport type ITSPickMember<T, K extends keyof T> = T[K];\n\n/**\n * exclude all key in K at T\n * @deprecated\n */\nexport type ITSPickNot<T, K extends keyof T> = Omit<T, K>;\n\n/**\n * @see https://stackoverflow.com/questions/49198713/override-the-properties-of-an-interface-in-typescript\n *\n * @example\n * export interface A1 { s: string;}\n * export declare type A2 = ITSOverwrite<A1, { s: number; }>;\n * export declare let a2: A2;\n */\nexport type ITSOverwrite<T, U> = Omit<T, keyof U> & U;\n\n/**\n * @example\n * type Test1 = { id: number, code: string }\n * type Test2 = { id: string, code: number }\n * type Test3 = ITSMergeBoth<Test1, Test2>\n * export const x: Test3 = { id: \"bob\", code: \"bob\" }\n * @see https://github.com/microsoft/TypeScript/issues/35627\n */\nexport type ITSMergeBoth<T, U> = ITSPickBothDiff<T, U> & Pick<T | U, ITSKeyofBothSame<T, U>>;\n\n/**\n * pick K and mark as Required\n */\nexport type ITSRequiredPick<T, K extends keyof T = keyof T> = {\n\t[P in K]-?: T[P];\n};\n\n/**\n * pick K and mark as Partial\n */\nexport type ITSPartialPick<T, K extends keyof T = keyof T> = {\n\t[P in K]?: T[P];\n};\n\n/**\n * clone a type and mark all RK is Required, PK is Partial\n */\nexport type ITSPickExtra<T, RK extends keyof T, PK extends Exclude<keyof T, RK> = Exclude<keyof T, RK>> =\n\tITSRequiredPick<T, RK>\n\t& ITSPartialPick<T, PK>;\n\n/**\n * clone a type and mark all RK is Required, PK is Partial\n */\nexport type ITSPickExtra2<T, PK extends keyof T, RK extends Exclude<keyof T, PK> = Exclude<keyof T, PK>> =\n\tITSRequiredPick<T, RK>\n\t& ITSPartialPick<T, PK>;\n\nexport type ITSRequiredWith<T, K extends keyof T> = Omit<T, K> & ITSRequiredPick<T, K>;\nexport type ITSPartialWith<T, K extends keyof T> = Omit<T, K> & ITSPartialPick<T, K>;\n\n/**\n * https://stackoverflow.com/questions/40510611/typescript-interface-require-one-of-two-properties-to-exist\n */\nexport type ITSRequireAtLeastOne<T, Keys extends keyof T = keyof T> =\n\tOmit<T, Keys>\n\t& {\n\t[K in Keys]-?: ITSRequiredPick<T, K>\n\t& ITSPartialPick<T, Exclude<Keys, K>>\n}[Keys];\n\n/**\n * https://stackoverflow.com/questions/40510611/typescript-interface-require-one-of-two-properties-to-exist\n */\nexport type ITSRequireOnlyOne<T, Keys extends keyof T = keyof T> =\n\tOmit<T, Keys>\n\t& {\n\t[K in Keys]-?: ITSRequiredPick<T, K>\n\t& Partial<Record<Exclude<Keys, K>, never>>\n}[Keys];\n"]}
@@ -1,2 +1,2 @@
1
1
  import { ITSArrayListMaybeReadonly } from '../base';
2
- export declare type ITSEmptyTuple = ITSArrayListMaybeReadonly<never>;
2
+ export type ITSEmptyTuple = ITSArrayListMaybeReadonly<never>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-type",
3
- "version": "2.1.10",
3
+ "version": "3.0.1",
4
4
  "description": "add some typescript type and re-export some build-in typescript type",
5
5
  "keywords": [
6
6
  ".d.ts",
@@ -33,7 +33,8 @@
33
33
  },
34
34
  "repository": {
35
35
  "type": "git",
36
- "url": "git+https://github.com/bluelovers/ws-ts-type.git"
36
+ "url": "git+https://github.com/bluelovers/ws-ts-type.git",
37
+ "directory": "packages/ts-type"
37
38
  },
38
39
  "license": "ISC",
39
40
  "author": "",
@@ -44,25 +45,42 @@
44
45
  },
45
46
  "scripts": {
46
47
  "pretest": "yarn run build",
47
- "test": "yarn run ts:check",
48
+ "test": "yarn run ts:check && yarn run test:tsd",
49
+ "test:jest": "jest --passWithNoTests",
50
+ "test:jest:snapshot": "yarn run test:jest -- -u",
51
+ "test:snapshot": "yarn run test -- -u",
52
+ "test:tsd": "tsd",
48
53
  "build": "yarn run build-lib-toc",
49
54
  "build-lib-toc": "ynpx ts-node ./test/script/toc && yarn run build:toc",
50
- "build:toc": "tsc -p ./ --isolatedModules --noStrictGenericChecks --skipLibCheck & echo build:toc",
55
+ "build:toc": "tsc --noStrictGenericChecks --skipLibCheck & echo build:toc",
51
56
  "preversion": "yarn run test && yarn run postpublish:git:commit",
52
57
  "prepublishOnly": "echo prepublishOnly",
53
58
  "postpublish:git:commit": "git commit -m \"build(release): publish\" ./lib/index.d.ts & echo postpublish:git:commit",
54
- "ncu": "npx yarn-tool ncu -u",
55
- "sort-package-json": "npx yarn-tool sort",
56
- "ts:check": "tsc --noEmit -p tsconfig.check.json"
59
+ "ncu": "yarn-tool ncu -u",
60
+ "sort-package-json": "yarn-tool sort",
61
+ "ts:check": "tsc -p tsconfig.check.json --emitDeclarationOnly --skipLibCheck"
57
62
  },
58
63
  "dependencies": {
59
- "tslib": "^2",
64
+ "@types/node": "*",
65
+ "tslib": ">=2",
60
66
  "typedarray-dts": "^1.0.0"
61
67
  },
62
68
  "peerDependencies": {
63
- "@types/bluebird": "*",
64
- "@types/node": "*",
65
69
  "ts-toolbelt": "^9.6.0"
66
70
  },
67
- "gitHead": "39049cae0123305c59b08c33069075b99411f4f4"
71
+ "gitHead": "fa34eea119b9bcbb363061ddffcfe9d78c2d0ddd",
72
+ "tsd": {
73
+ "compilerOptions": {
74
+ "skipLibCheck": true,
75
+ "emitDeclarationOnly": true,
76
+ "noUnusedParameters": false,
77
+ "allowUnusedLabels": true,
78
+ "noUnusedLocals": false,
79
+ "noPropertyAccessFromIndexSignature": false
80
+ },
81
+ "directory": "test/spec",
82
+ "testFiles": [
83
+ "test/spec/**/*.ts"
84
+ ]
85
+ }
68
86
  }
package/ts-toolbelt.js CHANGED
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,13 +0,0 @@
1
- /**
2
- * for Iterator IteratorResult
3
- */
4
- /**
5
- * @see https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html
6
- */
7
- import { ITSMapLike, ITSResolvable, ITSTypeFunction } from '../generic';
8
- export declare type ITSUnpackedReturnType<T extends (...args: any[]) => any> = ITSUnpacked<ReturnType<T>>;
9
- export declare type ITSUnpacked<T> = T extends ITSMapLike<any, infer U> ? U : T extends (infer U)[] ? U : T extends ArrayLike<infer U> ? U : T extends Iterator<infer U> ? U : T extends IteratorResult<infer U> ? U : T extends ITSTypeFunction<infer U> ? U : T extends ITSResolvable<infer U> ? U : T;
10
- export declare type ITSUnpackedPromiseLike<T> = T extends ITSResolvable<infer U> ? U : T;
11
- export declare type ITSUnpackedIteratorLike<T extends Iterator<any> | IteratorResult<any>> = T extends Iterator<infer U> ? ITSUnpacked<U> : T extends IteratorResult<infer U> ? ITSUnpacked<U> : T;
12
- export declare type ITSUnpackedArrayLike<T extends ArrayLike<any> | any[]> = T extends (infer U)[] ? ITSUnpacked<U> : T extends readonly (infer U)[] ? ITSUnpacked<U> : T extends ArrayLike<infer U> ? ITSUnpacked<U> : T;
13
- export declare type ITSUnpackedThisFunction<T extends (...args: any[]) => any> = T extends (this: infer R, ...args: any[]) => any ? R : unknown;
@@ -1 +0,0 @@
1
- {"version":3,"file":"unpacked.js","sourceRoot":"","sources":["unpacked.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * for Iterator IteratorResult\n */\n/**\n * @see https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html\n */\nimport { ITSMapLike, ITSResolvable, ITSTypeFunction } from '../generic';\n\nexport type ITSUnpackedReturnType<T extends (...args: any[]) => any> =\n\tITSUnpacked<ReturnType<T>>\n//\tT extends ITSTypeFunction<infer R>\n//\t\t? ITSUnpacked<R>\n//\t\t: T\n\t;\nexport type ITSUnpacked<T> =\n\tT extends ITSMapLike<any, infer U> ? U :\n\t\tT extends (infer U)[] ? U :\n\t\t\tT extends ArrayLike<infer U> ? U :\n\t\t\t\tT extends Iterator<infer U> ? U :\n\t\t\t\t\tT extends IteratorResult<infer U> ? U :\n\t\t\t\t\t\tT extends ITSTypeFunction<infer U> ? U :\n\t\t\t\t\t\t\tT extends ITSResolvable<infer U> ? U :\n\t\t\t\t\t\t\t\t//T extends Promise<infer U> ? U :\n\t\t\t\t\t\t\t\tT\n\t;\nexport type ITSUnpackedPromiseLike<T> =\n\tT extends ITSResolvable<infer U> ? U :\n\t\tT\n\t;\nexport type ITSUnpackedIteratorLike<T extends Iterator<any> | IteratorResult<any>> =\n\tT extends Iterator<infer U> ? ITSUnpacked<U> :\n\t\tT extends IteratorResult<infer U> ? ITSUnpacked<U> :\n\t\t\tT\n\t;\nexport type ITSUnpackedArrayLike<T extends ArrayLike<any> | any[]> =\n\tT extends (infer U)[] ? ITSUnpacked<U> :\n\t\tT extends readonly (infer U)[] ? ITSUnpacked<U> :\n\t\t\tT extends ArrayLike<infer U> ? ITSUnpacked<U> :\n\t\t\t\tT\n\t;\n\nexport type ITSUnpackedThisFunction<T extends (...args: any[]) => any> =\n\tT extends (this: infer R, ...args: any[]) => any\n\t\t? R\n\t\t: unknown;\n"]}
@@ -1,19 +0,0 @@
1
- /**
2
- * Created by user on 2019/5/17.
3
- */
4
- import Bluebird from 'bluebird';
5
- import { ITSUnpackedReturnType, ITSKeyOfRecordExtractToKey, ITSUnpackedPromiseLike, ITSAnyFunction } from '..';
6
- export declare type IBluebird<T> = Bluebird<T>;
7
- export declare type ITSBluebird<T> = Bluebird<T>;
8
- export declare type ITSWrapFunctionBluebird<T extends (...args: any[]) => any> = (...args: Parameters<T>) => IBluebird<ITSUnpackedReturnType<T>>;
9
- export declare type ITSBluebirdPromisifyAll<T extends {
10
- [p: string | symbol]: ITSAnyFunction;
11
- }, K extends ITSKeyOfRecordExtractToKey<T, Function> = ITSKeyOfRecordExtractToKey<T, Function>> = Omit<T, K> & {
12
- [P in K]: (...argv: Parameters<T[P]>) => IBluebird<ITSUnpackedPromiseLike<ReturnType<T[P]>>>;
13
- };
14
- export declare type ITSPromisifyAll<T extends {
15
- [p: string | symbol]: ITSAnyFunction;
16
- }, K extends ITSKeyOfRecordExtractToKey<T, Function> = ITSKeyOfRecordExtractToKey<T, Function>> = Omit<T, K> & {
17
- [P in K]: (...argv: Parameters<T[P]>) => Promise<ITSUnpackedPromiseLike<ReturnType<T[P]>>>;
18
- };
19
- export declare type ITSResultArrayToBluebirdInspection<T> = T extends [infer T1, infer T2, infer T3, infer T4, infer T5] ? [Bluebird.Inspection<T1>, Bluebird.Inspection<T2>, Bluebird.Inspection<T3>, Bluebird.Inspection<T4>, Bluebird.Inspection<T5>] : T extends [infer T1, infer T2, infer T3, infer T4] ? [Bluebird.Inspection<T1>, Bluebird.Inspection<T2>, Bluebird.Inspection<T3>, Bluebird.Inspection<T4>] : T extends [infer T1, infer T2, infer T3] ? [Bluebird.Inspection<T1>, Bluebird.Inspection<T2>, Bluebird.Inspection<T3>] : T extends [infer T1, infer T2] ? [Bluebird.Inspection<T1>, Bluebird.Inspection<T2>] : T extends [infer T1] ? [Bluebird.Inspection<T1>] : T extends (infer R)[] ? Bluebird.Inspection<R>[] : never;
@@ -1 +0,0 @@
1
- {"version":3,"file":"bluebird.js","sourceRoot":"","sources":["bluebird.ts"],"names":[],"mappings":";AAAA;;GAEG","sourcesContent":["/**\n * Created by user on 2019/5/17.\n */\n\nimport Bluebird from 'bluebird';\nimport { ITSUnpackedReturnType, ITSKeyOfRecordExtractToKey, ITSUnpackedPromiseLike, ITSAnyFunction } from '..';\n\nexport type IBluebird<T> = Bluebird<T>;\nexport type ITSBluebird<T> = Bluebird<T>;\n\nexport type ITSWrapFunctionBluebird<T extends (...args: any[]) => any> =\n\t(...args: Parameters<T>) => IBluebird<ITSUnpackedReturnType<T>>;\n\nexport type ITSBluebirdPromisifyAll<T extends {\n\t[p: string | symbol]: ITSAnyFunction\n}, K extends ITSKeyOfRecordExtractToKey<T, Function> = ITSKeyOfRecordExtractToKey<T, Function>> = Omit<T, K> & {\n\t[P in K]: (...argv: Parameters<T[P]>) => IBluebird<ITSUnpackedPromiseLike<ReturnType<T[P]>>>\n}\n\nexport type ITSPromisifyAll<T extends {\n\t[p: string | symbol]: ITSAnyFunction\n}, K extends ITSKeyOfRecordExtractToKey<T, Function> = ITSKeyOfRecordExtractToKey<T, Function>> = Omit<T, K> & {\n\t[P in K]: (...argv: Parameters<T[P]>) => Promise<ITSUnpackedPromiseLike<ReturnType<T[P]>>>\n}\n\nexport type ITSResultArrayToBluebirdInspection<T> = T extends [infer T1, infer T2, infer T3, infer T4, infer T5] ? [Bluebird.Inspection<T1>, Bluebird.Inspection<T2>, Bluebird.Inspection<T3>, Bluebird.Inspection<T4>, Bluebird.Inspection<T5>] : T extends [infer T1, infer T2, infer T3, infer T4] ? [Bluebird.Inspection<T1>, Bluebird.Inspection<T2>, Bluebird.Inspection<T3>, Bluebird.Inspection<T4>] : T extends [infer T1, infer T2, infer T3] ? [Bluebird.Inspection<T1>, Bluebird.Inspection<T2>, Bluebird.Inspection<T3>] : T extends [infer T1, infer T2] ? [Bluebird.Inspection<T1>, Bluebird.Inspection<T2>] : T extends [infer T1] ? [Bluebird.Inspection<T1>] : T extends (infer R)[] ? Bluebird.Inspection<R>[] : never;\n"]}
@@ -1,17 +0,0 @@
1
- {
2
- "extends": "@bluelovers/tsconfig/esm/mapfile.json",
3
- "compilerOptions": {
4
- "skipLibCheck": true,
5
- "noEmit": true,
6
- "declaration": false
7
- },
8
- "exclude": [
9
- "node_modules",
10
- "./node_modules",
11
- "./node_modules/*",
12
- "**/node_modules/*",
13
- "**/test/script/*",
14
- "**/test/demo/*",
15
- "**/test/temp/*"
16
- ]
17
- }