@tolki/types 1.1.1 → 1.1.2
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/package.json +1 -1
- package/src/enums.d.ts +15 -7
package/package.json
CHANGED
package/src/enums.d.ts
CHANGED
|
@@ -1,22 +1,30 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Extract the case key names from the _cases tuple.
|
|
3
3
|
*/
|
|
4
|
-
export type CaseKeys<TEnum extends EnumConst> =
|
|
4
|
+
export type CaseKeys<TEnum extends EnumConst> = NonNullable<
|
|
5
|
+
TEnum["_cases"]
|
|
6
|
+
>[number];
|
|
5
7
|
|
|
6
8
|
/**
|
|
7
9
|
* Extracts the instance method key names from the `_methods` tuple.
|
|
8
10
|
*/
|
|
9
|
-
export type MethodKeys<TEnum extends EnumConst> =
|
|
11
|
+
export type MethodKeys<TEnum extends EnumConst> = NonNullable<
|
|
12
|
+
TEnum["_methods"]
|
|
13
|
+
>[number];
|
|
10
14
|
|
|
11
15
|
/**
|
|
12
16
|
* Extracts the static helper key names from the `_static` tuple.
|
|
13
17
|
*/
|
|
14
|
-
export type StaticKeys<TEnum extends EnumConst> =
|
|
18
|
+
export type StaticKeys<TEnum extends EnumConst> = NonNullable<
|
|
19
|
+
TEnum["_static"]
|
|
20
|
+
>[number];
|
|
15
21
|
|
|
16
22
|
/**
|
|
17
23
|
* Extracts the helper key names from the `_helpers` tuple.
|
|
18
24
|
*/
|
|
19
|
-
export type HelperKeys<TEnum extends EnumConst> =
|
|
25
|
+
export type HelperKeys<TEnum extends EnumConst> = NonNullable<
|
|
26
|
+
TEnum["_helpers"]
|
|
27
|
+
>[number];
|
|
20
28
|
|
|
21
29
|
/**
|
|
22
30
|
* Constraint for all generated enum const objects.
|
|
@@ -29,9 +37,9 @@ export type HelperKeys<TEnum extends EnumConst> = TEnum["_helpers"][number];
|
|
|
29
37
|
* - `_static` lists static helper method names added to the enum.
|
|
30
38
|
*/
|
|
31
39
|
export type EnumConst = {
|
|
32
|
-
readonly _cases
|
|
33
|
-
readonly _methods
|
|
34
|
-
readonly _static
|
|
40
|
+
readonly _cases?: readonly string[];
|
|
41
|
+
readonly _methods?: readonly string[];
|
|
42
|
+
readonly _static?: readonly string[];
|
|
35
43
|
readonly [key: string]: unknown;
|
|
36
44
|
};
|
|
37
45
|
|