@infra-blocks/types 0.16.0-alpha.0 → 0.17.0-alpha.0
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/lib/cjs/types.d.ts +13 -0
- package/lib/esm/types.d.ts +13 -0
- package/package.json +1 -1
package/lib/cjs/types.d.ts
CHANGED
|
@@ -15,6 +15,12 @@ export type EnvVars = EnvironmentVariables;
|
|
|
15
15
|
export type KeyOfType<T, U> = {
|
|
16
16
|
[P in keyof T]: T[P] extends U ? P : never;
|
|
17
17
|
}[keyof T];
|
|
18
|
+
/**
|
|
19
|
+
* A mapped type remapping all keys of K to type V.
|
|
20
|
+
*/
|
|
21
|
+
export type MapKeys<K, V> = {
|
|
22
|
+
[k in keyof K]: V;
|
|
23
|
+
};
|
|
18
24
|
/**
|
|
19
25
|
* Convenient type alias to regroup a type that can be T, null or undefined.
|
|
20
26
|
*
|
|
@@ -31,6 +37,13 @@ export type Optional<T, K extends keyof T = keyof T> = Partial<Pick<T, K>> & Omi
|
|
|
31
37
|
* A union type that includes all primitive types.
|
|
32
38
|
*/
|
|
33
39
|
export type Primitive = bigint | boolean | null | number | string | symbol | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* A type utility useful to constrain types to have the same keys as M, without imposing
|
|
42
|
+
* restrictions on the value.
|
|
43
|
+
*
|
|
44
|
+
* It's an alias for MapKeys<M, unknown>.
|
|
45
|
+
*/
|
|
46
|
+
export type SameKeys<M> = MapKeys<M, unknown>;
|
|
34
47
|
/**
|
|
35
48
|
* A convenience type mapping that transitively make partial fields optional.
|
|
36
49
|
*
|
package/lib/esm/types.d.ts
CHANGED
|
@@ -15,6 +15,12 @@ export type EnvVars = EnvironmentVariables;
|
|
|
15
15
|
export type KeyOfType<T, U> = {
|
|
16
16
|
[P in keyof T]: T[P] extends U ? P : never;
|
|
17
17
|
}[keyof T];
|
|
18
|
+
/**
|
|
19
|
+
* A mapped type remapping all keys of K to type V.
|
|
20
|
+
*/
|
|
21
|
+
export type MapKeys<K, V> = {
|
|
22
|
+
[k in keyof K]: V;
|
|
23
|
+
};
|
|
18
24
|
/**
|
|
19
25
|
* Convenient type alias to regroup a type that can be T, null or undefined.
|
|
20
26
|
*
|
|
@@ -31,6 +37,13 @@ export type Optional<T, K extends keyof T = keyof T> = Partial<Pick<T, K>> & Omi
|
|
|
31
37
|
* A union type that includes all primitive types.
|
|
32
38
|
*/
|
|
33
39
|
export type Primitive = bigint | boolean | null | number | string | symbol | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* A type utility useful to constrain types to have the same keys as M, without imposing
|
|
42
|
+
* restrictions on the value.
|
|
43
|
+
*
|
|
44
|
+
* It's an alias for MapKeys<M, unknown>.
|
|
45
|
+
*/
|
|
46
|
+
export type SameKeys<M> = MapKeys<M, unknown>;
|
|
34
47
|
/**
|
|
35
48
|
* A convenience type mapping that transitively make partial fields optional.
|
|
36
49
|
*
|