@hkdigital/lib-core 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 +149 -0
- package/dist/assets/autospuiten/car-paint-picker/army-green.jpg +0 -0
- package/dist/assets/autospuiten/car-paint-picker/electric-blue.jpg +0 -0
- package/dist/assets/autospuiten/car-paint-picker/lemon-yellow.jpg +0 -0
- package/dist/assets/autospuiten/car-paint-picker/opaque-purple.jpg +0 -0
- package/dist/assets/autospuiten/car-paint-picker/rusty.jpg +0 -0
- package/dist/assets/autospuiten/car-paint-picker/sunset-orange.jpg +0 -0
- package/dist/assets/autospuiten/car-paint-picker/tomato-red.jpg +0 -0
- package/dist/assets/autospuiten/car-paint-picker.d.ts +17 -0
- package/dist/assets/autospuiten/car-paint-picker.js +41 -0
- package/dist/assets/autospuiten/labels.d.ts +7 -0
- package/dist/assets/autospuiten/labels.js +7 -0
- package/dist/classes/cache/IndexedDbCache.d.ts +216 -0
- package/dist/classes/cache/IndexedDbCache.js +1407 -0
- package/dist/classes/cache/MemoryResponseCache.d.ts +106 -0
- package/dist/classes/cache/MemoryResponseCache.js +138 -0
- package/dist/classes/cache/index.d.ts +3 -0
- package/dist/classes/cache/index.js +5 -0
- package/dist/classes/cache/typedef.d.ts +67 -0
- package/dist/classes/cache/typedef.js +41 -0
- package/dist/classes/data/IterableTree.d.ts +51 -0
- package/dist/classes/data/IterableTree.js +243 -0
- package/dist/classes/data/Selector.d.ts +30 -0
- package/dist/classes/data/Selector.js +190 -0
- package/dist/classes/data/index.d.ts +2 -0
- package/dist/classes/data/index.js +2 -0
- package/dist/classes/events/EventEmitter.d.ts +142 -0
- package/dist/classes/events/EventEmitter.js +275 -0
- package/dist/classes/events/index.d.ts +1 -0
- package/dist/classes/events/index.js +2 -0
- package/dist/classes/index.d.ts +4 -0
- package/dist/classes/index.js +4 -0
- package/dist/classes/logging/Logger.d.ts +78 -0
- package/dist/classes/logging/Logger.js +210 -0
- package/dist/classes/logging/constants.d.ts +12 -0
- package/dist/classes/logging/constants.js +16 -0
- package/dist/classes/logging/index.d.ts +2 -0
- package/dist/classes/logging/index.js +4 -0
- package/dist/classes/logging/typedef.d.ts +34 -0
- package/dist/classes/logging/typedef.js +17 -0
- package/dist/classes/promise/HkPromise.d.ts +121 -0
- package/dist/classes/promise/HkPromise.js +377 -0
- package/dist/classes/promise/index.d.ts +1 -0
- package/dist/classes/promise/index.js +1 -0
- package/dist/classes/services/ServiceBase.d.ts +163 -0
- package/dist/classes/services/ServiceBase.js +463 -0
- package/dist/classes/services/ServiceManager.d.ts +179 -0
- package/dist/classes/services/ServiceManager.js +614 -0
- package/dist/classes/services/index.d.ts +4 -0
- package/dist/classes/services/index.js +5 -0
- package/dist/classes/services/service-states.d.ts +159 -0
- package/dist/classes/services/service-states.js +205 -0
- package/dist/classes/services/typedef.d.ts +247 -0
- package/dist/classes/services/typedef.js +179 -0
- package/dist/classes/stores/SubscribersCount.d.ts +39 -0
- package/dist/classes/stores/SubscribersCount.js +107 -0
- package/dist/classes/stores/index.d.ts +1 -0
- package/dist/classes/stores/index.js +1 -0
- package/dist/classes/streams/LogTransformStream.d.ts +4 -0
- package/dist/classes/streams/LogTransformStream.js +19 -0
- package/dist/classes/streams/ServerEventsStore.d.ts +22 -0
- package/dist/classes/streams/ServerEventsStore.js +110 -0
- package/dist/classes/streams/TimeStampSource.d.ts +13 -0
- package/dist/classes/streams/TimeStampSource.js +26 -0
- package/dist/classes/streams/index.d.ts +3 -0
- package/dist/classes/streams/index.js +3 -0
- package/dist/classes/svelte/audio/AudioLoader.svelte.d.ts +30 -0
- package/dist/classes/svelte/audio/AudioLoader.svelte.js +58 -0
- package/dist/classes/svelte/audio/AudioScene.svelte.d.ts +74 -0
- package/dist/classes/svelte/audio/AudioScene.svelte.js +324 -0
- package/dist/classes/svelte/audio/mocks.d.ts +7 -0
- package/dist/classes/svelte/audio/mocks.js +35 -0
- package/dist/classes/svelte/finite-state-machine/FiniteStateMachine.svelte.d.ts +50 -0
- package/dist/classes/svelte/finite-state-machine/FiniteStateMachine.svelte.js +133 -0
- package/dist/classes/svelte/finite-state-machine/index.d.ts +1 -0
- package/dist/classes/svelte/finite-state-machine/index.js +1 -0
- package/dist/classes/svelte/image/ImageLoader.svelte.d.ts +19 -0
- package/dist/classes/svelte/image/ImageLoader.svelte.js +45 -0
- package/dist/classes/svelte/image/ImageScene.svelte.d.ts +78 -0
- package/dist/classes/svelte/image/ImageScene.svelte.js +249 -0
- package/dist/classes/svelte/image/ImageVariantsLoader.svelte.d.ts +43 -0
- package/dist/classes/svelte/image/ImageVariantsLoader.svelte.js +152 -0
- package/dist/classes/svelte/image/index.d.ts +2 -0
- package/dist/classes/svelte/image/index.js +4 -0
- package/dist/classes/svelte/image/mocks.d.ts +7 -0
- package/dist/classes/svelte/image/mocks.js +35 -0
- package/dist/classes/svelte/image/typedef.d.ts +16 -0
- package/dist/classes/svelte/image/typedef.js +8 -0
- package/dist/classes/svelte/index.d.ts +9 -0
- package/dist/classes/svelte/index.js +14 -0
- package/dist/classes/svelte/loading-state-machine/LoadingStateMachine.svelte.d.ts +12 -0
- package/dist/classes/svelte/loading-state-machine/LoadingStateMachine.svelte.js +109 -0
- package/dist/classes/svelte/loading-state-machine/constants.d.ts +12 -0
- package/dist/classes/svelte/loading-state-machine/constants.js +16 -0
- package/dist/classes/svelte/loading-state-machine/index.d.ts +2 -0
- package/dist/classes/svelte/loading-state-machine/index.js +3 -0
- package/dist/classes/svelte/network-loader/NetworkLoader.svelte.d.ts +91 -0
- package/dist/classes/svelte/network-loader/NetworkLoader.svelte.js +338 -0
- package/dist/classes/svelte/network-loader/constants.d.ts +2 -0
- package/dist/classes/svelte/network-loader/constants.js +3 -0
- package/dist/classes/svelte/network-loader/index.d.ts +2 -0
- package/dist/classes/svelte/network-loader/index.js +3 -0
- package/dist/classes/svelte/network-loader/mocks.d.ts +7 -0
- package/dist/classes/svelte/network-loader/mocks.js +30 -0
- package/dist/classes/svelte/network-loader/typedef.d.ts +7 -0
- package/dist/classes/svelte/network-loader/typedef.js +8 -0
- package/dist/components/area/HkArea.svelte +49 -0
- package/dist/components/area/HkArea.svelte.d.ts +26 -0
- package/dist/components/area/HkGridArea.svelte +77 -0
- package/dist/components/area/HkGridArea.svelte.d.ts +42 -0
- package/dist/components/area/index.d.ts +2 -0
- package/dist/components/area/index.js +2 -0
- package/dist/components/buttons/button/Button.svelte +82 -0
- package/dist/components/buttons/button/Button.svelte.d.ts +44 -0
- package/dist/components/buttons/button-icon-steeze/SteezeIconButton.svelte +30 -0
- package/dist/components/buttons/button-icon-steeze/SteezeIconButton.svelte.d.ts +16 -0
- package/dist/components/buttons/button-text/TextButton.svelte +21 -0
- package/dist/components/buttons/button-text/TextButton.svelte.d.ts +12 -0
- package/dist/components/buttons/index.d.ts +3 -0
- package/dist/components/buttons/index.js +3 -0
- package/dist/components/debug/debug-panel-design-scaling/DebugPanelDesignScaling.svelte +146 -0
- package/dist/components/debug/debug-panel-design-scaling/DebugPanelDesignScaling.svelte.d.ts +6 -0
- package/dist/components/debug/index.d.ts +1 -0
- package/dist/components/debug/index.js +1 -0
- package/dist/components/drag-drop/DragController.d.ts +20 -0
- package/dist/components/drag-drop/DragController.js +44 -0
- package/dist/components/drag-drop/DragDropContext.svelte +111 -0
- package/dist/components/drag-drop/DragDropContext.svelte.d.ts +18 -0
- package/dist/components/drag-drop/Draggable.svelte +519 -0
- package/dist/components/drag-drop/Draggable.svelte.d.ts +95 -0
- package/dist/components/drag-drop/DropZone.svelte +258 -0
- package/dist/components/drag-drop/DropZone.svelte.d.ts +96 -0
- package/dist/components/drag-drop/DropZoneArea.svelte +119 -0
- package/dist/components/drag-drop/DropZoneArea.svelte.d.ts +90 -0
- package/dist/components/drag-drop/DropZoneList.svelte +125 -0
- package/dist/components/drag-drop/DropZoneList.svelte.d.ts +92 -0
- package/dist/components/drag-drop/actions.d.ts +9 -0
- package/dist/components/drag-drop/actions.js +26 -0
- package/dist/components/drag-drop/drag-state.svelte.d.ts +97 -0
- package/dist/components/drag-drop/drag-state.svelte.js +322 -0
- package/dist/components/drag-drop/index.d.ts +6 -0
- package/dist/components/drag-drop/index.js +7 -0
- package/dist/components/drag-drop/util.d.ts +0 -0
- package/dist/components/drag-drop/util.js +85 -0
- package/dist/components/hkdev/blocks/TextBlock.svelte +47 -0
- package/dist/components/hkdev/blocks/TextBlock.svelte.d.ts +24 -0
- package/dist/components/hkdev/buttons/CheckButton.svelte +63 -0
- package/dist/components/hkdev/buttons/CheckButton.svelte.d.ts +34 -0
- package/dist/components/icons/HkIcon.svelte +86 -0
- package/dist/components/icons/HkIcon.svelte.d.ts +22 -0
- package/dist/components/icons/HkTabIcon.svelte +116 -0
- package/dist/components/icons/HkTabIcon.svelte.d.ts +40 -0
- package/dist/components/icons/SteezeIcon.svelte +97 -0
- package/dist/components/icons/SteezeIcon.svelte.d.ts +22 -0
- package/dist/components/icons/index.d.ts +4 -0
- package/dist/components/icons/index.js +6 -0
- package/dist/components/icons/typedef.d.ts +13 -0
- package/dist/components/icons/typedef.js +16 -0
- package/dist/components/index.d.ts +0 -0
- package/dist/components/index.js +2 -0
- package/dist/components/inputs/index.d.ts +1 -0
- package/dist/components/inputs/index.js +1 -0
- package/dist/components/inputs/text-input/TestTextInput.svelte__ +102 -0
- package/dist/components/inputs/text-input/TextInput.svelte +223 -0
- package/dist/components/inputs/text-input/TextInput.svelte.d.ts +56 -0
- package/dist/components/inputs/text-input/TextInput.svelte___ +83 -0
- package/dist/components/inputs/text-input/assets/IconInvalid.svelte +14 -0
- package/dist/components/inputs/text-input/assets/IconInvalid.svelte.d.ts +26 -0
- package/dist/components/inputs/text-input/assets/IconValid.svelte +12 -0
- package/dist/components/inputs/text-input/assets/IconValid.svelte.d.ts +26 -0
- package/dist/components/layout/grid-layers/GridLayers.svelte +63 -0
- package/dist/components/layout/grid-layers/GridLayers.svelte.d.ts +26 -0
- package/dist/components/layout/grid-layers/GridLayers.svelte__heightFrom__ +372 -0
- package/dist/components/layout/grid-layers/util.d.ts +19 -0
- package/dist/components/layout/grid-layers/util.js +74 -0
- package/dist/components/layout/index.d.ts +1 -0
- package/dist/components/layout/index.js +1 -0
- package/dist/components/panels/index.d.ts +1 -0
- package/dist/components/panels/index.js +1 -0
- package/dist/components/panels/panel/Panel.svelte +43 -0
- package/dist/components/panels/panel/Panel.svelte.d.ts +24 -0
- package/dist/components/rows/index.d.ts +2 -0
- package/dist/components/rows/index.js +3 -0
- package/dist/components/rows/panel-grid-row/PanelGridRow.svelte +104 -0
- package/dist/components/rows/panel-grid-row/PanelGridRow.svelte.d.ts +26 -0
- package/dist/components/rows/panel-row-2/PanelRow2.svelte +40 -0
- package/dist/components/rows/panel-row-2/PanelRow2.svelte.d.ts +26 -0
- package/dist/components/tab-bar/HkTabBar.state.svelte.d.ts +54 -0
- package/dist/components/tab-bar/HkTabBar.state.svelte.js +149 -0
- package/dist/components/tab-bar/HkTabBar.svelte +74 -0
- package/dist/components/tab-bar/HkTabBar.svelte.d.ts +34 -0
- package/dist/components/tab-bar/HkTabBarSelector.state.svelte.d.ts +19 -0
- package/dist/components/tab-bar/HkTabBarSelector.state.svelte.js +93 -0
- package/dist/components/tab-bar/HkTabBarSelector.svelte +49 -0
- package/dist/components/tab-bar/HkTabBarSelector.svelte.d.ts +36 -0
- package/dist/components/tab-bar/index.d.ts +5 -0
- package/dist/components/tab-bar/index.js +17 -0
- package/dist/components/tab-bar/typedef.d.ts +8 -0
- package/dist/components/tab-bar/typedef.js +11 -0
- package/dist/config/imagetools-config.d.ts +26 -0
- package/dist/config/imagetools-config.js +189 -0
- package/dist/config/imagetools.d.ts +72 -0
- package/dist/constants/bases.d.ts +10 -0
- package/dist/constants/bases.js +13 -0
- package/dist/constants/errors/api.d.ts +10 -0
- package/dist/constants/errors/api.js +9 -0
- package/dist/constants/errors/generic.d.ts +20 -0
- package/dist/constants/errors/generic.js +20 -0
- package/dist/constants/errors/http.d.ts +16 -0
- package/dist/constants/errors/http.js +16 -0
- package/dist/constants/errors/index.d.ts +4 -0
- package/dist/constants/errors/index.js +4 -0
- package/dist/constants/errors/jwt.d.ts +8 -0
- package/dist/constants/errors/jwt.js +5 -0
- package/dist/constants/http/headers.d.ts +5 -0
- package/dist/constants/http/headers.js +6 -0
- package/dist/constants/http/index.d.ts +2 -0
- package/dist/constants/http/index.js +2 -0
- package/dist/constants/http/methods.d.ts +7 -0
- package/dist/constants/http/methods.js +14 -0
- package/dist/constants/index.d.ts +2 -0
- package/dist/constants/index.js +3 -0
- package/dist/constants/mime/application.d.ts +3 -0
- package/dist/constants/mime/application.js +5 -0
- package/dist/constants/mime/audio.d.ts +10 -0
- package/dist/constants/mime/audio.js +13 -0
- package/dist/constants/mime/image.d.ts +3 -0
- package/dist/constants/mime/image.js +3 -0
- package/dist/constants/mime/index.d.ts +4 -0
- package/dist/constants/mime/index.js +4 -0
- package/dist/constants/mime/text.d.ts +2 -0
- package/dist/constants/mime/text.js +2 -0
- package/dist/constants/regexp/index.d.ts +3 -0
- package/dist/constants/regexp/index.js +31 -0
- package/dist/constants/regexp/inspiratie.js__ +95 -0
- package/dist/constants/regexp/text.d.ts +47 -0
- package/dist/constants/regexp/text.js +49 -0
- package/dist/constants/regexp/user.d.ts +6 -0
- package/dist/constants/regexp/user.js +33 -0
- package/dist/constants/regexp/web.d.ts +1 -0
- package/dist/constants/regexp/web.js +3 -0
- package/dist/constants/state-labels/drag-states.d.ts +5 -0
- package/dist/constants/state-labels/drag-states.js +6 -0
- package/dist/constants/state-labels/drop-states.d.ts +4 -0
- package/dist/constants/state-labels/drop-states.js +6 -0
- package/dist/constants/state-labels/input-states.d.ts +8 -0
- package/dist/constants/state-labels/input-states.js +11 -0
- package/dist/constants/state-labels/submit-states.d.ts +4 -0
- package/dist/constants/state-labels/submit-states.js +4 -0
- package/dist/constants/time.d.ts +18 -0
- package/dist/constants/time.js +28 -0
- package/dist/css/utilities.css +43 -0
- package/dist/design/design-config.d.ts +157 -0
- package/dist/design/design-config.js +73 -0
- package/dist/design/tailwind-theme-extend.d.ts +23 -0
- package/dist/design/tailwind-theme-extend.js +158 -0
- package/dist/features/button-group/ButtonGroup.svelte +82 -0
- package/dist/features/button-group/ButtonGroup.svelte.d.ts +34 -0
- package/dist/features/button-group/typedef.d.ts +7 -0
- package/dist/features/button-group/typedef.js +10 -0
- package/dist/features/compare-left-right/CompareLeftRight.svelte +179 -0
- package/dist/features/compare-left-right/CompareLeftRight.svelte.d.ts +18 -0
- package/dist/features/compare-left-right/index.d.ts +1 -0
- package/dist/features/compare-left-right/index.js +1 -0
- package/dist/features/game-box/GameBox.svelte +577 -0
- package/dist/features/game-box/GameBox.svelte.d.ts +140 -0
- package/dist/features/game-box/gamebox.util.d.ts +32 -0
- package/dist/features/game-box/gamebox.util.js +83 -0
- package/dist/features/hk-app-layout/HkAppLayout.state.svelte.d.ts +6 -0
- package/dist/features/hk-app-layout/HkAppLayout.state.svelte.js +25 -0
- package/dist/features/hk-app-layout/HkAppLayout.svelte +251 -0
- package/dist/features/hk-app-layout/HkAppLayout.svelte.d.ts +19 -0
- package/dist/features/image-box/ImageBox.svelte +210 -0
- package/dist/features/image-box/ImageBox.svelte.d.ts +38 -0
- package/dist/features/image-box/index.d.ts +4 -0
- package/dist/features/image-box/index.js +5 -0
- package/dist/features/image-box/typedef.d.ts +4 -0
- package/dist/features/image-box/typedef.js +32 -0
- package/dist/features/index.d.ts +11 -0
- package/dist/features/index.js +23 -0
- package/dist/features/presenter/ImageSlide.svelte +64 -0
- package/dist/features/presenter/ImageSlide.svelte.d.ts +36 -0
- package/dist/features/presenter/Presenter.state.svelte.d.ts +74 -0
- package/dist/features/presenter/Presenter.state.svelte.js +638 -0
- package/dist/features/presenter/Presenter.svelte +142 -0
- package/dist/features/presenter/Presenter.svelte.d.ts +18 -0
- package/dist/features/presenter/constants.d.ts +5 -0
- package/dist/features/presenter/constants.js +7 -0
- package/dist/features/presenter/index.d.ts +6 -0
- package/dist/features/presenter/index.js +10 -0
- package/dist/features/presenter/typedef.d.ts +92 -0
- package/dist/features/presenter/typedef.js +106 -0
- package/dist/features/presenter/util.d.ts +63 -0
- package/dist/features/presenter/util.js +210 -0
- package/dist/features/virtual-viewport/VirtualViewport.svelte +196 -0
- package/dist/features/virtual-viewport/VirtualViewport.svelte.d.ts +42 -0
- package/dist/index.d.ts +0 -0
- package/dist/index.js +0 -0
- package/dist/logging/adapters/console.d.ts +48 -0
- package/dist/logging/adapters/console.js +114 -0
- package/dist/logging/adapters/pino.d.ts +25 -0
- package/dist/logging/adapters/pino.js +60 -0
- package/dist/logging/constants.d.ts +1 -0
- package/dist/logging/constants.js +1 -0
- package/dist/logging/factories/client.d.ts +10 -0
- package/dist/logging/factories/client.js +21 -0
- package/dist/logging/factories/server.d.ts +10 -0
- package/dist/logging/factories/server.js +22 -0
- package/dist/logging/factories/universal.d.ts +9 -0
- package/dist/logging/factories/universal.js +23 -0
- package/dist/logging/index.d.ts +5 -0
- package/dist/logging/index.js +8 -0
- package/dist/schemas/index.d.ts +1 -0
- package/dist/schemas/index.js +1 -0
- package/dist/schemas/validate-url.d.ts +30 -0
- package/dist/schemas/validate-url.js +180 -0
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.js +1 -0
- package/dist/server/logger.d.ts +25 -0
- package/dist/server/logger.js +94 -0
- package/dist/states/index.d.ts +1 -0
- package/dist/states/index.js +1 -0
- package/dist/states/navigation.svelte.d.ts +23 -0
- package/dist/states/navigation.svelte.js +55 -0
- package/dist/stores/index.d.ts +1 -0
- package/dist/stores/index.js +1 -0
- package/dist/stores/theme.d.ts +28 -0
- package/dist/stores/theme.js +80 -0
- package/dist/themes/hkdev/components/blocks/text-block.css +34 -0
- package/dist/themes/hkdev/components/boxes/game-box.css +11 -0
- package/dist/themes/hkdev/components/buttons/button-icon-steeze.css +22 -0
- package/dist/themes/hkdev/components/buttons/button-text.css +32 -0
- package/dist/themes/hkdev/components/buttons/button.css +146 -0
- package/dist/themes/hkdev/components/buttons/skip-button.css +5 -0
- package/dist/themes/hkdev/components/drag-drop/draggable.css +73 -0
- package/dist/themes/hkdev/components/drag-drop/drop-zone.css +58 -0
- package/dist/themes/hkdev/components/icons/icon-steeze.css +16 -0
- package/dist/themes/hkdev/components/inputs/text-input.css +102 -0
- package/dist/themes/hkdev/components/panels/panel.css +25 -0
- package/dist/themes/hkdev/components/rows/panel-grid-row.css +4 -0
- package/dist/themes/hkdev/components/rows/panel-row-2.css +5 -0
- package/dist/themes/hkdev/components.css +29 -0
- package/dist/themes/hkdev/debug.css +2 -0
- package/dist/themes/hkdev/global/layout.css +32 -0
- package/dist/themes/hkdev/global/on-colors.css +32 -0
- package/dist/themes/hkdev/globals.css +4 -0
- package/dist/themes/hkdev/responsive.css +12 -0
- package/dist/themes/hkdev/theme-ext.d.ts +4 -0
- package/dist/themes/hkdev/theme-ext.js +12 -0
- package/dist/themes/hkdev/theme.css +219 -0
- package/dist/themes/index.d.ts +1 -0
- package/dist/themes/index.js +1 -0
- package/dist/typedef/context.d.ts +3 -0
- package/dist/typedef/context.js +6 -0
- package/dist/typedef/drag.d.ts +29 -0
- package/dist/typedef/drag.js +25 -0
- package/dist/typedef/drop.d.ts +15 -0
- package/dist/typedef/drop.js +12 -0
- package/dist/typedef/image.d.ts +12 -0
- package/dist/typedef/image.js +38 -0
- package/dist/typedef/index.d.ts +4 -0
- package/dist/typedef/index.js +4 -0
- package/dist/util/array/index.d.ts +183 -0
- package/dist/util/array/index.js +436 -0
- package/dist/util/bases/base58.d.ts +58 -0
- package/dist/util/bases/base58.js +262 -0
- package/dist/util/bases/index.d.ts +1 -0
- package/dist/util/bases/index.js +1 -0
- package/dist/util/compare/index.d.ts +68 -0
- package/dist/util/compare/index.js +247 -0
- package/dist/util/css/css-vars.d.ts +24 -0
- package/dist/util/css/css-vars.js +83 -0
- package/dist/util/css/index.d.ts +1 -0
- package/dist/util/css/index.js +1 -0
- package/dist/util/design-system/components/states.d.ts +15 -0
- package/dist/util/design-system/components/states.js +22 -0
- package/dist/util/design-system/css/clamp.d.ts +17 -0
- package/dist/util/design-system/css/clamp.js +66 -0
- package/dist/util/design-system/css/root-design-vars.d.ts +77 -0
- package/dist/util/design-system/css/root-design-vars.js +102 -0
- package/dist/util/design-system/index.d.ts +5 -0
- package/dist/util/design-system/index.js +5 -0
- package/dist/util/design-system/layout/scaling.d.ts +98 -0
- package/dist/util/design-system/layout/scaling.js +228 -0
- package/dist/util/design-system/skeleton.d.ts +41 -0
- package/dist/util/design-system/skeleton.js +208 -0
- package/dist/util/design-system/tailwind.d.ts +183 -0
- package/dist/util/design-system/tailwind.js +288 -0
- package/dist/util/env/index.d.ts +1 -0
- package/dist/util/env/index.js +9 -0
- package/dist/util/exceptions/index.d.ts +15 -0
- package/dist/util/exceptions/index.js +23 -0
- package/dist/util/expect/arrays.d.ts +30 -0
- package/dist/util/expect/arrays.js +47 -0
- package/dist/util/expect/index.d.ts +103 -0
- package/dist/util/expect/index.js +259 -0
- package/dist/util/expect/primitives.d.ts +30 -0
- package/dist/util/expect/primitives.js +55 -0
- package/dist/util/expect/url.d.ts +32 -0
- package/dist/util/expect/url.js +60 -0
- package/dist/util/function/index.d.ts +34 -0
- package/dist/util/function/index.js +218 -0
- package/dist/util/geo/index.d.ts +10 -0
- package/dist/util/geo/index.js +26 -0
- package/dist/util/http/caching.d.ts +28 -0
- package/dist/util/http/caching.js +263 -0
- package/dist/util/http/errors.d.ts +18 -0
- package/dist/util/http/errors.js +97 -0
- package/dist/util/http/headers.d.ts +40 -0
- package/dist/util/http/headers.js +75 -0
- package/dist/util/http/http-request.d.ts +267 -0
- package/dist/util/http/http-request.js +578 -0
- package/dist/util/http/index.d.ts +6 -0
- package/dist/util/http/index.js +22 -0
- package/dist/util/http/json-request.d.ts +84 -0
- package/dist/util/http/json-request.js +224 -0
- package/dist/util/http/mocks.d.ts +20 -0
- package/dist/util/http/mocks.js +65 -0
- package/dist/util/http/response.d.ts +125 -0
- package/dist/util/http/response.js +294 -0
- package/dist/util/http/test-data__/content-length-test-hkdigital-small.V4HfZyBQ.avif +0 -0
- package/dist/util/http/typedef.d.ts +184 -0
- package/dist/util/http/typedef.js +93 -0
- package/dist/util/http/url.d.ts +25 -0
- package/dist/util/http/url.js +52 -0
- package/dist/util/image/index.d.ts +25 -0
- package/dist/util/image/index.js +86 -0
- package/dist/util/index.d.ts +3 -0
- package/dist/util/index.js +3 -0
- package/dist/util/is/index.d.ts +68 -0
- package/dist/util/is/index.js +140 -0
- package/dist/util/iterate/index.d.ts +131 -0
- package/dist/util/iterate/index.js +234 -0
- package/dist/util/object/index.d.ts +326 -0
- package/dist/util/object/index.js +1361 -0
- package/dist/util/singleton/index.d.ts +34 -0
- package/dist/util/singleton/index.js +97 -0
- package/dist/util/string/array-path.d.ts +15 -0
- package/dist/util/string/array-path.js +75 -0
- package/dist/util/string/convert.d.ts +22 -0
- package/dist/util/string/convert.js +54 -0
- package/dist/util/string/fs.d.ts +55 -0
- package/dist/util/string/fs.js +226 -0
- package/dist/util/string/index.d.ts +5 -0
- package/dist/util/string/index.js +5 -0
- package/dist/util/string/interpolate.d.ts +22 -0
- package/dist/util/string/interpolate.js +61 -0
- package/dist/util/string/pad.d.ts +8 -0
- package/dist/util/string/pad.js +10 -0
- package/dist/util/svelte/index.d.ts +3 -0
- package/dist/util/svelte/index.js +4 -0
- package/dist/util/svelte/loading/loading-tracker.svelte.d.ts +31 -0
- package/dist/util/svelte/loading/loading-tracker.svelte.js +108 -0
- package/dist/util/svelte/observe/index.d.ts +10 -0
- package/dist/util/svelte/observe/index.js +49 -0
- package/dist/util/svelte/state-context/index.d.ts +18 -0
- package/dist/util/svelte/state-context/index.js +117 -0
- package/dist/util/svelte/wait/index.d.ts +15 -0
- package/dist/util/svelte/wait/index.js +38 -0
- package/dist/util/sveltekit/index.d.ts +1 -0
- package/dist/util/sveltekit/index.js +1 -0
- package/dist/util/sveltekit/route-folders/index.d.ts +28 -0
- package/dist/util/sveltekit/route-folders/index.js +101 -0
- package/dist/util/time/index.d.ts +108 -0
- package/dist/util/time/index.js +323 -0
- package/dist/util/unique/index.d.ts +81 -0
- package/dist/util/unique/index.js +249 -0
- package/dist/valibot/date.js__ +10 -0
- package/dist/valibot/index.d.ts +4 -0
- package/dist/valibot/index.js +9 -0
- package/dist/valibot/url.d.ts +26 -0
- package/dist/valibot/url.js +95 -0
- package/dist/valibot/user.d.ts +6 -0
- package/dist/valibot/user.js +23 -0
- package/dist/zod/all.d.ts +6 -0
- package/dist/zod/all.js +33 -0
- package/dist/zod/generic.d.ts +6 -0
- package/dist/zod/generic.js +11 -0
- package/dist/zod/javascript.d.ts +8 -0
- package/dist/zod/javascript.js +32 -0
- package/dist/zod/user.d.ts +9 -0
- package/dist/zod/user.js +16 -0
- package/dist/zod/web.d.ts +21 -0
- package/dist/zod/web.js +52 -0
- package/package.json +133 -0
package/README.md
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
# HKdigital's lib-core
|
|
2
|
+
|
|
3
|
+
Core library that we use to power up our Sveltekit projects
|
|
4
|
+
|
|
5
|
+
This is a library for [SvelteKit](https://svelte.dev/) projects.
|
|
6
|
+
It contains common code and components that we use to create our projects.
|
|
7
|
+
|
|
8
|
+
## Status
|
|
9
|
+
|
|
10
|
+
**EARLY DEVELOPMENT RELEASE**
|
|
11
|
+
This package is incomplete and not fully tested.
|
|
12
|
+
Do not use in production environments yet.
|
|
13
|
+
|
|
14
|
+
### TODO
|
|
15
|
+
|
|
16
|
+
## Using the library
|
|
17
|
+
|
|
18
|
+
### Install
|
|
19
|
+
|
|
20
|
+
The library can be installed as a normal NPM library.
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
pnpm add @hkdigital/lib-sveltekit
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
#### Tailwind
|
|
27
|
+
|
|
28
|
+
Components in this package use [tailwindcss](https://tailwindcss.com/).
|
|
29
|
+
|
|
30
|
+
To compile tailwind classes inside this package, you must add the package location to your tailwindcss plugin configuration.
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
// tailwind.config.js
|
|
34
|
+
export default {
|
|
35
|
+
content: [
|
|
36
|
+
'./node_modules/@hkdigital/**/*.{html,js,svelte,ts}',
|
|
37
|
+
'./src/**/*.{html,js,svelte,ts}',
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Update
|
|
41
|
+
|
|
42
|
+
Make sure your project has a script called `upgrade:hk` to upgrade all packages
|
|
43
|
+
in the '@hkdigital' namespace.
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
pnpm upgrade:hk
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### The package.json scripts:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
pnpm add -D npm-check-updates
|
|
53
|
+
pnpm add -D npm-check-updates
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
```js
|
|
57
|
+
"scripts": {
|
|
58
|
+
"upgrade:hk": "run-s upgrade:hk:update pnpm:install",
|
|
59
|
+
"upgrade:hk:update": "ncu --dep dev,optional,peer,prod '@hkdigital/*' -u",
|
|
60
|
+
"pnpm:install": "pnpm install"
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
### Import JS, Svelte files and Typedefs
|
|
66
|
+
|
|
67
|
+
Most subfolders have an index.js that export all functionality and typedefs.
|
|
68
|
+
|
|
69
|
+
```svelte
|
|
70
|
+
import { CHAR } from '@hkdigital/lib-sveltekit/constants/regexp/index.js';
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Import CSS
|
|
74
|
+
|
|
75
|
+
Vite should include postcss-import, but the only solution to get it working for now is to use a relative path to the node_modules folder.
|
|
76
|
+
|
|
77
|
+
For example:
|
|
78
|
+
|
|
79
|
+
```css
|
|
80
|
+
/* src/app.css */
|
|
81
|
+
@import '../node_modules/@hkdigital/lib-sveltekit/dist/css/utilities.css';
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Enable tailwind processing
|
|
85
|
+
|
|
86
|
+
Allow the tailwind CSS processor to work on the library inside node_modules
|
|
87
|
+
|
|
88
|
+
```js
|
|
89
|
+
// tailwind.config.js
|
|
90
|
+
export default {
|
|
91
|
+
content: [
|
|
92
|
+
'./node_modules/@hkdigital/**/*.{html,js,svelte,ts}',
|
|
93
|
+
'./src/**/*.{html,js,svelte,ts}',
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Building the library
|
|
97
|
+
|
|
98
|
+
To build your library:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
npm run package
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## Building the showcase app
|
|
105
|
+
|
|
106
|
+
To create a production version of your showcase app:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
npm run build
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
You can preview the production build with `npm run preview`.
|
|
113
|
+
|
|
114
|
+
> To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment.
|
|
115
|
+
|
|
116
|
+
## Developing
|
|
117
|
+
|
|
118
|
+
To develop this library, clone the repository and install the dependencies, then start the development server of the test runners. Checkout the [package.json](./package.json) file for more details.
|
|
119
|
+
|
|
120
|
+
Everything inside `src/lib` is part of the library, everything inside `src/routes` is the showcase app of this library.
|
|
121
|
+
|
|
122
|
+
## Publishing
|
|
123
|
+
|
|
124
|
+
The name of this library is `@hkdigital/lib-sveltekit` and it is published on [NPM](https://npmjs.com). You need NPM credentials to publish in the scope `@hkdigital`.
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
# Manually
|
|
128
|
+
npm login
|
|
129
|
+
npm version patch
|
|
130
|
+
npm publish --access public
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
# Run `npm version patch && npm publish --access public && git push`
|
|
135
|
+
# as specified in package.json
|
|
136
|
+
pnpm run publish:npm
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Troubleshooting
|
|
140
|
+
|
|
141
|
+
#### Running scripts from package.json in Windows
|
|
142
|
+
|
|
143
|
+
The CMD terminal in Windows is quite limited. Use the PowerShell instead of some scripts from package.json do not run correctly.
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
## Contribute
|
|
147
|
+
|
|
148
|
+
If your wish to contribute to this library, please contact us [HKdigital](https://hkdigital.nl/contact). Alternatively, the license permits you to fork the library and publish under an alternative name. Don't forget to change the package name in [package.json](./package.json) if you do so.
|
|
149
|
+
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export const carPaintImages: {
|
|
2
|
+
rusty: import("../../typedef/image.js").ImageMeta[];
|
|
3
|
+
"army-green": import("../../typedef/image.js").ImageMeta[];
|
|
4
|
+
"electric-blue": import("../../typedef/image.js").ImageMeta[];
|
|
5
|
+
"lemon-yellow": import("../../typedef/image.js").ImageMeta[];
|
|
6
|
+
"opaque-purple": import("../../typedef/image.js").ImageMeta[];
|
|
7
|
+
"sunset-orange": import("../../typedef/image.js").ImageMeta[];
|
|
8
|
+
"tomato-red": import("../../typedef/image.js").ImageMeta[];
|
|
9
|
+
};
|
|
10
|
+
import Rusty from './car-paint-picker/rusty.jpg?preset=render&responsive';
|
|
11
|
+
import ArmyGreen from './car-paint-picker/army-green.jpg?preset=render&responsive';
|
|
12
|
+
import ElectricBlue from './car-paint-picker/electric-blue.jpg?preset=render&responsive';
|
|
13
|
+
import LemonYellow from './car-paint-picker/lemon-yellow.jpg?preset=render&responsive';
|
|
14
|
+
import OpaquePurple from './car-paint-picker/opaque-purple.jpg?preset=render&responsive';
|
|
15
|
+
import SunsetOrange from './car-paint-picker/sunset-orange.jpg?preset=render&responsive';
|
|
16
|
+
import TomatoRed from './car-paint-picker/tomato-red.jpg?preset=render&responsive';
|
|
17
|
+
export { Rusty, ArmyGreen, ElectricBlue, LemonYellow, OpaquePurple, SunsetOrange, TomatoRed };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import {
|
|
2
|
+
LABEL_RUSTY,
|
|
3
|
+
LABEL_ARMY_GREEN,
|
|
4
|
+
LABEL_ELECTRIC_BLUE,
|
|
5
|
+
LABEL_LEMON_YELLOW,
|
|
6
|
+
LABEL_OPAQUE_PURPLE,
|
|
7
|
+
LABEL_SUNSET_ORANGE,
|
|
8
|
+
LABEL_TOMATO_RED
|
|
9
|
+
} from './labels.js';
|
|
10
|
+
|
|
11
|
+
import Rusty from './car-paint-picker/rusty.jpg?preset=render&responsive';
|
|
12
|
+
|
|
13
|
+
import ArmyGreen from './car-paint-picker/army-green.jpg?preset=render&responsive';
|
|
14
|
+
import ElectricBlue from './car-paint-picker/electric-blue.jpg?preset=render&responsive';
|
|
15
|
+
import LemonYellow from './car-paint-picker/lemon-yellow.jpg?preset=render&responsive';
|
|
16
|
+
import OpaquePurple from './car-paint-picker/opaque-purple.jpg?preset=render&responsive';
|
|
17
|
+
import SunsetOrange from './car-paint-picker/sunset-orange.jpg?preset=render&responsive';
|
|
18
|
+
import TomatoRed from './car-paint-picker/tomato-red.jpg?preset=render&responsive';
|
|
19
|
+
|
|
20
|
+
// console.log('ArmyGreen', ArmyGreen);
|
|
21
|
+
|
|
22
|
+
export const carPaintImages = {
|
|
23
|
+
[LABEL_RUSTY]: Rusty,
|
|
24
|
+
[LABEL_ARMY_GREEN]: ArmyGreen,
|
|
25
|
+
[LABEL_ELECTRIC_BLUE]: ElectricBlue,
|
|
26
|
+
[LABEL_LEMON_YELLOW]: LemonYellow,
|
|
27
|
+
[LABEL_OPAQUE_PURPLE]: OpaquePurple,
|
|
28
|
+
[LABEL_SUNSET_ORANGE]: SunsetOrange,
|
|
29
|
+
[LABEL_TOMATO_RED]: TomatoRed
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/* Also export as individual images */
|
|
33
|
+
export {
|
|
34
|
+
Rusty,
|
|
35
|
+
ArmyGreen,
|
|
36
|
+
ElectricBlue,
|
|
37
|
+
LemonYellow,
|
|
38
|
+
OpaquePurple,
|
|
39
|
+
SunsetOrange,
|
|
40
|
+
TomatoRed
|
|
41
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export const LABEL_RUSTY: "rusty";
|
|
2
|
+
export const LABEL_ARMY_GREEN: "army-green";
|
|
3
|
+
export const LABEL_ELECTRIC_BLUE: "electric-blue";
|
|
4
|
+
export const LABEL_LEMON_YELLOW: "lemon-yellow";
|
|
5
|
+
export const LABEL_OPAQUE_PURPLE: "opaque-purple";
|
|
6
|
+
export const LABEL_SUNSET_ORANGE: "sunset-orange";
|
|
7
|
+
export const LABEL_TOMATO_RED: "tomato-red";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export const LABEL_RUSTY = 'rusty';
|
|
2
|
+
export const LABEL_ARMY_GREEN = 'army-green';
|
|
3
|
+
export const LABEL_ELECTRIC_BLUE = 'electric-blue';
|
|
4
|
+
export const LABEL_LEMON_YELLOW = 'lemon-yellow';
|
|
5
|
+
export const LABEL_OPAQUE_PURPLE = 'opaque-purple';
|
|
6
|
+
export const LABEL_SUNSET_ORANGE = 'sunset-orange';
|
|
7
|
+
export const LABEL_TOMATO_RED = 'tomato-red';
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IndexedDbCache with automatic background cleanup
|
|
3
|
+
*/
|
|
4
|
+
export default class IndexedDbCache {
|
|
5
|
+
/**
|
|
6
|
+
* Create a new IndexedDB cache storage
|
|
7
|
+
*
|
|
8
|
+
* @param {Object} [options] - Cache options
|
|
9
|
+
* @param {string} [options.dbName='http-cache'] - Database name
|
|
10
|
+
* @param {string} [options.storeName='responses'] - Store name
|
|
11
|
+
* @param {number} [options.maxSize=50000000] - Max cache size in bytes (50MB)
|
|
12
|
+
* @param {number} [options.maxAge=604800000] - Max age in ms (7 days)
|
|
13
|
+
* @param {number} [options.cleanupBatchSize=100] - Items per cleanup batch
|
|
14
|
+
* @param {number} [options.cleanupInterval=300000] - Time between cleanup attempts (5min)
|
|
15
|
+
* @param {number} [options.cleanupPostponeTimeout=5000] - Time to postpone cleanup after store (5sec)
|
|
16
|
+
* @param {string} [options.cacheVersion='1.0.0'] - Cache version, used for cache invalidation
|
|
17
|
+
*/
|
|
18
|
+
constructor(options?: {
|
|
19
|
+
dbName?: string;
|
|
20
|
+
storeName?: string;
|
|
21
|
+
maxSize?: number;
|
|
22
|
+
maxAge?: number;
|
|
23
|
+
cleanupBatchSize?: number;
|
|
24
|
+
cleanupInterval?: number;
|
|
25
|
+
cleanupPostponeTimeout?: number;
|
|
26
|
+
cacheVersion?: string;
|
|
27
|
+
});
|
|
28
|
+
dbName: string;
|
|
29
|
+
storeName: string;
|
|
30
|
+
maxSize: number;
|
|
31
|
+
maxAge: number;
|
|
32
|
+
cleanupBatchSize: number;
|
|
33
|
+
cleanupInterval: number;
|
|
34
|
+
cleanupPostponeTimeout: number;
|
|
35
|
+
cacheVersion: string;
|
|
36
|
+
EXPIRES_INDEX: string;
|
|
37
|
+
TIMESTAMP_INDEX: string;
|
|
38
|
+
SIZE_INDEX: string;
|
|
39
|
+
CACHE_VERSION_INDEX: string;
|
|
40
|
+
SCHEMA_VERSION: number;
|
|
41
|
+
/**
|
|
42
|
+
* Database connection promise
|
|
43
|
+
* @type {Promise<IDBDatabase>}
|
|
44
|
+
* @private
|
|
45
|
+
*/
|
|
46
|
+
private dbPromise;
|
|
47
|
+
/**
|
|
48
|
+
* Cleanup state tracker
|
|
49
|
+
* @type {Object}
|
|
50
|
+
* @private
|
|
51
|
+
*/
|
|
52
|
+
private cleanupState;
|
|
53
|
+
postponeCleanupTimer: number;
|
|
54
|
+
/**
|
|
55
|
+
* Initialize the database connection
|
|
56
|
+
*
|
|
57
|
+
* @private
|
|
58
|
+
*/
|
|
59
|
+
private _initDatabase;
|
|
60
|
+
/**
|
|
61
|
+
* Open the IndexedDB database with proper schema versioning
|
|
62
|
+
*
|
|
63
|
+
* @private
|
|
64
|
+
* @returns {Promise<IDBDatabase>}
|
|
65
|
+
*/
|
|
66
|
+
private _openDatabase;
|
|
67
|
+
/**
|
|
68
|
+
* Ensure an index exists in a store, create if missing
|
|
69
|
+
*
|
|
70
|
+
* @private
|
|
71
|
+
* @param {IDBObjectStore} store - The object store
|
|
72
|
+
* @param {string} indexName - Name of the index
|
|
73
|
+
* @param {string} keyPath - Key path for the index
|
|
74
|
+
* @param {Object} options - Index options (e.g. unique)
|
|
75
|
+
*/
|
|
76
|
+
private _ensureIndexExists;
|
|
77
|
+
/**
|
|
78
|
+
* Check if all required indexes exist in the database
|
|
79
|
+
*
|
|
80
|
+
* @private
|
|
81
|
+
* @returns {Promise<boolean>}
|
|
82
|
+
*/
|
|
83
|
+
private _validateSchema;
|
|
84
|
+
/**
|
|
85
|
+
* Postpone cleanup for the specified duration
|
|
86
|
+
* Resets the postpone timer if called again before timeout
|
|
87
|
+
*
|
|
88
|
+
* @private
|
|
89
|
+
*/
|
|
90
|
+
private _postponeCleanup;
|
|
91
|
+
/**
|
|
92
|
+
* Check if cleanup is postponed
|
|
93
|
+
*
|
|
94
|
+
* @private
|
|
95
|
+
* @returns {boolean}
|
|
96
|
+
*/
|
|
97
|
+
private _isCleanupPostponed;
|
|
98
|
+
/**
|
|
99
|
+
* Get a cached response
|
|
100
|
+
* Supports retrieving older cache versions and migrating them
|
|
101
|
+
*
|
|
102
|
+
* @param {string} key - Cache key
|
|
103
|
+
* @returns {Promise<CacheEntry|null>} Cache entry or null if not found/expired
|
|
104
|
+
*/
|
|
105
|
+
get(key: string): Promise<CacheEntry | null>;
|
|
106
|
+
/**
|
|
107
|
+
* Store a response in the cache
|
|
108
|
+
*
|
|
109
|
+
* @param {string} key - Cache key
|
|
110
|
+
* @param {Response} response - Response to cache
|
|
111
|
+
* @param {Object} [metadata={}] - Cache metadata
|
|
112
|
+
* @returns {Promise<void>}
|
|
113
|
+
*/
|
|
114
|
+
set(key: string, response: Response, metadata?: any): Promise<void>;
|
|
115
|
+
/**
|
|
116
|
+
* Update an existing entry in the cache
|
|
117
|
+
*
|
|
118
|
+
* @private
|
|
119
|
+
* @param {Object} entry - The entry to update
|
|
120
|
+
* @returns {Promise<boolean>}
|
|
121
|
+
*/
|
|
122
|
+
private _updateEntry;
|
|
123
|
+
/**
|
|
124
|
+
* Update last accessed timestamp (without blocking)
|
|
125
|
+
*
|
|
126
|
+
* @private
|
|
127
|
+
* @param {string} key - Cache key
|
|
128
|
+
* @returns {Promise<void>}
|
|
129
|
+
*/
|
|
130
|
+
private _updateAccessTime;
|
|
131
|
+
/**
|
|
132
|
+
* Delete a cached entry
|
|
133
|
+
*
|
|
134
|
+
* @param {string} key - Cache key
|
|
135
|
+
* @returns {Promise<boolean>}
|
|
136
|
+
*/
|
|
137
|
+
delete(key: string): Promise<boolean>;
|
|
138
|
+
/**
|
|
139
|
+
* Delete a cached entry (internal implementation)
|
|
140
|
+
*
|
|
141
|
+
* @private
|
|
142
|
+
* @param {string} key - Cache key
|
|
143
|
+
* @returns {Promise<boolean>}
|
|
144
|
+
*/
|
|
145
|
+
private _deleteEntry;
|
|
146
|
+
/**
|
|
147
|
+
* Clear all cached responses
|
|
148
|
+
*
|
|
149
|
+
* @returns {Promise<void>}
|
|
150
|
+
*/
|
|
151
|
+
clear(): Promise<void>;
|
|
152
|
+
/**
|
|
153
|
+
* Check storage usage and schedule cleanup if needed
|
|
154
|
+
*
|
|
155
|
+
* @private
|
|
156
|
+
*/
|
|
157
|
+
private _checkAndScheduleCleanup;
|
|
158
|
+
/**
|
|
159
|
+
* Schedule a cleanup to run during idle time
|
|
160
|
+
*
|
|
161
|
+
* @private
|
|
162
|
+
* @param {boolean} [urgent=false] - If true, clean up sooner
|
|
163
|
+
*/
|
|
164
|
+
private _scheduleCleanup;
|
|
165
|
+
/**
|
|
166
|
+
* Get a random expiration time between 30 minutes and 90 minutes
|
|
167
|
+
*
|
|
168
|
+
* @private
|
|
169
|
+
* @returns {number} Expiration time in milliseconds
|
|
170
|
+
*/
|
|
171
|
+
private _getRandomExpiration;
|
|
172
|
+
/**
|
|
173
|
+
* Perform a single cleanup step
|
|
174
|
+
*
|
|
175
|
+
* @private
|
|
176
|
+
*/
|
|
177
|
+
private _performCleanupStep;
|
|
178
|
+
/**
|
|
179
|
+
* Remove expired entries
|
|
180
|
+
*
|
|
181
|
+
* @private
|
|
182
|
+
* @param {number} limit - Maximum number of entries to remove
|
|
183
|
+
* @returns {Promise<number>} Number of entries removed
|
|
184
|
+
*/
|
|
185
|
+
private _removeExpiredEntries;
|
|
186
|
+
/**
|
|
187
|
+
* Mark entries from old cache versions for gradual expiration
|
|
188
|
+
*
|
|
189
|
+
* @private
|
|
190
|
+
* @param {number} limit - Maximum number of entries to mark
|
|
191
|
+
* @returns {Promise<number>} Number of entries marked
|
|
192
|
+
*/
|
|
193
|
+
private _markOldCacheVersionsForExpiration;
|
|
194
|
+
/**
|
|
195
|
+
* Remove old entries based on age and size constraints
|
|
196
|
+
*
|
|
197
|
+
* @private
|
|
198
|
+
* @param {number} limit - Maximum number of entries to remove
|
|
199
|
+
* @returns {Promise<number>} Number of entries removed
|
|
200
|
+
*/
|
|
201
|
+
private _removeOldEntries;
|
|
202
|
+
/**
|
|
203
|
+
* Get an estimate of the total cache size
|
|
204
|
+
*
|
|
205
|
+
* @private
|
|
206
|
+
* @returns {Promise<number>} Size estimate in bytes
|
|
207
|
+
*/
|
|
208
|
+
private _getCacheSizeEstimate;
|
|
209
|
+
/**
|
|
210
|
+
* Close the database connection
|
|
211
|
+
*/
|
|
212
|
+
close(): Promise<void>;
|
|
213
|
+
}
|
|
214
|
+
export type CacheEntry = import("./typedef").CacheEntry;
|
|
215
|
+
export type IDBRequestEvent = import("./typedef").IDBRequestEvent;
|
|
216
|
+
export type IDBVersionChangeEvent = import("./typedef").IDBVersionChangeEvent;
|