mates-devtools 0.1.0-beta.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/dist/mates-devtools.es.js +3464 -0
- package/dist/mates-devtools.umd.js +650 -0
- package/dist/types/Mates-DevTools/src/MatesDevTools.d.ts +5 -0
- package/dist/types/Mates-DevTools/src/MatesDevTools.d.ts.map +1 -0
- package/dist/types/Mates-DevTools/src/MatesDevToolsComponent.d.ts +24 -0
- package/dist/types/Mates-DevTools/src/MatesDevToolsComponent.d.ts.map +1 -0
- package/dist/types/Mates-DevTools/src/components/AtomsViewer.d.ts +2 -0
- package/dist/types/Mates-DevTools/src/components/AtomsViewer.d.ts.map +1 -0
- package/dist/types/Mates-DevTools/src/components/ComponentInspector.d.ts +27 -0
- package/dist/types/Mates-DevTools/src/components/ComponentInspector.d.ts.map +1 -0
- package/dist/types/Mates-DevTools/src/components/ComponentList.d.ts +11 -0
- package/dist/types/Mates-DevTools/src/components/ComponentList.d.ts.map +1 -0
- package/dist/types/Mates-DevTools/src/components/ComponentTree.d.ts +9 -0
- package/dist/types/Mates-DevTools/src/components/ComponentTree.d.ts.map +1 -0
- package/dist/types/Mates-DevTools/src/components/Header.d.ts +10 -0
- package/dist/types/Mates-DevTools/src/components/Header.d.ts.map +1 -0
- package/dist/types/Mates-DevTools/src/components/Highlight.d.ts +6 -0
- package/dist/types/Mates-DevTools/src/components/Highlight.d.ts.map +1 -0
- package/dist/types/Mates-DevTools/src/components/HooksViewer.d.ts +7 -0
- package/dist/types/Mates-DevTools/src/components/HooksViewer.d.ts.map +1 -0
- package/dist/types/Mates-DevTools/src/components/LogsViewer.d.ts +6 -0
- package/dist/types/Mates-DevTools/src/components/LogsViewer.d.ts.map +1 -0
- package/dist/types/Mates-DevTools/src/components/PerfViewer.d.ts +7 -0
- package/dist/types/Mates-DevTools/src/components/PerfViewer.d.ts.map +1 -0
- package/dist/types/Mates-DevTools/src/components/PropsViewer.d.ts +2 -0
- package/dist/types/Mates-DevTools/src/components/PropsViewer.d.ts.map +1 -0
- package/dist/types/Mates-DevTools/src/components/ScopesViewer.d.ts +2 -0
- package/dist/types/Mates-DevTools/src/components/ScopesViewer.d.ts.map +1 -0
- package/dist/types/Mates-DevTools/src/components/TimerLogger.d.ts +5 -0
- package/dist/types/Mates-DevTools/src/components/TimerLogger.d.ts.map +1 -0
- package/dist/types/Mates-DevTools/src/components/UseStateViewer.d.ts +12 -0
- package/dist/types/Mates-DevTools/src/components/UseStateViewer.d.ts.map +1 -0
- package/dist/types/Mates-DevTools/src/components/ValueTree.d.ts +19 -0
- package/dist/types/Mates-DevTools/src/components/ValueTree.d.ts.map +1 -0
- package/dist/types/Mates-DevTools/src/index.d.ts +23 -0
- package/dist/types/Mates-DevTools/src/index.d.ts.map +1 -0
- package/dist/types/Mates-DevTools/src/interceptTimers.d.ts +11 -0
- package/dist/types/Mates-DevTools/src/interceptTimers.d.ts.map +1 -0
- package/dist/types/Mates-DevTools/src/logStore.d.ts +38 -0
- package/dist/types/Mates-DevTools/src/logStore.d.ts.map +1 -0
- package/dist/types/Mates-DevTools/src/perfStore.d.ts +36 -0
- package/dist/types/Mates-DevTools/src/perfStore.d.ts.map +1 -0
- package/dist/types/Mates-DevTools/src/registry.d.ts +68 -0
- package/dist/types/Mates-DevTools/src/registry.d.ts.map +1 -0
- package/dist/types/Mates-DevTools/src/styles.d.ts +833 -0
- package/dist/types/Mates-DevTools/src/styles.d.ts.map +1 -0
- package/dist/types/Mates-DevTools/src/types.d.ts +19 -0
- package/dist/types/Mates-DevTools/src/types.d.ts.map +1 -0
- package/dist/types/lib/Directives/$.d.ts +371 -0
- package/dist/types/lib/Directives/$.d.ts.map +1 -0
- package/dist/types/lib/Directives/animatedConditional.d.ts +67 -0
- package/dist/types/lib/Directives/animatedConditional.d.ts.map +1 -0
- package/dist/types/lib/Directives/animationClasses.d.ts +50 -0
- package/dist/types/lib/Directives/animationClasses.d.ts.map +1 -0
- package/dist/types/lib/Directives/attrDirective.d.ts +69 -0
- package/dist/types/lib/Directives/attrDirective.d.ts.map +1 -0
- package/dist/types/lib/Directives/classesDirective.d.ts +79 -0
- package/dist/types/lib/Directives/classesDirective.d.ts.map +1 -0
- package/dist/types/lib/Directives/eleHook.d.ts +84 -0
- package/dist/types/lib/Directives/eleHook.d.ts.map +1 -0
- package/dist/types/lib/Directives/eventBinding.d.ts +29 -0
- package/dist/types/lib/Directives/eventBinding.d.ts.map +1 -0
- package/dist/types/lib/Directives/htmlHook.d.ts +101 -0
- package/dist/types/lib/Directives/htmlHook.d.ts.map +1 -0
- package/dist/types/lib/Directives/index.d.ts +18 -0
- package/dist/types/lib/Directives/index.d.ts.map +1 -0
- package/dist/types/lib/Directives/intersectDirective.d.ts +67 -0
- package/dist/types/lib/Directives/intersectDirective.d.ts.map +1 -0
- package/dist/types/lib/Directives/lazyLoadDirective.d.ts +66 -0
- package/dist/types/lib/Directives/lazyLoadDirective.d.ts.map +1 -0
- package/dist/types/lib/Directives/lifecycleDirectives.d.ts +56 -0
- package/dist/types/lib/Directives/lifecycleDirectives.d.ts.map +1 -0
- package/dist/types/lib/Directives/masonryGrid.d.ts +114 -0
- package/dist/types/lib/Directives/masonryGrid.d.ts.map +1 -0
- package/dist/types/lib/Directives/memoTemplate.d.ts +94 -0
- package/dist/types/lib/Directives/memoTemplate.d.ts.map +1 -0
- package/dist/types/lib/Directives/onDirective.d.ts +71 -0
- package/dist/types/lib/Directives/onDirective.d.ts.map +1 -0
- package/dist/types/lib/Directives/onParentDirective.d.ts +34 -0
- package/dist/types/lib/Directives/onParentDirective.d.ts.map +1 -0
- package/dist/types/lib/Directives/renderSwitch.d.ts +55 -0
- package/dist/types/lib/Directives/renderSwitch.d.ts.map +1 -0
- package/dist/types/lib/Directives/resolveAttrValue.d.ts +35 -0
- package/dist/types/lib/Directives/resolveAttrValue.d.ts.map +1 -0
- package/dist/types/lib/Directives/styleDirective.d.ts +81 -0
- package/dist/types/lib/Directives/styleDirective.d.ts.map +1 -0
- package/dist/types/lib/Directives/timerDirective.d.ts +52 -0
- package/dist/types/lib/Directives/timerDirective.d.ts.map +1 -0
- package/dist/types/lib/Directives/virtualHelpers.d.ts +10 -0
- package/dist/types/lib/Directives/virtualHelpers.d.ts.map +1 -0
- package/dist/types/lib/Fetch/ErrorTypes.d.ts +74 -0
- package/dist/types/lib/Fetch/ErrorTypes.d.ts.map +1 -0
- package/dist/types/lib/Fetch/Fetch.d.ts +168 -0
- package/dist/types/lib/Fetch/Fetch.d.ts.map +1 -0
- package/dist/types/lib/Fetch/index.d.ts +3 -0
- package/dist/types/lib/Fetch/index.d.ts.map +1 -0
- package/dist/types/lib/Mutables/Extended Atoms/cacheAtom.d.ts +156 -0
- package/dist/types/lib/Mutables/Extended Atoms/cacheAtom.d.ts.map +1 -0
- package/dist/types/lib/Mutables/Extended Atoms/index.d.ts +4 -0
- package/dist/types/lib/Mutables/Extended Atoms/index.d.ts.map +1 -0
- package/dist/types/lib/Mutables/Extended Atoms/paginationAtom.d.ts +32 -0
- package/dist/types/lib/Mutables/Extended Atoms/paginationAtom.d.ts.map +1 -0
- package/dist/types/lib/Mutables/Extended Atoms/themeAtom.d.ts +59 -0
- package/dist/types/lib/Mutables/Extended Atoms/themeAtom.d.ts.map +1 -0
- package/dist/types/lib/Mutables/atom/atom.d.ts +148 -0
- package/dist/types/lib/Mutables/atom/atom.d.ts.map +1 -0
- package/dist/types/lib/Mutables/atom/createTimedAtom.d.ts +43 -0
- package/dist/types/lib/Mutables/atom/createTimedAtom.d.ts.map +1 -0
- package/dist/types/lib/Mutables/atom/debouncedAtom.d.ts +37 -0
- package/dist/types/lib/Mutables/atom/debouncedAtom.d.ts.map +1 -0
- package/dist/types/lib/Mutables/atom/index.d.ts +10 -0
- package/dist/types/lib/Mutables/atom/index.d.ts.map +1 -0
- package/dist/types/lib/Mutables/atom/mapAtom.d.ts +105 -0
- package/dist/types/lib/Mutables/atom/mapAtom.d.ts.map +1 -0
- package/dist/types/lib/Mutables/atom/setAtom.d.ts +107 -0
- package/dist/types/lib/Mutables/atom/setAtom.d.ts.map +1 -0
- package/dist/types/lib/Mutables/atom/storageAtom.d.ts +44 -0
- package/dist/types/lib/Mutables/atom/storageAtom.d.ts.map +1 -0
- package/dist/types/lib/Mutables/atom/throttledAtom.d.ts +37 -0
- package/dist/types/lib/Mutables/atom/throttledAtom.d.ts.map +1 -0
- package/dist/types/lib/Mutables/atom/titleAtom.d.ts +20 -0
- package/dist/types/lib/Mutables/atom/titleAtom.d.ts.map +1 -0
- package/dist/types/lib/Mutables/effect/effect.d.ts +31 -0
- package/dist/types/lib/Mutables/effect/effect.d.ts.map +1 -0
- package/dist/types/lib/Mutables/effect/index.d.ts +2 -0
- package/dist/types/lib/Mutables/effect/index.d.ts.map +1 -0
- package/dist/types/lib/Mutables/events/events.d.ts +123 -0
- package/dist/types/lib/Mutables/events/events.d.ts.map +1 -0
- package/dist/types/lib/Mutables/events/index.d.ts +2 -0
- package/dist/types/lib/Mutables/events/index.d.ts.map +1 -0
- package/dist/types/lib/Mutables/events/xTabEvent.d.ts +61 -0
- package/dist/types/lib/Mutables/events/xTabEvent.d.ts.map +1 -0
- package/dist/types/lib/Mutables/form/formAtom.d.ts +56 -0
- package/dist/types/lib/Mutables/form/formAtom.d.ts.map +1 -0
- package/dist/types/lib/Mutables/form/index.d.ts +5 -0
- package/dist/types/lib/Mutables/form/index.d.ts.map +1 -0
- package/dist/types/lib/Mutables/form/transformers.d.ts +4 -0
- package/dist/types/lib/Mutables/form/transformers.d.ts.map +1 -0
- package/dist/types/lib/Mutables/form/validateAll.d.ts +40 -0
- package/dist/types/lib/Mutables/form/validateAll.d.ts.map +1 -0
- package/dist/types/lib/Mutables/form/validators.d.ts +61 -0
- package/dist/types/lib/Mutables/form/validators.d.ts.map +1 -0
- package/dist/types/lib/Mutables/index.d.ts +13 -0
- package/dist/types/lib/Mutables/index.d.ts.map +1 -0
- package/dist/types/lib/Mutables/memo/index.d.ts +2 -0
- package/dist/types/lib/Mutables/memo/index.d.ts.map +1 -0
- package/dist/types/lib/Mutables/memo/memo.d.ts +47 -0
- package/dist/types/lib/Mutables/memo/memo.d.ts.map +1 -0
- package/dist/types/lib/Mutables/reactiveRunner/index.d.ts +4 -0
- package/dist/types/lib/Mutables/reactiveRunner/index.d.ts.map +1 -0
- package/dist/types/lib/Mutables/reactiveRunner/reactiveRunner.d.ts +56 -0
- package/dist/types/lib/Mutables/reactiveRunner/reactiveRunner.d.ts.map +1 -0
- package/dist/types/lib/Mutables/reactiveRunner/trackAndSubscribe.d.ts +6 -0
- package/dist/types/lib/Mutables/reactiveRunner/trackAndSubscribe.d.ts.map +1 -0
- package/dist/types/lib/Mutables/reactiveRunner/validateReactiveFunction.d.ts +6 -0
- package/dist/types/lib/Mutables/reactiveRunner/validateReactiveFunction.d.ts.map +1 -0
- package/dist/types/lib/Mutables/ref/index.d.ts +2 -0
- package/dist/types/lib/Mutables/ref/index.d.ts.map +1 -0
- package/dist/types/lib/Mutables/ref/ref.d.ts +74 -0
- package/dist/types/lib/Mutables/ref/ref.d.ts.map +1 -0
- package/dist/types/lib/Mutables/scope/index.d.ts +2 -0
- package/dist/types/lib/Mutables/scope/index.d.ts.map +1 -0
- package/dist/types/lib/Mutables/scope/scope.d.ts +60 -0
- package/dist/types/lib/Mutables/scope/scope.d.ts.map +1 -0
- package/dist/types/lib/Mutables/store/index.d.ts +2 -0
- package/dist/types/lib/Mutables/store/index.d.ts.map +1 -0
- package/dist/types/lib/Mutables/store/store.d.ts +73 -0
- package/dist/types/lib/Mutables/store/store.d.ts.map +1 -0
- package/dist/types/lib/Mutables/useState/index.d.ts +2 -0
- package/dist/types/lib/Mutables/useState/index.d.ts.map +1 -0
- package/dist/types/lib/Mutables/useState/useState.d.ts +54 -0
- package/dist/types/lib/Mutables/useState/useState.d.ts.map +1 -0
- package/dist/types/lib/Mutables/useStore/hostContext.d.ts +13 -0
- package/dist/types/lib/Mutables/useStore/hostContext.d.ts.map +1 -0
- package/dist/types/lib/Mutables/useStore/index.d.ts +9 -0
- package/dist/types/lib/Mutables/useStore/index.d.ts.map +1 -0
- package/dist/types/lib/Mutables/useStore/lifecycle.d.ts +94 -0
- package/dist/types/lib/Mutables/useStore/lifecycle.d.ts.map +1 -0
- package/dist/types/lib/Mutables/useStore/onError.d.ts +21 -0
- package/dist/types/lib/Mutables/useStore/onError.d.ts.map +1 -0
- package/dist/types/lib/Mutables/useStore/onReferenceChange.d.ts +2 -0
- package/dist/types/lib/Mutables/useStore/onReferenceChange.d.ts.map +1 -0
- package/dist/types/lib/Mutables/useStore/safetyCheck.d.ts +2 -0
- package/dist/types/lib/Mutables/useStore/safetyCheck.d.ts.map +1 -0
- package/dist/types/lib/Mutables/useStore/setter.d.ts +52 -0
- package/dist/types/lib/Mutables/useStore/setter.d.ts.map +1 -0
- package/dist/types/lib/Mutables/useStore/subscription.d.ts +50 -0
- package/dist/types/lib/Mutables/useStore/subscription.d.ts.map +1 -0
- package/dist/types/lib/Mutables/useStore/useContext.d.ts +3 -0
- package/dist/types/lib/Mutables/useStore/useContext.d.ts.map +1 -0
- package/dist/types/lib/Mutables/useStore/useStore.d.ts +7 -0
- package/dist/types/lib/Mutables/useStore/useStore.d.ts.map +1 -0
- package/dist/types/lib/Router/Router.d.ts +54 -0
- package/dist/types/lib/Router/Router.d.ts.map +1 -0
- package/dist/types/lib/Router/animatedRouter.d.ts +48 -0
- package/dist/types/lib/Router/animatedRouter.d.ts.map +1 -0
- package/dist/types/lib/Router/buildPath.d.ts +20 -0
- package/dist/types/lib/Router/buildPath.d.ts.map +1 -0
- package/dist/types/lib/Router/hashAtom.d.ts +12 -0
- package/dist/types/lib/Router/hashAtom.d.ts.map +1 -0
- package/dist/types/lib/Router/index.d.ts +11 -0
- package/dist/types/lib/Router/index.d.ts.map +1 -0
- package/dist/types/lib/Router/isPathMatching.d.ts +12 -0
- package/dist/types/lib/Router/isPathMatching.d.ts.map +1 -0
- package/dist/types/lib/Router/location.d.ts +74 -0
- package/dist/types/lib/Router/location.d.ts.map +1 -0
- package/dist/types/lib/Router/navigateTo.d.ts +31 -0
- package/dist/types/lib/Router/navigateTo.d.ts.map +1 -0
- package/dist/types/lib/Router/navigationLock.d.ts +50 -0
- package/dist/types/lib/Router/navigationLock.d.ts.map +1 -0
- package/dist/types/lib/Router/pathAtom.d.ts +42 -0
- package/dist/types/lib/Router/pathAtom.d.ts.map +1 -0
- package/dist/types/lib/Router/pathResolver.d.ts +9 -0
- package/dist/types/lib/Router/pathResolver.d.ts.map +1 -0
- package/dist/types/lib/Router/qsAtom.d.ts +12 -0
- package/dist/types/lib/Router/qsAtom.d.ts.map +1 -0
- package/dist/types/lib/Template/index.d.ts +6 -0
- package/dist/types/lib/Template/index.d.ts.map +1 -0
- package/dist/types/lib/Template/scheduler.d.ts +59 -0
- package/dist/types/lib/Template/scheduler.d.ts.map +1 -0
- package/dist/types/lib/Template/x-x.d.ts +60 -0
- package/dist/types/lib/Template/x-x.d.ts.map +1 -0
- package/dist/types/lib/Template/x-x.types.d.ts +91 -0
- package/dist/types/lib/Template/x-x.types.d.ts.map +1 -0
- package/dist/types/lib/Template/x-x.utils.d.ts +15 -0
- package/dist/types/lib/Template/x-x.utils.d.ts.map +1 -0
- package/dist/types/lib/Template/x.d.ts +5 -0
- package/dist/types/lib/Template/x.d.ts.map +1 -0
- package/dist/types/lib/Template/xProvider.d.ts +2 -0
- package/dist/types/lib/Template/xProvider.d.ts.map +1 -0
- package/dist/types/lib/Timers/createManagedTimer.d.ts +12 -0
- package/dist/types/lib/Timers/createManagedTimer.d.ts.map +1 -0
- package/dist/types/lib/Timers/index.d.ts +4 -0
- package/dist/types/lib/Timers/index.d.ts.map +1 -0
- package/dist/types/lib/Timers/interval.d.ts +2 -0
- package/dist/types/lib/Timers/interval.d.ts.map +1 -0
- package/dist/types/lib/Timers/timeout.d.ts +2 -0
- package/dist/types/lib/Timers/timeout.d.ts.map +1 -0
- package/dist/types/lib/TrackState/componentStatus.d.ts +105 -0
- package/dist/types/lib/TrackState/componentStatus.d.ts.map +1 -0
- package/dist/types/lib/TrackState/readTracking.d.ts +20 -0
- package/dist/types/lib/TrackState/readTracking.d.ts.map +1 -0
- package/dist/types/lib/Utils/Context.d.ts +6 -0
- package/dist/types/lib/Utils/Context.d.ts.map +1 -0
- package/dist/types/lib/Utils/Date/calendar.d.ts +30 -0
- package/dist/types/lib/Utils/Date/calendar.d.ts.map +1 -0
- package/dist/types/lib/Utils/Date/core.d.ts +29 -0
- package/dist/types/lib/Utils/Date/core.d.ts.map +1 -0
- package/dist/types/lib/Utils/Date/date.d.ts +60 -0
- package/dist/types/lib/Utils/Date/date.d.ts.map +1 -0
- package/dist/types/lib/Utils/Date/index.d.ts +3 -0
- package/dist/types/lib/Utils/Date/index.d.ts.map +1 -0
- package/dist/types/lib/Utils/deepClone.d.ts +7 -0
- package/dist/types/lib/Utils/deepClone.d.ts.map +1 -0
- package/dist/types/lib/Utils/deepFreeze.d.ts +2 -0
- package/dist/types/lib/Utils/deepFreeze.d.ts.map +1 -0
- package/dist/types/lib/Utils/getAllProps.d.ts +2 -0
- package/dist/types/lib/Utils/getAllProps.d.ts.map +1 -0
- package/dist/types/lib/Utils/helpers.d.ts +13 -0
- package/dist/types/lib/Utils/helpers.d.ts.map +1 -0
- package/dist/types/lib/Utils/index.d.ts +13 -0
- package/dist/types/lib/Utils/index.d.ts.map +1 -0
- package/dist/types/lib/Utils/is.d.ts +12 -0
- package/dist/types/lib/Utils/is.d.ts.map +1 -0
- package/dist/types/lib/Utils/isDefinedAsGetter.d.ts +2 -0
- package/dist/types/lib/Utils/isDefinedAsGetter.d.ts.map +1 -0
- package/dist/types/lib/Utils/logger.d.ts +22 -0
- package/dist/types/lib/Utils/logger.d.ts.map +1 -0
- package/dist/types/lib/Utils/notificationManager.d.ts +67 -0
- package/dist/types/lib/Utils/notificationManager.d.ts.map +1 -0
- package/dist/types/lib/Utils/registerCleanup.d.ts +7 -0
- package/dist/types/lib/Utils/registerCleanup.d.ts.map +1 -0
- package/dist/types/lib/Utils/svgIcon.d.ts +95 -0
- package/dist/types/lib/Utils/svgIcon.d.ts.map +1 -0
- package/dist/types/lib/Utils/uuid.d.ts +7 -0
- package/dist/types/lib/Utils/uuid.d.ts.map +1 -0
- package/dist/types/lib/ZeroPromise/index.d.ts +2 -0
- package/dist/types/lib/ZeroPromise/index.d.ts.map +1 -0
- package/dist/types/lib/ZeroPromise/zero.d.ts +23 -0
- package/dist/types/lib/ZeroPromise/zero.d.ts.map +1 -0
- package/dist/types/lib/actions/action.d.ts +14 -0
- package/dist/types/lib/actions/action.d.ts.map +1 -0
- package/dist/types/lib/actions/animatePresets.d.ts +38 -0
- package/dist/types/lib/actions/animatePresets.d.ts.map +1 -0
- package/dist/types/lib/actions/animateSwap.d.ts +79 -0
- package/dist/types/lib/actions/animateSwap.d.ts.map +1 -0
- package/dist/types/lib/actions/animateTypes.d.ts +103 -0
- package/dist/types/lib/actions/animateTypes.d.ts.map +1 -0
- package/dist/types/lib/actions/asyncAction.d.ts +4 -0
- package/dist/types/lib/actions/asyncAction.d.ts.map +1 -0
- package/dist/types/lib/actions/asyncActionCache.d.ts +16 -0
- package/dist/types/lib/actions/asyncActionCache.d.ts.map +1 -0
- package/dist/types/lib/actions/asyncActionPolling.d.ts +14 -0
- package/dist/types/lib/actions/asyncActionPolling.d.ts.map +1 -0
- package/dist/types/lib/actions/asyncActionTypes.d.ts +74 -0
- package/dist/types/lib/actions/asyncActionTypes.d.ts.map +1 -0
- package/dist/types/lib/actions/createTimingFunction.d.ts +23 -0
- package/dist/types/lib/actions/createTimingFunction.d.ts.map +1 -0
- package/dist/types/lib/actions/debounce.d.ts +10 -0
- package/dist/types/lib/actions/debounce.d.ts.map +1 -0
- package/dist/types/lib/actions/index.d.ts +12 -0
- package/dist/types/lib/actions/index.d.ts.map +1 -0
- package/dist/types/lib/actions/paginatedAsyncAction.d.ts +121 -0
- package/dist/types/lib/actions/paginatedAsyncAction.d.ts.map +1 -0
- package/dist/types/lib/actions/taskAction.d.ts +105 -0
- package/dist/types/lib/actions/taskAction.d.ts.map +1 -0
- package/dist/types/lib/actions/throttle.d.ts +9 -0
- package/dist/types/lib/actions/throttle.d.ts.map +1 -0
- package/dist/types/lib/css-in-js/cl.d.ts +37 -0
- package/dist/types/lib/css-in-js/cl.d.ts.map +1 -0
- package/dist/types/lib/css-in-js/index.d.ts +7 -0
- package/dist/types/lib/css-in-js/index.d.ts.map +1 -0
- package/dist/types/lib/css-in-js/sanitize.d.ts +31 -0
- package/dist/types/lib/css-in-js/sanitize.d.ts.map +1 -0
- package/dist/types/lib/css-in-js/serialize.d.ts +98 -0
- package/dist/types/lib/css-in-js/serialize.d.ts.map +1 -0
- package/dist/types/lib/css-in-js/stylesheet.d.ts +188 -0
- package/dist/types/lib/css-in-js/stylesheet.d.ts.map +1 -0
- package/dist/types/lib/css-in-js/theme.d.ts +110 -0
- package/dist/types/lib/css-in-js/theme.d.ts.map +1 -0
- package/dist/types/lib/devtools/devtoolsHooks.d.ts +101 -0
- package/dist/types/lib/devtools/devtoolsHooks.d.ts.map +1 -0
- package/dist/types/lib/devtools/index.d.ts +2 -0
- package/dist/types/lib/devtools/index.d.ts.map +1 -0
- package/dist/types/lib/index.d.ts +46 -0
- package/dist/types/lib/index.d.ts.map +1 -0
- package/dist/types/lib/on/hooks.d.ts +319 -0
- package/dist/types/lib/on/hooks.d.ts.map +1 -0
- package/dist/types/lib/on/index.d.ts +3 -0
- package/dist/types/lib/on/index.d.ts.map +1 -0
- package/dist/types/lib/on/on.d.ts +16 -0
- package/dist/types/lib/on/on.d.ts.map +1 -0
- package/dist/types/lib/portals/dialog.d.ts +56 -0
- package/dist/types/lib/portals/dialog.d.ts.map +1 -0
- package/dist/types/lib/portals/index.d.ts +9 -0
- package/dist/types/lib/portals/index.d.ts.map +1 -0
- package/dist/types/lib/portals/popup.d.ts +37 -0
- package/dist/types/lib/portals/popup.d.ts.map +1 -0
- package/dist/types/lib/portals/portal.d.ts +57 -0
- package/dist/types/lib/portals/portal.d.ts.map +1 -0
- package/dist/types/lib/portals/tip.d.ts +38 -0
- package/dist/types/lib/portals/tip.d.ts.map +1 -0
- package/dist/types/lib/socket/index.d.ts +2 -0
- package/dist/types/lib/socket/index.d.ts.map +1 -0
- package/dist/types/lib/socket/ws.d.ts +83 -0
- package/dist/types/lib/socket/ws.d.ts.map +1 -0
- package/dist/types/lib/ssr/index.d.ts +3 -0
- package/dist/types/lib/ssr/index.d.ts.map +1 -0
- package/dist/types/lib/ssr/ssr-bridge.d.ts +89 -0
- package/dist/types/lib/ssr/ssr-bridge.d.ts.map +1 -0
- package/dist/types/lib/ssr/ssrFlag.d.ts +38 -0
- package/dist/types/lib/ssr/ssrFlag.d.ts.map +1 -0
- package/dist/types/lib/virtualizer/ScrollerController.d.ts +54 -0
- package/dist/types/lib/virtualizer/ScrollerController.d.ts.map +1 -0
- package/dist/types/lib/virtualizer/Virtualizer.d.ts +214 -0
- package/dist/types/lib/virtualizer/Virtualizer.d.ts.map +1 -0
- package/dist/types/lib/virtualizer/events.d.ts +27 -0
- package/dist/types/lib/virtualizer/events.d.ts.map +1 -0
- package/dist/types/lib/virtualizer/layouts/flow.d.ts +123 -0
- package/dist/types/lib/virtualizer/layouts/flow.d.ts.map +1 -0
- package/dist/types/lib/virtualizer/layouts/grid.d.ts +25 -0
- package/dist/types/lib/virtualizer/layouts/grid.d.ts.map +1 -0
- package/dist/types/lib/virtualizer/layouts/masonry.d.ts +37 -0
- package/dist/types/lib/virtualizer/layouts/masonry.d.ts.map +1 -0
- package/dist/types/lib/virtualizer/layouts/shared/BaseLayout.d.ts +204 -0
- package/dist/types/lib/virtualizer/layouts/shared/BaseLayout.d.ts.map +1 -0
- package/dist/types/lib/virtualizer/layouts/shared/GridBaseLayout.d.ts +41 -0
- package/dist/types/lib/virtualizer/layouts/shared/GridBaseLayout.d.ts.map +1 -0
- package/dist/types/lib/virtualizer/layouts/shared/Layout.d.ts +138 -0
- package/dist/types/lib/virtualizer/layouts/shared/Layout.d.ts.map +1 -0
- package/dist/types/lib/virtualizer/layouts/shared/SizeCache.d.ts +19 -0
- package/dist/types/lib/virtualizer/layouts/shared/SizeCache.d.ts.map +1 -0
- package/dist/types/lib/virtualizer/layouts/shared/SizeGapPaddingBaseLayout.d.ts +57 -0
- package/dist/types/lib/virtualizer/layouts/shared/SizeGapPaddingBaseLayout.d.ts.map +1 -0
- package/dist/types/lib/virtualizer/mates-adapter.d.ts +201 -0
- package/dist/types/lib/virtualizer/mates-adapter.d.ts.map +1 -0
- package/dist/types/lib/virtualizer/virtualize.d.ts +52 -0
- package/dist/types/lib/virtualizer/virtualize.d.ts.map +1 -0
- package/package.json +45 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { AnimationPreset } from "./animateTypes";
|
|
2
|
+
/**
|
|
3
|
+
* Animate an element with a given preset. Cancels any in-flight
|
|
4
|
+
* animations on the element first.
|
|
5
|
+
*
|
|
6
|
+
* Returns a promise that resolves when the animation finishes or is cancelled.
|
|
7
|
+
*/
|
|
8
|
+
export declare function animateContainer(el: HTMLElement, preset: AnimationPreset): Promise<void>;
|
|
9
|
+
/**
|
|
10
|
+
* Wait two animation frames so lit-html has committed any pending
|
|
11
|
+
* template updates to the DOM before we read element geometry or
|
|
12
|
+
* start a new animation.
|
|
13
|
+
*/
|
|
14
|
+
export declare function nextFrame(): Promise<void>;
|
|
15
|
+
/**
|
|
16
|
+
* Configuration for a single `animateSwap` call.
|
|
17
|
+
*/
|
|
18
|
+
export interface AnimateSwapConfig {
|
|
19
|
+
/**
|
|
20
|
+
* The wrapper element to animate.
|
|
21
|
+
* When `null`/`undefined`, the swap runs immediately with no animation.
|
|
22
|
+
*/
|
|
23
|
+
el: HTMLElement | null | undefined;
|
|
24
|
+
/** Animation preset played on the wrapper *before* the swap. */
|
|
25
|
+
exit: AnimationPreset;
|
|
26
|
+
/** Animation preset played on the wrapper *after* the swap. */
|
|
27
|
+
enter: AnimationPreset;
|
|
28
|
+
/**
|
|
29
|
+
* Called between exit and enter — this is where you update the atom /
|
|
30
|
+
* state that drives what is rendered inside the wrapper.
|
|
31
|
+
*/
|
|
32
|
+
swap: () => void;
|
|
33
|
+
/**
|
|
34
|
+
* Optional: re-resolve the wrapper element after the swap.
|
|
35
|
+
* Useful when the swap replaces the wrapper itself (e.g. a new `<div>`
|
|
36
|
+
* rendered by lit-html). When omitted the original `el` is reused.
|
|
37
|
+
*/
|
|
38
|
+
getEl?: () => HTMLElement | null | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* Optional staleness guard. Called after exit and after swap — if it
|
|
41
|
+
* returns `true` the sequence aborts early. Use this to bail out when
|
|
42
|
+
* a newer swap has been requested while this one was in flight.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* isStale: () => nextRoute.get() !== targetRoute
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
isStale?: () => boolean;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Orchestrates the exit → swap → enter animation sequence.
|
|
53
|
+
*
|
|
54
|
+
* 1. Play `exit` on `el`.
|
|
55
|
+
* 2. Call `swap()` — the caller updates state so the template re-renders.
|
|
56
|
+
* 3. Wait one double-rAF (`nextFrame`) so lit-html commits the new DOM.
|
|
57
|
+
* 4. Play `enter` on the (possibly new) wrapper element.
|
|
58
|
+
*
|
|
59
|
+
* At steps 2 and 4 the optional `isStale()` guard is checked — if it
|
|
60
|
+
* returns `true` the sequence stops, letting a newer transition take over.
|
|
61
|
+
*
|
|
62
|
+
* If `el` is `null`/`undefined`, steps 1 and 3–4 are skipped and
|
|
63
|
+
* `swap()` is called immediately.
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```ts
|
|
67
|
+
* // Inside an effect that watches `nextRoute`:
|
|
68
|
+
* await animateSwap({
|
|
69
|
+
* el: wrapperRef.value,
|
|
70
|
+
* exit: current?.exit ?? fadeOutPreset(200),
|
|
71
|
+
* enter: next?.enter ?? fadeInPreset(250),
|
|
72
|
+
* swap: () => currentRoute.set(next),
|
|
73
|
+
* getEl: () => wrapperRef.value,
|
|
74
|
+
* isStale: () => nextRoute.get() !== next,
|
|
75
|
+
* });
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
export declare function animateSwap(config: AnimateSwapConfig): Promise<void>;
|
|
79
|
+
//# sourceMappingURL=animateSwap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"animateSwap.d.ts","sourceRoot":"","sources":["../../../../../lib/actions/animateSwap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAOtD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,EAAE,EAAE,WAAW,EACf,MAAM,EAAE,eAAe,GACtB,OAAO,CAAC,IAAI,CAAC,CAmBf;AAED;;;;GAIG;AACH,wBAAgB,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAOzC;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,EAAE,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,CAAC;IAEnC,gEAAgE;IAChE,IAAI,EAAE,eAAe,CAAC;IAEtB,+DAA+D;IAC/D,KAAK,EAAE,eAAe,CAAC;IAEvB;;;OAGG;IACH,IAAI,EAAE,MAAM,IAAI,CAAC;IAEjB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,WAAW,GAAG,IAAI,GAAG,SAAS,CAAC;IAE7C;;;;;;;;;OASG;IACH,OAAO,CAAC,EAAE,MAAM,OAAO,CAAC;CACzB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,WAAW,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CA6B1E"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import type { AtomType } from "../Mutables/atom/atom";
|
|
2
|
+
/**
|
|
3
|
+
* Keyframe definition — maps directly to the Web Animations API `Keyframe` type.
|
|
4
|
+
*/
|
|
5
|
+
export type AnimateKeyframes = Keyframe[] | PropertyIndexedKeyframes;
|
|
6
|
+
/**
|
|
7
|
+
* Animation timing options — maps to `KeyframeAnimationOptions` from the
|
|
8
|
+
* Web Animations API, with sensible defaults layered on top.
|
|
9
|
+
*/
|
|
10
|
+
export interface AnimateOptions extends KeyframeAnimationOptions {
|
|
11
|
+
/** Duration in milliseconds. Defaults to 300. */
|
|
12
|
+
duration?: number;
|
|
13
|
+
/** CSS easing string. Defaults to "ease". */
|
|
14
|
+
easing?: string;
|
|
15
|
+
/** Fill mode. Defaults to "both". */
|
|
16
|
+
fill?: FillMode;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* How to supply the target element — directly, via a Ref, or via a lazy getter.
|
|
20
|
+
*/
|
|
21
|
+
export type ElementTarget = Element | {
|
|
22
|
+
value?: Element | undefined;
|
|
23
|
+
} | (() => Element | null | undefined);
|
|
24
|
+
/**
|
|
25
|
+
* The handle returned by `animate()`.
|
|
26
|
+
*
|
|
27
|
+
* A lightweight, stateful animation controller backed by the Web Animations API.
|
|
28
|
+
* Only exposes what you need: start/stop controls, a single reactive `isRunning`
|
|
29
|
+
* atom, and re-configuration helpers.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* const { start, stop, isRunning } = animate(
|
|
34
|
+
* boxRef,
|
|
35
|
+
* [{ opacity: 0 }, { opacity: 1 }],
|
|
36
|
+
* { duration: 400 },
|
|
37
|
+
* () => console.log("started"),
|
|
38
|
+
* () => console.log("ended"),
|
|
39
|
+
* );
|
|
40
|
+
*
|
|
41
|
+
* start(); // plays (cancels any previous run)
|
|
42
|
+
* stop(); // cancels entirely
|
|
43
|
+
* isRunning(); // true while playing
|
|
44
|
+
* pause();
|
|
45
|
+
* resume();
|
|
46
|
+
* reverse();
|
|
47
|
+
* finish(); // jumps to end state
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export interface AnimationHandle {
|
|
51
|
+
/** Play the animation. Auto-cancels any in-flight run. */
|
|
52
|
+
start: () => void;
|
|
53
|
+
/** Cancel the animation entirely. */
|
|
54
|
+
stop: () => void;
|
|
55
|
+
/** Pause a running animation. */
|
|
56
|
+
pause: () => void;
|
|
57
|
+
/** Resume a paused animation. */
|
|
58
|
+
resume: () => void;
|
|
59
|
+
/** Reverse the playback direction. */
|
|
60
|
+
reverse: () => void;
|
|
61
|
+
/** Jump to the end state immediately. */
|
|
62
|
+
finish: () => void;
|
|
63
|
+
/** Atom: `true` while the animation is running. */
|
|
64
|
+
isRunning: AtomType<boolean>;
|
|
65
|
+
/** The current Web Animations API `Animation` instance, or `null` if idle. */
|
|
66
|
+
readonly currentAnimation: Animation | null;
|
|
67
|
+
/** The current playback state of the underlying animation. */
|
|
68
|
+
readonly playState: AnimationPlayState | "idle";
|
|
69
|
+
/** Replace the target element after creation. */
|
|
70
|
+
setElement: (el: ElementTarget) => void;
|
|
71
|
+
/** Replace the keyframes after creation. */
|
|
72
|
+
setKeyframes: (keyframes: AnimateKeyframes) => void;
|
|
73
|
+
/** Merge new options into the current options. */
|
|
74
|
+
setOptions: (options: AnimateOptions) => void;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Configuration for the `animateDirective` lit-html directive.
|
|
78
|
+
*/
|
|
79
|
+
export interface AnimateDirectiveConfig {
|
|
80
|
+
/** Keyframes to animate */
|
|
81
|
+
keyframes: AnimateKeyframes;
|
|
82
|
+
/** Animation options (duration, easing, fill, etc.) */
|
|
83
|
+
options?: AnimateOptions;
|
|
84
|
+
/**
|
|
85
|
+
* When true, the animation plays immediately when the directive
|
|
86
|
+
* is first applied or when this value transitions from false→true.
|
|
87
|
+
* Defaults to true.
|
|
88
|
+
*/
|
|
89
|
+
play?: boolean;
|
|
90
|
+
/** Callback fired when the animation starts. */
|
|
91
|
+
onStart?: () => void;
|
|
92
|
+
/** Callback fired when the animation ends (finished or cancelled). */
|
|
93
|
+
onEnd?: () => void;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Preset animation factories — convenience functions that return
|
|
97
|
+
* `{ keyframes, options }` pairs ready to spread into `animate()`.
|
|
98
|
+
*/
|
|
99
|
+
export interface AnimationPreset {
|
|
100
|
+
keyframes: AnimateKeyframes;
|
|
101
|
+
options: AnimateOptions;
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=animateTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"animateTypes.d.ts","sourceRoot":"","sources":["../../../../../lib/actions/animateTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAItD;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,QAAQ,EAAE,GAAG,wBAAwB,CAAC;AAErE;;;GAGG;AACH,MAAM,WAAW,cAAe,SAAQ,wBAAwB;IAC9D,iDAAiD;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,6CAA6C;IAC7C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qCAAqC;IACrC,IAAI,CAAC,EAAE,QAAQ,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,GACrB,OAAO,GACP;IAAE,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAAE,GAC/B,CAAC,MAAM,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;AAIvC;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,WAAW,eAAe;IAC9B,0DAA0D;IAC1D,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,qCAAqC;IACrC,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,iCAAiC;IACjC,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,iCAAiC;IACjC,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,sCAAsC;IACtC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,yCAAyC;IACzC,MAAM,EAAE,MAAM,IAAI,CAAC;IAEnB,mDAAmD;IACnD,SAAS,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;IAE7B,8EAA8E;IAC9E,QAAQ,CAAC,gBAAgB,EAAE,SAAS,GAAG,IAAI,CAAC;IAC5C,8DAA8D;IAC9D,QAAQ,CAAC,SAAS,EAAE,kBAAkB,GAAG,MAAM,CAAC;IAEhD,iDAAiD;IACjD,UAAU,EAAE,CAAC,EAAE,EAAE,aAAa,KAAK,IAAI,CAAC;IACxC,4CAA4C;IAC5C,YAAY,EAAE,CAAC,SAAS,EAAE,gBAAgB,KAAK,IAAI,CAAC;IACpD,kDAAkD;IAClD,UAAU,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;CAC/C;AAID;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,2BAA2B;IAC3B,SAAS,EAAE,gBAAgB,CAAC;IAC5B,uDAAuD;IACvD,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB;;;;OAIG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,gDAAgD;IAChD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,sEAAsE;IACtE,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;CACpB;AAID;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,gBAAgB,CAAC;IAC5B,OAAO,EAAE,cAAc,CAAC;CACzB"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { AsyncActionOptions, AsyncActionReturnType } from "./asyncActionTypes";
|
|
2
|
+
export type { AsyncActionAfterInterceptor, AsyncActionBeforeInterceptor, AsyncActionOptions, AsyncActionReturnType, AsyncActionStatus, } from "./asyncActionTypes";
|
|
3
|
+
export declare function asyncAction<T extends (...args: any[]) => Promise<any>>(AsyncFn: T, options?: AsyncActionOptions): AsyncActionReturnType<T>;
|
|
4
|
+
//# sourceMappingURL=asyncAction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asyncAction.d.ts","sourceRoot":"","sources":["../../../../../lib/actions/asyncAction.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAGV,kBAAkB,EAClB,qBAAqB,EAGtB,MAAM,oBAAoB,CAAC;AAE5B,YAAY,EACV,2BAA2B,EAC3B,4BAA4B,EAC5B,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,oBAAoB,CAAC;AAK5B,wBAAgB,WAAW,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,EACpE,OAAO,EAAE,CAAC,EACV,OAAO,CAAC,EAAE,kBAAkB,GAC3B,qBAAqB,CAAC,CAAC,CAAC,CAmO1B"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { AtomType } from "../Mutables/atom/atom";
|
|
2
|
+
import type { AsyncActionOptions, AsyncActionStatus } from "./asyncActionTypes";
|
|
3
|
+
/**
|
|
4
|
+
* Cache manager interface for async actions
|
|
5
|
+
*/
|
|
6
|
+
export interface CacheManager<T extends (...args: any[]) => Promise<any>> {
|
|
7
|
+
getCacheKey: (args: Parameters<T>) => string;
|
|
8
|
+
removeCacheEntry: (cacheKey: string) => void;
|
|
9
|
+
createCacheMethod: (dataAtom: AtomType<Awaited<ReturnType<T>> | null>, errorAtom: AtomType<Error | null>, statusAtom: AtomType<AsyncActionStatus>, executeAction: (context: any, args: Parameters<T>) => Promise<Awaited<ReturnType<T>>>) => T;
|
|
10
|
+
createClearCacheMethod: () => (...args: any[]) => void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Creates a cache manager for async actions with LRU eviction and expiration support
|
|
14
|
+
*/
|
|
15
|
+
export declare function createCacheManager<T extends (...args: any[]) => Promise<any>>(options?: AsyncActionOptions): CacheManager<T>;
|
|
16
|
+
//# sourceMappingURL=asyncActionCache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asyncActionCache.d.ts","sourceRoot":"","sources":["../../../../../lib/actions/asyncActionCache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEhF;;GAEG;AACH,MAAM,WAAW,YAAY,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC;IACtE,WAAW,EAAE,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC;IAC7C,gBAAgB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,iBAAiB,EAAE,CACjB,QAAQ,EAAE,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,EACjD,SAAS,EAAE,QAAQ,CAAC,KAAK,GAAG,IAAI,CAAC,EACjC,UAAU,EAAE,QAAQ,CAAC,iBAAiB,CAAC,EACvC,aAAa,EAAE,CACb,OAAO,EAAE,GAAG,EACZ,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAChB,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,KACjC,CAAC,CAAC;IACP,sBAAsB,EAAE,MAAM,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAAC;CACxD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,EAC3E,OAAO,CAAC,EAAE,kBAAkB,GAC3B,YAAY,CAAC,CAAC,CAAC,CAwFjB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { AsyncActionOptions } from "./asyncActionTypes";
|
|
2
|
+
/**
|
|
3
|
+
* Polling manager interface for async actions
|
|
4
|
+
*/
|
|
5
|
+
export interface PollingManager<T extends (...args: any[]) => Promise<any>> {
|
|
6
|
+
createStartPollingMethod: (wrapperFn: T) => (...args: Parameters<T>) => void;
|
|
7
|
+
createStopPollingMethod: () => () => void;
|
|
8
|
+
stopPolling: () => void;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Creates a polling manager for async actions with configurable intervals
|
|
12
|
+
*/
|
|
13
|
+
export declare function createPollingManager<T extends (...args: any[]) => Promise<any>>(options?: AsyncActionOptions): PollingManager<T>;
|
|
14
|
+
//# sourceMappingURL=asyncActionPolling.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asyncActionPolling.d.ts","sourceRoot":"","sources":["../../../../../lib/actions/asyncActionPolling.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAE7D;;GAEG;AACH,MAAM,WAAW,cAAc,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC;IACxE,wBAAwB,EAAE,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;IAC7E,uBAAuB,EAAE,MAAM,MAAM,IAAI,CAAC;IAC1C,WAAW,EAAE,MAAM,IAAI,CAAC;CACzB;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,EAC1C,OAAO,CAAC,EAAE,kBAAkB,GAAG,cAAc,CAAC,CAAC,CAAC,CAwCjD"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { AtomType } from "../Mutables/atom/atom";
|
|
2
|
+
/**
|
|
3
|
+
* Represents the current status of an async action
|
|
4
|
+
*/
|
|
5
|
+
export type AsyncActionStatus = "init" | "loading" | "success" | "error";
|
|
6
|
+
/**
|
|
7
|
+
* Configuration options for async actions
|
|
8
|
+
*/
|
|
9
|
+
export type AsyncFetchOptions = {
|
|
10
|
+
/** Cache duration in milliseconds. Default: undefined (infinite — cache never expires) */
|
|
11
|
+
cacheDuration?: number;
|
|
12
|
+
/** Maximum number of cache entries. Uses LRU eviction when exceeded. Default: 10 */
|
|
13
|
+
cacheLimit?: number;
|
|
14
|
+
/** Polling interval in milliseconds. Default: 5000 */
|
|
15
|
+
pollInterval?: number;
|
|
16
|
+
allowInRestrictedContext?: boolean;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Interceptor called before the async action executes.
|
|
20
|
+
* Receives `next` (the original fn) and the call arguments.
|
|
21
|
+
* Must call `next` and return its result.
|
|
22
|
+
*/
|
|
23
|
+
export type AsyncActionBeforeInterceptor<T extends (...args: any[]) => Promise<any>> = (next: T, ...args: Parameters<T>) => ReturnType<T>;
|
|
24
|
+
/**
|
|
25
|
+
* Interceptor called after the async action resolves.
|
|
26
|
+
* Receives the resolved result and must return a (possibly modified) result.
|
|
27
|
+
*/
|
|
28
|
+
export type AsyncActionAfterInterceptor<T extends (...args: any[]) => Promise<any>> = (result: Awaited<ReturnType<T>>) => Awaited<ReturnType<T>>;
|
|
29
|
+
/**
|
|
30
|
+
* Return type for asyncAction - combines the original function with state management
|
|
31
|
+
*/
|
|
32
|
+
export type AsyncActionReturnType<T extends (...args: any[]) => Promise<any>> = T & {
|
|
33
|
+
/** Atom containing the result data */
|
|
34
|
+
data: AtomType<Awaited<ReturnType<T>> | null>;
|
|
35
|
+
/** Atom containing any error that occurred */
|
|
36
|
+
error: AtomType<Error | null>;
|
|
37
|
+
/** Atom indicating if action is currently loading */
|
|
38
|
+
isLoading: AtomType<boolean>;
|
|
39
|
+
/** Atom containing current action status */
|
|
40
|
+
status: AtomType<AsyncActionStatus>;
|
|
41
|
+
/** The AbortController for the current in-flight operation, or null if idle */
|
|
42
|
+
abortController: AbortController | null;
|
|
43
|
+
/** Get the underlying action function */
|
|
44
|
+
val: () => T;
|
|
45
|
+
/** Replace the action function */
|
|
46
|
+
set: (fn: T) => void;
|
|
47
|
+
/** Cancel the current operation */
|
|
48
|
+
cancel: () => void;
|
|
49
|
+
/** Subscribe to action completion events */
|
|
50
|
+
subscribe: (fn: () => void, onSuccessOrError?: boolean) => () => void;
|
|
51
|
+
/** Call action and cache the result */
|
|
52
|
+
cache: T;
|
|
53
|
+
/** Clear cached results */
|
|
54
|
+
clearCache: (...args: any[]) => void;
|
|
55
|
+
/** Start polling with given arguments */
|
|
56
|
+
startPolling: (...args: Parameters<T>) => void;
|
|
57
|
+
/** Stop polling */
|
|
58
|
+
stopPolling: () => void;
|
|
59
|
+
/** Set a before-interceptor */
|
|
60
|
+
interceptBefore: (interceptor: AsyncActionBeforeInterceptor<T>) => void;
|
|
61
|
+
/** Set an after-interceptor */
|
|
62
|
+
interceptAfter: (interceptor: AsyncActionAfterInterceptor<T>) => void;
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Subscriber configuration for async action events
|
|
66
|
+
*/
|
|
67
|
+
export type Subscriber = {
|
|
68
|
+
/** Callback function to execute */
|
|
69
|
+
fn: () => void;
|
|
70
|
+
/** Filter: true = success only, false = error only, undefined = both */
|
|
71
|
+
filter?: boolean;
|
|
72
|
+
};
|
|
73
|
+
export type AsyncActionOptions = AsyncFetchOptions;
|
|
74
|
+
//# sourceMappingURL=asyncActionTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asyncActionTypes.d.ts","sourceRoot":"","sources":["../../../../../lib/actions/asyncActionTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAEzE;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,0FAA0F;IAC1F,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,oFAAoF;IACpF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,sDAAsD;IACtD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,wBAAwB,CAAC,EAAE,OAAO,CAAC;CACpC,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,4BAA4B,CACtC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,IACxC,CAAC,IAAI,EAAE,CAAC,EAAE,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,UAAU,CAAC,CAAC,CAAC,CAAC;AAEvD;;;GAGG;AACH,MAAM,MAAM,2BAA2B,CACrC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,IACxC,CAAC,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;AAE/D;;GAEG;AACH,MAAM,MAAM,qBAAqB,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,IAC1E,CAAC,GAAG;IACF,sCAAsC;IACtC,IAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IAC9C,8CAA8C;IAC9C,KAAK,EAAE,QAAQ,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC;IAC9B,qDAAqD;IACrD,SAAS,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC7B,4CAA4C;IAC5C,MAAM,EAAE,QAAQ,CAAC,iBAAiB,CAAC,CAAC;IACpC,+EAA+E;IAC/E,eAAe,EAAE,eAAe,GAAG,IAAI,CAAC;IACxC,yCAAyC;IACzC,GAAG,EAAE,MAAM,CAAC,CAAC;IACb,kCAAkC;IAClC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,KAAK,IAAI,CAAC;IACrB,mCAAmC;IACnC,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,4CAA4C;IAC5C,SAAS,EAAE,CAAC,EAAE,EAAE,MAAM,IAAI,EAAE,gBAAgB,CAAC,EAAE,OAAO,KAAK,MAAM,IAAI,CAAC;IACtE,uCAAuC;IACvC,KAAK,EAAE,CAAC,CAAC;IACT,2BAA2B;IAC3B,UAAU,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAAC;IACrC,yCAAyC;IACzC,YAAY,EAAE,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;IAC/C,mBAAmB;IACnB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,+BAA+B;IAC/B,eAAe,EAAE,CAAC,WAAW,EAAE,4BAA4B,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;IACxE,+BAA+B;IAC/B,cAAc,EAAE,CAAC,WAAW,EAAE,2BAA2B,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;CACvE,CAAC;AAEJ;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,mCAAmC;IACnC,EAAE,EAAE,MAAM,IAAI,CAAC;IACf,wEAAwE;IACxE,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared state and methods for timing functions (debounce/throttle)
|
|
3
|
+
*/
|
|
4
|
+
export declare class TimingFunctionState<T extends (...args: any[]) => any> {
|
|
5
|
+
timeoutId: ReturnType<typeof setTimeout> | null;
|
|
6
|
+
lastResult: ReturnType<T> | undefined;
|
|
7
|
+
pendingArgs: Parameters<T> | null;
|
|
8
|
+
pendingContext: any;
|
|
9
|
+
clearPending(): void;
|
|
10
|
+
setPending(args: Parameters<T>, context: any): void;
|
|
11
|
+
clearTimer(): void;
|
|
12
|
+
setTimer(callback: () => void, delay: number): void;
|
|
13
|
+
executePending(func: T): ReturnType<T> | undefined;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Creates cancel method for timing functions
|
|
17
|
+
*/
|
|
18
|
+
export declare function createCancelMethod<T extends (...args: any[]) => any>(state: TimingFunctionState<T>, onCancel?: () => void): () => void;
|
|
19
|
+
/**
|
|
20
|
+
* Creates flush method for timing functions
|
|
21
|
+
*/
|
|
22
|
+
export declare function createFlushMethod<T extends (...args: any[]) => any>(state: TimingFunctionState<T>, func: T): () => ReturnType<T> | undefined;
|
|
23
|
+
//# sourceMappingURL=createTimingFunction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createTimingFunction.d.ts","sourceRoot":"","sources":["../../../../../lib/actions/createTimingFunction.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,qBAAa,mBAAmB,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG;IAChE,SAAS,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,GAAG,IAAI,CAAQ;IACvD,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IACtC,WAAW,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,IAAI,CAAQ;IACzC,cAAc,EAAE,GAAG,CAAQ;IAE3B,YAAY,IAAI,IAAI;IAKpB,UAAU,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,GAAG,IAAI;IAKnD,UAAU,IAAI,IAAI;IAOlB,QAAQ,CAAC,QAAQ,EAAE,MAAM,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAInD,cAAc,CAAC,IAAI,EAAE,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,SAAS;CAOnD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EAClE,KAAK,EAAE,mBAAmB,CAAC,CAAC,CAAC,EAC7B,QAAQ,CAAC,EAAE,MAAM,IAAI,GACpB,MAAM,IAAI,CAMZ;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EACjE,KAAK,EAAE,mBAAmB,CAAC,CAAC,CAAC,EAC7B,IAAI,EAAE,CAAC,GACN,MAAM,UAAU,CAAC,CAAC,CAAC,GAAG,SAAS,CASjC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a debounced function that delays invoking func until after wait milliseconds
|
|
3
|
+
* have elapsed since the last time the debounced function was invoked.
|
|
4
|
+
* Similar to lodash debounce.
|
|
5
|
+
*/
|
|
6
|
+
export declare function debounce<T extends (...args: any[]) => any>(func: T, wait: number): T & {
|
|
7
|
+
cancel: () => void;
|
|
8
|
+
flush: () => ReturnType<T> | undefined;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=debounce.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debounce.d.ts","sourceRoot":"","sources":["../../../../../lib/actions/debounce.ts"],"names":[],"mappings":"AAMA;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EACxD,IAAI,EAAE,CAAC,EACP,IAAI,EAAE,MAAM,GACX,CAAC,GAAG;IAAE,MAAM,EAAE,MAAM,IAAI,CAAC;IAAC,KAAK,EAAE,MAAM,UAAU,CAAC,CAAC,CAAC,GAAG,SAAS,CAAA;CAAE,CAmBpE"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { type ActionAfterInterceptor, type ActionBeforeInterceptor, type ActionFn, type ActionReturnType, type ActionSubscriber, action, } from "./action";
|
|
2
|
+
export { blurInPreset, blurOutPreset, bouncePreset, collapseWidthPreset, expandWidthPreset, fadeInPreset, fadeOutPreset, flipInPreset, flipOutPreset, pulsePreset, type SlideDirection, scaleInPreset, scaleOutPreset, shakePreset, slideInPreset, slideOutPreset, spinPreset, springInPreset, withStaggerPreset, } from "./animatePresets";
|
|
3
|
+
export type { AnimateDirectiveConfig, AnimateKeyframes, AnimateOptions, AnimationHandle, AnimationPreset, ElementTarget, } from "./animateTypes";
|
|
4
|
+
export { type AsyncActionAfterInterceptor, type AsyncActionBeforeInterceptor, type AsyncActionOptions, type AsyncActionReturnType, type AsyncActionStatus, asyncAction, } from "./asyncAction";
|
|
5
|
+
export { type CacheManager, createCacheManager, createCacheManager as cache, } from "./asyncActionCache";
|
|
6
|
+
export { createPollingManager, type PollingManager, } from "./asyncActionPolling";
|
|
7
|
+
export { debounce } from "./debounce";
|
|
8
|
+
export { type PaginatedAsyncActionReturnType, paginatedAsyncAction, } from "./paginatedAsyncAction";
|
|
9
|
+
export { type Task, type TaskActionType, type TaskStatus, taskAction, } from "./taskAction";
|
|
10
|
+
export { throttle } from "./throttle";
|
|
11
|
+
export { deleteAction, type FetchActionConfig, type FetchBody, fetchAction, getAction, patchAction, postAction, putAction, } from "../Fetch/Fetch";
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../lib/actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,MAAM,GACP,MAAM,UAAU,CAAC;AAGlB,OAAO,EACL,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,mBAAmB,EACnB,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,aAAa,EACb,WAAW,EACX,KAAK,cAAc,EACnB,aAAa,EACb,cAAc,EACd,WAAW,EACX,aAAa,EACb,cAAc,EACd,UAAU,EACV,cAAc,EACd,iBAAiB,GAClB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACV,sBAAsB,EACtB,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,eAAe,EACf,aAAa,GACd,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,KAAK,2BAA2B,EAChC,KAAK,4BAA4B,EACjC,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,WAAW,GACZ,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,KAAK,YAAY,EACjB,kBAAkB,EAClB,kBAAkB,IAAI,KAAK,GAC5B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,oBAAoB,EACpB,KAAK,cAAc,GACpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EACL,KAAK,8BAA8B,EACnC,oBAAoB,GACrB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,KAAK,IAAI,EACT,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,UAAU,GACX,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAKtC,OAAO,EACL,YAAY,EACZ,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACd,WAAW,EACX,SAAS,EACT,WAAW,EACX,UAAU,EACV,SAAS,GACV,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import type { AtomType } from "../Mutables/atom/atom";
|
|
2
|
+
import type { AsyncActionOptions, AsyncActionReturnType } from "./asyncActionTypes";
|
|
3
|
+
/**
|
|
4
|
+
* Everything `asyncAction` returns, plus a `page` atom and a `next()` method.
|
|
5
|
+
*
|
|
6
|
+
* @template T - The wrapped async function type.
|
|
7
|
+
*/
|
|
8
|
+
export type PaginatedAsyncActionReturnType<T extends (...args: any[]) => Promise<any>> = AsyncActionReturnType<T> & {
|
|
9
|
+
/**
|
|
10
|
+
* Total number of pages.
|
|
11
|
+
*
|
|
12
|
+
* Default is `-1`, meaning unknown. Set it from the API response:
|
|
13
|
+
*
|
|
14
|
+
* ```ts
|
|
15
|
+
* const fetchPosts = paginatedAsyncAction(async () => {
|
|
16
|
+
* const res = await fetch(`/api/posts?page=${fetchPosts.page.val}`);
|
|
17
|
+
* const json = await res.json();
|
|
18
|
+
* fetchPosts.totalPages.set(json.totalPages);
|
|
19
|
+
* return json.items;
|
|
20
|
+
* });
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* When `-1`, `next()` always proceeds (we don't know the limit yet).
|
|
24
|
+
* Once set, `next()` becomes a no-op when `page >= totalPages`.
|
|
25
|
+
*/
|
|
26
|
+
totalPages: AtomType<number>;
|
|
27
|
+
/**
|
|
28
|
+
* Current page number (1-based).
|
|
29
|
+
*
|
|
30
|
+
* It is a plain atom — use `.val` to read, `.set()` / `.update()` to write:
|
|
31
|
+
*
|
|
32
|
+
* ```ts
|
|
33
|
+
* action.page.val // read
|
|
34
|
+
* action.page.set(1) // reset to first page
|
|
35
|
+
* action.page.set(n) // jump to any page
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* Read it from inside the async callback via closure:
|
|
39
|
+
*
|
|
40
|
+
* ```ts
|
|
41
|
+
* const fetchPosts = paginatedAsyncAction(async () => {
|
|
42
|
+
* const page = fetchPosts.page.val;
|
|
43
|
+
* const res = await fetch(`/api/posts?page=${page}`);
|
|
44
|
+
* return res.json();
|
|
45
|
+
* });
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
page: AtomType<number>;
|
|
49
|
+
/**
|
|
50
|
+
* Increment `page` by 1 then call the action with the provided arguments.
|
|
51
|
+
*
|
|
52
|
+
* Has the same signature as the wrapped async function so any arguments
|
|
53
|
+
* the action accepts can be passed straight through:
|
|
54
|
+
*
|
|
55
|
+
* ```ts
|
|
56
|
+
* fetchPosts.next(); // 0-arg action
|
|
57
|
+
* fetchUserPosts.next(userId); // 1-arg action
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
next: (...args: Parameters<T>) => ReturnType<T> | undefined;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* `paginatedAsyncAction` — an `asyncAction` with a `page` atom and a `next()`
|
|
64
|
+
* method for simple pagination.
|
|
65
|
+
*
|
|
66
|
+
* The wrapped callback reads the current page via closure rather than receiving
|
|
67
|
+
* it as a parameter, keeping the function signature clean for any other
|
|
68
|
+
* arguments the action needs.
|
|
69
|
+
*
|
|
70
|
+
* ---
|
|
71
|
+
*
|
|
72
|
+
* ### Usage
|
|
73
|
+
*
|
|
74
|
+
* ```ts
|
|
75
|
+
* const fetchPosts = paginatedAsyncAction(async () => {
|
|
76
|
+
* const page = fetchPosts.page.val; // ← closure access
|
|
77
|
+
* const res = await fetch(`/api/posts?_page=${page}&_limit=10`);
|
|
78
|
+
* return res.json();
|
|
79
|
+
* });
|
|
80
|
+
*
|
|
81
|
+
* // Load first page on mount
|
|
82
|
+
* fetchPosts();
|
|
83
|
+
*
|
|
84
|
+
* // Advance to next page (e.g. on button click or onVisible sentinel)
|
|
85
|
+
* fetchPosts.next();
|
|
86
|
+
*
|
|
87
|
+
* // Reset to page 1 manually
|
|
88
|
+
* fetchPosts.page.set(1);
|
|
89
|
+
* fetchPosts();
|
|
90
|
+
* ```
|
|
91
|
+
*
|
|
92
|
+
* ### With extra arguments
|
|
93
|
+
*
|
|
94
|
+
* ```ts
|
|
95
|
+
* const fetchUserPosts = paginatedAsyncAction(async (userId: number) => {
|
|
96
|
+
* const page = fetchUserPosts.page.val;
|
|
97
|
+
* const res = await fetch(`/api/users/${userId}/posts?page=${page}`);
|
|
98
|
+
* return res.json();
|
|
99
|
+
* });
|
|
100
|
+
*
|
|
101
|
+
* fetchUserPosts(5); // userId = 5, page = 1
|
|
102
|
+
* fetchUserPosts.next(5); // userId = 5, page = 2
|
|
103
|
+
* fetchUserPosts.next(5); // userId = 5, page = 3
|
|
104
|
+
* fetchUserPosts.page.set(1) // back to page 1
|
|
105
|
+
* fetchUserPosts(5); // reload page 1
|
|
106
|
+
* ```
|
|
107
|
+
*
|
|
108
|
+
* ### Infinite scroll sentinel
|
|
109
|
+
*
|
|
110
|
+
* ```ts
|
|
111
|
+
* html`
|
|
112
|
+
* ${fetchPosts.data.val?.map(p => html`<li>${p.title}</li>`)}
|
|
113
|
+
* <div ${onVisible(() => fetchPosts.next())}></div>
|
|
114
|
+
* `
|
|
115
|
+
* ```
|
|
116
|
+
*
|
|
117
|
+
* @param fn - Async function. Read `action.page.val` inside via closure.
|
|
118
|
+
* @param options - Forwarded to the underlying `asyncAction`.
|
|
119
|
+
*/
|
|
120
|
+
export declare function paginatedAsyncAction<T extends (...args: any[]) => Promise<any>>(fn: T, options?: AsyncActionOptions): PaginatedAsyncActionReturnType<T>;
|
|
121
|
+
//# sourceMappingURL=paginatedAsyncAction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paginatedAsyncAction.d.ts","sourceRoot":"","sources":["../../../../../lib/actions/paginatedAsyncAction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGtD,OAAO,KAAK,EACV,kBAAkB,EAClB,qBAAqB,EACtB,MAAM,oBAAoB,CAAC;AAI5B;;;;GAIG;AACH,MAAM,MAAM,8BAA8B,CACxC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,IACxC,qBAAqB,CAAC,CAAC,CAAC,GAAG;IAC7B;;;;;;;;;;;;;;;;OAgBG;IACH,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAE7B;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAEvB;;;;;;;;;;OAUG;IACH,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,UAAU,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;CAC7D,CAAC;AAIF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AACH,wBAAgB,oBAAoB,CAClC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,EAC1C,EAAE,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,8BAA8B,CAAC,CAAC,CAAC,CAoCxE"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import type { AtomType } from "../Mutables/atom/atom";
|
|
2
|
+
export type TaskStatus = "pending" | "running" | "success" | "failed" | "cancelled";
|
|
3
|
+
export type Task<TInput, TOutput> = {
|
|
4
|
+
/** Auto-incrementing integer, unique within this taskAction instance. */
|
|
5
|
+
id: number;
|
|
6
|
+
/** The value originally passed to add(). */
|
|
7
|
+
input: TInput;
|
|
8
|
+
status: TaskStatus;
|
|
9
|
+
result: {
|
|
10
|
+
data: TOutput | null;
|
|
11
|
+
error: Error | null;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Live AbortController while the task is running.
|
|
15
|
+
* For ZeroPromise-based callbacks this is a synthetic wrapper that
|
|
16
|
+
* routes .abort() to zp.cancel() and exposes zp.signal.
|
|
17
|
+
* null when the task is pending, settled, or cancelled.
|
|
18
|
+
*/
|
|
19
|
+
abortController: AbortController | null;
|
|
20
|
+
};
|
|
21
|
+
export type TaskActionType<TInput, TOutput> = {
|
|
22
|
+
/**
|
|
23
|
+
* Append one task or an array of tasks to the list.
|
|
24
|
+
*
|
|
25
|
+
* If the session is currently running and a concurrency slot is free the
|
|
26
|
+
* task(s) are launched immediately. Otherwise they sit as "pending" until
|
|
27
|
+
* the next available slot (or until start() is called).
|
|
28
|
+
*/
|
|
29
|
+
add(input: TInput | TInput[]): void;
|
|
30
|
+
/**
|
|
31
|
+
* Begin (or resume) processing.
|
|
32
|
+
*
|
|
33
|
+
* concurrency controls how many tasks run at the same time:
|
|
34
|
+
* 1 → one at a time (queue / serial mode) [default]
|
|
35
|
+
* N → up to N tasks concurrently
|
|
36
|
+
* -1 → all pending tasks at once
|
|
37
|
+
*
|
|
38
|
+
* No-op if the session is already running.
|
|
39
|
+
*/
|
|
40
|
+
start(concurrency?: number): void;
|
|
41
|
+
/**
|
|
42
|
+
* Soft pause — running tasks are allowed to finish, but once the current
|
|
43
|
+
* batch settles no new tasks are launched. The session transitions to idle
|
|
44
|
+
* after the last in-flight task settles. Call start() to resume.
|
|
45
|
+
*/
|
|
46
|
+
pause(): void;
|
|
47
|
+
/**
|
|
48
|
+
* Hard stop — immediately cancels every running task (marks them
|
|
49
|
+
* "cancelled" and aborts their signal), then transitions to idle.
|
|
50
|
+
* Pending tasks remain in the list. Call start() to resume.
|
|
51
|
+
*/
|
|
52
|
+
stop(): void;
|
|
53
|
+
/**
|
|
54
|
+
* Remove one or more tasks by identity.
|
|
55
|
+
* If a matched task is currently running it is cancelled first.
|
|
56
|
+
*/
|
|
57
|
+
delete(task: Task<TInput, TOutput> | Task<TInput, TOutput>[]): void;
|
|
58
|
+
/**
|
|
59
|
+
* stop() + clear the whole task list + add fresh tasks.
|
|
60
|
+
* Does NOT automatically call start() — the caller decides when to start.
|
|
61
|
+
*/
|
|
62
|
+
clearAndAdd(input: TInput | TInput[]): void;
|
|
63
|
+
/**
|
|
64
|
+
* add() + start() if not already running.
|
|
65
|
+
* If already running the tasks are simply appended (and launched immediately
|
|
66
|
+
* if a slot is free).
|
|
67
|
+
*/
|
|
68
|
+
addAndStart(input: TInput | TInput[], concurrency?: number): void;
|
|
69
|
+
/**
|
|
70
|
+
* stop() + clearAndAdd() + start() in one call.
|
|
71
|
+
* Replaces the entire task list and immediately begins processing.
|
|
72
|
+
*/
|
|
73
|
+
clearAndStart(input: TInput | TInput[], concurrency?: number): void;
|
|
74
|
+
/**
|
|
75
|
+
* Returns true while the session status is "running".
|
|
76
|
+
* Reads from a reactive atom — reactive when called inside a template or
|
|
77
|
+
* effect.
|
|
78
|
+
*/
|
|
79
|
+
isRunning(): boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Reactive progress atom (0 – 100).
|
|
82
|
+
*
|
|
83
|
+
* Progress formula per task:
|
|
84
|
+
* pending → 0 points
|
|
85
|
+
* running → 0.5 points (picked up = halfway there)
|
|
86
|
+
* settled → 1 point (success | failed | cancelled)
|
|
87
|
+
*
|
|
88
|
+
* progress = (Σ points / total tasks) × 100, rounded to nearest integer.
|
|
89
|
+
* Returns 0 when the task list is empty.
|
|
90
|
+
*/
|
|
91
|
+
progress: AtomType<number>;
|
|
92
|
+
/**
|
|
93
|
+
* Atom containing every task regardless of status, in insertion order.
|
|
94
|
+
* All derived getters and the progress atom derive from this.
|
|
95
|
+
*/
|
|
96
|
+
tasks: AtomType<Task<TInput, TOutput>[]>;
|
|
97
|
+
pendingTasks(): Task<TInput, TOutput>[];
|
|
98
|
+
runningTasks(): Task<TInput, TOutput>[];
|
|
99
|
+
successTasks(): Task<TInput, TOutput>[];
|
|
100
|
+
failedTasks(): Task<TInput, TOutput>[];
|
|
101
|
+
cancelledTasks(): Task<TInput, TOutput>[];
|
|
102
|
+
__isTaskAction__: true;
|
|
103
|
+
};
|
|
104
|
+
export declare function taskAction<TInput, TOutput>(cb: (input: TInput, signal: AbortSignal) => Promise<TOutput>): TaskActionType<TInput, TOutput>;
|
|
105
|
+
//# sourceMappingURL=taskAction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"taskAction.d.ts","sourceRoot":"","sources":["../../../../../lib/actions/taskAction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAQtD,MAAM,MAAM,UAAU,GAClB,SAAS,GACT,SAAS,GACT,SAAS,GACT,QAAQ,GACR,WAAW,CAAC;AAEhB,MAAM,MAAM,IAAI,CAAC,MAAM,EAAE,OAAO,IAAI;IAClC,yEAAyE;IACzE,EAAE,EAAE,MAAM,CAAC;IACX,4CAA4C;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,UAAU,CAAC;IACnB,MAAM,EAAE;QACN,IAAI,EAAE,OAAO,GAAG,IAAI,CAAC;QACrB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;KACrB,CAAC;IACF;;;;;OAKG;IACH,eAAe,EAAE,eAAe,GAAG,IAAI,CAAC;CACzC,CAAC;AAEF,MAAM,MAAM,cAAc,CAAC,MAAM,EAAE,OAAO,IAAI;IAG5C;;;;;;OAMG;IACH,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CAAC;IAEpC;;;;;;;;;OASG;IACH,KAAK,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAElC;;;;OAIG;IACH,KAAK,IAAI,IAAI,CAAC;IAEd;;;;OAIG;IACH,IAAI,IAAI,IAAI,CAAC;IAEb;;;OAGG;IACH,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,IAAI,CAAC;IAEpE;;;OAGG;IACH,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CAAC;IAE5C;;;;OAIG;IACH,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAElE;;;OAGG;IACH,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAIpE;;;;OAIG;IACH,SAAS,IAAI,OAAO,CAAC;IAErB;;;;;;;;;;OAUG;IACH,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAI3B;;;OAGG;IACH,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;IAMzC,YAAY,IAAI,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IACxC,YAAY,IAAI,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IACxC,YAAY,IAAI,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IACxC,WAAW,IAAI,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IACvC,cAAc,IAAI,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IAG1C,gBAAgB,EAAE,IAAI,CAAC;CACxB,CAAC;AAIF,wBAAgB,UAAU,CAAC,MAAM,EAAE,OAAO,EACxC,EAAE,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,OAAO,CAAC,GAC3D,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,CA6UjC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a throttled function that only invokes func at most once per every wait milliseconds.
|
|
3
|
+
* Similar to lodash throttle.
|
|
4
|
+
*/
|
|
5
|
+
export declare function throttle<T extends (...args: any[]) => any>(func: T, wait: number): T & {
|
|
6
|
+
cancel: () => void;
|
|
7
|
+
flush: () => ReturnType<T> | undefined;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=throttle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"throttle.d.ts","sourceRoot":"","sources":["../../../../../lib/actions/throttle.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EACxD,IAAI,EAAE,CAAC,EACP,IAAI,EAAE,MAAM,GACX,CAAC,GAAG;IAAE,MAAM,EAAE,MAAM,IAAI,CAAC;IAAC,KAAK,EAAE,MAAM,UAAU,CAAC,CAAC,CAAC,GAAG,SAAS,CAAA;CAAE,CAqCpE"}
|