@contember/utilities 1.2.0-alpha.1

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.
Files changed (175) hide show
  1. package/dist/development/assert-types/AssertionError.js +9 -0
  2. package/dist/development/assert-types/AssertionError.js.map +1 -0
  3. package/dist/development/assert-types/Predicates.js +84 -0
  4. package/dist/development/assert-types/Predicates.js.map +1 -0
  5. package/dist/development/assert-types/assert.js +10 -0
  6. package/dist/development/assert-types/assert.js.map +1 -0
  7. package/dist/development/class-name/Internal/deduplicateClassName.js +7 -0
  8. package/dist/development/class-name/Internal/deduplicateClassName.js.map +1 -0
  9. package/dist/development/class-name/Internal/flatClassNameList.js +15 -0
  10. package/dist/development/class-name/Internal/flatClassNameList.js.map +1 -0
  11. package/dist/development/class-name/classNameFor.js +18 -0
  12. package/dist/development/class-name/classNameFor.js.map +1 -0
  13. package/dist/development/class-name/listClassName.js +9 -0
  14. package/dist/development/class-name/listClassName.js.map +1 -0
  15. package/dist/development/class-name/stateClassName.js +14 -0
  16. package/dist/development/class-name/stateClassName.js.map +1 -0
  17. package/dist/development/css-utilities/px.js +7 -0
  18. package/dist/development/css-utilities/px.js.map +1 -0
  19. package/dist/development/dom/getMatchingParentElement.js +17 -0
  20. package/dist/development/dom/getMatchingParentElement.js.map +1 -0
  21. package/dist/development/dom/getSizeFromResizeObserverEntry.js +24 -0
  22. package/dist/development/dom/getSizeFromResizeObserverEntry.js.map +1 -0
  23. package/dist/development/dom/isScrollable.js +22 -0
  24. package/dist/development/dom/isScrollable.js.map +1 -0
  25. package/dist/development/dom/parseTransformMatrix.js +29 -0
  26. package/dist/development/dom/parseTransformMatrix.js.map +1 -0
  27. package/dist/development/dom/svgSizeProps.js +15 -0
  28. package/dist/development/dom/svgSizeProps.js.map +1 -0
  29. package/dist/development/functional/pick.js +15 -0
  30. package/dist/development/functional/pick.js.map +1 -0
  31. package/dist/development/functional/setHasOneOf.js +7 -0
  32. package/dist/development/functional/setHasOneOf.js.map +1 -0
  33. package/dist/development/index.js +54 -0
  34. package/dist/development/index.js.map +1 -0
  35. package/dist/development/string-utilities/capitalize.js +7 -0
  36. package/dist/development/string-utilities/capitalize.js.map +1 -0
  37. package/dist/development/string-utilities/trimString.js +8 -0
  38. package/dist/development/string-utilities/trimString.js.map +1 -0
  39. package/dist/production/assert-types/AssertionError.js +9 -0
  40. package/dist/production/assert-types/AssertionError.js.map +1 -0
  41. package/dist/production/assert-types/Predicates.js +84 -0
  42. package/dist/production/assert-types/Predicates.js.map +1 -0
  43. package/dist/production/assert-types/assert.js +10 -0
  44. package/dist/production/assert-types/assert.js.map +1 -0
  45. package/dist/production/class-name/Internal/deduplicateClassName.js +7 -0
  46. package/dist/production/class-name/Internal/deduplicateClassName.js.map +1 -0
  47. package/dist/production/class-name/Internal/flatClassNameList.js +15 -0
  48. package/dist/production/class-name/Internal/flatClassNameList.js.map +1 -0
  49. package/dist/production/class-name/classNameFor.js +18 -0
  50. package/dist/production/class-name/classNameFor.js.map +1 -0
  51. package/dist/production/class-name/listClassName.js +9 -0
  52. package/dist/production/class-name/listClassName.js.map +1 -0
  53. package/dist/production/class-name/stateClassName.js +14 -0
  54. package/dist/production/class-name/stateClassName.js.map +1 -0
  55. package/dist/production/css-utilities/px.js +7 -0
  56. package/dist/production/css-utilities/px.js.map +1 -0
  57. package/dist/production/dom/getMatchingParentElement.js +17 -0
  58. package/dist/production/dom/getMatchingParentElement.js.map +1 -0
  59. package/dist/production/dom/getSizeFromResizeObserverEntry.js +24 -0
  60. package/dist/production/dom/getSizeFromResizeObserverEntry.js.map +1 -0
  61. package/dist/production/dom/isScrollable.js +22 -0
  62. package/dist/production/dom/isScrollable.js.map +1 -0
  63. package/dist/production/dom/parseTransformMatrix.js +29 -0
  64. package/dist/production/dom/parseTransformMatrix.js.map +1 -0
  65. package/dist/production/dom/svgSizeProps.js +15 -0
  66. package/dist/production/dom/svgSizeProps.js.map +1 -0
  67. package/dist/production/functional/pick.js +15 -0
  68. package/dist/production/functional/pick.js.map +1 -0
  69. package/dist/production/functional/setHasOneOf.js +7 -0
  70. package/dist/production/functional/setHasOneOf.js.map +1 -0
  71. package/dist/production/index.js +54 -0
  72. package/dist/production/index.js.map +1 -0
  73. package/dist/production/string-utilities/capitalize.js +7 -0
  74. package/dist/production/string-utilities/capitalize.js.map +1 -0
  75. package/dist/production/string-utilities/trimString.js +8 -0
  76. package/dist/production/string-utilities/trimString.js.map +1 -0
  77. package/dist/types/assert-types/AssertionError.d.ts +4 -0
  78. package/dist/types/assert-types/AssertionError.d.ts.map +1 -0
  79. package/dist/types/assert-types/Predicates.d.ts +21 -0
  80. package/dist/types/assert-types/Predicates.d.ts.map +1 -0
  81. package/dist/types/assert-types/assert.d.ts +2 -0
  82. package/dist/types/assert-types/assert.d.ts.map +1 -0
  83. package/dist/types/assert-types/index.d.ts +4 -0
  84. package/dist/types/assert-types/index.d.ts.map +1 -0
  85. package/dist/types/class-name/Internal/deduplicateClassName.d.ts +2 -0
  86. package/dist/types/class-name/Internal/deduplicateClassName.d.ts.map +1 -0
  87. package/dist/types/class-name/Internal/flatClassNameList.d.ts +3 -0
  88. package/dist/types/class-name/Internal/flatClassNameList.d.ts.map +1 -0
  89. package/dist/types/class-name/Types.d.ts +5 -0
  90. package/dist/types/class-name/Types.d.ts.map +1 -0
  91. package/dist/types/class-name/classNameFor.d.ts +13 -0
  92. package/dist/types/class-name/classNameFor.d.ts.map +1 -0
  93. package/dist/types/class-name/index.d.ts +5 -0
  94. package/dist/types/class-name/index.d.ts.map +1 -0
  95. package/dist/types/class-name/listClassName.d.ts +8 -0
  96. package/dist/types/class-name/listClassName.d.ts.map +1 -0
  97. package/dist/types/class-name/stateClassName.d.ts +13 -0
  98. package/dist/types/class-name/stateClassName.d.ts.map +1 -0
  99. package/dist/types/css-utilities/index.d.ts +2 -0
  100. package/dist/types/css-utilities/index.d.ts.map +1 -0
  101. package/dist/types/css-utilities/px.d.ts +6 -0
  102. package/dist/types/css-utilities/px.d.ts.map +1 -0
  103. package/dist/types/dom/getMatchingParentElement.d.ts +2 -0
  104. package/dist/types/dom/getMatchingParentElement.d.ts.map +1 -0
  105. package/dist/types/dom/getSizeFromResizeObserverEntry.d.ts +5 -0
  106. package/dist/types/dom/getSizeFromResizeObserverEntry.d.ts.map +1 -0
  107. package/dist/types/dom/index.d.ts +6 -0
  108. package/dist/types/dom/index.d.ts.map +1 -0
  109. package/dist/types/dom/isScrollable.d.ts +7 -0
  110. package/dist/types/dom/isScrollable.d.ts.map +1 -0
  111. package/dist/types/dom/parseTransformMatrix.d.ts +15 -0
  112. package/dist/types/dom/parseTransformMatrix.d.ts.map +1 -0
  113. package/dist/types/dom/svgSizeProps.d.ts +7 -0
  114. package/dist/types/dom/svgSizeProps.d.ts.map +1 -0
  115. package/dist/types/functional/index.d.ts +3 -0
  116. package/dist/types/functional/index.d.ts.map +1 -0
  117. package/dist/types/functional/pick.d.ts +2 -0
  118. package/dist/types/functional/pick.d.ts.map +1 -0
  119. package/dist/types/functional/setHasOneOf.d.ts +2 -0
  120. package/dist/types/functional/setHasOneOf.d.ts.map +1 -0
  121. package/dist/types/index.d.ts +8 -0
  122. package/dist/types/index.d.ts.map +1 -0
  123. package/dist/types/string-utilities/capitalize.d.ts +2 -0
  124. package/dist/types/string-utilities/capitalize.d.ts.map +1 -0
  125. package/dist/types/string-utilities/index.d.ts +3 -0
  126. package/dist/types/string-utilities/index.d.ts.map +1 -0
  127. package/dist/types/string-utilities/trimString.d.ts +9 -0
  128. package/dist/types/string-utilities/trimString.d.ts.map +1 -0
  129. package/dist/types/tsconfig.tsbuildinfo +1 -0
  130. package/dist/types/typescript-utilities/DeepPartial.d.ts +4 -0
  131. package/dist/types/typescript-utilities/DeepPartial.d.ts.map +1 -0
  132. package/dist/types/typescript-utilities/NonNullableRequired.d.ts +4 -0
  133. package/dist/types/typescript-utilities/NonNullableRequired.d.ts.map +1 -0
  134. package/dist/types/typescript-utilities/ObjectKeyValue.d.ts +4 -0
  135. package/dist/types/typescript-utilities/ObjectKeyValue.d.ts.map +1 -0
  136. package/dist/types/typescript-utilities/PolymorphicRefs.d.ts +37 -0
  137. package/dist/types/typescript-utilities/PolymorphicRefs.d.ts.map +1 -0
  138. package/dist/types/typescript-utilities/Try.d.ts +2 -0
  139. package/dist/types/typescript-utilities/Try.d.ts.map +1 -0
  140. package/dist/types/typescript-utilities/index.d.ts +6 -0
  141. package/dist/types/typescript-utilities/index.d.ts.map +1 -0
  142. package/package.json +43 -0
  143. package/src/assert-types/AssertionError.ts +5 -0
  144. package/src/assert-types/Predicates.ts +61 -0
  145. package/src/assert-types/assert.ts +14 -0
  146. package/src/assert-types/index.ts +3 -0
  147. package/src/class-name/Internal/deduplicateClassName.ts +3 -0
  148. package/src/class-name/Internal/flatClassNameList.ts +13 -0
  149. package/src/class-name/Types.ts +2 -0
  150. package/src/class-name/classNameFor.ts +32 -0
  151. package/src/class-name/index.ts +4 -0
  152. package/src/class-name/listClassName.ts +12 -0
  153. package/src/class-name/stateClassName.ts +27 -0
  154. package/src/css-utilities/index.ts +1 -0
  155. package/src/css-utilities/px.ts +16 -0
  156. package/src/dom/getMatchingParentElement.ts +13 -0
  157. package/src/dom/getSizeFromResizeObserverEntry.ts +26 -0
  158. package/src/dom/index.ts +5 -0
  159. package/src/dom/isScrollable.ts +24 -0
  160. package/src/dom/parseTransformMatrix.ts +35 -0
  161. package/src/dom/svgSizeProps.ts +23 -0
  162. package/src/functional/index.ts +2 -0
  163. package/src/functional/pick.ts +13 -0
  164. package/src/functional/setHasOneOf.ts +3 -0
  165. package/src/index.ts +7 -0
  166. package/src/string-utilities/capitalize.ts +3 -0
  167. package/src/string-utilities/index.ts +2 -0
  168. package/src/string-utilities/trimString.ts +12 -0
  169. package/src/tsconfig.json +6 -0
  170. package/src/typescript-utilities/DeepPartial.ts +7 -0
  171. package/src/typescript-utilities/NonNullableRequired.ts +1 -0
  172. package/src/typescript-utilities/ObjectKeyValue.ts +1 -0
  173. package/src/typescript-utilities/PolymorphicRefs.ts +58 -0
  174. package/src/typescript-utilities/Try.ts +4 -0
  175. package/src/typescript-utilities/index.ts +5 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"svgSizeProps.d.ts","sourceRoot":"","sources":["../../../src/dom/svgSizeProps.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,YAAY;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,YAAY,CAC3B,KAAK,EAAE,MAAM,EACb,MAAM,CAAC,EAAE,MAAM,EACf,IAAI,GAAE,MAAU,GACd,YAAY,CAUd"}
