source: imaps-frontend/node_modules/which-builtin-type/index.d.ts

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 
1import whichBoxedPrimitive from 'which-boxed-primitive';
2import whichCollection from 'which-collection';
3import whichTypedArray from 'which-typed-array';
4
5type AsyncFunction<T = unknown> = (...args: unknown[]) => Promise<T>;
6
7declare function whichBuiltinType<T>(value: Parameters<typeof whichCollection>[0]): ReturnType<typeof whichCollection>;
8declare function whichBuiltinType<T>(value: Parameters<typeof whichTypedArray>[0]): ReturnType<typeof whichTypedArray>;
9declare function whichBuiltinType<T>(value: ReadonlyArray<T>): 'Array';
10declare function whichBuiltinType<T>(value: Date): 'Date';
11declare function whichBuiltinType<T>(value: RegExp): 'RegExp';
12declare function whichBuiltinType<T>(value: T extends object ? WeakRef<T> : never): 'WeakRef';
13declare function whichBuiltinType<T>(value: FinalizationRegistry<T>): 'FinalizationRegistry';
14declare function whichBuiltinType<T>(value: GeneratorFunction): 'GeneratorFunction';
15declare function whichBuiltinType<T>(value: AsyncFunction<T>): 'AsyncFunction';
16declare function whichBuiltinType<T>(value: Function): 'Function';
17declare function whichBuiltinType<T>(value: Promise<T>): 'Promise';
18
19declare function whichBuiltinType<T>(value: T): 'Object' | Exclude<ReturnType<typeof whichBoxedPrimitive>, null | undefined> | string;
20
21export = whichBuiltinType;
Note: See TracBrowser for help on using the repository browser.