@mirohq/design-system-types 1.0.1-aria-label-icon-button.1 → 1.0.1-aria-label-icon-button.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/CHANGELOG.md +1 -1
- package/package.json +1 -1
- package/src/global.d.ts +9 -1
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
package/src/global.d.ts
CHANGED
|
@@ -17,6 +17,14 @@ export type Pretty<T> = { [K in keyof T]: T[K] } & {}
|
|
|
17
17
|
*/
|
|
18
18
|
export type Nullable<T> = T | null | undefined
|
|
19
19
|
|
|
20
|
+
/**
|
|
21
|
+
* Assigns properties from U to T, overwriting T's properties with U's if they overlap.
|
|
22
|
+
* @example
|
|
23
|
+
* type Result = Assign<{a: 1, b: 2}, {b: 3, c: 4}>
|
|
24
|
+
* // { a: 1; b: 3; c: 4 }
|
|
25
|
+
*/
|
|
26
|
+
export type Assign<T, U> = Pretty<Omit<T, keyof U> & U>
|
|
27
|
+
|
|
20
28
|
/**
|
|
21
29
|
* A type that can be a number or a string representation of a number.
|
|
22
30
|
*
|
|
@@ -94,7 +102,7 @@ export type MergeUnion<T, U> = {
|
|
|
94
102
|
* type Result = AddToUnion<Union, Foo>
|
|
95
103
|
* { foo: number, id: number } | { bar: string, id: number }
|
|
96
104
|
*/
|
|
97
|
-
export type AddToUnion<T, U> = T extends any ?
|
|
105
|
+
export type AddToUnion<T, U> = T extends any ? Assign<T, U> : never
|
|
98
106
|
|
|
99
107
|
/**
|
|
100
108
|
* Convert a type into a union of the value itself and an array of the value.
|