@@ -0,0 +1,3 @@
1
+ export * from './pick';
2
+ export * from './setHasOneOf';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/functional/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAA;AACtB,cAAc,eAAe,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare function pick<T extends Object, K extends keyof T>(object: T, properties: K[]): Pick<T, K>;
2
+ //# sourceMappingURL=pick.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pick.d.ts","sourceRoot":"","sources":["../../../src/functional/pick.ts"],"names":[],"mappings":"AAAA,wBAAgB,IAAI,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAYhG"}
@@ -0,0 +1,2 @@
1
+ export declare function setHasOneOf<T>(set: Set<T>, values: T[]): boolean;
2
+ //# sourceMappingURL=setHasOneOf.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setHasOneOf.d.ts","sourceRoot":"","sources":["../../../src/functional/setHasOneOf.ts"],"names":[],"mappings":"AAAA,wBAAgB,WAAW,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,OAAO,CAEhE"}
@@ -0,0 +1,8 @@
1
+ export * from './assert-types';
2
+ export * from './class-name';
3
+ export * from './css-utilities';
4
+ export * from './dom';
5
+ export * from './functional';
6
+ export * from './string-utilities';
7
+ export * from './typescript-utilities';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,cAAc,CAAA;AAC5B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,OAAO,CAAA;AACrB,cAAc,cAAc,CAAA;AAC5B,cAAc,oBAAoB,CAAA;AAClC,cAAc,wBAAwB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare function capitalize(str: string): string;
2
+ //# sourceMappingURL=capitalize.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capitalize.d.ts","sourceRoot":"","sources":["../../../src/string-utilities/capitalize.ts"],"names":[],"mappings":"AAAA,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,UAErC"}
@@ -0,0 +1,3 @@
1
+ export * from './capitalize';
2
+ export * from './trimString';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/string-utilities/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Trims the provided string of any characters in the provided set.
3
+ *
4
+ * @param value - The string to trim.
5
+ * @param characters - The characters to remove.
6
+ * @returns The trimmed string.
7
+ */
8
+ export declare function trimString(value: string, characters: string): string;
9
+ //# sourceMappingURL=trimString.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trimString.d.ts","sourceRoot":"","sources":["../../../src/string-utilities/trimString.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,UAI3D"}
@@ -0,0 +1 @@
1
+ {"program":{"fileNames":["../../../../node_modules/typescript/lib/lib.es5.d.ts","../../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../../node_modules/typescript/lib/lib.es2021.d.ts","../../../../node_modules/typescript/lib/lib.es2022.d.ts","../../../../node_modules/typescript/lib/lib.es2023.d.ts","../../../../node_modules/typescript/lib/lib.esnext.d.ts","../../../../node_modules/typescript/lib/lib.dom.d.ts","../../../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../../../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../../../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../../node_modules/typescript/lib/lib.es2023.array.d.ts","../../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../../node_modules/typescript/lib/lib.decorators.d.ts","../../../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../../node_modules/@types/react/global.d.ts","../../../../node_modules/@types/react/node_modules/csstype/index.d.ts","../../../../node_modules/@types/prop-types/index.d.ts","../../../../node_modules/@types/scheduler/tracing.d.ts","../../../../node_modules/@types/react/index.d.ts","../../../../node_modules/@types/react/jsx-runtime.d.ts","../../src/assert-types/AssertionError.ts","../../src/assert-types/Predicates.ts","../../src/assert-types/assert.ts","../../src/assert-types/index.ts","../../src/class-name/Types.ts","../../src/class-name/Internal/deduplicateClassName.ts","../../src/class-name/Internal/flatClassNameList.ts","../../src/class-name/stateClassName.ts","../../src/class-name/classNameFor.ts","../../src/class-name/listClassName.ts","../../src/class-name/index.ts","../../src/css-utilities/px.ts","../../src/css-utilities/index.ts","../../src/dom/getMatchingParentElement.ts","../../src/dom/getSizeFromResizeObserverEntry.ts","../../src/dom/isScrollable.ts","../../src/dom/parseTransformMatrix.ts","../../src/dom/svgSizeProps.ts","../../src/dom/index.ts","../../src/functional/pick.ts","../../src/functional/setHasOneOf.ts","../../src/functional/index.ts","../../src/string-utilities/capitalize.ts","../../src/string-utilities/trimString.ts","../../src/string-utilities/index.ts","../../src/typescript-utilities/DeepPartial.ts","../../src/typescript-utilities/NonNullableRequired.ts","../../src/typescript-utilities/ObjectKeyValue.ts","../../src/typescript-utilities/PolymorphicRefs.ts","../../src/typescript-utilities/Try.ts","../../src/typescript-utilities/index.ts","../../src/index.ts","../../node_modules/vite/types/hmrPayload.d.ts","../../node_modules/vite/types/customEvent.d.ts","../../node_modules/vite/types/hot.d.ts","../../node_modules/vite/types/importGlob.d.ts","../../node_modules/vite/types/importMeta.d.ts","../../node_modules/vite/client.d.ts"],"fileInfos":[{"version":"6a6b471e7e43e15ef6f8fe617a22ce4ecb0e34efa6c3dfcfe7cebd392bcca9d2","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","dc48272d7c333ccf58034c0026162576b7d50ea0e69c3b9292f803fc20720fd5","27147504487dc1159369da4f4da8a26406364624fa9bc3db632f7d94a5bae2c3","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc","f4e736d6c8d69ae5b3ab0ddfcaa3dc365c3e76909d6660af5b4e979b3934ac20","eeeb3aca31fbadef8b82502484499dfd1757204799a6f5b33116201c810676ec",{"version":"fcd3ecc9f764f06f4d5c467677f4f117f6abf49dee6716283aa204ff1162498b","affectsGlobalScope":true},{"version":"9a60b92bca4c1257db03b349d58e63e4868cfc0d1c8d0ba60c2dbc63f4e6c9f6","affectsGlobalScope":true},{"version":"f296963760430fb65b4e5d91f0ed770a91c6e77455bacf8fa23a1501654ede0e","affectsGlobalScope":true},{"version":"5114a95689b63f96b957e00216bc04baf9e1a1782aa4d8ee7e5e9acbf768e301","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"ab22100fdd0d24cfc2cc59d0a00fc8cf449830d9c4030dc54390a46bd562e929","affectsGlobalScope":true},{"version":"f7bd636ae3a4623c503359ada74510c4005df5b36de7f23e1db8a5c543fd176b","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"0c20f4d2358eb679e4ae8a4432bdd96c857a2960fd6800b21ec4008ec59d60ea","affectsGlobalScope":true},{"version":"36ae84ccc0633f7c0787bc6108386c8b773e95d3b052d9464a99cd9b8795fbec","affectsGlobalScope":true},{"version":"82d0d8e269b9eeac02c3bd1c9e884e85d483fcb2cd168bccd6bc54df663da031","affectsGlobalScope":true},{"version":"b8deab98702588840be73d67f02412a2d45a417a3c097b2e96f7f3a42ac483d1","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"376d554d042fb409cb55b5cbaf0b2b4b7e669619493c5d18d5fa8bd67273f82a","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"c4138a3dd7cd6cf1f363ca0f905554e8d81b45844feea17786cdf1626cb8ea06","affectsGlobalScope":true},{"version":"6ff3e2452b055d8f0ec026511c6582b55d935675af67cdb67dd1dc671e8065df","affectsGlobalScope":true},{"version":"03de17b810f426a2f47396b0b99b53a82c1b60e9cba7a7edda47f9bb077882f4","affectsGlobalScope":true},{"version":"8184c6ddf48f0c98429326b428478ecc6143c27f79b79e85740f17e6feb090f1","affectsGlobalScope":true},{"version":"261c4d2cf86ac5a89ad3fb3fafed74cbb6f2f7c1d139b0540933df567d64a6ca","affectsGlobalScope":true},{"version":"6af1425e9973f4924fca986636ac19a0cf9909a7e0d9d3009c349e6244e957b6","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"15a630d6817718a2ddd7088c4f83e4673fde19fa992d2eae2cf51132a302a5d3","affectsGlobalScope":true},{"version":"b7e9f95a7387e3f66be0ed6db43600c49cec33a3900437ce2fd350d9b7cb16f2","affectsGlobalScope":true},{"version":"01e0ee7e1f661acedb08b51f8a9b7d7f959e9cdb6441360f06522cc3aea1bf2e","affectsGlobalScope":true},{"version":"ac17a97f816d53d9dd79b0d235e1c0ed54a8cc6a0677e9a3d61efb480b2a3e4e","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"ec0104fee478075cb5171e5f4e3f23add8e02d845ae0165bfa3f1099241fa2aa","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"9cc66b0513ad41cb5f5372cca86ef83a0d37d1c1017580b7dace3ea5661836df","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"709efdae0cb5df5f49376cde61daacc95cdd44ae4671da13a540da5088bf3f30","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"61ed9b6d07af959e745fb11f9593ecd743b279418cc8a99448ea3cd5f3b3eb22","affectsGlobalScope":true},{"version":"038a2f66a34ee7a9c2fbc3584c8ab43dff2995f8c68e3f566f4c300d2175e31e","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"f5c92f2c27b06c1a41b88f6db8299205aee52c2a2943f7ed29bd585977f254e8","affectsGlobalScope":true},{"version":"b7feb7967c6c6003e11f49efa8f5de989484e0a6ba2e5a6c41b55f8b8bd85dba","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"b9ea5778ff8b50d7c04c9890170db34c26a5358cccba36844fe319f50a43a61a","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"50d53ccd31f6667aff66e3d62adf948879a3a16f05d89882d1188084ee415bbc","affectsGlobalScope":true},{"version":"25de46552b782d43cb7284df22fe2a265de387cf0248b747a7a1b647d81861f6","affectsGlobalScope":true},{"version":"307c8b7ebbd7f23a92b73a4c6c0a697beca05b06b036c23a34553e5fe65e4fdc","affectsGlobalScope":true},{"version":"189c0703923150aa30673fa3de411346d727cc44a11c75d05d7cf9ef095daa22","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},{"version":"bbdf156fea2fabed31a569445835aeedcc33643d404fcbaa54541f06c109df3f","affectsGlobalScope":true},"1c29793071152b207c01ea1954e343be9a44d85234447b2b236acae9e709a383","6a386ff939f180ae8ef064699d8b7b6e62bc2731a62d7fbf5e02589383838dea","f5a8b384f182b3851cec3596ccc96cb7464f8d3469f48c74bf2befb782a19de5",{"version":"7fb6faf1006c3503d44e4922c8c65772ddc98e92bad7c2ae2d5db123f3e297b3","affectsGlobalScope":true},"af7fd2870746deed40e130fc0a3966de74e8f52a97ec114d0fbb35876ab05ca9",{"version":"13f2427f34067116c49878ad494e92c56b52463c77c4c55819e9b0730025965b","signature":"f341c93fefe964ea97c5106e3d93c4271bb3951a06a34e08da704c6faf871380"},{"version":"88dc99a641cda908fb2647b56f7e561b4742de4b5c3c4ce3394b43ade918e039","signature":"d008cfe24f8735737cd75c908b4a46595eed628952fb1c8866f592d72ebab3f9"},{"version":"e7853e7bce4e7e11666c82df8a226415fbf7de650c82d6dac8572c2ffe8faf65","signature":"fd476e29349bf7fa3585d85a418d12fbbe9ca7003f890388d8689b5bd22ae49a"},{"version":"83e56db1200bf740a707420f0a2b316b05444a8deda514427dfa9819c1a6fa02","signature":"4208294e49e360d85181893edd94b4fe4b2ae35c39f0e76f8edfb8d0cc6a958a"},{"version":"2eebfe7d680655d3ab0d1b8e9f71804aaf538eabd71839de7a62081f410f2df7","signature":"e6de7bbbc8f1b4516625a0d9b3baf5d5e2188993caa4c6c0fd2bcd57f0b906f1"},{"version":"bb4cfffa30415c521dfc0be75fb4cfdfce1f485a7d08d4fc4df536819d658c38","signature":"854e693935e706cde39ec782c3d16ba2d76923d71accba703d21c71bba284184"},{"version":"cd3fbf137c38d697cf8bec57895d3bb998ca3c4ae585708c27fbab7334f17f06","signature":"406c7d457f84ed86693c309f1f46a3bdce2c2fe67f6d047b6ab50db258983ba2"},{"version":"e0d45a0d35e0a998f9e5eb9a02115e6aa1410a5ce8c7969f7cb9ad34153f199f","signature":"a81f32494df0e41ff9ccd7ad0ebf03bd3cf57dc6cb3c9d6725f2b7e985b6cfb4"},{"version":"391c6ee2054f43b1a26871124c679e44d0fab0352389e7a5bb5b3d24941c7601","signature":"a19199399eded44250cd989ec6ac0b64b9a64082012cc561a27cd96e3f9d347b"},{"version":"b9ca15e67d870c25dd57a91e43d8f8291d88e8692ce7447ed4baaf25d83f6324","signature":"adf99208c7680acbbf39170aaa798b9914286e2c4ef83f301ca45b233b49a737"},{"version":"b89214dcac57155320bb9cf7ba88561b7e1098c0e4666ba1b9b8b9a4da814e56","signature":"e5f85f0166a2f3e45a23dba6435c306d6ab412ede158aa52c29836a83dfb23bf"},{"version":"25d656f630df5c2b4e0d3b120892fcd4eb78ec7743e1fa8479ed0d4c2eedb8fb","signature":"afd44534064f3d94cd248096074344857d9e8aaa787eb209b155002f76b44271"},{"version":"405f3a410f0c1cdb8126c8409ef7f218dbba2af35f9f53778e0a60734cb23f46","signature":"f3c9d693e0597f6b1b5dd49bd0beaaa237bd491508991ea3c72b47d3c7d20fdb"},{"version":"543ce9b4b87803c99f166d6e3f90652a909d5626e10231c1557c388b1419aba5","signature":"7bd62fc2cefeeb76bf935279de114a8f509d70232badea6f02c5235b8efd08a7"},{"version":"c2ac220afabd9933ec7b6751c9c37fb6f1839585b8081f92925950a0e3afea0d","signature":"cc9bdde4319a73448db9e4dd8dc256d04f0060b90383b4563c3a32a3b67780d5"},{"version":"3bf2c6c3e4f9636becb3fea0617e5ae27928c39543d47cece5ffd2c00c7cdeb0","signature":"2a5d65d9ef97588e66e1eb9ba088e3bcd8fad77f56319a34f206f042716d5f98"},{"version":"e68b3980e2d38c9ac16c81b3dc4cee6489c5082df866095f51ce6abbe64e679d","signature":"53870be174a4233e5ceb0b0f7d7b298eb5896f45782236f65cfce1e971e13a02"},{"version":"3501b66f7603d22f32ec06dd5a2c230eafd31b0ae533dd79c50184b2bbf92b2c","signature":"dfe644b96a0786c3ed103bffe7331349022c647802d40030067cf71c9ce79bb5"},{"version":"16e5c1869f25d1e6eefa21290326d85c799339fb9e55aa168d06d47341288a2c","signature":"80a16e6c4ae5e1fb7bb726540647fd0d687b441d275ee3b429fe46adbcd2820e"},{"version":"17cbbe7dc7137ca3dbf011ca90d77b42dd917a40aef0f81b5d73be8849ef4cae","signature":"16803990fe6e4e75f83a6a35bb69afa0ea6eb7af218c17e67e9449e4e44bd280"},{"version":"20007a789c4bec1b24093c39203f971723fa7806e4e575b158db328dd3218566","signature":"f4d6688e7084a99a025d570c620544d5235668cf2fe90acc8b5b311729c83816"},{"version":"2d874f4c0327f883e2845a847c2cf60208b94f4df005f4e38a51655fe13f5f30","signature":"016afc13dc57e151a2cebeefbf07b95fbb7429a4c75b79979021d82728e78b83"},{"version":"609a034689c6272371e2ab6d9d35ca593c10b1d053492d9b1412712d9350e376","signature":"7a8119cc3d41a3adfa818800df5899f1bf3cc68eed005e44a85c218dbcf3889a"},{"version":"d60cf96c92f012c979331d554725e739f42e4a65d883e4f5c0bd86b48ff699bc","signature":"1ea04e06101a73c7896a461675bd5a429b121c5cb6de24c94332ff102d145a98"},{"version":"4ca57602e6ed95c5322431c397d38e4eff9b7b6e1d84490979a8f84e9c46d916","signature":"3c1cda1ddaa0975a89502446e0c8932df2b242971d832648dd380268351e7bf9"},{"version":"b193362fc3d502de7cc1c31f51037605f3a26752d0cd181efce9c9b86972d3ba","signature":"d6339e78331aef24260e77249cc452ab8487ed3308a7bdc06135e7b465587127"},{"version":"a9db385b3a290a1de5b97a12f0aa8fe7abb7336e00c6a73180ea7c7e81d7b6f5","signature":"e1e25bc3db37f4722303072a8f02c3d9408d7c226e2f070f45dc21a7c0214be7"},{"version":"834478dcb2876e3b8b8a7e856d6c424188111bb62bd940a0dada748e65be8517","signature":"325430df8b9df3d182ab9edfa79b6f772eced949949620db3f2cef29091b24ed"},{"version":"7d646d55a57cc0cdd74073194e4e2d2f1f3120c4a0dfad30645128d4907b373d","signature":"28d766affdde4aa6fd61b870f4d738cfcdb7388f4f26565eba7d0aca87831131"},{"version":"302297fde1a88f9d8d48b2c028fbf0c6f7f96187feb8da342b1174945de43da2","signature":"b182b44845c33c2c049c56bbc090c182f8a39e55362b266fdc6871299567a597"},{"version":"7658943bed2b41b6f0183c75cc9605f1207661952d0b5518923007317a71c660","signature":"611934171fe82ad4c214817603caab99c5ae1844cfe4b18edcd2724fe35cb9f5"},{"version":"028beb9aecb3945f3bd8247e62160167861b119ca0a5c936a96f7707050cdf69","signature":"9e47c559935123ff2dd8a8b7c07e93c6ac139a4b72ebac8fee3ae3a879e39717"},"bcb6ea18f23dae2c48459d7b86d3adccd6898f824fcbf9da08b935f559896580","0aa7220845f5f3902fe043f646f9d9218bd7dd6c4046e8471580866ea6b03aa2","4d5fb5d6b35f731b2ae4d9d7c592d48e91d6de531dd130628edf4eba16add893","739c2c46edc112421fc023c24b4898b1f413f792bb6a02b40ba182c648e56c2f",{"version":"df93bb67d5ae7be3d599323de42e12cb8da59f0b490c3186ae91d493632b5e36","affectsGlobalScope":true},{"version":"f8b8b34c4f7651c9f7b126af8affda4139a0499e62e74f0f8dc2be36e9f14b59","affectsGlobalScope":true}],"root":[[68,99]],"options":{"allowSyntheticDefaultImports":true,"composite":true,"declaration":true,"declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":true,"experimentalDecorators":true,"jsx":4,"module":99,"noEmitOnError":true,"noImplicitOverride":true,"outDir":"./","skipLibCheck":true,"sourceMap":true,"strict":true,"target":7,"useDefineForClassFields":true},"fileIdsList":[[62,63,64,65],[66],[104],[100],[101],[102,103],[67],[67,68],[67,68,69,70],[67,72],[67,72,73,74,75],[67,72,75,76,77],[67,73,74],[67,79],[67,81,82,83,84,85],[67,71],[66,67],[67,87,88],[67,71,78,80,86,89,92,98],[67,90,91],[67,93,94,95,96,97],[68,69,70],[72],[72,75,76,77],[79],[81,82,83,84,85],[87,88],[71,78,80,86,89,92,98],[90,91],[93,94,95,96,97]],"referencedMap":[[66,1],[67,2],[105,3],[101,4],[102,5],[104,6],[68,7],[69,7],[70,8],[71,9],[73,7],[74,10],[72,7],[76,11],[78,12],[77,13],[75,10],[80,14],[79,7],[81,7],[82,7],[86,15],[83,7],[84,16],[85,17],[89,18],[87,7],[88,7],[99,19],[90,7],[92,20],[91,7],[93,7],[94,7],[95,7],[96,7],[97,7],[98,21]],"exportedModulesMap":[[66,1],[67,2],[105,3],[101,4],[102,5],[104,6],[71,22],[74,23],[76,23],[78,24],[75,23],[80,25],[86,26],[89,27],[99,28],[92,29],[98,30]],"semanticDiagnosticsPerFile":[64,62,66,67,63,65,60,61,12,13,15,14,2,16,17,18,19,20,21,22,23,3,4,27,24,25,26,28,29,30,5,31,32,33,34,6,38,35,36,37,39,7,40,45,46,41,42,43,44,8,50,47,48,49,51,9,52,53,54,57,55,56,58,10,1,11,59,105,101,100,102,103,104,68,69,70,71,73,74,72,76,78,77,75,80,79,81,82,86,83,84,85,89,87,88,99,90,92,91,93,94,95,96,97,98],"latestChangedDtsFile":"./index.d.ts"},"version":"5.0.4"}
@@ -0,0 +1,4 @@
1
+ export type DeepPartial<T> = T extends Function ? T : T extends Array<infer InferredArrayMember> ? Array<DeepPartial<InferredArrayMember>> : T extends object ? {
2
+ [Key in keyof T]?: DeepPartial<T[Key]>;
3
+ } : T | undefined;
4
+ //# sourceMappingURL=DeepPartial.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeepPartial.d.ts","sourceRoot":"","sources":["../../../src/typescript-utilities/DeepPartial.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,QAAQ,GAC5C,CAAC,GACD,CAAC,SAAS,KAAK,CAAC,MAAM,mBAAmB,CAAC,GAC1C,KAAK,CAAC,WAAW,CAAC,mBAAmB,CAAC,CAAC,GACvC,CAAC,SAAS,MAAM,GAChB;KAAG,GAAG,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;CAAE,GAC1C,CAAC,GAAG,SAAS,CAAC"}
@@ -0,0 +1,4 @@
1
+ export type NonNullableRequired<T> = {
2
+ [P in keyof T]-?: NonNullable<T[P]>;
3
+ };
4
+ //# sourceMappingURL=NonNullableRequired.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NonNullableRequired.d.ts","sourceRoot":"","sources":["../../../src/typescript-utilities/NonNullableRequired.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,CAAC"}
@@ -0,0 +1,4 @@
1
+ export type ObjectKeyValue<T, K extends keyof T> = T extends {
2
+ [P in K]: T[P];
3
+ } ? T[K] : never;
4
+ //# sourceMappingURL=ObjectKeyValue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ObjectKeyValue.d.ts","sourceRoot":"","sources":["../../../src/typescript-utilities/ObjectKeyValue.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,CAAC,SAAS;KAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAE,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAA"}
@@ -0,0 +1,37 @@
1
+ export type PropsOf<C extends keyof JSX.IntrinsicElements | React.JSXElementConstructor<any>> = JSX.LibraryManagedAttributes<C, React.ComponentPropsWithoutRef<C>>;
2
+ export type AsProp<C extends React.ElementType> = {
3
+ /**
4
+ * An override of the default HTML tag.
5
+ * Can also be another React component.
6
+ */
7
+ as?: C;
8
+ };
9
+ /**
10
+ * Allows for extending a set of props (`ExtendedProps`) by an overriding set of props
11
+ * (`OverrideProps`), ensuring that any duplicates are overridden by the overriding
12
+ * set of props.
13
+ */
14
+ export type ExtendableProps<ExtendedProps = {}, OverrideProps = {}> = OverrideProps & Omit<ExtendedProps, keyof OverrideProps>;
15
+ /**
16
+ * Allows for inheriting the props from the specified element type so that
17
+ * props like children, className & style work, as well as element-specific
18
+ * attributes like aria roles. The component (`C`) must be passed in.
19
+ */
20
+ export type InheritableElementProps<C extends React.ElementType, Props = {}> = ExtendableProps<PropsOf<C>, Props>;
21
+ /**
22
+ * A more sophisticated version of `InheritableElementProps` where
23
+ * the passed in `as` prop will determine which props can be included
24
+ */
25
+ export type PolymorphicComponentProps<C extends React.ElementType, Props = {}> = InheritableElementProps<C, Props & AsProp<C>>;
26
+ /**
27
+ * Utility type to extract the `ref` prop from a polymorphic component
28
+ */
29
+ export type PolymorphicRef<C extends React.ElementType> = React.ComponentPropsWithRef<C>['ref'];
30
+ /**
31
+ * A wrapper of `PolymorphicComponentProps` that also includes the `ref`
32
+ * prop for the polymorphic component
33
+ */
34
+ export type PolymorphicComponentPropsWithRef<C extends React.ElementType, Props = {}> = PolymorphicComponentProps<C, Props> & {
35
+ ref?: PolymorphicRef<C>;
36
+ };
37
+ //# sourceMappingURL=PolymorphicRefs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PolymorphicRefs.d.ts","sourceRoot":"","sources":["../../../src/typescript-utilities/PolymorphicRefs.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,OAAO,CAClB,CAAC,SAAS,MAAM,GAAG,CAAC,iBAAiB,GAAG,KAAK,CAAC,qBAAqB,CAAC,GAAG,CAAC,IACrE,GAAG,CAAC,wBAAwB,CAAC,CAAC,EAAE,KAAK,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAAC,CAAA;AAEtE,MAAM,MAAM,MAAM,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,IAAI;IACjD;;;OAGG;IACH,EAAE,CAAC,EAAE,CAAC,CAAA;CACN,CAAA;AAED;;;;GAIG;AACH,MAAM,MAAM,eAAe,CAC1B,aAAa,GAAG,EAAE,EAClB,aAAa,GAAG,EAAE,IACf,aAAa,GAAG,IAAI,CAAC,aAAa,EAAE,MAAM,aAAa,CAAC,CAAA;AAE5D;;;;GAIG;AACH,MAAM,MAAM,uBAAuB,CAClC,CAAC,SAAS,KAAK,CAAC,WAAW,EAC3B,KAAK,GAAG,EAAE,IACP,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAA;AAEtC;;;GAGG;AACH,MAAM,MAAM,yBAAyB,CACpC,CAAC,SAAS,KAAK,CAAC,WAAW,EAC3B,KAAK,GAAG,EAAE,IACP,uBAAuB,CAAC,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;AAEjD;;GAEG;AACH,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;AAE/F;;;GAGG;AACH,MAAM,MAAM,gCAAgC,CAC3C,CAAC,SAAS,KAAK,CAAC,WAAW,EAC3B,KAAK,GAAG,EAAE,IACP,yBAAyB,CAAC,CAAC,EAAE,KAAK,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,CAAA;CAAE,CAAA"}
@@ -0,0 +1,2 @@
1
+ export type Try<A1, A2, Catch = never> = A1 extends A2 ? A1 : Catch;
2
+ //# sourceMappingURL=Try.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Try.d.ts","sourceRoot":"","sources":["../../../src/typescript-utilities/Try.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,GAAG,CAAC,EAAE,EAAE,EAAE,EAAE,KAAK,GAAG,KAAK,IACpC,EAAE,SAAS,EAAE,GACX,EAAE,GACF,KAAK,CAAA"}
@@ -0,0 +1,6 @@
1
+ export * from './DeepPartial';
2
+ export * from './NonNullableRequired';
3
+ export * from './ObjectKeyValue';
4
+ export * from './PolymorphicRefs';
5
+ export * from './Try';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/typescript-utilities/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,uBAAuB,CAAA;AACrC,cAAc,kBAAkB,CAAA;AAChC,cAAc,mBAAmB,CAAA;AACjC,cAAc,OAAO,CAAA"}
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "@contember/utilities",
3
+ "license": "Apache-2.0",
4
+ "version": "1.2.0-alpha.1",
5
+ "type": "module",
6
+ "sideEffects": false,
7
+ "main": "./dist/production/index.js",
8
+ "exports": {
9
+ ".": {
10
+ "import": {
11
+ "development": "./dist/development/index.js",
12
+ "production": "./dist/production/index.js",
13
+ "default": "./dist/production/index.js"
14
+ }
15
+ }
16
+ },
17
+ "files": [
18
+ "dist/",
19
+ "src/"
20
+ ],
21
+ "typings": "./dist/types/index.d.ts",
22
+ "scripts": {
23
+ "build": "yarn build:js:dev && yarn build:js:prod",
24
+ "build:js:dev": "vite build --mode development",
25
+ "build:js:prod": "vite build --mode production",
26
+ "ae:build": "api-extractor run --local",
27
+ "ae:test": "api-extractor run",
28
+ "test": "vitest"
29
+ },
30
+ "repository": {
31
+ "type": "git",
32
+ "url": "https://github.com/contember/interface.git",
33
+ "directory": "packages/utilities"
34
+ },
35
+ "peerDependencies": {
36
+ "react": "^17 || ^18"
37
+ },
38
+ "devDependencies": {
39
+ "vite": "^4",
40
+ "vitest": "^0"
41
+ },
42
+ "stableVersion": "0.0.0"
43
+ }
@@ -0,0 +1,5 @@
1
+ export class AssertionError extends Error {
2
+ constructor(value: unknown, that: string = 'value to pass assertion') {
3
+ super(`Expecting ${that}, ${JSON.stringify(value)} given`)
4
+ }
5
+ }
@@ -0,0 +1,61 @@
1
+ export function isNull(value: unknown): value is null {
2
+ return value === null
3
+ }
4
+ export function isNotNull<T>(value: unknown): value is T {
5
+ return value !== null
6
+ }
7
+ export function isUndefined(value: unknown): value is undefined {
8
+ return value === undefined
9
+ }
10
+ export function isDefined<T>(value: unknown): value is T {
11
+ return value !== undefined
12
+ }
13
+ export function isNotNullish<T>(value: T): value is Exclude<T, null | undefined> {
14
+ return value != null
15
+ }
16
+ export function isBoolean(value: unknown): value is boolean {
17
+ return typeof value === 'boolean'
18
+ }
19
+ export function isTrue(value: unknown): value is true {
20
+ return value === true
21
+ }
22
+ export function isFalse(value: unknown): value is false {
23
+ return value === false
24
+ }
25
+ export function isString(value: unknown): value is string {
26
+ return typeof value === 'string'
27
+ }
28
+ export function isNonEmptyString(value: unknown): value is string {
29
+ return isString(value) && value.length > 0
30
+ }
31
+ function isNonEmptyTrimmedStringFactory(trim: 'trim' | 'trimStart' | 'trimEnd' = 'trim') {
32
+ return function isNonEmptyString(value: unknown): value is string {
33
+ return isString(value) && value[trim]().length > 0
34
+ }
35
+ }
36
+ export const isNonEmptyTrimmedString = isNonEmptyTrimmedStringFactory()
37
+ export const isNonEmptyTrimmedStartString = isNonEmptyTrimmedStringFactory('trimStart')
38
+ export const isNonEmptyTrimmedEndString = isNonEmptyTrimmedStringFactory('trimEnd')
39
+ export function isNumber(value: unknown): value is number {
40
+ return typeof value === 'number' && value === value
41
+ }
42
+ export function isNonNegativeNumber(value: unknown): value is number {
43
+ return isNumber(value) && value >= 0
44
+ }
45
+ export function isNumericString(value: string): value is string {
46
+ return isString(value) && !isNaN(parseFloat(value))
47
+ }
48
+ export function isOneOfFactory<U, T = any>(options: T extends Array<U> | ReadonlyArray<U> ? T : never): (value: unknown) => value is U {
49
+ return function isOneOfProduct(value: unknown): value is U {
50
+ return options.includes(value as U)
51
+ }
52
+ }
53
+ export function isHTMLElement(value: unknown): value is HTMLElement {
54
+ return value instanceof HTMLElement
55
+ }
56
+ export function isObject(value: unknown): value is Object {
57
+ return typeof value === 'object' && value !== null
58
+ }
59
+ export function isPlainObject<T extends Record<string, unknown>>(value: unknown): value is T {
60
+ return isObject(value) && value.constructor === Object
61
+ }
@@ -0,0 +1,14 @@
1
+ import { AssertionError } from './AssertionError'
2
+
3
+ export function assert<
4
+ In,
5
+ Out extends In
6
+ >(
7
+ that: string | undefined = undefined,
8
+ value: In,
9
+ predicate: (value: In) => value is Out,
10
+ ): asserts value is Out {
11
+ if (!predicate(value)) {
12
+ throw new AssertionError(value, that)
13
+ }
14
+ }
@@ -0,0 +1,3 @@
1
+ export * from './AssertionError'
2
+ export * from './Predicates'
3
+ export * from './assert'
@@ -0,0 +1,3 @@
1
+ export function deduplicateClassName(classNameArray: string[]): string[] {
2
+ return [...new Set(classNameArray)]
3
+ }
@@ -0,0 +1,13 @@
1
+ import { NestedClassName } from '../Types'
2
+
3
+ export function flatClassNameList(className: NestedClassName): string[] {
4
+ if (className == null) {
5
+ return []
6
+ } else if (typeof className === 'string') {
7
+ return className.split(' ').filter(Boolean)
8
+ } else if (Array.isArray(className)) {
9
+ return className.map(flatClassNameList).flat(1)
10
+ } else {
11
+ throw new Error(`Unexpected className: ${JSON.stringify(className)}`)
12
+ }
13
+ }
@@ -0,0 +1,2 @@
1
+ export type NestedClassName = string | false | null | undefined | (string | false | null | undefined)[] | NestedClassName[]
2
+ export type ClassNameStateMap = { [key: string]: string | number | boolean | null | undefined }
@@ -0,0 +1,32 @@
1
+ import { deduplicateClassName } from './Internal/deduplicateClassName'
2
+ import { flatClassNameList } from './Internal/flatClassNameList'
3
+ import { ClassNameStateMap, NestedClassName } from './Types'
4
+ import { stateClassName } from './stateClassName'
5
+
6
+ /**
7
+ * Creates a function that can be used to generate class names for a component
8
+ *
9
+ * @param componentClassName - Base class name for the component.
10
+ * @param className - External class name passed to a component.
11
+ * @param state - State map object similar to the one used by `stateClassName`.
12
+ * @param glue - Glue to use between the component class name and the suffix, default is '-'. Set to '' to disable.
13
+ * @param stateGlue - Glue to use between the state class name and the value, default is '-'. Set to '' to disable.
14
+ * @returns Function that can be used to generate class names for a component and its sub-components.
15
+ */
16
+ export function classNameForFactory(componentClassName: NestedClassName, className?: NestedClassName, state?: ClassNameStateMap, glue: string = '-', stateGlue: string = '-') {
17
+ const classNameList: string[] = flatClassNameList(className)
18
+ const componentClassNameList: string[] = flatClassNameList(componentClassName)
19
+
20
+ return function classNameFor(suffix: string | null | undefined = null, additionalClassName: NestedClassName = null) {
21
+ return deduplicateClassName((!suffix
22
+ ? componentClassNameList.concat(classNameList)
23
+ : suffix.match(/^\w/)
24
+ ? componentClassNameList.map(componentClassName => `${componentClassName}${glue}${suffix}`)
25
+ : componentClassNameList.map(componentClassName => `${componentClassName}${suffix}`)
26
+ ).concat(
27
+ stateClassName(state, stateGlue),
28
+ ).concat(
29
+ flatClassNameList(additionalClassName),
30
+ )).join(' ')
31
+ }
32
+ }
@@ -0,0 +1,4 @@
1
+ export * from './Types'
2
+ export * from './classNameFor'
3
+ export * from './listClassName'
4
+ export * from './stateClassName'
@@ -0,0 +1,12 @@
1
+ import { deduplicateClassName } from './Internal/deduplicateClassName'
2
+ import { flatClassNameList } from './Internal/flatClassNameList'
3
+
4
+ /**
5
+ * Combines a list of class names into a single string, even nested
6
+ *
7
+ * @param list - List of class names
8
+ * @returns Combined class names as string
9
+ */
10
+ export function listClassName(list: (string | false | null | undefined)[]) {
11
+ return deduplicateClassName(flatClassNameList(list)).join(' ')
12
+ }
@@ -0,0 +1,27 @@
1
+ import { ClassNameStateMap } from './Types'
2
+
3
+ const UPPER_CASE_REG_EXP = /([A-Z])/g
4
+
5
+ function toKebabCase(value: string) {
6
+ return value.replace(UPPER_CASE_REG_EXP, '-$1').toLowerCase()
7
+ }
8
+
9
+ /**
10
+ * Combines a state map of class names into a single string
11
+ *
12
+ * @example
13
+ * stateClassName({ foo: true, bar: false, baz: 1 }) // => 'foo baz-1'
14
+ *
15
+ * @param state - State map object with class names as keys and literals as values.
16
+ * @param glue - Glue to use between the class name and the value, default is '-'. Set to '' to disable.
17
+ * @returns Combined class names as string
18
+ */
19
+ export function stateClassName(state: ClassNameStateMap | null = null, glue = '-'): string[] {
20
+ const entries = Object.entries(state ?? []).map(
21
+ ([className, value]) => value || value === 0
22
+ ? (value === true ? toKebabCase(className) : `${toKebabCase(className)}${glue}${value}`)
23
+ : '',
24
+ ).filter(Boolean)
25
+
26
+ return entries
27
+ }
@@ -0,0 +1 @@
1
+ export * from './px'
@@ -0,0 +1,16 @@
1
+ export function px<V extends number>(value: V): `${V}px`;
2
+ export function px<V extends false>(value: V): '';
3
+ export function px<V extends null>(value: V): '';
4
+ export function px<V extends undefined>(value: V): '';
5
+ // NOTE: Next overload fixes:
6
+ // The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible.
7
+ export function px<V extends number | false | null | undefined>(value?: V): string;
8
+ /**
9
+ * Converts a value to a string in the format '10px'
10
+ *
11
+ * @param value - The value to convert to a string.
12
+ * @returns Returns a string in the format '10px' or '' when value is falsy.
13
+ */
14
+ export function px<V extends number | false | null | undefined>(value?: V): string {
15
+ return typeof value === 'number' && !isNaN(value) ? value + 'px' : ''
16
+ }
@@ -0,0 +1,13 @@
1
+ export function getMatchingParentElement(element: HTMLElement | null, predicate: (element: HTMLElement | null) => boolean | Promise<boolean>): HTMLElement {
2
+ if (!element || !element.parentElement) {
3
+ if (document.scrollingElement instanceof HTMLElement) {
4
+ return document.scrollingElement
5
+ } else {
6
+ return document.body
7
+ }
8
+ } else if (predicate(element.parentElement)) {
9
+ return element.parentElement
10
+ } else {
11
+ return getMatchingParentElement(element.parentElement, predicate)
12
+ }
13
+ }
@@ -0,0 +1,26 @@
1
+ export function getSizeFromResizeObserverEntryFactory(box: ResizeObserverOptions['box']) {
2
+ return function getSizeFromResizeObserverEntry(entry: ResizeObserverEntry): { height: number, width: number } {
3
+ const boxSize = box === 'border-box'
4
+ ? entry.borderBoxSize
5
+ : box === 'content-box'
6
+ ? entry.contentBoxSize
7
+ : entry.devicePixelContentBoxSize
8
+
9
+ if (boxSize) {
10
+ const formatBoxSize: ResizeObserverSize[] = Array.isArray(boxSize) ? boxSize : [boxSize]
11
+
12
+ return formatBoxSize.reduce(
13
+ (previous, { inlineSize, blockSize }) => ({
14
+ width: previous.width + inlineSize,
15
+ height: previous.height + blockSize,
16
+ }),
17
+ { height: 0, width: 0 },
18
+ )
19
+ } else {
20
+ return {
21
+ width: entry.contentRect.width,
22
+ height: entry.contentRect.height,
23
+ }
24
+ }
25
+ }
26
+ }
@@ -0,0 +1,5 @@
1
+ export * from './getMatchingParentElement'
2
+ export * from './getSizeFromResizeObserverEntry'
3
+ export * from './isScrollable'
4
+ export * from './parseTransformMatrix'
5
+ export * from './svgSizeProps'
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Checks if an element is scrollable
3
+ * @param element - Element to check
4
+ * @returns Boolean indicating if the element is scrollable
5
+ */
6
+ export function isScrollable(element: HTMLElement | null) {
7
+ if (element === document.scrollingElement) {
8
+ return true
9
+ } else if (element instanceof HTMLElement) {
10
+ const contentOverflows = element.scrollHeight > element.clientHeight || element.scrollWidth > element.clientWidth
11
+
12
+ if (contentOverflows) {
13
+ if ((getComputedStyle(element)).overflow === 'hidden') {
14
+ return false
15
+ } else {
16
+ return contentOverflows
17
+ }
18
+ } else {
19
+ return false
20
+ }
21
+ } else {
22
+ return false
23
+ }
24
+ }
@@ -0,0 +1,35 @@
1
+ import { assert, isNumber } from '../assert-types'
2
+
3
+ const MATRIX_REG_EXP = /^matrix\((.+)\)/
4
+
5
+ function isTransformMatrixTuple(value: unknown): value is [number, number, number, number, number, number] {
6
+ if (Array.isArray(value) && value.length === 6 && value.filter(isNumber).length === 6) {
7
+ return true
8
+ } else {
9
+ return false
10
+ }
11
+ }
12
+
13
+ /**
14
+ * Parses a CSS transform matrix string into an object.
15
+ *
16
+ * @param transform - CSS transform matrix string.
17
+ * @returns Object with the transform matrix values or undefined.
18
+ */
19
+ export function parseTransformMatrix(transform = '') {
20
+ let matches: RegExpMatchArray | null = null
21
+
22
+ if (matches = transform.match(MATRIX_REG_EXP)) {
23
+ const vector = matches[1].split(',').map(value => parseFloat(value))
24
+ assert('transform matrix is tuple of six numbers', vector, isTransformMatrixTuple)
25
+
26
+ return {
27
+ scaleX: vector[0],
28
+ skewY: vector[1],
29
+ skewX: vector[2],
30
+ scaleY: vector[3],
31
+ translateX: vector[4],
32
+ translateY: vector[5],
33
+ }
34
+ }
35
+ }
@@ -0,0 +1,23 @@
1
+ import { SVGProps } from 'react'
2
+
3
+ export interface SvgSizeProps {
4
+ width: number;
5
+ height: number;
6
+ viewBox: string;
7
+ }
8
+
9
+ export function svgSizeProps(
10
+ width: number,
11
+ height?: number,
12
+ crop: number = 0,
13
+ ): SvgSizeProps {
14
+ const viewBoxWidth = width - crop * 2
15
+ const viewBoxHeight = (height ?? width) - crop * 2
16
+ const viewBoxX = crop
17
+ const viewBoxY = crop
18
+ return {
19
+ width: viewBoxWidth,
20
+ height: viewBoxHeight,
21
+ viewBox: `${viewBoxX} ${viewBoxY} ${viewBoxWidth} ${viewBoxHeight}`,
22
+ }
23
+ }
@@ -0,0 +1,2 @@
1
+ export * from './pick'
2
+ export * from './setHasOneOf'