@contember/utilities 2.0.0-alpha.2 → 2.0.0-alpha.21
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/api-extractor.json +3 -0
- package/dist/development/index.cjs +10 -33
- package/dist/development/index.cjs.map +1 -1
- package/dist/development/index.js +11 -34
- package/dist/development/index.js.map +1 -1
- package/dist/development/src/assert-types/assertNever.cjs.map +1 -0
- package/dist/development/src/assert-types/assertNever.js.map +1 -0
- package/dist/development/{deprecate → src/deprecate}/deprecate.cjs +1 -2
- package/dist/development/src/deprecate/deprecate.cjs.map +1 -0
- package/dist/development/{deprecate → src/deprecate}/deprecate.js +1 -2
- package/dist/development/src/deprecate/deprecate.js.map +1 -0
- package/dist/development/src/dom/dataAttribute.cjs.map +1 -0
- package/dist/development/src/dom/dataAttribute.js.map +1 -0
- package/dist/development/src/dom/svgSizeProps.cjs.map +1 -0
- package/dist/development/src/dom/svgSizeProps.js.map +1 -0
- package/dist/development/src/structures/BijectiveIndexedMap.cjs +116 -0
- package/dist/development/src/structures/BijectiveIndexedMap.cjs.map +1 -0
- package/dist/development/src/structures/BijectiveIndexedMap.js +116 -0
- package/dist/development/src/structures/BijectiveIndexedMap.js.map +1 -0
- package/dist/development/src/structures/LRUCache.cjs +32 -0
- package/dist/development/src/structures/LRUCache.cjs.map +1 -0
- package/dist/development/src/structures/LRUCache.js +32 -0
- package/dist/development/src/structures/LRUCache.js.map +1 -0
- package/dist/development/src/structures/WeakIdCache.cjs +30 -0
- package/dist/development/src/structures/WeakIdCache.cjs.map +1 -0
- package/dist/development/src/structures/WeakIdCache.js +30 -0
- package/dist/development/src/structures/WeakIdCache.js.map +1 -0
- package/dist/production/index.cjs +10 -33
- package/dist/production/index.cjs.map +1 -1
- package/dist/production/index.js +11 -34
- package/dist/production/index.js.map +1 -1
- package/dist/production/src/assert-types/assertNever.cjs.map +1 -0
- package/dist/production/src/assert-types/assertNever.js.map +1 -0
- package/dist/production/src/deprecate/deprecate.cjs.map +1 -0
- package/dist/production/src/deprecate/deprecate.js.map +1 -0
- package/dist/production/src/dom/dataAttribute.cjs.map +1 -0
- package/dist/production/src/dom/dataAttribute.js.map +1 -0
- package/dist/production/src/dom/svgSizeProps.cjs.map +1 -0
- package/dist/production/src/dom/svgSizeProps.js.map +1 -0
- package/dist/production/src/structures/BijectiveIndexedMap.cjs +116 -0
- package/dist/production/src/structures/BijectiveIndexedMap.cjs.map +1 -0
- package/dist/production/src/structures/BijectiveIndexedMap.js +116 -0
- package/dist/production/src/structures/BijectiveIndexedMap.js.map +1 -0
- package/dist/production/src/structures/LRUCache.cjs +32 -0
- package/dist/production/src/structures/LRUCache.cjs.map +1 -0
- package/dist/production/src/structures/LRUCache.js +32 -0
- package/dist/production/src/structures/LRUCache.js.map +1 -0
- package/dist/production/src/structures/WeakIdCache.cjs +30 -0
- package/dist/production/src/structures/WeakIdCache.cjs.map +1 -0
- package/dist/production/src/structures/WeakIdCache.js +30 -0
- package/dist/production/src/structures/WeakIdCache.js.map +1 -0
- package/dist/types/assert-types/index.d.ts +0 -4
- package/dist/types/assert-types/index.d.ts.map +1 -1
- package/dist/types/dom/index.d.ts +0 -4
- package/dist/types/dom/index.d.ts.map +1 -1
- package/dist/types/dom/svgSizeProps.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -6
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/structures/BijectiveIndexedMap.d.ts +24 -0
- package/dist/types/structures/BijectiveIndexedMap.d.ts.map +1 -0
- package/dist/types/structures/LRUCache.d.ts +9 -0
- package/dist/types/structures/LRUCache.d.ts.map +1 -0
- package/dist/types/structures/WeakIdCache.d.ts +9 -0
- package/dist/types/structures/WeakIdCache.d.ts.map +1 -0
- package/dist/types/structures/index.d.ts +4 -0
- package/dist/types/structures/index.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dist/types/types/index.d.ts +0 -1
- package/dist/types/types/index.d.ts.map +1 -1
- package/package.json +4 -12
- package/src/assert-types/index.ts +0 -4
- package/src/dom/index.ts +0 -4
- package/src/dom/svgSizeProps.ts +3 -3
- package/src/index.ts +1 -6
- package/src/structures/BijectiveIndexedMap.ts +137 -0
- package/src/structures/LRUCache.ts +29 -0
- package/src/structures/WeakIdCache.ts +25 -0
- package/src/structures/index.ts +3 -0
- package/src/tsconfig.json +4 -1
- package/src/types/index.ts +0 -1
- package/tests/dom/dataAttribute.test.ts +13 -0
- package/tests/dom/svgSizeProps.test.ts +22 -0
- package/tests/tsconfig.json +10 -0
- package/tsconfig.json +8 -0
- package/tsdoc.json +6 -0
- package/vitest.config.ts +3 -0
- package/dist/development/assert-types/AssertionError.cjs +0 -9
- package/dist/development/assert-types/AssertionError.cjs.map +0 -1
- package/dist/development/assert-types/AssertionError.js +0 -9
- package/dist/development/assert-types/AssertionError.js.map +0 -1
- package/dist/development/assert-types/Predicates.cjs +0 -7
- package/dist/development/assert-types/Predicates.cjs.map +0 -1
- package/dist/development/assert-types/Predicates.js +0 -7
- package/dist/development/assert-types/Predicates.js.map +0 -1
- package/dist/development/assert-types/assert.cjs +0 -10
- package/dist/development/assert-types/assert.cjs.map +0 -1
- package/dist/development/assert-types/assert.js +0 -10
- package/dist/development/assert-types/assert.js.map +0 -1
- package/dist/development/assert-types/assertNever.cjs.map +0 -1
- package/dist/development/assert-types/assertNever.js.map +0 -1
- package/dist/development/css-utilities/px.cjs +0 -7
- package/dist/development/css-utilities/px.cjs.map +0 -1
- package/dist/development/css-utilities/px.js +0 -7
- package/dist/development/css-utilities/px.js.map +0 -1
- package/dist/development/data-utilities/dateToStringWithoutTimezone.cjs +0 -20
- package/dist/development/data-utilities/dateToStringWithoutTimezone.cjs.map +0 -1
- package/dist/development/data-utilities/dateToStringWithoutTimezone.js +0 -20
- package/dist/development/data-utilities/dateToStringWithoutTimezone.js.map +0 -1
- package/dist/development/deprecate/deprecate.cjs.map +0 -1
- package/dist/development/deprecate/deprecate.js.map +0 -1
- package/dist/development/dom/dataAttribute.cjs.map +0 -1
- package/dist/development/dom/dataAttribute.js.map +0 -1
- package/dist/development/dom/getElementDimensions.cjs +0 -22
- package/dist/development/dom/getElementDimensions.cjs.map +0 -1
- package/dist/development/dom/getElementDimensions.js +0 -22
- package/dist/development/dom/getElementDimensions.js.map +0 -1
- package/dist/development/dom/getSizeFromResizeObserverEntry.cjs +0 -24
- package/dist/development/dom/getSizeFromResizeObserverEntry.cjs.map +0 -1
- package/dist/development/dom/getSizeFromResizeObserverEntry.js +0 -24
- package/dist/development/dom/getSizeFromResizeObserverEntry.js.map +0 -1
- package/dist/development/dom/shouldCancelStart.cjs +0 -29
- package/dist/development/dom/shouldCancelStart.cjs.map +0 -1
- package/dist/development/dom/shouldCancelStart.js +0 -29
- package/dist/development/dom/shouldCancelStart.js.map +0 -1
- package/dist/development/dom/stateDataAttributes.cjs +0 -11
- package/dist/development/dom/stateDataAttributes.cjs.map +0 -1
- package/dist/development/dom/stateDataAttributes.js +0 -11
- package/dist/development/dom/stateDataAttributes.js.map +0 -1
- package/dist/development/dom/svgSizeProps.cjs.map +0 -1
- package/dist/development/dom/svgSizeProps.js.map +0 -1
- package/dist/development/events/isSpecialLinkClick.cjs +0 -5
- package/dist/development/events/isSpecialLinkClick.cjs.map +0 -1
- package/dist/development/events/isSpecialLinkClick.js +0 -5
- package/dist/development/events/isSpecialLinkClick.js.map +0 -1
- package/dist/development/functional/omit.cjs +0 -15
- package/dist/development/functional/omit.cjs.map +0 -1
- package/dist/development/functional/omit.js +0 -15
- package/dist/development/functional/omit.js.map +0 -1
- package/dist/development/functional/pick.cjs +0 -15
- package/dist/development/functional/pick.cjs.map +0 -1
- package/dist/development/functional/pick.js +0 -15
- package/dist/development/functional/pick.js.map +0 -1
- package/dist/development/functional/range.cjs +0 -7
- package/dist/development/functional/range.cjs.map +0 -1
- package/dist/development/functional/range.js +0 -7
- package/dist/development/functional/range.js.map +0 -1
- package/dist/development/string-utilities/kebabCase.cjs +0 -8
- package/dist/development/string-utilities/kebabCase.cjs.map +0 -1
- package/dist/development/string-utilities/kebabCase.js +0 -8
- package/dist/development/string-utilities/kebabCase.js.map +0 -1
- package/dist/production/assert-types/AssertionError.cjs +0 -9
- package/dist/production/assert-types/AssertionError.cjs.map +0 -1
- package/dist/production/assert-types/AssertionError.js +0 -9
- package/dist/production/assert-types/AssertionError.js.map +0 -1
- package/dist/production/assert-types/Predicates.cjs +0 -7
- package/dist/production/assert-types/Predicates.cjs.map +0 -1
- package/dist/production/assert-types/Predicates.js +0 -7
- package/dist/production/assert-types/Predicates.js.map +0 -1
- package/dist/production/assert-types/assert.cjs +0 -10
- package/dist/production/assert-types/assert.cjs.map +0 -1
- package/dist/production/assert-types/assert.js +0 -10
- package/dist/production/assert-types/assert.js.map +0 -1
- package/dist/production/assert-types/assertNever.cjs.map +0 -1
- package/dist/production/assert-types/assertNever.js.map +0 -1
- package/dist/production/css-utilities/px.cjs +0 -7
- package/dist/production/css-utilities/px.cjs.map +0 -1
- package/dist/production/css-utilities/px.js +0 -7
- package/dist/production/css-utilities/px.js.map +0 -1
- package/dist/production/data-utilities/dateToStringWithoutTimezone.cjs +0 -20
- package/dist/production/data-utilities/dateToStringWithoutTimezone.cjs.map +0 -1
- package/dist/production/data-utilities/dateToStringWithoutTimezone.js +0 -20
- package/dist/production/data-utilities/dateToStringWithoutTimezone.js.map +0 -1
- package/dist/production/deprecate/deprecate.cjs.map +0 -1
- package/dist/production/deprecate/deprecate.js.map +0 -1
- package/dist/production/dom/dataAttribute.cjs.map +0 -1
- package/dist/production/dom/dataAttribute.js.map +0 -1
- package/dist/production/dom/getElementDimensions.cjs +0 -22
- package/dist/production/dom/getElementDimensions.cjs.map +0 -1
- package/dist/production/dom/getElementDimensions.js +0 -22
- package/dist/production/dom/getElementDimensions.js.map +0 -1
- package/dist/production/dom/getSizeFromResizeObserverEntry.cjs +0 -24
- package/dist/production/dom/getSizeFromResizeObserverEntry.cjs.map +0 -1
- package/dist/production/dom/getSizeFromResizeObserverEntry.js +0 -24
- package/dist/production/dom/getSizeFromResizeObserverEntry.js.map +0 -1
- package/dist/production/dom/shouldCancelStart.cjs +0 -29
- package/dist/production/dom/shouldCancelStart.cjs.map +0 -1
- package/dist/production/dom/shouldCancelStart.js +0 -29
- package/dist/production/dom/shouldCancelStart.js.map +0 -1
- package/dist/production/dom/stateDataAttributes.cjs +0 -11
- package/dist/production/dom/stateDataAttributes.cjs.map +0 -1
- package/dist/production/dom/stateDataAttributes.js +0 -11
- package/dist/production/dom/stateDataAttributes.js.map +0 -1
- package/dist/production/dom/svgSizeProps.cjs.map +0 -1
- package/dist/production/dom/svgSizeProps.js.map +0 -1
- package/dist/production/events/isSpecialLinkClick.cjs +0 -5
- package/dist/production/events/isSpecialLinkClick.cjs.map +0 -1
- package/dist/production/events/isSpecialLinkClick.js +0 -5
- package/dist/production/events/isSpecialLinkClick.js.map +0 -1
- package/dist/production/functional/omit.cjs +0 -15
- package/dist/production/functional/omit.cjs.map +0 -1
- package/dist/production/functional/omit.js +0 -15
- package/dist/production/functional/omit.js.map +0 -1
- package/dist/production/functional/pick.cjs +0 -15
- package/dist/production/functional/pick.cjs.map +0 -1
- package/dist/production/functional/pick.js +0 -15
- package/dist/production/functional/pick.js.map +0 -1
- package/dist/production/functional/range.cjs +0 -7
- package/dist/production/functional/range.cjs.map +0 -1
- package/dist/production/functional/range.js +0 -7
- package/dist/production/functional/range.js.map +0 -1
- package/dist/production/string-utilities/kebabCase.cjs +0 -8
- package/dist/production/string-utilities/kebabCase.cjs.map +0 -1
- package/dist/production/string-utilities/kebabCase.js +0 -8
- package/dist/production/string-utilities/kebabCase.js.map +0 -1
- package/dist/types/assert-types/AssertionError.d.ts +0 -4
- package/dist/types/assert-types/AssertionError.d.ts.map +0 -1
- package/dist/types/assert-types/Predicates.d.ts +0 -2
- package/dist/types/assert-types/Predicates.d.ts.map +0 -1
- package/dist/types/assert-types/assert.d.ts +0 -3
- package/dist/types/assert-types/assert.d.ts.map +0 -1
- package/dist/types/assert-types/types.d.ts +0 -2
- package/dist/types/assert-types/types.d.ts.map +0 -1
- package/dist/types/css-utilities/index.d.ts +0 -2
- package/dist/types/css-utilities/index.d.ts.map +0 -1
- package/dist/types/css-utilities/px.d.ts +0 -8
- package/dist/types/css-utilities/px.d.ts.map +0 -1
- package/dist/types/data-utilities/dateToStringWithoutTimezone.d.ts +0 -4
- package/dist/types/data-utilities/dateToStringWithoutTimezone.d.ts.map +0 -1
- package/dist/types/data-utilities/index.d.ts +0 -2
- package/dist/types/data-utilities/index.d.ts.map +0 -1
- package/dist/types/dom/getElementDimensions.d.ts +0 -14
- package/dist/types/dom/getElementDimensions.d.ts.map +0 -1
- package/dist/types/dom/getSizeFromResizeObserverEntry.d.ts +0 -5
- package/dist/types/dom/getSizeFromResizeObserverEntry.d.ts.map +0 -1
- package/dist/types/dom/shouldCancelStart.d.ts +0 -4
- package/dist/types/dom/shouldCancelStart.d.ts.map +0 -1
- package/dist/types/dom/stateDataAttributes.d.ts +0 -4
- package/dist/types/dom/stateDataAttributes.d.ts.map +0 -1
- package/dist/types/events/index.d.ts +0 -2
- package/dist/types/events/index.d.ts.map +0 -1
- package/dist/types/events/isSpecialLinkClick.d.ts +0 -2
- package/dist/types/events/isSpecialLinkClick.d.ts.map +0 -1
- package/dist/types/functional/index.d.ts +0 -4
- package/dist/types/functional/index.d.ts.map +0 -1
- package/dist/types/functional/omit.d.ts +0 -2
- package/dist/types/functional/omit.d.ts.map +0 -1
- package/dist/types/functional/pick.d.ts +0 -2
- package/dist/types/functional/pick.d.ts.map +0 -1
- package/dist/types/functional/range.d.ts +0 -9
- package/dist/types/functional/range.d.ts.map +0 -1
- package/dist/types/string-utilities/index.d.ts +0 -2
- package/dist/types/string-utilities/index.d.ts.map +0 -1
- package/dist/types/string-utilities/kebabCase.d.ts +0 -2
- package/dist/types/string-utilities/kebabCase.d.ts.map +0 -1
- package/dist/types/types/PolymorphicRefs.d.ts +0 -47
- package/dist/types/types/PolymorphicRefs.d.ts.map +0 -1
- package/src/assert-types/AssertionError.ts +0 -5
- package/src/assert-types/Predicates.ts +0 -3
- package/src/assert-types/assert.ts +0 -15
- package/src/assert-types/types.ts +0 -1
- package/src/css-utilities/index.ts +0 -1
- package/src/css-utilities/px.ts +0 -9
- package/src/data-utilities/dateToStringWithoutTimezone.ts +0 -18
- package/src/data-utilities/index.ts +0 -1
- package/src/dom/getElementDimensions.ts +0 -36
- package/src/dom/getSizeFromResizeObserverEntry.ts +0 -26
- package/src/dom/shouldCancelStart.ts +0 -32
- package/src/dom/stateDataAttributes.ts +0 -8
- package/src/events/index.ts +0 -1
- package/src/events/isSpecialLinkClick.ts +0 -1
- package/src/functional/index.ts +0 -3
- package/src/functional/omit.ts +0 -13
- package/src/functional/pick.ts +0 -13
- package/src/functional/range.ts +0 -11
- package/src/string-utilities/index.ts +0 -1
- package/src/string-utilities/kebabCase.ts +0 -5
- package/src/types/PolymorphicRefs.ts +0 -70
- /package/dist/development/{assert-types → src/assert-types}/assertNever.cjs +0 -0
- /package/dist/development/{assert-types → src/assert-types}/assertNever.js +0 -0
- /package/dist/development/{dom → src/dom}/dataAttribute.cjs +0 -0
- /package/dist/development/{dom → src/dom}/dataAttribute.js +0 -0
- /package/dist/development/{dom → src/dom}/svgSizeProps.cjs +0 -0
- /package/dist/development/{dom → src/dom}/svgSizeProps.js +0 -0
- /package/dist/production/{assert-types → src/assert-types}/assertNever.cjs +0 -0
- /package/dist/production/{assert-types → src/assert-types}/assertNever.js +0 -0
- /package/dist/production/{deprecate → src/deprecate}/deprecate.cjs +0 -0
- /package/dist/production/{deprecate → src/deprecate}/deprecate.js +0 -0
- /package/dist/production/{dom → src/dom}/dataAttribute.cjs +0 -0
- /package/dist/production/{dom → src/dom}/dataAttribute.js +0 -0
- /package/dist/production/{dom → src/dom}/svgSizeProps.cjs +0 -0
- /package/dist/production/{dom → src/dom}/svgSizeProps.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"px.d.ts","sourceRoot":"","sources":["../../../src/css-utilities/px.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,EAAE,CAAC,CAAC,SAAS,MAAM,GAAG,KAAK,GAAG,IAAI,GAAG,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,GAAG,MAAM,CAEjF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dateToStringWithoutTimezone.d.ts","sourceRoot":"","sources":["../../../src/data-utilities/dateToStringWithoutTimezone.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,2BAA2B,SAAU,IAAI,oBAAmB;IAAE,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE,KAAQ,MAiBzG,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/data-utilities/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAA"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Calls the callback with the element's dimensions.
|
|
3
|
-
*
|
|
4
|
-
* @param element - The element to observe for dimensions
|
|
5
|
-
* @param callback - The callback to call with the element's dimensions
|
|
6
|
-
*/
|
|
7
|
-
export declare function getElementDimensionsCallback(element: HTMLElement, callback: (dimensions: DOMRectReadOnly) => void): void;
|
|
8
|
-
/**
|
|
9
|
-
* Returns a promise that resolves with the element's dimensions.
|
|
10
|
-
* @param element - The element to observe for dimensions
|
|
11
|
-
* @returns A promise that resolves with the element's dimensions
|
|
12
|
-
*/
|
|
13
|
-
export declare function getElementDimensions(element: HTMLElement): Promise<DOMRectReadOnly>;
|
|
14
|
-
//# sourceMappingURL=getElementDimensions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getElementDimensions.d.ts","sourceRoot":"","sources":["../../../src/dom/getElementDimensions.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAC3C,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,CAAC,UAAU,EAAE,eAAe,KAAK,IAAI,QAc/C;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CACnC,OAAO,EAAE,WAAW,GAClB,OAAO,CAAC,eAAe,CAAC,CAI1B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getSizeFromResizeObserverEntry.d.ts","sourceRoot":"","sources":["../../../src/dom/getSizeFromResizeObserverEntry.ts"],"names":[],"mappings":"AAAA,wBAAgB,qCAAqC,CAAC,GAAG,EAAE,qBAAqB,CAAC,KAAK,CAAC,WAChC,mBAAmB,KAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAwB7G"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shouldCancelStart.d.ts","sourceRoot":"","sources":["../../../src/dom/shouldCancelStart.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,iBAAiB,UAAW;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAC,KAAG,OA2B7D,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stateDataAttributes.d.ts","sourceRoot":"","sources":["../../../src/dom/stateDataAttributes.ts"],"names":[],"mappings":"AAGA,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;EAIjE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/events/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isSpecialLinkClick.d.ts","sourceRoot":"","sources":["../../../src/events/isSpecialLinkClick.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,MAAO,UAAU,KAAG,OAA2D,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/functional/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAA;AACtB,cAAc,QAAQ,CAAA;AACtB,cAAc,SAAS,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"omit.d.ts","sourceRoot":"","sources":["../../../src/functional/omit.ts"],"names":[],"mappings":"AAAA,wBAAgB,IAAI,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,MAAM,GAAE,OAAe,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAYtI"}
|
|
@@ -1 +0,0 @@
|
|
|
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,aAAa,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAY7G"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Get a list of numbers between start and end, inclusive, with the given step size (defaulting to 1)
|
|
3
|
-
* @param start - The starting number.
|
|
4
|
-
* @param end - The ending number.
|
|
5
|
-
* @param step - The step size, optional, defaults to 1.
|
|
6
|
-
* @returns A list of numbers between start and end, inclusive, with the given step size (defaulting to 1)
|
|
7
|
-
*/
|
|
8
|
-
export declare function range(start: number, end: number, step?: number): number[];
|
|
9
|
-
//# sourceMappingURL=range.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"range.d.ts","sourceRoot":"","sources":["../../../src/functional/range.ts"],"names":[],"mappings":"AACA;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,SAAI,GAAG,MAAM,EAAE,CAEpE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/string-utilities/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"kebabCase.d.ts","sourceRoot":"","sources":["../../../src/string-utilities/kebabCase.ts"],"names":[],"mappings":"AAEA,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,UAExC"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
export type PropsOf<C extends keyof JSX.IntrinsicElements | React.JSXElementConstructor<any>> = JSX.LibraryManagedAttributes<C, React.ComponentPropsWithoutRef<C>>;
|
|
3
|
-
export type AsProp<C extends React.ElementType> = {
|
|
4
|
-
/**
|
|
5
|
-
* An override of the default HTML tag.
|
|
6
|
-
* Can also be another React component.
|
|
7
|
-
*/
|
|
8
|
-
as?: C;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* Allows for extending a set of props (`ExtendedProps`) by an overriding set of props
|
|
12
|
-
* (`OverrideProps`), ensuring that any duplicates are overridden by the overriding
|
|
13
|
-
* set of props.
|
|
14
|
-
*/
|
|
15
|
-
export type ExtendableProps<ExtendedProps = {}, OverrideProps = {}> = OverrideProps & Omit<ExtendedProps, keyof OverrideProps>;
|
|
16
|
-
/**
|
|
17
|
-
* Allows for inheriting the props from the specified element type so that
|
|
18
|
-
* props like children, className & style work, as well as element-specific
|
|
19
|
-
* attributes like aria roles. The component (`C`) must be passed in.
|
|
20
|
-
*/
|
|
21
|
-
export type InheritableElementProps<C extends React.ElementType, Props = {}> = ExtendableProps<PropsOf<C>, Props>;
|
|
22
|
-
/**
|
|
23
|
-
* A more sophisticated version of `InheritableElementProps` where
|
|
24
|
-
* the passed in `as` prop will determine which props can be included
|
|
25
|
-
*/
|
|
26
|
-
export type PolymorphicComponentProps<C extends React.ElementType, Props = {}> = InheritableElementProps<C, Props & AsProp<C>>;
|
|
27
|
-
/**
|
|
28
|
-
* Utility type to extract the `ref` prop from a polymorphic component
|
|
29
|
-
*/
|
|
30
|
-
export type PolymorphicRef<C extends React.ElementType> = React.ComponentPropsWithRef<C>['ref'];
|
|
31
|
-
/**
|
|
32
|
-
* A wrapper of `PolymorphicComponentProps` that also includes the `ref`
|
|
33
|
-
* prop for the polymorphic component
|
|
34
|
-
*/
|
|
35
|
-
export type PolymorphicComponentPropsWithRef<C extends React.ElementType, Props = {}> = PolymorphicComponentProps<C, Props> & {
|
|
36
|
-
ref?: PolymorphicRef<C>;
|
|
37
|
-
};
|
|
38
|
-
/**
|
|
39
|
-
* A polymorphic component is a component that can be rendered as different
|
|
40
|
-
* HTML elements or other React components by specifying the `as` prop.
|
|
41
|
-
* This type allows for specifying the component (`C`) and the props (`P`)
|
|
42
|
-
* that the component accepts.
|
|
43
|
-
*/
|
|
44
|
-
export type PolymorphicComponent<T extends React.ElementType, P = {}> = (<C extends React.ElementType = T>(props: PolymorphicComponentPropsWithRef<C, P>) => ReactNode) & {
|
|
45
|
-
displayName?: string | undefined;
|
|
46
|
-
};
|
|
47
|
-
//# sourceMappingURL=PolymorphicRefs.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PolymorphicRefs.d.ts","sourceRoot":"","sources":["../../../src/types/PolymorphicRefs.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEjC,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;AAErE;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,EAAE,CAAC,GAAG,EAAE,IACjE,CAAC,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,CAAC,EAAE,KAAK,EAAE,gCAAgC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,GAC/F;IAAE,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAA"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { AssertionError } from './AssertionError'
|
|
2
|
-
import { Predicate } from './types'
|
|
3
|
-
|
|
4
|
-
export function assert<
|
|
5
|
-
In,
|
|
6
|
-
Out extends In
|
|
7
|
-
>(
|
|
8
|
-
that: string | undefined = undefined,
|
|
9
|
-
value: In,
|
|
10
|
-
predicate: Predicate<In, Out>, // (value: In) => value is Out,
|
|
11
|
-
): asserts value is Out {
|
|
12
|
-
if (!predicate(value)) {
|
|
13
|
-
throw new AssertionError(value, that)
|
|
14
|
-
}
|
|
15
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type Predicate<T, U extends T> = (value: T) => value is U
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './px'
|
package/src/css-utilities/px.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Converts a value to a string in the format '10px'
|
|
3
|
-
*
|
|
4
|
-
* @param value - The value to convert to a string.
|
|
5
|
-
* @returns Returns a string in the format '10px' or '' when value is falsy.
|
|
6
|
-
*/
|
|
7
|
-
export function px<V extends number | false | null | undefined>(value?: V): string {
|
|
8
|
-
return typeof value === 'number' && !(isNaN(value) || value === Infinity || value === -Infinity) ? value + 'px' : ''
|
|
9
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export const dateToStringWithoutTimezone = (date: Date, { includeTime }: { includeTime?: boolean } = {}): string => {
|
|
2
|
-
const [year, month, day] = [
|
|
3
|
-
date.getFullYear(),
|
|
4
|
-
(date.getMonth() + 1).toFixed(0).padStart(2, '0'),
|
|
5
|
-
date.getDate().toFixed(0).padStart(2, '0'),
|
|
6
|
-
]
|
|
7
|
-
let serialized = `${year}-${month}-${day}`
|
|
8
|
-
|
|
9
|
-
if (includeTime) {
|
|
10
|
-
const [hours, minutes] = [
|
|
11
|
-
date.getHours().toFixed(0).padStart(2, '0'),
|
|
12
|
-
date.getMinutes().toFixed(0).padStart(2, '0'),
|
|
13
|
-
]
|
|
14
|
-
serialized += ` ${hours}:${minutes}`
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
return serialized
|
|
18
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './dateToStringWithoutTimezone'
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Calls the callback with the element's dimensions.
|
|
3
|
-
*
|
|
4
|
-
* @param element - The element to observe for dimensions
|
|
5
|
-
* @param callback - The callback to call with the element's dimensions
|
|
6
|
-
*/
|
|
7
|
-
export function getElementDimensionsCallback(
|
|
8
|
-
element: HTMLElement,
|
|
9
|
-
callback: (dimensions: DOMRectReadOnly) => void,
|
|
10
|
-
) {
|
|
11
|
-
const observer = new IntersectionObserver((entries, observer) => {
|
|
12
|
-
if (entries.length === 1) {
|
|
13
|
-
callback(entries[0].boundingClientRect)
|
|
14
|
-
} else {
|
|
15
|
-
const entry = entries.find(entry => entry.boundingClientRect.width > 0 || entry.boundingClientRect.height > 0) || entries[0]
|
|
16
|
-
callback(entry.boundingClientRect)
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
observer.disconnect()
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
observer.observe(element)
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Returns a promise that resolves with the element's dimensions.
|
|
27
|
-
* @param element - The element to observe for dimensions
|
|
28
|
-
* @returns A promise that resolves with the element's dimensions
|
|
29
|
-
*/
|
|
30
|
-
export function getElementDimensions(
|
|
31
|
-
element: HTMLElement,
|
|
32
|
-
): Promise<DOMRectReadOnly> {
|
|
33
|
-
return new Promise(resolve => {
|
|
34
|
-
getElementDimensionsCallback(element, resolve)
|
|
35
|
-
})
|
|
36
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
const interactiveElements = new Set(['INPUT', 'TEXTAREA', 'SELECT', 'OPTION', 'BUTTON'])
|
|
2
|
-
|
|
3
|
-
// This is almost completely copied from the defaultShouldCancelStart.js from react-sortable-hoc.
|
|
4
|
-
// We just needed to add support for slate void elements as well as some additional checks.
|
|
5
|
-
export const shouldCancelStart = (event: {target?: unknown}): boolean => {
|
|
6
|
-
// Cancel sorting if the event target is an `input`, `textarea`, `select` or `option`
|
|
7
|
-
if (!(event.target instanceof Element)) {
|
|
8
|
-
return true
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
let el: Node | null = event.target
|
|
12
|
-
|
|
13
|
-
while (el) {
|
|
14
|
-
if (el instanceof Element) {
|
|
15
|
-
if (interactiveElements.has(el.tagName)) {
|
|
16
|
-
return true
|
|
17
|
-
}
|
|
18
|
-
if ((el as any).sortableHandle === true) {
|
|
19
|
-
return false
|
|
20
|
-
}
|
|
21
|
-
if (el.getAttribute('data-slate-void') === 'true') {
|
|
22
|
-
return false
|
|
23
|
-
}
|
|
24
|
-
if (el instanceof HTMLElement && el.contentEditable === 'true') {
|
|
25
|
-
return true
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
el = el.parentNode
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return false
|
|
32
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { toKebabCase } from '../string-utilities'
|
|
2
|
-
import { dataAttribute } from './dataAttribute'
|
|
3
|
-
|
|
4
|
-
export function stateDataAttributes(state: Record<string, unknown>) {
|
|
5
|
-
return Object.fromEntries(Object.entries(state).map(
|
|
6
|
-
([key, value]) => [`data-${toKebabCase(key).toLowerCase()}`, dataAttribute(value)],
|
|
7
|
-
))
|
|
8
|
-
}
|
package/src/events/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './isSpecialLinkClick'
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const isSpecialLinkClick = (e: MouseEvent): boolean => e.metaKey || e.altKey || e.ctrlKey || e.shiftKey
|
package/src/functional/index.ts
DELETED
package/src/functional/omit.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export function omit<T extends Object, K extends keyof T>(object: T, properties: ReadonlyArray<K>, strict: boolean = false): Omit<T, K> {
|
|
2
|
-
const next: Partial<T> = { ...object }
|
|
3
|
-
|
|
4
|
-
for (let key of properties) {
|
|
5
|
-
if (key in object) {
|
|
6
|
-
delete next[key]
|
|
7
|
-
} else if (strict) {
|
|
8
|
-
throw new Error(`Key "${String(key)}" does not exist in object ${JSON.stringify(object)}`)
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
return next as Omit<T, K>
|
|
13
|
-
}
|
package/src/functional/pick.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export function pick<T extends Object, K extends keyof T>(object: T, properties: ReadonlyArray<K>): Pick<T, K> {
|
|
2
|
-
const next: Partial<Pick<T, K>> = {}
|
|
3
|
-
|
|
4
|
-
for (let key of properties) {
|
|
5
|
-
if (key in object) {
|
|
6
|
-
next[key] = object[key]
|
|
7
|
-
} else {
|
|
8
|
-
throw new Error(`Key "${String(key)}" does not exist in object ${JSON.stringify(object)}`)
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
return next as Pick<T, K>
|
|
13
|
-
}
|
package/src/functional/range.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* Get a list of numbers between start and end, inclusive, with the given step size (defaulting to 1)
|
|
4
|
-
* @param start - The starting number.
|
|
5
|
-
* @param end - The ending number.
|
|
6
|
-
* @param step - The step size, optional, defaults to 1.
|
|
7
|
-
* @returns A list of numbers between start and end, inclusive, with the given step size (defaulting to 1)
|
|
8
|
-
*/
|
|
9
|
-
export function range(start: number, end: number, step = 1): number[] {
|
|
10
|
-
return Array.from({ length: Math.floor(Math.abs(end - start) / step) + 1 }, (_, i) => start + i * (end > start ? 1 : -1) * Math.abs(step))
|
|
11
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './kebabCase'
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
// Source: https://www.benmvp.com/blog/forwarding-refs-polymorphic-react-component-typescript/
|
|
2
|
-
|
|
3
|
-
// Source: https://github.com/emotion-js/emotion/blob/master/packages/styled-base/types/helper.d.ts
|
|
4
|
-
// A more precise version of just React.ComponentPropsWithoutRef on its own
|
|
5
|
-
import { ReactNode } from 'react'
|
|
6
|
-
|
|
7
|
-
export type PropsOf<
|
|
8
|
-
C extends keyof JSX.IntrinsicElements | React.JSXElementConstructor<any>
|
|
9
|
-
> = JSX.LibraryManagedAttributes<C, React.ComponentPropsWithoutRef<C>>
|
|
10
|
-
|
|
11
|
-
export type AsProp<C extends React.ElementType> = {
|
|
12
|
-
/**
|
|
13
|
-
* An override of the default HTML tag.
|
|
14
|
-
* Can also be another React component.
|
|
15
|
-
*/
|
|
16
|
-
as?: C
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Allows for extending a set of props (`ExtendedProps`) by an overriding set of props
|
|
21
|
-
* (`OverrideProps`), ensuring that any duplicates are overridden by the overriding
|
|
22
|
-
* set of props.
|
|
23
|
-
*/
|
|
24
|
-
export type ExtendableProps<
|
|
25
|
-
ExtendedProps = {},
|
|
26
|
-
OverrideProps = {}
|
|
27
|
-
> = OverrideProps & Omit<ExtendedProps, keyof OverrideProps>
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Allows for inheriting the props from the specified element type so that
|
|
31
|
-
* props like children, className & style work, as well as element-specific
|
|
32
|
-
* attributes like aria roles. The component (`C`) must be passed in.
|
|
33
|
-
*/
|
|
34
|
-
export type InheritableElementProps<
|
|
35
|
-
C extends React.ElementType,
|
|
36
|
-
Props = {}
|
|
37
|
-
> = ExtendableProps<PropsOf<C>, Props>
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* A more sophisticated version of `InheritableElementProps` where
|
|
41
|
-
* the passed in `as` prop will determine which props can be included
|
|
42
|
-
*/
|
|
43
|
-
export type PolymorphicComponentProps<
|
|
44
|
-
C extends React.ElementType,
|
|
45
|
-
Props = {}
|
|
46
|
-
> = InheritableElementProps<C, Props & AsProp<C>>
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Utility type to extract the `ref` prop from a polymorphic component
|
|
50
|
-
*/
|
|
51
|
-
export type PolymorphicRef<C extends React.ElementType> = React.ComponentPropsWithRef<C>['ref']
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* A wrapper of `PolymorphicComponentProps` that also includes the `ref`
|
|
55
|
-
* prop for the polymorphic component
|
|
56
|
-
*/
|
|
57
|
-
export type PolymorphicComponentPropsWithRef<
|
|
58
|
-
C extends React.ElementType,
|
|
59
|
-
Props = {}
|
|
60
|
-
> = PolymorphicComponentProps<C, Props> & { ref?: PolymorphicRef<C> }
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* A polymorphic component is a component that can be rendered as different
|
|
64
|
-
* HTML elements or other React components by specifying the `as` prop.
|
|
65
|
-
* This type allows for specifying the component (`C`) and the props (`P`)
|
|
66
|
-
* that the component accepts.
|
|
67
|
-
*/
|
|
68
|
-
export type PolymorphicComponent<T extends React.ElementType, P = {}> =
|
|
69
|
-
& (<C extends React.ElementType = T>(props: PolymorphicComponentPropsWithRef<C, P>) => ReactNode)
|
|
70
|
-
& { displayName?: string | undefined }
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|