@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # @mirohq-internal/design-system-types
2
2
 
3
- ## 1.0.1-aria-label-icon-button.1
3
+ ## 1.0.1-aria-label-icon-button.2
4
4
 
5
5
  ### Patch Changes
6
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mirohq/design-system-types",
3
- "version": "1.0.1-aria-label-icon-button.1",
3
+ "version": "1.0.1-aria-label-icon-button.2",
4
4
  "description": "",
5
5
  "author": "Miro",
6
6
  "types": "src/index.d.ts",
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 ? Pretty<T & U> : never
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.