@omnitron-dev/prism 0.2.0 → 0.3.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.
- package/README.md +148 -0
- package/dist/accessibility/index.d.ts +7 -151
- package/dist/accessibility/index.d.ts.map +1 -0
- package/dist/accessibility/index.js +0 -1
- package/dist/accessibility/index.js.map +1 -1
- package/dist/accessibility/vision-mode.d.ts +154 -0
- package/dist/accessibility/vision-mode.d.ts.map +1 -0
- package/dist/blocks/auth-block/auth-block.d.ts +107 -0
- package/dist/blocks/auth-block/auth-block.d.ts.map +1 -0
- package/dist/blocks/auth-block/guards.d.ts +262 -0
- package/dist/blocks/auth-block/guards.d.ts.map +1 -0
- package/dist/blocks/auth-block/index.d.ts +13 -0
- package/dist/blocks/auth-block/index.d.ts.map +1 -0
- package/dist/blocks/auth-block/types.d.ts +232 -0
- package/dist/blocks/auth-block/types.d.ts.map +1 -0
- package/dist/blocks/dashboard-block/dashboard-block.d.ts +53 -0
- package/dist/blocks/dashboard-block/dashboard-block.d.ts.map +1 -0
- package/dist/blocks/dashboard-block/index.d.ts +12 -0
- package/dist/blocks/dashboard-block/index.d.ts.map +1 -0
- package/dist/blocks/dashboard-block/types.d.ts +182 -0
- package/dist/blocks/dashboard-block/types.d.ts.map +1 -0
- package/dist/blocks/dashboard-block/use-dashboard-block.d.ts +95 -0
- package/dist/blocks/dashboard-block/use-dashboard-block.d.ts.map +1 -0
- package/dist/blocks/data-grid-block/data-grid-block.d.ts +81 -0
- package/dist/blocks/data-grid-block/data-grid-block.d.ts.map +1 -0
- package/dist/blocks/data-grid-block/index.d.ts +11 -0
- package/dist/blocks/data-grid-block/index.d.ts.map +1 -0
- package/dist/blocks/data-grid-block/types.d.ts +304 -0
- package/dist/blocks/data-grid-block/types.d.ts.map +1 -0
- package/dist/blocks/index.d.ts +10 -1235
- package/dist/blocks/index.d.ts.map +1 -0
- package/dist/blocks/index.js +141 -42
- package/dist/blocks/index.js.map +1 -1
- package/dist/{chunk-IZOIO7PA.js → chunk-472SOF76.js} +31 -22
- package/dist/chunk-472SOF76.js.map +1 -0
- package/dist/chunk-4Z5DE5GK.js +1579 -0
- package/dist/chunk-4Z5DE5GK.js.map +1 -0
- package/dist/chunk-52PQL67Q.js +559 -0
- package/dist/chunk-52PQL67Q.js.map +1 -0
- package/dist/chunk-75FQ5IW3.js +590 -0
- package/dist/chunk-75FQ5IW3.js.map +1 -0
- package/dist/{chunk-VAAIHNWQ.js → chunk-7G5D5PTC.js} +4 -3
- package/dist/chunk-7G5D5PTC.js.map +1 -0
- package/dist/{chunk-JDTC2SBY.js → chunk-AD4W7HYC.js} +2 -2
- package/dist/chunk-AD4W7HYC.js.map +1 -0
- package/dist/{chunk-SNKGGHBT.js → chunk-ADG4HZEP.js} +3 -3
- package/dist/chunk-ADG4HZEP.js.map +1 -0
- package/dist/{chunk-JNU4QHJK.js → chunk-AYYFMTMI.js} +5 -4
- package/dist/{chunk-JNU4QHJK.js.map → chunk-AYYFMTMI.js.map} +1 -1
- package/dist/chunk-BJE2AKD4.js +105 -0
- package/dist/chunk-BJE2AKD4.js.map +1 -0
- package/dist/{chunk-HO2GKTWJ.js → chunk-BRDWQVRT.js} +2 -2
- package/dist/chunk-BRDWQVRT.js.map +1 -0
- package/dist/{chunk-2FYNRDXR.js → chunk-DRFNMZLG.js} +2 -2
- package/dist/chunk-DRFNMZLG.js.map +1 -0
- package/dist/chunk-FF5RF32O.js +248 -0
- package/dist/chunk-FF5RF32O.js.map +1 -0
- package/dist/{chunk-KTCWPGON.js → chunk-GMIE6III.js} +561 -111
- package/dist/chunk-GMIE6III.js.map +1 -0
- package/dist/{chunk-BV32OJ2A.js → chunk-GUFHFEPZ.js} +2 -2
- package/dist/chunk-GUFHFEPZ.js.map +1 -0
- package/dist/chunk-GUGTDURV.js +826 -0
- package/dist/chunk-GUGTDURV.js.map +1 -0
- package/dist/chunk-HOXFSQUV.js +573 -0
- package/dist/chunk-HOXFSQUV.js.map +1 -0
- package/dist/chunk-JSQTYDPG.js +3 -0
- package/dist/{chunk-77KIJLPP.js.map → chunk-JSQTYDPG.js.map} +1 -1
- package/dist/{chunk-MEFT6XPH.js → chunk-KQ67XB6T.js} +351 -704
- package/dist/chunk-KQ67XB6T.js.map +1 -0
- package/dist/{chunk-YJMAQL3S.js → chunk-LOY2NPCO.js} +129 -635
- package/dist/chunk-LOY2NPCO.js.map +1 -0
- package/dist/{chunk-A2Z7NVGL.js → chunk-LSPFFEJT.js} +1026 -2128
- package/dist/chunk-LSPFFEJT.js.map +1 -0
- package/dist/{chunk-XXP3ZGU6.js → chunk-OKTLA23Q.js} +22 -14
- package/dist/chunk-OKTLA23Q.js.map +1 -0
- package/dist/chunk-PFT2BNYO.js +191 -0
- package/dist/chunk-PFT2BNYO.js.map +1 -0
- package/dist/chunk-PGHEP4JD.js +106 -0
- package/dist/chunk-PGHEP4JD.js.map +1 -0
- package/dist/chunk-PXXPLHIY.js +74 -0
- package/dist/chunk-PXXPLHIY.js.map +1 -0
- package/dist/chunk-SNZK5X6F.js +594 -0
- package/dist/chunk-SNZK5X6F.js.map +1 -0
- package/dist/chunk-SU3LVQ7N.js +518 -0
- package/dist/chunk-SU3LVQ7N.js.map +1 -0
- package/dist/{chunk-DDY7TLUI.js → chunk-XIXSSI3B.js} +28 -2
- package/dist/chunk-XIXSSI3B.js.map +1 -0
- package/dist/chunk-YHE7HXSG.js +206 -0
- package/dist/chunk-YHE7HXSG.js.map +1 -0
- package/dist/{chunk-XWL6J6IO.js → chunk-YSIG2XYH.js} +2 -2
- package/dist/chunk-YSIG2XYH.js.map +1 -0
- package/dist/cli/commands/add.d.ts +22 -0
- package/dist/cli/commands/add.d.ts.map +1 -0
- package/dist/cli/commands/diff.d.ts +13 -0
- package/dist/cli/commands/diff.d.ts.map +1 -0
- package/dist/cli/commands/doctor.d.ts +13 -0
- package/dist/cli/commands/doctor.d.ts.map +1 -0
- package/dist/cli/commands/init.d.ts +13 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/list.d.ts +13 -0
- package/dist/cli/commands/list.d.ts.map +1 -0
- package/dist/cli/commands/remove.d.ts +13 -0
- package/dist/cli/commands/remove.d.ts.map +1 -0
- package/dist/cli/commands/update.d.ts +13 -0
- package/dist/cli/commands/update.d.ts.map +1 -0
- package/dist/cli/config.d.ts +73 -0
- package/dist/cli/config.d.ts.map +1 -0
- package/dist/cli/constants.d.ts +60 -0
- package/dist/cli/constants.d.ts.map +1 -0
- package/dist/cli/index.d.ts +27 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +38 -39
- package/dist/cli/index.js.map +1 -1
- package/dist/components/accordion/accordion.d.ts +149 -0
- package/dist/components/accordion/accordion.d.ts.map +1 -0
- package/dist/components/accordion/index.d.ts +7 -0
- package/dist/components/accordion/index.d.ts.map +1 -0
- package/dist/components/admin-filters/admin-data-table.d.ts +185 -0
- package/dist/components/admin-filters/admin-data-table.d.ts.map +1 -0
- package/dist/components/admin-filters/amount-cell.d.ts +39 -0
- package/dist/components/admin-filters/amount-cell.d.ts.map +1 -0
- package/dist/components/admin-filters/filter-toolbar.d.ts +99 -0
- package/dist/components/admin-filters/filter-toolbar.d.ts.map +1 -0
- package/dist/components/admin-filters/index.d.ts +13 -0
- package/dist/components/admin-filters/index.d.ts.map +1 -0
- package/dist/components/admin-filters/status-chip.d.ts +55 -0
- package/dist/components/admin-filters/status-chip.d.ts.map +1 -0
- package/dist/components/alert/alert.d.ts +159 -0
- package/dist/components/alert/alert.d.ts.map +1 -0
- package/dist/components/alert/index.d.ts +7 -0
- package/dist/components/alert/index.d.ts.map +1 -0
- package/dist/components/animate/animate-border.d.ts +33 -0
- package/dist/components/animate/animate-border.d.ts.map +1 -0
- package/dist/components/animate/index.d.ts +3 -0
- package/dist/components/animate/index.d.ts.map +1 -0
- package/dist/components/animate/motion-lazy.d.ts +5 -0
- package/dist/components/animate/motion-lazy.d.ts.map +1 -0
- package/dist/components/avatar/avatar.d.ts +78 -0
- package/dist/components/avatar/avatar.d.ts.map +1 -0
- package/dist/components/avatar/index.d.ts +7 -0
- package/dist/components/avatar/index.d.ts.map +1 -0
- package/dist/components/badge/badge.d.ts +102 -0
- package/dist/components/badge/badge.d.ts.map +1 -0
- package/dist/components/badge/index.d.ts +7 -0
- package/dist/components/badge/index.d.ts.map +1 -0
- package/dist/components/breadcrumbs/breadcrumbs.d.ts +100 -0
- package/dist/components/breadcrumbs/breadcrumbs.d.ts.map +1 -0
- package/dist/components/breadcrumbs/index.d.ts +7 -0
- package/dist/components/breadcrumbs/index.d.ts.map +1 -0
- package/dist/components/card/card.d.ts +127 -0
- package/dist/components/card/card.d.ts.map +1 -0
- package/dist/components/card/index.d.ts +7 -0
- package/dist/components/card/index.d.ts.map +1 -0
- package/dist/components/carousel/carousel.d.ts +35 -0
- package/dist/components/carousel/carousel.d.ts.map +1 -0
- package/dist/components/carousel/classes.d.ts +35 -0
- package/dist/components/carousel/classes.d.ts.map +1 -0
- package/dist/components/carousel/index.d.ts +10 -0
- package/dist/components/carousel/index.d.ts.map +1 -0
- package/dist/components/carousel/types.d.ts +167 -0
- package/dist/components/carousel/types.d.ts.map +1 -0
- package/dist/components/carousel/use-carousel.d.ts +51 -0
- package/dist/components/carousel/use-carousel.d.ts.map +1 -0
- package/dist/components/changelog/changelog-entry.d.ts +10 -0
- package/dist/components/changelog/changelog-entry.d.ts.map +1 -0
- package/dist/components/changelog/changelog-timeline.d.ts +9 -0
- package/dist/components/changelog/changelog-timeline.d.ts.map +1 -0
- package/dist/components/changelog/index.d.ts +3 -0
- package/dist/components/changelog/index.d.ts.map +1 -0
- package/dist/components/chart/chart.d.ts +39 -0
- package/dist/components/chart/chart.d.ts.map +1 -0
- package/dist/components/chart/classes.d.ts +24 -0
- package/dist/components/chart/classes.d.ts.map +1 -0
- package/dist/components/chart/components/chart-legends.d.ts +24 -0
- package/dist/components/chart/components/chart-legends.d.ts.map +1 -0
- package/dist/components/chart/components/chart-loading.d.ts +21 -0
- package/dist/components/chart/components/chart-loading.d.ts.map +1 -0
- package/dist/components/chart/components/index.d.ts +8 -0
- package/dist/components/chart/components/index.d.ts.map +1 -0
- package/dist/components/chart/index.d.ts +14 -0
- package/dist/components/chart/index.d.ts.map +1 -0
- package/dist/components/chart/types.d.ts +264 -0
- package/dist/components/chart/types.d.ts.map +1 -0
- package/dist/components/chart/use-chart.d.ts +34 -0
- package/dist/components/chart/use-chart.d.ts.map +1 -0
- package/dist/components/command-palette/command-palette.d.ts +73 -0
- package/dist/components/command-palette/command-palette.d.ts.map +1 -0
- package/dist/components/command-palette/index.d.ts +7 -0
- package/dist/components/command-palette/index.d.ts.map +1 -0
- package/dist/components/confirm-dialog/confirm-dialog.d.ts +89 -0
- package/dist/components/confirm-dialog/confirm-dialog.d.ts.map +1 -0
- package/dist/components/confirm-dialog/index.d.ts +7 -0
- package/dist/components/confirm-dialog/index.d.ts.map +1 -0
- package/dist/components/content-renderer/classes.d.ts +33 -0
- package/dist/components/content-renderer/classes.d.ts.map +1 -0
- package/dist/components/content-renderer/content-renderer.d.ts +37 -0
- package/dist/components/content-renderer/content-renderer.d.ts.map +1 -0
- package/dist/components/content-renderer/html-tags.d.ts +6 -0
- package/dist/components/content-renderer/html-tags.d.ts.map +1 -0
- package/dist/components/content-renderer/html-to-markdown.d.ts +7 -0
- package/dist/components/content-renderer/html-to-markdown.d.ts.map +1 -0
- package/dist/components/content-renderer/index.d.ts +7 -0
- package/dist/components/content-renderer/index.d.ts.map +1 -0
- package/dist/components/content-renderer/markdown.d.ts +23 -0
- package/dist/components/content-renderer/markdown.d.ts.map +1 -0
- package/dist/components/content-renderer/remark-spoiler.d.ts +9 -0
- package/dist/components/content-renderer/remark-spoiler.d.ts.map +1 -0
- package/dist/components/content-renderer/styles.d.ts +2 -0
- package/dist/components/content-renderer/styles.d.ts.map +1 -0
- package/dist/components/country-select/country-select.d.ts +101 -0
- package/dist/components/country-select/country-select.d.ts.map +1 -0
- package/dist/components/country-select/flag-icon.d.ts +36 -0
- package/dist/components/country-select/flag-icon.d.ts.map +1 -0
- package/dist/components/country-select/index.d.ts +5 -0
- package/dist/components/country-select/index.d.ts.map +1 -0
- package/dist/components/date-input/date-input.d.ts +27 -0
- package/dist/components/date-input/date-input.d.ts.map +1 -0
- package/dist/components/date-input/index.d.ts +4 -0
- package/dist/components/date-input/index.d.ts.map +1 -0
- package/dist/components/date-input/value.d.ts +9 -0
- package/dist/components/date-input/value.d.ts.map +1 -0
- package/dist/components/date-range-picker/date-range-input.d.ts +48 -0
- package/dist/components/date-range-picker/date-range-input.d.ts.map +1 -0
- package/dist/components/date-range-picker/date-range-picker.d.ts +39 -0
- package/dist/components/date-range-picker/date-range-picker.d.ts.map +1 -0
- package/dist/components/date-range-picker/index.d.ts +7 -0
- package/dist/components/date-range-picker/index.d.ts.map +1 -0
- package/dist/components/date-range-picker/use-date-range-picker.d.ts +28 -0
- package/dist/components/date-range-picker/use-date-range-picker.d.ts.map +1 -0
- package/dist/components/deadline-chip/deadline-chip.d.ts +41 -0
- package/dist/components/deadline-chip/deadline-chip.d.ts.map +1 -0
- package/dist/components/deadline-chip/index.d.ts +7 -0
- package/dist/components/deadline-chip/index.d.ts.map +1 -0
- package/dist/components/doc-layout/doc-layout.d.ts +17 -0
- package/dist/components/doc-layout/doc-layout.d.ts.map +1 -0
- package/dist/components/doc-layout/doc-section-nav.d.ts +16 -0
- package/dist/components/doc-layout/doc-section-nav.d.ts.map +1 -0
- package/dist/components/doc-layout/doc-sidebar.d.ts +18 -0
- package/dist/components/doc-layout/doc-sidebar.d.ts.map +1 -0
- package/dist/components/doc-layout/index.d.ts +4 -0
- package/dist/components/doc-layout/index.d.ts.map +1 -0
- package/dist/components/doc-layout/index.js +6 -0
- package/dist/components/doc-layout/index.js.map +1 -0
- package/dist/components/drawer/drawer.d.ts +65 -0
- package/dist/components/drawer/drawer.d.ts.map +1 -0
- package/dist/components/drawer/index.d.ts +7 -0
- package/dist/components/drawer/index.d.ts.map +1 -0
- package/dist/components/duration-picker/duration-picker.d.ts +24 -0
- package/dist/components/duration-picker/duration-picker.d.ts.map +1 -0
- package/dist/components/duration-picker/index.d.ts +2 -0
- package/dist/components/duration-picker/index.d.ts.map +1 -0
- package/dist/components/editor/classes.d.ts +52 -0
- package/dist/components/editor/classes.d.ts.map +1 -0
- package/dist/components/editor/editor.d.ts +15 -0
- package/dist/components/editor/editor.d.ts.map +1 -0
- package/dist/components/editor/extensions/clear-format.d.ts +3 -0
- package/dist/components/editor/extensions/clear-format.d.ts.map +1 -0
- package/dist/components/editor/extensions/index.d.ts +3 -0
- package/dist/components/editor/extensions/index.d.ts.map +1 -0
- package/dist/components/editor/extensions/text-transform.d.ts +20 -0
- package/dist/components/editor/extensions/text-transform.d.ts.map +1 -0
- package/dist/components/editor/icons/index.d.ts +34 -0
- package/dist/components/editor/icons/index.d.ts.map +1 -0
- package/dist/components/editor/index.d.ts +41 -104
- package/dist/components/editor/index.d.ts.map +1 -0
- package/dist/components/editor/index.js +3 -2
- package/dist/components/editor/presets.d.ts +3 -0
- package/dist/components/editor/presets.d.ts.map +1 -0
- package/dist/components/editor/styles.d.ts +2 -0
- package/dist/components/editor/styles.d.ts.map +1 -0
- package/dist/components/editor/toolbar/bubble-toolbar.d.ts +9 -0
- package/dist/components/editor/toolbar/bubble-toolbar.d.ts.map +1 -0
- package/dist/components/editor/toolbar/code-highlight-block.d.ts +3 -0
- package/dist/components/editor/toolbar/code-highlight-block.d.ts.map +1 -0
- package/dist/components/editor/toolbar/heading-block.d.ts +11 -0
- package/dist/components/editor/toolbar/heading-block.d.ts.map +1 -0
- package/dist/components/editor/toolbar/image-block.d.ts +11 -0
- package/dist/components/editor/toolbar/image-block.d.ts.map +1 -0
- package/dist/components/editor/toolbar/link-block.d.ts +13 -0
- package/dist/components/editor/toolbar/link-block.d.ts.map +1 -0
- package/dist/components/editor/toolbar/toolbar-item.d.ts +3 -0
- package/dist/components/editor/toolbar/toolbar-item.d.ts.map +1 -0
- package/dist/components/editor/toolbar/toolbar.d.ts +3 -0
- package/dist/components/editor/toolbar/toolbar.d.ts.map +1 -0
- package/dist/components/editor/toolbar/use-toolbar-state.d.ts +24 -0
- package/dist/components/editor/toolbar/use-toolbar-state.d.ts.map +1 -0
- package/dist/components/editor/types.d.ts +130 -0
- package/dist/components/editor/types.d.ts.map +1 -0
- package/dist/components/emoji-picker/emoji-picker.d.ts +24 -0
- package/dist/components/emoji-picker/emoji-picker.d.ts.map +1 -0
- package/dist/components/emoji-picker/emoji-search.d.ts +22 -0
- package/dist/components/emoji-picker/emoji-search.d.ts.map +1 -0
- package/dist/components/emoji-picker/emoji.d.ts +19 -0
- package/dist/components/emoji-picker/emoji.d.ts.map +1 -0
- package/dist/components/emoji-picker/index.d.ts +14 -0
- package/dist/components/emoji-picker/index.d.ts.map +1 -0
- package/dist/components/emoji-picker/index.js +3 -0
- package/dist/components/emoji-picker/index.js.map +1 -0
- package/dist/components/emoji-picker/twemoji-url.d.ts +26 -0
- package/dist/components/emoji-picker/twemoji-url.d.ts.map +1 -0
- package/dist/components/emoji-picker/types.d.ts +96 -0
- package/dist/components/emoji-picker/types.d.ts.map +1 -0
- package/dist/components/emoji-picker/use-emoji-data.d.ts +26 -0
- package/dist/components/emoji-picker/use-emoji-data.d.ts.map +1 -0
- package/dist/components/emoji-picker/use-recent-emojis.d.ts +16 -0
- package/dist/components/emoji-picker/use-recent-emojis.d.ts.map +1 -0
- package/dist/components/empty-content/empty-content.d.ts +92 -0
- package/dist/components/empty-content/empty-content.d.ts.map +1 -0
- package/dist/components/empty-content/index.d.ts +7 -0
- package/dist/components/empty-content/index.d.ts.map +1 -0
- package/dist/components/error-boundary/error-boundary.d.ts +162 -0
- package/dist/components/error-boundary/error-boundary.d.ts.map +1 -0
- package/dist/components/error-boundary/index.d.ts +7 -0
- package/dist/components/error-boundary/index.d.ts.map +1 -0
- package/dist/components/field/field-autocomplete.d.ts +74 -0
- package/dist/components/field/field-autocomplete.d.ts.map +1 -0
- package/dist/components/field/field-checkbox.d.ts +42 -0
- package/dist/components/field/field-checkbox.d.ts.map +1 -0
- package/dist/components/field/field-code.d.ts +80 -0
- package/dist/components/field/field-code.d.ts.map +1 -0
- package/dist/components/field/field-country-select.d.ts +84 -0
- package/dist/components/field/field-country-select.d.ts.map +1 -0
- package/dist/components/field/field-date-picker.d.ts +58 -0
- package/dist/components/field/field-date-picker.d.ts.map +1 -0
- package/dist/components/field/field-datetime-picker.d.ts +96 -0
- package/dist/components/field/field-datetime-picker.d.ts.map +1 -0
- package/dist/components/field/field-editor.d.ts +218 -0
- package/dist/components/field/field-editor.d.ts.map +1 -0
- package/dist/components/field/field-multi-checkbox.d.ts +91 -0
- package/dist/components/field/field-multi-checkbox.d.ts.map +1 -0
- package/dist/components/field/field-multi-select.d.ts +85 -0
- package/dist/components/field/field-multi-select.d.ts.map +1 -0
- package/dist/components/field/field-multi-switch.d.ts +93 -0
- package/dist/components/field/field-multi-switch.d.ts.map +1 -0
- package/dist/components/field/field-number.d.ts +50 -0
- package/dist/components/field/field-number.d.ts.map +1 -0
- package/dist/components/field/field-phone.d.ts +82 -0
- package/dist/components/field/field-phone.d.ts.map +1 -0
- package/dist/components/field/field-radio.d.ts +64 -0
- package/dist/components/field/field-radio.d.ts.map +1 -0
- package/dist/components/field/field-rating.d.ts +43 -0
- package/dist/components/field/field-rating.d.ts.map +1 -0
- package/dist/components/field/field-select.d.ts +50 -0
- package/dist/components/field/field-select.d.ts.map +1 -0
- package/dist/components/field/field-slider.d.ts +56 -0
- package/dist/components/field/field-slider.d.ts.map +1 -0
- package/dist/components/field/field-switch.d.ts +44 -0
- package/dist/components/field/field-switch.d.ts.map +1 -0
- package/dist/components/field/field-text.d.ts +38 -0
- package/dist/components/field/field-text.d.ts.map +1 -0
- package/dist/components/field/field-time-picker.d.ts +79 -0
- package/dist/components/field/field-time-picker.d.ts.map +1 -0
- package/dist/components/field/field-upload.d.ts +120 -0
- package/dist/components/field/field-upload.d.ts.map +1 -0
- package/dist/components/field/index.d.ts +149 -0
- package/dist/components/field/index.d.ts.map +1 -0
- package/dist/components/image/image.d.ts +79 -0
- package/dist/components/image/image.d.ts.map +1 -0
- package/dist/components/image/index.d.ts +7 -0
- package/dist/components/image/index.d.ts.map +1 -0
- package/dist/components/index.css +4 -0
- package/dist/components/index.css.map +1 -1
- package/dist/components/index.d.ts +60 -7072
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +21 -11
- package/dist/components/knowledge-graph/edge-labels.d.ts +14 -0
- package/dist/components/knowledge-graph/edge-labels.d.ts.map +1 -0
- package/dist/components/knowledge-graph/graph.d.ts +56 -0
- package/dist/components/knowledge-graph/graph.d.ts.map +1 -0
- package/dist/components/knowledge-graph/index.css +176 -0
- package/dist/components/knowledge-graph/index.css.map +1 -0
- package/dist/components/knowledge-graph/index.d.ts +3 -0
- package/dist/components/knowledge-graph/index.d.ts.map +1 -0
- package/dist/components/knowledge-graph/index.js +795 -0
- package/dist/components/knowledge-graph/index.js.map +1 -0
- package/dist/components/knowledge-graph/label-layout.d.ts +28 -0
- package/dist/components/knowledge-graph/label-layout.d.ts.map +1 -0
- package/dist/components/knowledge-graph/label-store.d.ts +15 -0
- package/dist/components/knowledge-graph/label-store.d.ts.map +1 -0
- package/dist/components/knowledge-graph/model.d.ts +92 -0
- package/dist/components/knowledge-graph/model.d.ts.map +1 -0
- package/dist/components/label/index.d.ts +7 -0
- package/dist/components/label/index.d.ts.map +1 -0
- package/dist/components/label/label.d.ts +71 -0
- package/dist/components/label/label.d.ts.map +1 -0
- package/dist/components/lightbox/classes.d.ts +34 -0
- package/dist/components/lightbox/classes.d.ts.map +1 -0
- package/dist/components/lightbox/index.d.ts +11 -0
- package/dist/components/lightbox/index.d.ts.map +1 -0
- package/dist/components/lightbox/lightbox.d.ts +42 -0
- package/dist/components/lightbox/lightbox.d.ts.map +1 -0
- package/dist/components/lightbox/types.d.ts +233 -0
- package/dist/components/lightbox/types.d.ts.map +1 -0
- package/dist/components/lightbox/use-lightbox.d.ts +42 -0
- package/dist/components/lightbox/use-lightbox.d.ts.map +1 -0
- package/dist/components/loading-screen/index.d.ts +8 -0
- package/dist/components/loading-screen/index.d.ts.map +1 -0
- package/dist/components/loading-screen/loading-screen.d.ts +37 -0
- package/dist/components/loading-screen/loading-screen.d.ts.map +1 -0
- package/dist/components/loading-screen/splash-screen.d.ts +80 -0
- package/dist/components/loading-screen/splash-screen.d.ts.map +1 -0
- package/dist/components/map/Map.d.ts +39 -0
- package/dist/components/map/Map.d.ts.map +1 -0
- package/dist/components/map/MapCoverageLayer.d.ts +25 -0
- package/dist/components/map/MapCoverageLayer.d.ts.map +1 -0
- package/dist/components/map/MapMarker.d.ts +17 -0
- package/dist/components/map/MapMarker.d.ts.map +1 -0
- package/dist/components/map/MapPlaceSearch.d.ts +33 -0
- package/dist/components/map/MapPlaceSearch.d.ts.map +1 -0
- package/dist/components/map/MapPointPicker.d.ts +35 -0
- package/dist/components/map/MapPointPicker.d.ts.map +1 -0
- package/dist/components/map/coordinates.d.ts +10 -0
- package/dist/components/map/coordinates.d.ts.map +1 -0
- package/dist/components/map/index.css +4 -0
- package/dist/components/map/index.css.map +1 -0
- package/dist/components/map/index.d.ts +19 -0
- package/dist/components/map/index.d.ts.map +1 -0
- package/dist/components/map/index.js +3 -0
- package/dist/components/map/index.js.map +1 -0
- package/dist/components/mega-menu/index.d.ts +12 -0
- package/dist/components/mega-menu/index.d.ts.map +1 -0
- package/dist/components/mega-menu/mega-menu-horizontal.d.ts +41 -0
- package/dist/components/mega-menu/mega-menu-horizontal.d.ts.map +1 -0
- package/dist/components/mega-menu/mega-menu-mobile.d.ts +28 -0
- package/dist/components/mega-menu/mega-menu-mobile.d.ts.map +1 -0
- package/dist/components/mega-menu/mega-menu-vertical.d.ts +28 -0
- package/dist/components/mega-menu/mega-menu-vertical.d.ts.map +1 -0
- package/dist/components/mega-menu/styles.d.ts +18 -0
- package/dist/components/mega-menu/styles.d.ts.map +1 -0
- package/dist/components/mega-menu/types.d.ts +200 -0
- package/dist/components/mega-menu/types.d.ts.map +1 -0
- package/dist/components/menu/index.d.ts +7 -0
- package/dist/components/menu/index.d.ts.map +1 -0
- package/dist/components/menu/menu.d.ts +144 -0
- package/dist/components/menu/menu.d.ts.map +1 -0
- package/dist/components/nav-card/index.d.ts +8 -0
- package/dist/components/nav-card/index.d.ts.map +1 -0
- package/dist/components/nav-card/nav-card-grid.d.ts +57 -0
- package/dist/components/nav-card/nav-card-grid.d.ts.map +1 -0
- package/dist/components/nav-card/nav-card.d.ts +69 -0
- package/dist/components/nav-card/nav-card.d.ts.map +1 -0
- package/dist/components/nav-section/components.d.ts +143 -0
- package/dist/components/nav-section/components.d.ts.map +1 -0
- package/dist/components/nav-section/index.d.ts +15 -0
- package/dist/components/nav-section/index.d.ts.map +1 -0
- package/dist/components/nav-section/nav-context.d.ts +80 -0
- package/dist/components/nav-section/nav-context.d.ts.map +1 -0
- package/dist/components/nav-section/nav-item.d.ts +20 -0
- package/dist/components/nav-section/nav-item.d.ts.map +1 -0
- package/dist/components/nav-section/nav-list.d.ts +25 -0
- package/dist/components/nav-section/nav-list.d.ts.map +1 -0
- package/dist/components/nav-section/nav-section-horizontal.d.ts +29 -0
- package/dist/components/nav-section/nav-section-horizontal.d.ts.map +1 -0
- package/dist/components/nav-section/nav-section-mini.d.ts +30 -0
- package/dist/components/nav-section/nav-section-mini.d.ts.map +1 -0
- package/dist/components/nav-section/nav-section-vertical.d.ts +37 -0
- package/dist/components/nav-section/nav-section-vertical.d.ts.map +1 -0
- package/dist/components/nav-section/styles.d.ts +35 -0
- package/dist/components/nav-section/styles.d.ts.map +1 -0
- package/dist/components/nav-section/types.d.ts +178 -0
- package/dist/components/nav-section/types.d.ts.map +1 -0
- package/dist/components/navigation-progress/index.d.ts +7 -0
- package/dist/components/navigation-progress/index.d.ts.map +1 -0
- package/dist/components/navigation-progress/navigation-progress.d.ts +36 -0
- package/dist/components/navigation-progress/navigation-progress.d.ts.map +1 -0
- package/dist/components/page-content/index.d.ts +7 -0
- package/dist/components/page-content/index.d.ts.map +1 -0
- package/dist/components/page-content/page-content.d.ts +55 -0
- package/dist/components/page-content/page-content.d.ts.map +1 -0
- package/dist/components/popover/index.d.ts +7 -0
- package/dist/components/popover/index.d.ts.map +1 -0
- package/dist/{popover-Dmw7SJLR.d.ts → components/popover/popover.d.ts} +11 -14
- package/dist/components/popover/popover.d.ts.map +1 -0
- package/dist/components/progress/countdown-ring.d.ts +60 -0
- package/dist/components/progress/countdown-ring.d.ts.map +1 -0
- package/dist/components/progress/index.d.ts +8 -0
- package/dist/components/progress/index.d.ts.map +1 -0
- package/dist/components/progress/progress.d.ts +106 -0
- package/dist/components/progress/progress.d.ts.map +1 -0
- package/dist/components/rail/index.d.ts +7 -0
- package/dist/components/rail/index.d.ts.map +1 -0
- package/dist/components/rail/rail.d.ts +39 -0
- package/dist/components/rail/rail.d.ts.map +1 -0
- package/dist/components/research/diagram-image.d.ts +11 -0
- package/dist/components/research/diagram-image.d.ts.map +1 -0
- package/dist/components/research/diagram.d.ts +8 -0
- package/dist/components/research/diagram.d.ts.map +1 -0
- package/dist/components/research/document.d.ts +33 -0
- package/dist/components/research/document.d.ts.map +1 -0
- package/dist/components/research/frontmatter.d.ts +15 -0
- package/dist/components/research/frontmatter.d.ts.map +1 -0
- package/dist/components/research/index.css +51 -0
- package/dist/components/research/index.css.map +1 -0
- package/dist/components/research/index.d.ts +3 -0
- package/dist/components/research/index.d.ts.map +1 -0
- package/dist/components/research/index.js +6 -0
- package/dist/components/research/index.js.map +1 -0
- package/dist/components/research/parse.d.ts +29 -0
- package/dist/components/research/parse.d.ts.map +1 -0
- package/dist/components/research-editor/block-commands.d.ts +20 -0
- package/dist/components/research-editor/block-commands.d.ts.map +1 -0
- package/dist/components/research-editor/block-controls.d.ts +13 -0
- package/dist/components/research-editor/block-controls.d.ts.map +1 -0
- package/dist/components/research-editor/editor.d.ts +75 -0
- package/dist/components/research-editor/editor.d.ts.map +1 -0
- package/dist/components/research-editor/extensions.d.ts +14 -0
- package/dist/components/research-editor/extensions.d.ts.map +1 -0
- package/dist/components/research-editor/index.css +332 -0
- package/dist/components/research-editor/index.css.map +1 -0
- package/dist/components/research-editor/index.d.ts +5 -0
- package/dist/components/research-editor/index.d.ts.map +1 -0
- package/dist/components/research-editor/index.js +1592 -0
- package/dist/components/research-editor/index.js.map +1 -0
- package/dist/components/research-editor/math-input.d.ts +32 -0
- package/dist/components/research-editor/math-input.d.ts.map +1 -0
- package/dist/components/research-editor/math-markup.d.ts +4 -0
- package/dist/components/research-editor/math-markup.d.ts.map +1 -0
- package/dist/components/research-editor/math-navigation.d.ts +6 -0
- package/dist/components/research-editor/math-navigation.d.ts.map +1 -0
- package/dist/components/research-editor/math-node.d.ts +11 -0
- package/dist/components/research-editor/math-node.d.ts.map +1 -0
- package/dist/components/research-editor/source.d.ts +19 -0
- package/dist/components/research-editor/source.d.ts.map +1 -0
- package/dist/components/scroll-spy/index.d.ts +3 -0
- package/dist/components/scroll-spy/index.d.ts.map +1 -0
- package/dist/components/scroll-spy/scroll-spy-provider.d.ts +26 -0
- package/dist/components/scroll-spy/scroll-spy-provider.d.ts.map +1 -0
- package/dist/components/scroll-spy/scroll-spy-section.d.ts +10 -0
- package/dist/components/scroll-spy/scroll-spy-section.d.ts.map +1 -0
- package/dist/components/scroll-to-top/index.d.ts +7 -0
- package/dist/components/scroll-to-top/index.d.ts.map +1 -0
- package/dist/components/scroll-to-top/scroll-to-top.d.ts +25 -0
- package/dist/components/scroll-to-top/scroll-to-top.d.ts.map +1 -0
- package/dist/components/scrollbar/index.d.ts +7 -0
- package/dist/components/scrollbar/index.d.ts.map +1 -0
- package/dist/components/scrollbar/scrollbar.d.ts +61 -0
- package/dist/components/scrollbar/scrollbar.d.ts.map +1 -0
- package/dist/components/search-input/index.d.ts +2 -0
- package/dist/components/search-input/index.d.ts.map +1 -0
- package/dist/components/search-input/search-input.d.ts +36 -0
- package/dist/components/search-input/search-input.d.ts.map +1 -0
- package/dist/components/settings/index.d.ts +10 -0
- package/dist/components/settings/index.d.ts.map +1 -0
- package/dist/components/settings/settings-drawer.d.ts +39 -0
- package/dist/components/settings/settings-drawer.d.ts.map +1 -0
- package/dist/components/settings/settings-provider.d.ts +106 -0
- package/dist/components/settings/settings-provider.d.ts.map +1 -0
- package/dist/components/skeleton/index.d.ts +7 -0
- package/dist/components/skeleton/index.d.ts.map +1 -0
- package/dist/components/skeleton/skeleton.d.ts +77 -0
- package/dist/components/skeleton/skeleton.d.ts.map +1 -0
- package/dist/components/snackbar/index.d.ts +7 -0
- package/dist/components/snackbar/index.d.ts.map +1 -0
- package/dist/components/snackbar/snackbar.d.ts +120 -0
- package/dist/components/snackbar/snackbar.d.ts.map +1 -0
- package/dist/components/sponsored-slot/index.d.ts +3 -0
- package/dist/components/sponsored-slot/index.d.ts.map +1 -0
- package/dist/components/sponsored-slot/sponsored-slot.d.ts +16 -0
- package/dist/components/sponsored-slot/sponsored-slot.d.ts.map +1 -0
- package/dist/components/sponsored-slot/types.d.ts +45 -0
- package/dist/components/sponsored-slot/types.d.ts.map +1 -0
- package/dist/components/stepper/index.d.ts +7 -0
- package/dist/components/stepper/index.d.ts.map +1 -0
- package/dist/components/stepper/stepper.d.ts +145 -0
- package/dist/components/stepper/stepper.d.ts.map +1 -0
- package/dist/components/svg-color/index.d.ts +7 -0
- package/dist/components/svg-color/index.d.ts.map +1 -0
- package/dist/components/svg-color/svg-color.d.ts +80 -0
- package/dist/components/svg-color/svg-color.d.ts.map +1 -0
- package/dist/components/table/index.d.ts +7 -0
- package/dist/components/table/index.d.ts.map +1 -0
- package/dist/components/table/table.d.ts +184 -0
- package/dist/components/table/table.d.ts.map +1 -0
- package/dist/components/tabs/index.d.ts +7 -0
- package/dist/components/tabs/index.d.ts.map +1 -0
- package/dist/components/tabs/tabs.d.ts +146 -0
- package/dist/components/tabs/tabs.d.ts.map +1 -0
- package/dist/components/tag-cloud/index.d.ts +7 -0
- package/dist/components/tag-cloud/index.d.ts.map +1 -0
- package/dist/components/tag-cloud/tag-cloud.d.ts +58 -0
- package/dist/components/tag-cloud/tag-cloud.d.ts.map +1 -0
- package/dist/components/tiptap-renderer/index.d.ts +2 -0
- package/dist/components/tiptap-renderer/index.d.ts.map +1 -0
- package/dist/components/tiptap-renderer/tiptap-renderer.d.ts +46 -0
- package/dist/components/tiptap-renderer/tiptap-renderer.d.ts.map +1 -0
- package/dist/components/tooltip/index.d.ts +7 -0
- package/dist/components/tooltip/index.d.ts.map +1 -0
- package/dist/components/tooltip/tooltip.d.ts +38 -0
- package/dist/components/tooltip/tooltip.d.ts.map +1 -0
- package/dist/components/virtual-list/index.d.ts +7 -0
- package/dist/components/virtual-list/index.d.ts.map +1 -0
- package/dist/components/virtual-list/virtual-list.d.ts +64 -0
- package/dist/components/virtual-list/virtual-list.d.ts.map +1 -0
- package/dist/core/accessibility/index.d.ts +96 -0
- package/dist/core/accessibility/index.d.ts.map +1 -0
- package/dist/core/accessibility/skip-link.d.ts +31 -0
- package/dist/core/accessibility/skip-link.d.ts.map +1 -0
- package/dist/core/context.d.ts +99 -0
- package/dist/core/context.d.ts.map +1 -0
- package/dist/core/hooks/use-boolean.d.ts +54 -0
- package/dist/core/hooks/use-boolean.d.ts.map +1 -0
- package/dist/core/hooks/use-breakpoints.d.ts +87 -0
- package/dist/core/hooks/use-breakpoints.d.ts.map +1 -0
- package/dist/core/hooks/use-click-outside.d.ts +26 -0
- package/dist/core/hooks/use-click-outside.d.ts.map +1 -0
- package/dist/core/hooks/use-copy-to-clipboard.d.ts +66 -0
- package/dist/core/hooks/use-copy-to-clipboard.d.ts.map +1 -0
- package/dist/core/hooks/use-countdown.d.ts +105 -0
- package/dist/core/hooks/use-countdown.d.ts.map +1 -0
- package/dist/core/hooks/use-debounce.d.ts +64 -0
- package/dist/core/hooks/use-debounce.d.ts.map +1 -0
- package/dist/core/hooks/use-event-listener.d.ts +37 -0
- package/dist/core/hooks/use-event-listener.d.ts.map +1 -0
- package/dist/core/hooks/use-interval.d.ts +30 -0
- package/dist/core/hooks/use-interval.d.ts.map +1 -0
- package/dist/core/hooks/use-is-client.d.ts +24 -0
- package/dist/core/hooks/use-is-client.d.ts.map +1 -0
- package/dist/core/hooks/use-local-storage.d.ts +61 -0
- package/dist/core/hooks/use-local-storage.d.ts.map +1 -0
- package/dist/core/hooks/use-media-query.d.ts +107 -0
- package/dist/core/hooks/use-media-query.d.ts.map +1 -0
- package/dist/core/hooks/use-mounted.d.ts +33 -0
- package/dist/core/hooks/use-mounted.d.ts.map +1 -0
- package/dist/core/hooks/use-multi-select.d.ts +113 -0
- package/dist/core/hooks/use-multi-select.d.ts.map +1 -0
- package/dist/core/hooks/use-previous.d.ts +23 -0
- package/dist/core/hooks/use-previous.d.ts.map +1 -0
- package/dist/core/hooks/use-set-state.d.ts +56 -0
- package/dist/core/hooks/use-set-state.d.ts.map +1 -0
- package/dist/core/hooks/use-tabs.d.ts +74 -0
- package/dist/core/hooks/use-tabs.d.ts.map +1 -0
- package/dist/core/hooks/use-timeout.d.ts +37 -0
- package/dist/core/hooks/use-timeout.d.ts.map +1 -0
- package/dist/core/index.d.ts +36 -468
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +10 -7
- package/dist/core/provider-stack.d.ts +181 -0
- package/dist/core/provider-stack.d.ts.map +1 -0
- package/dist/core/provider.d.ts +72 -0
- package/dist/core/provider.d.ts.map +1 -0
- package/dist/forms/index.d.ts +6 -557
- package/dist/forms/index.d.ts.map +1 -0
- package/dist/forms/index.js +0 -1
- package/dist/forms/index.js.map +1 -1
- package/dist/forms/schema-provider.d.ts +282 -0
- package/dist/forms/schema-provider.d.ts.map +1 -0
- package/dist/forms/schema-utils.d.ts +286 -0
- package/dist/forms/schema-utils.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +38 -8
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +12 -9
- package/dist/hooks/use-array.d.ts +126 -0
- package/dist/hooks/use-array.d.ts.map +1 -0
- package/dist/hooks/use-async.d.ts +88 -0
- package/dist/hooks/use-async.d.ts.map +1 -0
- package/dist/hooks/use-back-to-top.d.ts +57 -0
- package/dist/hooks/use-back-to-top.d.ts.map +1 -0
- package/dist/hooks/use-client-rect.d.ts +67 -0
- package/dist/hooks/use-client-rect.d.ts.map +1 -0
- package/dist/hooks/use-config-from-query.d.ts +98 -0
- package/dist/hooks/use-config-from-query.d.ts.map +1 -0
- package/dist/hooks/use-cookies.d.ts +62 -0
- package/dist/hooks/use-cookies.d.ts.map +1 -0
- package/dist/hooks/use-countdown-date.d.ts +47 -0
- package/dist/hooks/use-countdown-date.d.ts.map +1 -0
- package/dist/hooks/use-countdown-seconds.d.ts +83 -0
- package/dist/hooks/use-countdown-seconds.d.ts.map +1 -0
- package/dist/hooks/use-double-click.d.ts +67 -0
- package/dist/hooks/use-double-click.d.ts.map +1 -0
- package/dist/hooks/use-focus-trap.d.ts +66 -0
- package/dist/hooks/use-focus-trap.d.ts.map +1 -0
- package/dist/hooks/use-image-dimensions.d.ts +124 -0
- package/dist/hooks/use-image-dimensions.d.ts.map +1 -0
- package/dist/hooks/use-infinite-scroll.d.ts +204 -0
- package/dist/hooks/use-infinite-scroll.d.ts.map +1 -0
- package/dist/hooks/use-intersection-observer.d.ts +93 -0
- package/dist/hooks/use-intersection-observer.d.ts.map +1 -0
- package/dist/hooks/use-isomorphic-layout-effect.d.ts +34 -0
- package/dist/hooks/use-isomorphic-layout-effect.d.ts.map +1 -0
- package/dist/hooks/use-keyboard-shortcut.d.ts +112 -0
- package/dist/hooks/use-keyboard-shortcut.d.ts.map +1 -0
- package/dist/hooks/use-lazy-query.d.ts +132 -0
- package/dist/hooks/use-lazy-query.d.ts.map +1 -0
- package/dist/hooks/use-mutation.d.ts +141 -0
- package/dist/hooks/use-mutation.d.ts.map +1 -0
- package/dist/hooks/use-online-status.d.ts +56 -0
- package/dist/hooks/use-online-status.d.ts.map +1 -0
- package/dist/hooks/use-password-visibility.d.ts +83 -0
- package/dist/hooks/use-password-visibility.d.ts.map +1 -0
- package/dist/hooks/use-popover-hover.d.ts +78 -0
- package/dist/hooks/use-popover-hover.d.ts.map +1 -0
- package/dist/hooks/use-scroll-offset-top.d.ts +69 -0
- package/dist/hooks/use-scroll-offset-top.d.ts.map +1 -0
- package/dist/hooks/use-scroll-position.d.ts +96 -0
- package/dist/hooks/use-scroll-position.d.ts.map +1 -0
- package/dist/hooks/use-session-storage.d.ts +66 -0
- package/dist/hooks/use-session-storage.d.ts.map +1 -0
- package/dist/hooks/use-throttle.d.ts +67 -0
- package/dist/hooks/use-throttle.d.ts.map +1 -0
- package/dist/hooks/use-update-effect.d.ts +53 -0
- package/dist/hooks/use-update-effect.d.ts.map +1 -0
- package/dist/hooks/use-window-size.d.ts +132 -0
- package/dist/hooks/use-window-size.d.ts.map +1 -0
- package/dist/http/client.d.ts +74 -0
- package/dist/http/client.d.ts.map +1 -0
- package/dist/http/index.d.ts +6 -229
- package/dist/http/index.d.ts.map +1 -0
- package/dist/http/index.js +0 -2
- package/dist/http/index.js.map +1 -1
- package/dist/http/types.d.ts +158 -0
- package/dist/http/types.d.ts.map +1 -0
- package/dist/icons/context.d.ts +17 -0
- package/dist/icons/context.d.ts.map +1 -0
- package/dist/icons/controls.d.ts +51 -0
- package/dist/icons/controls.d.ts.map +1 -0
- package/dist/icons/index.d.ts +3 -0
- package/dist/icons/index.d.ts.map +1 -0
- package/dist/icons/index.js +4 -0
- package/dist/icons/index.js.map +1 -0
- package/dist/icons/theme.d.ts +4 -0
- package/dist/icons/theme.d.ts.map +1 -0
- package/dist/index.css +4 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +19 -2758
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +46 -63
- package/dist/index.js.map +1 -1
- package/dist/layouts/auth/centered.d.ts +49 -0
- package/dist/layouts/auth/centered.d.ts.map +1 -0
- package/dist/layouts/auth/index.d.ts +12 -0
- package/dist/layouts/auth/index.d.ts.map +1 -0
- package/dist/layouts/auth/simple.d.ts +58 -0
- package/dist/layouts/auth/simple.d.ts.map +1 -0
- package/dist/layouts/auth/split.d.ts +81 -0
- package/dist/layouts/auth/split.d.ts.map +1 -0
- package/dist/layouts/core/context.d.ts +102 -0
- package/dist/layouts/core/context.d.ts.map +1 -0
- package/dist/layouts/core/css-vars.d.ts +43 -0
- package/dist/layouts/core/css-vars.d.ts.map +1 -0
- package/dist/layouts/core/header-section.d.ts +79 -0
- package/dist/layouts/core/header-section.d.ts.map +1 -0
- package/dist/layouts/core/index.d.ts +18 -0
- package/dist/layouts/core/index.d.ts.map +1 -0
- package/dist/layouts/core/layout-section.d.ts +64 -0
- package/dist/layouts/core/layout-section.d.ts.map +1 -0
- package/dist/layouts/core/user-menu.d.ts +88 -0
- package/dist/layouts/core/user-menu.d.ts.map +1 -0
- package/dist/layouts/dashboard/index.d.ts +10 -0
- package/dist/layouts/dashboard/index.d.ts.map +1 -0
- package/dist/layouts/dashboard/labels.d.ts +12 -0
- package/dist/layouts/dashboard/labels.d.ts.map +1 -0
- package/dist/layouts/dashboard/layout.d.ts +96 -0
- package/dist/layouts/dashboard/layout.d.ts.map +1 -0
- package/dist/layouts/dashboard/sidenav.d.ts +62 -0
- package/dist/layouts/dashboard/sidenav.d.ts.map +1 -0
- package/dist/layouts/dashboard/topnav.d.ts +41 -0
- package/dist/layouts/dashboard/topnav.d.ts.map +1 -0
- package/dist/layouts/index.d.ts +32 -850
- package/dist/layouts/index.d.ts.map +1 -0
- package/dist/layouts/index.js +8 -4
- package/dist/layouts/panel-layout.d.ts +35 -0
- package/dist/layouts/panel-layout.d.ts.map +1 -0
- package/dist/layouts/sidebar-toggle.d.ts +11 -0
- package/dist/layouts/sidebar-toggle.d.ts.map +1 -0
- package/dist/layouts/types.d.ts +317 -0
- package/dist/layouts/types.d.ts.map +1 -0
- package/dist/netron/context.d.ts +18 -0
- package/dist/netron/context.d.ts.map +1 -0
- package/dist/netron/hooks.d.ts +10 -0
- package/dist/netron/hooks.d.ts.map +1 -0
- package/dist/netron/index.d.ts +47 -4
- package/dist/netron/index.d.ts.map +1 -0
- package/dist/netron/index.js +1 -2
- package/dist/netron/types.d.ts +12 -0
- package/dist/netron/types.d.ts.map +1 -0
- package/dist/registry/index.d.ts +8 -341
- package/dist/registry/index.d.ts.map +1 -0
- package/dist/registry/index.js +1 -2
- package/dist/registry/installer.d.ts +137 -0
- package/dist/registry/installer.d.ts.map +1 -0
- package/dist/registry/manager.d.ts +196 -0
- package/dist/registry/manager.d.ts.map +1 -0
- package/dist/state/create-store.d.ts +164 -0
- package/dist/state/create-store.d.ts.map +1 -0
- package/dist/state/index.d.ts +12 -969
- package/dist/state/index.d.ts.map +1 -0
- package/dist/state/index.js +2 -3
- package/dist/state/settings-version.d.ts +255 -0
- package/dist/state/settings-version.d.ts.map +1 -0
- package/dist/state/stores/auth.d.ts +143 -0
- package/dist/state/stores/auth.d.ts.map +1 -0
- package/dist/state/stores/index.d.ts +10 -0
- package/dist/state/stores/index.d.ts.map +1 -0
- package/dist/state/stores/settings.d.ts +151 -0
- package/dist/state/stores/settings.d.ts.map +1 -0
- package/dist/state/stores/theme.d.ts +87 -0
- package/dist/state/stores/theme.d.ts.map +1 -0
- package/dist/state/stores/ui.d.ts +106 -0
- package/dist/state/stores/ui.d.ts.map +1 -0
- package/dist/theme/colors/base.d.ts +61 -0
- package/dist/theme/colors/base.d.ts.map +1 -0
- package/dist/theme/colors/index.d.ts +10 -0
- package/dist/theme/colors/index.d.ts.map +1 -0
- package/dist/theme/colors/luxury.d.ts +49 -0
- package/dist/theme/colors/luxury.d.ts.map +1 -0
- package/dist/theme/components/Autocomplete.d.ts +9 -0
- package/dist/theme/components/Autocomplete.d.ts.map +1 -0
- package/dist/theme/components/Button.d.ts +33 -0
- package/dist/theme/components/Button.d.ts.map +1 -0
- package/dist/theme/components/Card.d.ts +20 -0
- package/dist/theme/components/Card.d.ts.map +1 -0
- package/dist/theme/components/Chip.d.ts +29 -0
- package/dist/theme/components/Chip.d.ts.map +1 -0
- package/dist/theme/components/DataGrid.d.ts +15 -0
- package/dist/theme/components/DataGrid.d.ts.map +1 -0
- package/dist/theme/components/DatePicker.d.ts +19 -0
- package/dist/theme/components/DatePicker.d.ts.map +1 -0
- package/dist/theme/components/Dialog.d.ts +23 -0
- package/dist/theme/components/Dialog.d.ts.map +1 -0
- package/dist/theme/components/FormControls.d.ts +44 -0
- package/dist/theme/components/FormControls.d.ts.map +1 -0
- package/dist/theme/components/Tabs.d.ts +21 -0
- package/dist/theme/components/Tabs.d.ts.map +1 -0
- package/dist/theme/components/TextField.d.ts +87 -0
- package/dist/theme/components/TextField.d.ts.map +1 -0
- package/dist/theme/components/index.d.ts +27 -0
- package/dist/theme/components/index.d.ts.map +1 -0
- package/dist/theme/components/theme-utils.d.ts +42 -0
- package/dist/theme/components/theme-utils.d.ts.map +1 -0
- package/dist/theme/create-theme.d.ts +119 -0
- package/dist/theme/create-theme.d.ts.map +1 -0
- package/dist/theme/css-variables.d.ts +42 -0
- package/dist/theme/css-variables.d.ts.map +1 -0
- package/dist/theme/custom-shadows.d.ts +58 -0
- package/dist/theme/custom-shadows.d.ts.map +1 -0
- package/dist/theme/index.d.ts +23 -1045
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/index.js +6 -3
- package/dist/theme/mixins.d.ts +334 -0
- package/dist/theme/mixins.d.ts.map +1 -0
- package/dist/theme/opacity.d.ts +51 -0
- package/dist/theme/opacity.d.ts.map +1 -0
- package/dist/theme/palette/builder.d.ts +138 -0
- package/dist/theme/palette/builder.d.ts.map +1 -0
- package/dist/theme/palette/index.d.ts +7 -0
- package/dist/theme/palette/index.d.ts.map +1 -0
- package/dist/theme/palette/overrides.d.ts +23 -0
- package/dist/theme/palette/overrides.d.ts.map +1 -0
- package/dist/theme/palette.d.ts +43 -0
- package/dist/theme/palette.d.ts.map +1 -0
- package/dist/theme/presets/arctic.d.ts +13 -0
- package/dist/theme/presets/arctic.d.ts.map +1 -0
- package/dist/theme/presets/default.d.ts +13 -0
- package/dist/theme/presets/default.d.ts.map +1 -0
- package/dist/theme/presets/dracula.d.ts +27 -0
- package/dist/theme/presets/dracula.d.ts.map +1 -0
- package/dist/theme/presets/ember.d.ts +23 -0
- package/dist/theme/presets/ember.d.ts.map +1 -0
- package/dist/theme/presets/index.d.ts +39 -0
- package/dist/theme/presets/index.d.ts.map +1 -0
- package/dist/theme/presets/luxury.d.ts +13 -0
- package/dist/theme/presets/luxury.d.ts.map +1 -0
- package/dist/theme/presets/midnight.d.ts +23 -0
- package/dist/theme/presets/midnight.d.ts.map +1 -0
- package/dist/theme/presets/minimal.d.ts +23 -0
- package/dist/theme/presets/minimal.d.ts.map +1 -0
- package/dist/theme/presets/nature.d.ts +14 -0
- package/dist/theme/presets/nature.d.ts.map +1 -0
- package/dist/theme/presets/retro.d.ts +23 -0
- package/dist/theme/presets/retro.d.ts.map +1 -0
- package/dist/theme/shadows.d.ts +61 -0
- package/dist/theme/shadows.d.ts.map +1 -0
- package/dist/theme/typography.d.ts +24 -0
- package/dist/theme/typography.d.ts.map +1 -0
- package/dist/theme/utils/color.d.ts +295 -0
- package/dist/theme/utils/color.d.ts.map +1 -0
- package/dist/theme/utils/index.d.ts +7 -0
- package/dist/theme/utils/index.d.ts.map +1 -0
- package/dist/{registry-DQcIzW2s.d.ts → types/blocks.d.ts} +30 -191
- package/dist/types/blocks.d.ts.map +1 -0
- package/dist/{components-BCGZ-Rwt.d.ts → types/components.d.ts} +17 -20
- package/dist/types/components.d.ts.map +1 -0
- package/dist/{config-Pct0n_Kq.d.ts → types/config.d.ts} +14 -16
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/index.d.ts +13 -7
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +1 -2
- package/dist/types/registry.d.ts +158 -0
- package/dist/types/registry.d.ts.map +1 -0
- package/dist/{theme-B4Q3Bg5o.d.ts → types/theme.d.ts} +31 -34
- package/dist/types/theme.d.ts.map +1 -0
- package/dist/ui/index.d.ts +18 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +148 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/utils/async-lock.d.ts +169 -0
- package/dist/utils/async-lock.d.ts.map +1 -0
- package/dist/utils/cn.d.ts +80 -0
- package/dist/utils/cn.d.ts.map +1 -0
- package/dist/utils/cookies.d.ts +68 -0
- package/dist/utils/cookies.d.ts.map +1 -0
- package/dist/utils/create-classes.d.ts +90 -0
- package/dist/utils/create-classes.d.ts.map +1 -0
- package/dist/utils/errors.d.ts +201 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/fetch-interceptor.d.ts +230 -0
- package/dist/utils/fetch-interceptor.d.ts.map +1 -0
- package/dist/utils/font.d.ts +65 -0
- package/dist/utils/font.d.ts.map +1 -0
- package/dist/utils/format-crypto.d.ts +312 -0
- package/dist/utils/format-crypto.d.ts.map +1 -0
- package/dist/utils/format-date.d.ts +240 -0
- package/dist/utils/format-date.d.ts.map +1 -0
- package/dist/utils/format-number.d.ts +245 -0
- package/dist/utils/format-number.d.ts.map +1 -0
- package/dist/utils/i18n-text.d.ts +68 -0
- package/dist/utils/i18n-text.d.ts.map +1 -0
- package/dist/utils/index.d.ts +30 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/jwt.d.ts +227 -0
- package/dist/utils/jwt.d.ts.map +1 -0
- package/dist/utils/object.d.ts +96 -0
- package/dist/utils/object.d.ts.map +1 -0
- package/dist/utils/refs.d.ts +60 -0
- package/dist/utils/refs.d.ts.map +1 -0
- package/dist/utils/rtl.d.ts +75 -0
- package/dist/utils/rtl.d.ts.map +1 -0
- package/dist/utils/storage.d.ts +190 -0
- package/dist/utils/storage.d.ts.map +1 -0
- package/dist/utils/string.d.ts +216 -0
- package/dist/utils/string.d.ts.map +1 -0
- package/dist/utils/template-resolver.d.ts +12 -0
- package/dist/utils/template-resolver.d.ts.map +1 -0
- package/dist/utils/toast.d.ts +25 -0
- package/dist/utils/toast.d.ts.map +1 -0
- package/dist/utils/transform-number.d.ts +108 -0
- package/dist/utils/transform-number.d.ts.map +1 -0
- package/dist/utils/url.d.ts +198 -0
- package/dist/utils/url.d.ts.map +1 -0
- package/package.json +120 -63
- package/dist/chunk-2FYNRDXR.js.map +0 -1
- package/dist/chunk-77KIJLPP.js +0 -37
- package/dist/chunk-A2Z7NVGL.js.map +0 -1
- package/dist/chunk-BV32OJ2A.js.map +0 -1
- package/dist/chunk-DDY7TLUI.js.map +0 -1
- package/dist/chunk-HO2GKTWJ.js.map +0 -1
- package/dist/chunk-IZOIO7PA.js.map +0 -1
- package/dist/chunk-JDTC2SBY.js.map +0 -1
- package/dist/chunk-KTCWPGON.js.map +0 -1
- package/dist/chunk-MEFT6XPH.js.map +0 -1
- package/dist/chunk-SNKGGHBT.js.map +0 -1
- package/dist/chunk-VAAIHNWQ.js.map +0 -1
- package/dist/chunk-XQXGE2PW.js +0 -16793
- package/dist/chunk-XQXGE2PW.js.map +0 -1
- package/dist/chunk-XWL6J6IO.js.map +0 -1
- package/dist/chunk-XXP3ZGU6.js.map +0 -1
- package/dist/chunk-YJMAQL3S.js.map +0 -1
- package/dist/index-nmJ8Muwg.d.ts +0 -2368
- package/dist/settings-CAC0qFjS.d.ts +0 -455
- package/dist/text-transform-D6MzzF7V.d.ts +0 -165
- package/dist/use-timeout-D7U3EAtH.d.ts +0 -808
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fetch Interceptor Factory
|
|
3
|
+
*
|
|
4
|
+
* A flexible fetch wrapper with support for request/response interceptors,
|
|
5
|
+
* automatic token refresh, and retry logic.
|
|
6
|
+
*
|
|
7
|
+
* Designed for production applications that need centralized HTTP handling.
|
|
8
|
+
*
|
|
9
|
+
* @module utils
|
|
10
|
+
*/
|
|
11
|
+
import { type AsyncLock } from './async-lock.js';
|
|
12
|
+
import { type RetryConfig } from './errors.js';
|
|
13
|
+
/**
|
|
14
|
+
* Extended request init with additional options.
|
|
15
|
+
*/
|
|
16
|
+
export interface FetchRequestInit extends RequestInit {
|
|
17
|
+
/** Skip all interceptors for this request */
|
|
18
|
+
skipInterceptors?: boolean;
|
|
19
|
+
/** Skip request interceptors only */
|
|
20
|
+
skipRequestInterceptors?: boolean;
|
|
21
|
+
/** Skip response interceptors only */
|
|
22
|
+
skipResponseInterceptors?: boolean;
|
|
23
|
+
/** Custom timeout in milliseconds */
|
|
24
|
+
timeout?: number;
|
|
25
|
+
/** Enable automatic retry on failure */
|
|
26
|
+
retry?: boolean | RetryConfig;
|
|
27
|
+
/** Request metadata for logging/debugging */
|
|
28
|
+
metadata?: Record<string, unknown>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Request interceptor context.
|
|
32
|
+
*/
|
|
33
|
+
export interface RequestContext {
|
|
34
|
+
url: string;
|
|
35
|
+
init: FetchRequestInit;
|
|
36
|
+
/** Original request info (can be string or Request) */
|
|
37
|
+
input: RequestInfo | URL;
|
|
38
|
+
/** Request metadata */
|
|
39
|
+
metadata: Record<string, unknown>;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Response interceptor context.
|
|
43
|
+
*/
|
|
44
|
+
export interface ResponseContext {
|
|
45
|
+
response: Response;
|
|
46
|
+
request: RequestContext;
|
|
47
|
+
/** Time taken for the request in ms */
|
|
48
|
+
duration: number;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Error interceptor context.
|
|
52
|
+
*/
|
|
53
|
+
export interface ErrorContext {
|
|
54
|
+
error: unknown;
|
|
55
|
+
request: RequestContext;
|
|
56
|
+
/** Time taken before error in ms */
|
|
57
|
+
duration: number;
|
|
58
|
+
/** Number of retry attempts made */
|
|
59
|
+
retryCount: number;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Request interceptor function.
|
|
63
|
+
* Can modify the request or return a new one.
|
|
64
|
+
*/
|
|
65
|
+
export type RequestInterceptor = (ctx: RequestContext) => RequestContext | Promise<RequestContext>;
|
|
66
|
+
/**
|
|
67
|
+
* Response interceptor function.
|
|
68
|
+
* Can modify the response or return a new one.
|
|
69
|
+
*/
|
|
70
|
+
export type ResponseInterceptor = (ctx: ResponseContext) => Response | Promise<Response>;
|
|
71
|
+
/**
|
|
72
|
+
* Error interceptor function.
|
|
73
|
+
* Can handle the error, retry, or rethrow.
|
|
74
|
+
*/
|
|
75
|
+
export type ErrorInterceptor = (ctx: ErrorContext) => Response | Promise<Response> | never;
|
|
76
|
+
/**
|
|
77
|
+
* Interceptor configuration.
|
|
78
|
+
*/
|
|
79
|
+
export interface FetchInterceptorConfig {
|
|
80
|
+
/** Base URL to prepend to relative paths */
|
|
81
|
+
baseUrl?: string;
|
|
82
|
+
/** Default headers for all requests */
|
|
83
|
+
defaultHeaders?: HeadersInit;
|
|
84
|
+
/** Default timeout in milliseconds (0 = no timeout) */
|
|
85
|
+
defaultTimeout?: number;
|
|
86
|
+
/** Request interceptors (run in order) */
|
|
87
|
+
requestInterceptors?: RequestInterceptor[];
|
|
88
|
+
/** Response interceptors (run in order) */
|
|
89
|
+
responseInterceptors?: ResponseInterceptor[];
|
|
90
|
+
/** Error interceptors (run in order, first to handle wins) */
|
|
91
|
+
errorInterceptors?: ErrorInterceptor[];
|
|
92
|
+
/** Default retry configuration */
|
|
93
|
+
defaultRetry?: RetryConfig | false;
|
|
94
|
+
/** Credentials mode for all requests */
|
|
95
|
+
credentials?: RequestCredentials;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Token refresh handler configuration.
|
|
99
|
+
*/
|
|
100
|
+
export interface TokenRefreshConfig {
|
|
101
|
+
/** Check if a response indicates token expiration */
|
|
102
|
+
isTokenExpired: (response: Response) => boolean;
|
|
103
|
+
/** Refresh the token (called when token is expired) */
|
|
104
|
+
refreshToken: () => Promise<string | null>;
|
|
105
|
+
/** Get the current access token */
|
|
106
|
+
getAccessToken: () => string | null;
|
|
107
|
+
/** Called when refresh fails (e.g., redirect to login) */
|
|
108
|
+
onRefreshFailure?: () => void;
|
|
109
|
+
/** Maximum number of refresh attempts */
|
|
110
|
+
maxRefreshAttempts?: number;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Fetch client interface.
|
|
114
|
+
*/
|
|
115
|
+
export interface FetchClient {
|
|
116
|
+
/** Make a fetch request */
|
|
117
|
+
fetch: (input: RequestInfo | URL, init?: FetchRequestInit) => Promise<Response>;
|
|
118
|
+
/** Add a request interceptor */
|
|
119
|
+
addRequestInterceptor: (interceptor: RequestInterceptor) => () => void;
|
|
120
|
+
/** Add a response interceptor */
|
|
121
|
+
addResponseInterceptor: (interceptor: ResponseInterceptor) => () => void;
|
|
122
|
+
/** Add an error interceptor */
|
|
123
|
+
addErrorInterceptor: (interceptor: ErrorInterceptor) => () => void;
|
|
124
|
+
/** Remove all interceptors */
|
|
125
|
+
clearInterceptors: () => void;
|
|
126
|
+
/** Get current configuration */
|
|
127
|
+
getConfig: () => FetchInterceptorConfig;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Create a fetch client with interceptor support.
|
|
131
|
+
*
|
|
132
|
+
* @example
|
|
133
|
+
* ```tsx
|
|
134
|
+
* // Basic usage
|
|
135
|
+
* const api = createFetchClient({
|
|
136
|
+
* baseUrl: 'https://api.example.com',
|
|
137
|
+
* defaultHeaders: { 'Content-Type': 'application/json' },
|
|
138
|
+
* defaultTimeout: 30000,
|
|
139
|
+
* });
|
|
140
|
+
*
|
|
141
|
+
* // Add auth header interceptor
|
|
142
|
+
* api.addRequestInterceptor(async (ctx) => {
|
|
143
|
+
* const token = getAccessToken();
|
|
144
|
+
* if (token) {
|
|
145
|
+
* ctx.init.headers = {
|
|
146
|
+
* ...ctx.init.headers,
|
|
147
|
+
* Authorization: `Bearer ${token}`,
|
|
148
|
+
* };
|
|
149
|
+
* }
|
|
150
|
+
* return ctx;
|
|
151
|
+
* });
|
|
152
|
+
*
|
|
153
|
+
* // Add response logging
|
|
154
|
+
* api.addResponseInterceptor(async (ctx) => {
|
|
155
|
+
* console.log(`${ctx.request.init.method} ${ctx.request.url} - ${ctx.response.status} (${ctx.duration}ms)`);
|
|
156
|
+
* return ctx.response;
|
|
157
|
+
* });
|
|
158
|
+
*
|
|
159
|
+
* // Make requests
|
|
160
|
+
* const response = await api.fetch('/users');
|
|
161
|
+
* const data = await response.json();
|
|
162
|
+
* ```
|
|
163
|
+
*/
|
|
164
|
+
export declare function createFetchClient(config?: FetchInterceptorConfig): FetchClient;
|
|
165
|
+
/**
|
|
166
|
+
* Create a token refresh interceptor that automatically refreshes
|
|
167
|
+
* expired tokens and retries failed requests.
|
|
168
|
+
*
|
|
169
|
+
* Uses AsyncLock to prevent multiple simultaneous refresh attempts.
|
|
170
|
+
*
|
|
171
|
+
* @example
|
|
172
|
+
* ```tsx
|
|
173
|
+
* const api = createFetchClient({ baseUrl: '/api' });
|
|
174
|
+
*
|
|
175
|
+
* const { addToClient } = createTokenRefreshInterceptor({
|
|
176
|
+
* isTokenExpired: (response) => response.status === 401,
|
|
177
|
+
* refreshToken: async () => {
|
|
178
|
+
* const response = await fetch('/auth/refresh', { method: 'POST' });
|
|
179
|
+
* const data = await response.json();
|
|
180
|
+
* localStorage.setItem('token', data.accessToken);
|
|
181
|
+
* return data.accessToken;
|
|
182
|
+
* },
|
|
183
|
+
* getAccessToken: () => localStorage.getItem('token'),
|
|
184
|
+
* onRefreshFailure: () => {
|
|
185
|
+
* localStorage.removeItem('token');
|
|
186
|
+
* window.location.href = '/login';
|
|
187
|
+
* },
|
|
188
|
+
* });
|
|
189
|
+
*
|
|
190
|
+
* addToClient(api);
|
|
191
|
+
* ```
|
|
192
|
+
*/
|
|
193
|
+
export declare function createTokenRefreshInterceptor(config: TokenRefreshConfig): {
|
|
194
|
+
addToClient: (client: FetchClient) => void;
|
|
195
|
+
refreshLock: AsyncLock;
|
|
196
|
+
};
|
|
197
|
+
/**
|
|
198
|
+
* Create a simple JSON API client.
|
|
199
|
+
*
|
|
200
|
+
* @example
|
|
201
|
+
* ```tsx
|
|
202
|
+
* const api = createJsonApiClient({
|
|
203
|
+
* baseUrl: 'https://api.example.com',
|
|
204
|
+
* getAuthToken: () => localStorage.getItem('token'),
|
|
205
|
+
* });
|
|
206
|
+
*
|
|
207
|
+
* // GET request
|
|
208
|
+
* const users = await api.get<User[]>('/users');
|
|
209
|
+
*
|
|
210
|
+
* // POST request
|
|
211
|
+
* const newUser = await api.post<User>('/users', { name: 'John' });
|
|
212
|
+
*
|
|
213
|
+
* // DELETE request
|
|
214
|
+
* await api.delete('/users/1');
|
|
215
|
+
* ```
|
|
216
|
+
*/
|
|
217
|
+
export declare function createJsonApiClient(options: {
|
|
218
|
+
baseUrl?: string;
|
|
219
|
+
getAuthToken?: () => string | null;
|
|
220
|
+
defaultHeaders?: Record<string, string>;
|
|
221
|
+
timeout?: number;
|
|
222
|
+
}): {
|
|
223
|
+
client: FetchClient;
|
|
224
|
+
get: <T>(path: string) => Promise<T | null>;
|
|
225
|
+
post: <T>(path: string, body?: unknown) => Promise<T | null>;
|
|
226
|
+
put: <T>(path: string, body?: unknown) => Promise<T | null>;
|
|
227
|
+
patch: <T>(path: string, body?: unknown) => Promise<T | null>;
|
|
228
|
+
delete: <T>(path: string) => Promise<T | null>;
|
|
229
|
+
};
|
|
230
|
+
//# sourceMappingURL=fetch-interceptor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetch-interceptor.d.ts","sourceRoot":"","sources":["../../src/utils/fetch-interceptor.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Font Utilities
|
|
3
|
+
*
|
|
4
|
+
* Font family and unit conversion helpers.
|
|
5
|
+
*
|
|
6
|
+
* @module utils
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Create a font family string with fallback stack.
|
|
10
|
+
*
|
|
11
|
+
* @param {string} [fontName] - Primary font name
|
|
12
|
+
* @returns {string} Font family with fallbacks
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* setFont('Inter'); // '"Inter", -apple-system, ...'
|
|
17
|
+
* setFont(); // Default system font stack
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare function setFont(fontName?: string): string;
|
|
21
|
+
/**
|
|
22
|
+
* Convert rem to pixels.
|
|
23
|
+
*
|
|
24
|
+
* @param {string | number} value - Rem value (number or string like '1rem')
|
|
25
|
+
* @returns {number} Value in pixels
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* remToPx(1); // 16
|
|
30
|
+
* remToPx('1rem'); // 16
|
|
31
|
+
* remToPx(1.5); // 24
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export declare function remToPx(value: string | number): number;
|
|
35
|
+
/**
|
|
36
|
+
* Convert pixels to rem.
|
|
37
|
+
*
|
|
38
|
+
* @param {string | number} value - Pixel value (number or string like '16px')
|
|
39
|
+
* @returns {string} Value in rem with unit
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```ts
|
|
43
|
+
* pxToRem(16); // '1rem'
|
|
44
|
+
* pxToRem('16px'); // '1rem'
|
|
45
|
+
* pxToRem(24); // '1.5rem'
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
export declare function pxToRem(value: string | number): string;
|
|
49
|
+
/**
|
|
50
|
+
* Create responsive font size based on viewport.
|
|
51
|
+
*
|
|
52
|
+
* @param {number} minSize - Minimum font size in px
|
|
53
|
+
* @param {number} maxSize - Maximum font size in px
|
|
54
|
+
* @param {number} [minWidth=320] - Minimum viewport width in px
|
|
55
|
+
* @param {number} [maxWidth=1200] - Maximum viewport width in px
|
|
56
|
+
* @returns {string} CSS clamp() value
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* responsiveFontSize(14, 18);
|
|
61
|
+
* // 'clamp(0.875rem, 0.7955rem + 0.3977vw, 1.125rem)'
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
export declare function responsiveFontSize(minSize: number, maxSize: number, minWidth?: number, maxWidth?: number): string;
|
|
65
|
+
//# sourceMappingURL=font.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"font.d.ts","sourceRoot":"","sources":["../../src/utils/font.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAQH;;;;;;;;;;;GAWG;AACH,wBAAgB,OAAO,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAMjD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAGtD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAGtD;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,SAAM,EAAE,QAAQ,SAAO,GAAG,MAAM,CAW5G"}
|
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical BTC / XMR amount formatter.
|
|
3
|
+
*
|
|
4
|
+
* Why this exists
|
|
5
|
+
* ---------------
|
|
6
|
+
* Pre-consolidation the platform had ~8 independent formatters,
|
|
7
|
+
* each shipping its own opinion of precision:
|
|
8
|
+
*
|
|
9
|
+
* - `org-finances/formatBtc` → BTC 8, XMR 4
|
|
10
|
+
* - `org-revenue-card` → BTC 4, XMR 4
|
|
11
|
+
* - `orgs-overview/formatBtc` → tiered 8 → 4 → 2 by magnitude
|
|
12
|
+
* - `shop-dashboard` → BTC 4
|
|
13
|
+
* - `shop-categories` → BTC 8 with trailing-zero trim
|
|
14
|
+
* - `finances/hooks` → BTC 8, XMR 8 (already canonical
|
|
15
|
+
* but isolated from everyone else)
|
|
16
|
+
* - `pages/finances DEFAULT_ASSETS` → XMR 12 (wire-precision leak)
|
|
17
|
+
*
|
|
18
|
+
* Result: a single dashboard showed BTC 4 in the KPI tile, BTC 8
|
|
19
|
+
* in the Financial Overview tile, and BTC 6 in another corner —
|
|
20
|
+
* three "truths" for the same value. This module is the single
|
|
21
|
+
* source of truth from now on; all call sites import from here.
|
|
22
|
+
*
|
|
23
|
+
* Display vs wire precision
|
|
24
|
+
* -------------------------
|
|
25
|
+
* Wire precision (what the backend stores) is 8 for BTC, 12 for
|
|
26
|
+
* XMR — those are the on-chain atomic units (satoshi, piconero).
|
|
27
|
+
* Display precision is 8 for BOTH coins by platform convention:
|
|
28
|
+
*
|
|
29
|
+
* - 8 fractional digits is a satoshi-level read for BTC,
|
|
30
|
+
* - 8 fractional digits for XMR is "good enough" for human eyes
|
|
31
|
+
* and keeps the column widths symmetric. The last 4 digits of
|
|
32
|
+
* XMR's wire value are dropped from display only — never from
|
|
33
|
+
* storage, math, or wire transfers.
|
|
34
|
+
*
|
|
35
|
+
* The platform-wide symmetric formatting was a direct user-facing
|
|
36
|
+
* request: the same coin column should align cleanly whether the
|
|
37
|
+
* row holds BTC or XMR.
|
|
38
|
+
*
|
|
39
|
+
* Which way a dropped digit goes
|
|
40
|
+
* ------------------------------
|
|
41
|
+
* Those four dropped XMR digits are the reason this module has a
|
|
42
|
+
* rounding DIRECTION and not just a scale. Display rounding used
|
|
43
|
+
* to be half-up, so a balance of
|
|
44
|
+
*
|
|
45
|
+
* 1.586170199999 XMR (what the account holds)
|
|
46
|
+
*
|
|
47
|
+
* rendered as `1.58617020 XMR` — a tenth of a piconero MORE than
|
|
48
|
+
* exists. A person who reads that number and types it back into a
|
|
49
|
+
* withdrawal is refused for insufficient funds, by a figure the
|
|
50
|
+
* platform itself put on their screen. The same arithmetic seeds
|
|
51
|
+
* the "max balance" shortcut, so the refusal arrives from a button
|
|
52
|
+
* whose entire purpose is to be correct.
|
|
53
|
+
*
|
|
54
|
+
* So the rule for anything rendered as money is: **the displayed
|
|
55
|
+
* magnitude is never larger than the real one.** Quantization for
|
|
56
|
+
* display truncates toward zero (`'down'`), at any precision, in
|
|
57
|
+
* either sign. That is not a matter of taste at eight decimals
|
|
58
|
+
* versus twelve — it holds whatever the scale, which is why it is
|
|
59
|
+
* a separate decision from the 8-vs-12 convention above.
|
|
60
|
+
*
|
|
61
|
+
* Half-up remains available and remains the default for the
|
|
62
|
+
* ARITHMETIC primitives (`toScaledInteger`, `sumDecimalStrings`,
|
|
63
|
+
* `subtractDecimalStrings`), where the scale is the value's own
|
|
64
|
+
* and the last digit is a genuine rounding rather than a
|
|
65
|
+
* truncation of digits that are really there. Arithmetic on money
|
|
66
|
+
* belongs at `getCoinWireDecimals(coin)`, not at display scale;
|
|
67
|
+
* quantize once, at the end, downward.
|
|
68
|
+
*
|
|
69
|
+
* The other direction is a lie too
|
|
70
|
+
* --------------------------------
|
|
71
|
+
* Truncating `0.000000004916 XMR` to eight decimals gives
|
|
72
|
+
* `0.00000000` — a balance that exists, shown as nothing at all.
|
|
73
|
+
* `formatCoinAmount` renders that as `< 0.00000001 XMR` instead
|
|
74
|
+
* (`> -0.00000001` below zero). A threshold marker is honest about
|
|
75
|
+
* both the amount and the limit of the column; a flat zero is not.
|
|
76
|
+
* Pass `markDust: false` where a bare numeral is required.
|
|
77
|
+
*
|
|
78
|
+
* If you need a *narrower* surface (a dense table, a stat-card
|
|
79
|
+
* subtitle), use `{ trim: true }` to drop trailing zeros while
|
|
80
|
+
* keeping the canonical precision as the cap. Don't bypass this
|
|
81
|
+
* module with an ad-hoc `toFixed(N)` — that's exactly the entropy
|
|
82
|
+
* we just cleaned up, and `toFixed` rounds the wrong way for money
|
|
83
|
+
* on top of rounding a double.
|
|
84
|
+
*/
|
|
85
|
+
/**
|
|
86
|
+
* Canonical display-precision per supported coin. Use this when
|
|
87
|
+
* you need the raw precision number (e.g. populating an input
|
|
88
|
+
* field's `.toFixed(...)` to seed a "max balance" button). For
|
|
89
|
+
* actual rendering of a value, prefer `formatCoinAmount`.
|
|
90
|
+
*/
|
|
91
|
+
export declare const COIN_DISPLAY_DECIMALS: Readonly<Record<string, number>>;
|
|
92
|
+
/**
|
|
93
|
+
* Atomic-unit precision per coin — what the backend actually stores.
|
|
94
|
+
*
|
|
95
|
+
* This is NOT a display precision and must never be used as one; the
|
|
96
|
+
* platform shows both coins at eight digits on purpose (see the module
|
|
97
|
+
* docblock). It is the scale to do ARITHMETIC at: totalling balances,
|
|
98
|
+
* subtracting a lock from a total, comparing an entered amount against
|
|
99
|
+
* what is available. Doing that at display scale quantizes four XMR
|
|
100
|
+
* digits away before the sum, and each quantization is a chance to
|
|
101
|
+
* report a figure the ledger does not agree with.
|
|
102
|
+
*
|
|
103
|
+
* The authority is payments's `coins.precision` column (`BTC` 8, `XMR` 12);
|
|
104
|
+
* main keeps its own copy in `billing.service.ts` as `CRYPTO_PRECISION`.
|
|
105
|
+
* This is the browser's copy, because a synchronous formatter cannot
|
|
106
|
+
* query a table. Three copies of one fact: when a coin is added, all
|
|
107
|
+
* three change, and a mismatch here shows up as arithmetic that silently
|
|
108
|
+
* drops the coin's last digits.
|
|
109
|
+
*/
|
|
110
|
+
export declare const COIN_WIRE_DECIMALS: Readonly<Record<string, number>>;
|
|
111
|
+
/**
|
|
112
|
+
* Which way a value that does not fit the requested scale is quantized.
|
|
113
|
+
*
|
|
114
|
+
* `'down'` toward zero. The displayed magnitude is never larger
|
|
115
|
+
* than the real one — the rule for money on a screen.
|
|
116
|
+
* `'half-up'` to the nearest, ties away from zero. The rule for
|
|
117
|
+
* arithmetic, where the scale is the value's own.
|
|
118
|
+
*/
|
|
119
|
+
export type DecimalRounding = 'down' | 'half-up';
|
|
120
|
+
export interface FormatCoinAmountOptions {
|
|
121
|
+
/**
|
|
122
|
+
* Append the uppercase coin symbol (`"0.00012345 BTC"`).
|
|
123
|
+
* Default `true`. Disable for places where the symbol is
|
|
124
|
+
* rendered separately (e.g. a chip beside the number).
|
|
125
|
+
*/
|
|
126
|
+
withSymbol?: boolean;
|
|
127
|
+
/**
|
|
128
|
+
* Trim trailing zeros after the decimal point. Useful in dense
|
|
129
|
+
* tables where `0 BTC` reads cleaner than `0.00000000 BTC`. The
|
|
130
|
+
* precision cap (8) is still honoured — we just drop tail
|
|
131
|
+
* zeros up to and including the decimal point. Default `false`.
|
|
132
|
+
*/
|
|
133
|
+
trim?: boolean;
|
|
134
|
+
/**
|
|
135
|
+
* Override precision. ONLY use this for legacy back-compat
|
|
136
|
+
* (e.g. a screen that genuinely needs to truncate at a non-
|
|
137
|
+
* standard width). Prefer the default. Negative values clamp
|
|
138
|
+
* to 0.
|
|
139
|
+
*/
|
|
140
|
+
precision?: number;
|
|
141
|
+
/**
|
|
142
|
+
* Custom symbol override. Defaults to `coin.toUpperCase()`. Set
|
|
143
|
+
* this if you need a non-standard label (e.g. "₿" for BTC) —
|
|
144
|
+
* but be aware that mixing symbols across the platform is what
|
|
145
|
+
* this module was built to prevent.
|
|
146
|
+
*/
|
|
147
|
+
symbol?: string;
|
|
148
|
+
/**
|
|
149
|
+
* Which way to quantize digits that do not fit `precision`.
|
|
150
|
+
* Default `'down'` — a rendered amount is never larger than the
|
|
151
|
+
* amount that exists. Pass `'half-up'` only where the figure is
|
|
152
|
+
* not a quantity anyone holds (a rate, an average, a chart axis).
|
|
153
|
+
*/
|
|
154
|
+
rounding?: DecimalRounding;
|
|
155
|
+
/**
|
|
156
|
+
* Render a non-zero amount that vanishes at this precision as
|
|
157
|
+
* `< 0.00000001` rather than `0.00000000`. Default `true`.
|
|
158
|
+
* Disable where the output has to be a bare numeral.
|
|
159
|
+
*/
|
|
160
|
+
markDust?: boolean;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Resolve the canonical display precision for a coin code.
|
|
164
|
+
* Case-insensitive. Unknown codes fall back to 8.
|
|
165
|
+
*/
|
|
166
|
+
export declare function getCoinDecimals(coin: string): number;
|
|
167
|
+
/**
|
|
168
|
+
* Resolve the ATOMIC-UNIT precision for a coin code — the scale the value
|
|
169
|
+
* arrived at and the scale to compute at. Case-insensitive.
|
|
170
|
+
*
|
|
171
|
+
* `getCoinDecimals` is for rendering; this is for `sumDecimalStrings`,
|
|
172
|
+
* `subtractDecimalStrings`, and any comparison between an amount a person
|
|
173
|
+
* entered and an amount the ledger holds.
|
|
174
|
+
*/
|
|
175
|
+
export declare function getCoinWireDecimals(coin: string): number;
|
|
176
|
+
/**
|
|
177
|
+
* Format a decimal STRING at a fixed scale without going through a float.
|
|
178
|
+
*
|
|
179
|
+
* Exported because more than one surface needs it: `formatCoinAmount` for
|
|
180
|
+
* coin balances, `AmountCell` for financial tables. Anything that receives a
|
|
181
|
+
* decimal string from the wire and renders it should use this rather than
|
|
182
|
+
* `Number(x).toFixed(n)`.
|
|
183
|
+
*
|
|
184
|
+
* The docblock above promises that string input "preserves full precision
|
|
185
|
+
* end-to-end from the RPC wire", but the implementation used to hand the
|
|
186
|
+
* string straight to `Number()` — inheriting binary floating point along with
|
|
187
|
+
* its rounding surprises. `'1.005'` is fractionally BELOW 1.005 as a double,
|
|
188
|
+
* so `toFixed(2)` rendered `'1.00'`: a balance displayed one cent short of
|
|
189
|
+
* the one actually stored.
|
|
190
|
+
*
|
|
191
|
+
* This is the RENDERING half of the pair, so it quantizes DOWN by default:
|
|
192
|
+
* the string it returns never stands for more than the string it was given.
|
|
193
|
+
* Its arithmetic counterpart `toScaledInteger` defaults to `'half-up'`;
|
|
194
|
+
* the two differ on purpose and the module docblock says why.
|
|
195
|
+
*
|
|
196
|
+
* Unlike `formatCoinAmount` it always returns a plain parseable decimal —
|
|
197
|
+
* no threshold marker, no symbol — because its callers feed the result back
|
|
198
|
+
* into `Number()`.
|
|
199
|
+
*
|
|
200
|
+
* @returns the formatted string, or `null` when `raw` is not a plain decimal
|
|
201
|
+
* (exponent notation, junk) — the caller then falls back to `Number`.
|
|
202
|
+
*/
|
|
203
|
+
export declare function formatDecimalString(raw: string, decimals: number, rounding?: DecimalRounding): string | null;
|
|
204
|
+
/**
|
|
205
|
+
* A decimal string as an exact integer at `decimals` scale.
|
|
206
|
+
*
|
|
207
|
+
* `'1.005'` at scale 2 is `101n` under the default half-up — which is the
|
|
208
|
+
* whole point: as a double the same literal sits fractionally BELOW 1.005,
|
|
209
|
+
* so any arithmetic that starts with `Number('1.005')` has already lost
|
|
210
|
+
* before it begins.
|
|
211
|
+
*
|
|
212
|
+
* The default is `'half-up'` because this is the arithmetic primitive:
|
|
213
|
+
* callers pass the value's own scale, where the last digit is a rounding
|
|
214
|
+
* and not a truncation. Rendering goes through `formatDecimalString`, which
|
|
215
|
+
* defaults to `'down'` — see the module docblock.
|
|
216
|
+
*
|
|
217
|
+
* @returns null when `raw` is not a plain decimal (exponent notation, junk).
|
|
218
|
+
*/
|
|
219
|
+
export declare function toScaledInteger(raw: string, decimals: number, rounding?: DecimalRounding): bigint | null;
|
|
220
|
+
/** Render a scaled integer back as a decimal string. Inverse of `toScaledInteger`. */
|
|
221
|
+
export declare function fromScaledInteger(scaled: bigint, decimals: number): string;
|
|
222
|
+
/**
|
|
223
|
+
* Add decimal strings exactly, returning a decimal string.
|
|
224
|
+
*
|
|
225
|
+
* For totalling amounts that arrived from the wire as strings. Accumulating
|
|
226
|
+
* them with `parseFloat` is the same mistake as formatting with it, one step
|
|
227
|
+
* earlier and harder to see: `0.1 + 0.2 + 0.3` is `0.6000000000000001`, and
|
|
228
|
+
* while a formatter capped at eight decimals rounds that back to `0.60000000`,
|
|
229
|
+
* anything that shows the raw total — a tooltip, a CSV export, a value posted
|
|
230
|
+
* back to the server — shows the artefact.
|
|
231
|
+
*
|
|
232
|
+
* Values that are not plain decimals are skipped rather than poisoning the
|
|
233
|
+
* total with `NaN`; `null` and `undefined` count as absent, not as zero-ish
|
|
234
|
+
* junk. Numbers are accepted for callers mid-migration, and go through their
|
|
235
|
+
* decimal representation rather than their binary one.
|
|
236
|
+
*
|
|
237
|
+
* @param decimals scale to accumulate at — use the coin's WIRE precision
|
|
238
|
+
* (`getCoinWireDecimals`). Accumulating at display scale quantizes
|
|
239
|
+
* each value before it is added, so the total is a sum of roundings;
|
|
240
|
+
* `getCoinDecimals` is for the one quantization at the end.
|
|
241
|
+
* @param options.rounding how each value is quantized to `decimals`. Default
|
|
242
|
+
* `'half-up'`; at wire scale nothing is dropped and it does not
|
|
243
|
+
* arise. Pass `'down'` if you must accumulate at display scale and
|
|
244
|
+
* the total is money — a sum of half-ups can exceed what exists.
|
|
245
|
+
*/
|
|
246
|
+
export declare function sumDecimalStrings(values: Iterable<string | number | null | undefined>, decimals: number, options?: {
|
|
247
|
+
rounding?: DecimalRounding;
|
|
248
|
+
}): string;
|
|
249
|
+
/**
|
|
250
|
+
* Subtract decimal strings exactly, returning a decimal string.
|
|
251
|
+
*
|
|
252
|
+
* The companion to `sumDecimalStrings`, and the one a wallet needs more
|
|
253
|
+
* often: available balance is total minus locked, and computing it with
|
|
254
|
+
* `parseFloat` produces `0.19999999999999998` from `0.30000000 - 0.10000000`.
|
|
255
|
+
* A formatter capped at the coin's precision rounds that back, but the raw
|
|
256
|
+
* value does not always reach a formatter — a tooltip, a CSV column, a
|
|
257
|
+
* "max" button that fills an amount field, or a value posted back to the
|
|
258
|
+
* server all show it as it is. Small amounts are worse than wrong: they
|
|
259
|
+
* become exponential notation, and `1.0999999999999999e-7` is not a number
|
|
260
|
+
* any balance field will accept.
|
|
261
|
+
*
|
|
262
|
+
* Unparseable inputs are treated as absent — `null` when the minuend cannot
|
|
263
|
+
* be read, since a difference from an unknown quantity is unknown, and
|
|
264
|
+
* subtracting nothing when a subtrahend cannot be read.
|
|
265
|
+
*
|
|
266
|
+
* @param decimals scale to compute at — `getCoinWireDecimals(coin)`. At
|
|
267
|
+
* display scale the minuend and the subtrahends are each quantized
|
|
268
|
+
* first, and an available balance assembled from two roundings can
|
|
269
|
+
* come out above the amount the ledger will actually release.
|
|
270
|
+
* @param clampAtZero return '0' rather than a negative result. On for the
|
|
271
|
+
* available-balance case, where a negative would be a display artefact
|
|
272
|
+
* of two readings taken a moment apart, not a debt.
|
|
273
|
+
* @param rounding how each operand is quantized to `decimals`. Default
|
|
274
|
+
* `'half-up'`, matching `toScaledInteger`.
|
|
275
|
+
*/
|
|
276
|
+
export declare function subtractDecimalStrings(minuend: string | number | null | undefined, subtrahends: Iterable<string | number | null | undefined>, decimals: number, options?: {
|
|
277
|
+
clampAtZero?: boolean;
|
|
278
|
+
rounding?: DecimalRounding;
|
|
279
|
+
}): string | null;
|
|
280
|
+
/**
|
|
281
|
+
* Format a crypto amount for display.
|
|
282
|
+
*
|
|
283
|
+
* Input can be a string (preferred — preserves full precision
|
|
284
|
+
* end-to-end from the RPC wire) or a number. Non-finite / NaN
|
|
285
|
+
* inputs render as the zero-shaped placeholder so the UI never
|
|
286
|
+
* shows `NaN BTC`.
|
|
287
|
+
*
|
|
288
|
+
* Digits below the coin's display precision are dropped, not rounded up:
|
|
289
|
+
* the string returned never stands for more coin than the argument did.
|
|
290
|
+
* An amount that is real but smaller than the last displayed digit renders
|
|
291
|
+
* as `< 0.00000001` rather than as a flat zero.
|
|
292
|
+
*
|
|
293
|
+
* @example
|
|
294
|
+
* formatCoinAmount('0.001', 'BTC') // '0.00100000 BTC'
|
|
295
|
+
* formatCoinAmount('0.001', 'BTC', { trim: true }) // '0.001 BTC'
|
|
296
|
+
* formatCoinAmount(null, 'XMR') // '0.00000000 XMR'
|
|
297
|
+
* formatCoinAmount('1.23456789', 'BTC', { withSymbol: false }) // '1.23456789'
|
|
298
|
+
* formatCoinAmount('1.586170199999', 'XMR') // '1.58617019 XMR'
|
|
299
|
+
* formatCoinAmount('0.000000004916', 'XMR') // '< 0.00000001 XMR'
|
|
300
|
+
*/
|
|
301
|
+
export declare function formatCoinAmount(value: string | number | null | undefined, coin: string, options?: FormatCoinAmountOptions): string;
|
|
302
|
+
/**
|
|
303
|
+
* Render a multi-coin total map (e.g. revenue across coins)
|
|
304
|
+
* as a single inline string: `"0.00010000 BTC · 0.00000000 XMR"`.
|
|
305
|
+
*
|
|
306
|
+
* Stable ordering by lower-cased coin code so BTC always appears
|
|
307
|
+
* before XMR regardless of object-property iteration quirks.
|
|
308
|
+
*/
|
|
309
|
+
export declare function formatCoinAmountList(totals: Partial<Record<string, string | number | null | undefined>>, options?: FormatCoinAmountOptions & {
|
|
310
|
+
separator?: string;
|
|
311
|
+
}): string;
|
|
312
|
+
//# sourceMappingURL=format-crypto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-crypto.d.ts","sourceRoot":"","sources":["../../src/utils/format-crypto.ts"],"names":[],"mappings":"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"}
|