@infra-blocks/types 0.24.0 → 0.25.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 +12 -0
- package/lib/esm/types.d.ts +12 -0
- package/package.json +1 -1
package/lib/cjs/types.d.ts
CHANGED
|
@@ -96,3 +96,15 @@ export type TransitivePartial<T> = {
|
|
|
96
96
|
* See here: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html
|
|
97
97
|
*/
|
|
98
98
|
export type UnpackedArray<T> = T extends (infer U)[] ? U : never;
|
|
99
|
+
/**
|
|
100
|
+
* Returns a type where fields have selectively been made partial.
|
|
101
|
+
*/
|
|
102
|
+
export type WithPartial<T, K extends keyof T> = Omit<T, K> & {
|
|
103
|
+
[P in K]?: T[P];
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* Returns a type where fields have selectively been made required.
|
|
107
|
+
*/
|
|
108
|
+
export type WithRequired<T, K extends keyof T> = Omit<T, K> & {
|
|
109
|
+
[P in K]-?: T[P];
|
|
110
|
+
};
|
package/lib/esm/types.d.ts
CHANGED
|
@@ -96,3 +96,15 @@ export type TransitivePartial<T> = {
|
|
|
96
96
|
* See here: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html
|
|
97
97
|
*/
|
|
98
98
|
export type UnpackedArray<T> = T extends (infer U)[] ? U : never;
|
|
99
|
+
/**
|
|
100
|
+
* Returns a type where fields have selectively been made partial.
|
|
101
|
+
*/
|
|
102
|
+
export type WithPartial<T, K extends keyof T> = Omit<T, K> & {
|
|
103
|
+
[P in K]?: T[P];
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* Returns a type where fields have selectively been made required.
|
|
107
|
+
*/
|
|
108
|
+
export type WithRequired<T, K extends keyof T> = Omit<T, K> & {
|
|
109
|
+
[P in K]-?: T[P];
|
|
110
|
+
};
|