/
TypeOfDictionary.ts
36 lines (36 loc) 路 1.17 KB
/
TypeOfDictionary.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/**
* `typeof` dictionary.
*
* @category Common
* @remarks
* Dictionary of types and their `typeof` values, including the proposed but
* never added type `"null"` for `null`.
* @example
* ```typescript
* TypeOfMap["string"]; // `string`
* TypeOfMap["boolean"]; // `boolean`
* TypeOfMap["function"]; // `GenericFunction`
* ```
* @see [typeof null bug](https://lou.cx/null-bug)
* @see [typeof typeof rejected proposal](https://lou.cx/null-typeof)
*/
export type TypeOfDictionary = {
/** {@link TypeOfDictionary} key for `BigInt` */
readonly bigint: bigint;
/** {@link TypeOfDictionary} key for `Boolean` */
readonly boolean: boolean;
/** {@link TypeOfDictionary} key for `Function` */
readonly function: Function;
/** {@link TypeOfDictionary} key for `null` */
readonly null: null;
/** {@link TypeOfDictionary} key for `Number` */
readonly number: number;
/** {@link TypeOfDictionary} key for `Object` */
readonly object: object;
/** {@link TypeOfDictionary} key for `String` */
readonly string: string;
/** {@link TypeOfDictionary} key for `Symbol` */
readonly symbol: symbol;
/** {@link TypeOfDictionary} key for `undefined` */
readonly undefined: undefined;
};