main
Last change
on this file was 0c6b92a, checked in by stefan toskovski <stefantoska84@…>, 6 weeks ago |
Pred finalna verzija
|
-
Property mode
set to
100644
|
File size:
1.3 KB
|
Line | |
---|
1 | import whichBoxedPrimitive from 'which-boxed-primitive';
|
---|
2 | import whichCollection from 'which-collection';
|
---|
3 | import whichTypedArray from 'which-typed-array';
|
---|
4 |
|
---|
5 | type AsyncFunction<T = unknown> = (...args: unknown[]) => Promise<T>;
|
---|
6 |
|
---|
7 | declare function whichBuiltinType<T>(value: Parameters<typeof whichCollection>[0]): ReturnType<typeof whichCollection>;
|
---|
8 | declare function whichBuiltinType<T>(value: Parameters<typeof whichTypedArray>[0]): ReturnType<typeof whichTypedArray>;
|
---|
9 | declare function whichBuiltinType<T>(value: ReadonlyArray<T>): 'Array';
|
---|
10 | declare function whichBuiltinType<T>(value: Date): 'Date';
|
---|
11 | declare function whichBuiltinType<T>(value: RegExp): 'RegExp';
|
---|
12 | declare function whichBuiltinType<T>(value: T extends object ? WeakRef<T> : never): 'WeakRef';
|
---|
13 | declare function whichBuiltinType<T>(value: FinalizationRegistry<T>): 'FinalizationRegistry';
|
---|
14 | declare function whichBuiltinType<T>(value: GeneratorFunction): 'GeneratorFunction';
|
---|
15 | declare function whichBuiltinType<T>(value: AsyncFunction<T>): 'AsyncFunction';
|
---|
16 | declare function whichBuiltinType<T>(value: Function): 'Function';
|
---|
17 | declare function whichBuiltinType<T>(value: Promise<T>): 'Promise';
|
---|
18 |
|
---|
19 | declare function whichBuiltinType<T>(value: T): 'Object' | Exclude<ReturnType<typeof whichBoxedPrimitive>, null | undefined> | string;
|
---|
20 |
|
---|
21 | export = whichBuiltinType;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.