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 @@
|
|
|
1
|
+
{"version":3,"file":"createTimedAtom.d.ts","sourceRoot":"","sources":["../../../../../../lib/Mutables/atom/createTimedAtom.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,QAAQ,EAAQ,MAAM,QAAQ,CAAC;AAE9D,KAAK,cAAc,GAAG,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EACtD,EAAE,EAAE,CAAC,EACL,KAAK,EAAE,MAAM,KACV,CAAC,GAAG;IAAE,MAAM,EAAE,MAAM,IAAI,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,IAAI,CAAA;CAAE,CAAC;AAEpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,eAAO,MAAM,eAAe,GAAI,CAAC,EAC/B,oBAAoB,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,EACnC,OAAO,MAAM,EACb,UAAU,cAAc,EACxB,SAAS,UAAU,KAClB,QAAQ,CAAC,CAAC,CAkCZ,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { AtomConfig, AtomType } from "./atom";
|
|
2
|
+
/**
|
|
3
|
+
* Creates a debounced reactive atom whose `set()` and `update()` calls are
|
|
4
|
+
* delayed by `delay` ms. When multiple calls arrive within the delay window,
|
|
5
|
+
* only the **last** one fires — earlier calls are cancelled.
|
|
6
|
+
*
|
|
7
|
+
* Accepts either a plain initial value or a source {@link AtomType}. When a
|
|
8
|
+
* source atom is provided, the debounced atom mirrors the source's value,
|
|
9
|
+
* applying the debounce to every propagated change.
|
|
10
|
+
*
|
|
11
|
+
* Cleanup of the internal debounce timer is registered automatically and runs
|
|
12
|
+
* when the atom is disposed.
|
|
13
|
+
*
|
|
14
|
+
* @param initialAtomOrState - A plain initial value, or a source atom whose
|
|
15
|
+
* updates will be mirrored with debouncing.
|
|
16
|
+
* @param delay - How long to wait (in milliseconds) after the last call before
|
|
17
|
+
* the value is actually committed.
|
|
18
|
+
* @param config - Optional atom configuration forwarded to the underlying
|
|
19
|
+
* {@link atom} instance.
|
|
20
|
+
* @returns A new {@link AtomType} whose writes are debounced.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* // Standalone debounced atom — only the last rapid set fires after 300 ms:
|
|
24
|
+
* const search = debouncedAtom("", 300);
|
|
25
|
+
* search.set("he");
|
|
26
|
+
* search.set("hel");
|
|
27
|
+
* search.set("hello"); // only this fires after 300 ms
|
|
28
|
+
* search(); // "hello"
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* // Mirror a source atom with debouncing:
|
|
32
|
+
* const raw = atom("");
|
|
33
|
+
* const debounced = debouncedAtom(raw, 300);
|
|
34
|
+
* // Every time `raw` changes, `debounced` receives the latest value 300 ms later.
|
|
35
|
+
*/
|
|
36
|
+
export declare const debouncedAtom: <T>(initialAtomOrState: T | AtomType<T>, delay: number, config?: AtomConfig) => AtomType<T>;
|
|
37
|
+
//# sourceMappingURL=debouncedAtom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debouncedAtom.d.ts","sourceRoot":"","sources":["../../../../../../lib/Mutables/atom/debouncedAtom.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAGnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,aAAa,GAAI,CAAC,EAC7B,oBAAoB,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,EACnC,OAAO,MAAM,EACb,SAAS,UAAU,KAClB,QAAQ,CAAC,CAAC,CAEZ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from "./atom";
|
|
2
|
+
export * from "./createTimedAtom";
|
|
3
|
+
export * from "./debouncedAtom";
|
|
4
|
+
export * from "./atom";
|
|
5
|
+
export * from "./mapAtom";
|
|
6
|
+
export * from "./setAtom";
|
|
7
|
+
export * from "./storageAtom";
|
|
8
|
+
export * from "./throttledAtom";
|
|
9
|
+
export * from "./titleAtom";
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../lib/Mutables/atom/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { type AtomConfig } from "./atom";
|
|
2
|
+
/**
|
|
3
|
+
* A reactive `Map<K, V>` returned by `mapAtom`.
|
|
4
|
+
*
|
|
5
|
+
* Extends the standard `Map<K, V>` with two extra mutation methods:
|
|
6
|
+
*
|
|
7
|
+
* - `update(fn)` — pass the live map instance into `fn` so you can
|
|
8
|
+
* call any Map method directly (set/delete/clear/get).
|
|
9
|
+
* `fn` returns nothing; mutations are in-place.
|
|
10
|
+
* One notification fires after `fn` returns.
|
|
11
|
+
*
|
|
12
|
+
* - `updateItem(key, fn)` — get the object stored at `key` and pass it to
|
|
13
|
+
* `fn` for in-place mutation (no return value).
|
|
14
|
+
* Only meaningful when `V` is an object type.
|
|
15
|
+
* Use `map.set(key, newValue)` to replace primitives.
|
|
16
|
+
*/
|
|
17
|
+
export type MapAtomType<K, V> = Map<K, V> & {
|
|
18
|
+
/**
|
|
19
|
+
* Receive the live `Map<K, V>` instance and mutate it directly.
|
|
20
|
+
* `fn` may call any Map method (`set`, `delete`, `clear`, `get`, …).
|
|
21
|
+
* No return value — mutations are in-place.
|
|
22
|
+
* One reactive notification fires after `fn` returns.
|
|
23
|
+
*
|
|
24
|
+
* ```ts
|
|
25
|
+
* const users = mapAtom([["alice", { name: "Alice", score: 0 }]]);
|
|
26
|
+
*
|
|
27
|
+
* users.update((map) => {
|
|
28
|
+
* map.get("alice")!.score += 10; // mutate a nested object
|
|
29
|
+
* map.set("bob", { name: "Bob", score: 5 }); // add an entry
|
|
30
|
+
* map.delete("carol"); // remove an entry
|
|
31
|
+
* });
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* @param fn - Receives the live map and should mutate it in place.
|
|
35
|
+
* @returns The map instance for chaining.
|
|
36
|
+
*/
|
|
37
|
+
update(fn: (map: Map<K, V>) => void): MapAtomType<K, V>;
|
|
38
|
+
/**
|
|
39
|
+
* Get the object stored at `key` and pass it to `fn` for in-place mutation.
|
|
40
|
+
* `fn` returns nothing — the value is mutated directly.
|
|
41
|
+
* One reactive notification fires after `fn` returns.
|
|
42
|
+
*
|
|
43
|
+
* Only meaningful when `V` is an object type. To replace a primitive value
|
|
44
|
+
* use `map.set(key, newValue)` instead.
|
|
45
|
+
* No-op when `key` is absent or its value is not an object.
|
|
46
|
+
*
|
|
47
|
+
* ```ts
|
|
48
|
+
* const users = mapAtom([["alice", { name: "Alice", age: 30 }]]);
|
|
49
|
+
*
|
|
50
|
+
* users.updateItem("alice", (user) => {
|
|
51
|
+
* user.age += 1;
|
|
52
|
+
* user.name = user.name.toUpperCase();
|
|
53
|
+
* });
|
|
54
|
+
*
|
|
55
|
+
* users.get("alice"); // { name: "ALICE", age: 31 }
|
|
56
|
+
* ```
|
|
57
|
+
*
|
|
58
|
+
* @param key - The key whose value should be mutated.
|
|
59
|
+
* @param fn - Receives the current value and should mutate it in place.
|
|
60
|
+
* @returns The map instance for chaining.
|
|
61
|
+
*/
|
|
62
|
+
updateItem(key: K, fn: (value: V) => void): MapAtomType<K, V>;
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Creates a reactive `Map<K, V>` whose mutation methods notify subscribers
|
|
66
|
+
* and whose read methods register the map as a tracked dependency.
|
|
67
|
+
*
|
|
68
|
+
* **Mutations** — each triggers a notification so subscribers are informed:
|
|
69
|
+
* - `set(key, value)`, `delete(key)`, `clear()`
|
|
70
|
+
* - `update(fn)` — in-place whole-map mutation
|
|
71
|
+
* - `updateItem(key, fn)` — in-place mutation of a single object value
|
|
72
|
+
*
|
|
73
|
+
* **Reads** — each registers a reactive dependency:
|
|
74
|
+
* - `get(key)`, `has(key)`, `size`, `entries()`, `values()`, `keys()`,
|
|
75
|
+
* `forEach()`, `[Symbol.iterator]()`
|
|
76
|
+
*
|
|
77
|
+
* The underlying atom is exposed via two non-enumerable properties:
|
|
78
|
+
* - `m.__isAtom___` — the raw `AtomType<Map<K, V>>` for manual subscriptions
|
|
79
|
+
* - `m.__version__` — current version counter of the underlying atom
|
|
80
|
+
*
|
|
81
|
+
* @param initialState - Optional `[key, value]` pairs (same as `Map` ctor).
|
|
82
|
+
* @param config - Optional atom configuration.
|
|
83
|
+
* @returns A `MapAtomType<K, V>` instance with reactive tracking.
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* ```ts
|
|
87
|
+
* const scores = mapAtom([["alice", { value: 10 }], ["bob", { value: 5 }]]);
|
|
88
|
+
*
|
|
89
|
+
* // Replace a value (use set for primitives too)
|
|
90
|
+
* scores.set("carol", { value: 3 });
|
|
91
|
+
*
|
|
92
|
+
* // Mutate the whole map in one go
|
|
93
|
+
* scores.update((map) => {
|
|
94
|
+
* map.get("alice")!.value += 1;
|
|
95
|
+
* map.delete("bob");
|
|
96
|
+
* });
|
|
97
|
+
*
|
|
98
|
+
* // Mutate one entry in place
|
|
99
|
+
* scores.updateItem("alice", (entry) => {
|
|
100
|
+
* entry.value *= 2;
|
|
101
|
+
* });
|
|
102
|
+
* ```
|
|
103
|
+
*/
|
|
104
|
+
export declare const mapAtom: <K, V>(initialState?: [K, V][], config?: AtomConfig) => MapAtomType<K, V>;
|
|
105
|
+
//# sourceMappingURL=mapAtom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mapAtom.d.ts","sourceRoot":"","sources":["../../../../../../lib/Mutables/atom/mapAtom.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAQ,MAAM,QAAQ,CAAC;AAI/C;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,EAAE,CAAC,IAAI,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;IAC1C;;;;;;;;;;;;;;;;;;OAkBG;IACH,MAAM,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,IAAI,GAAG,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAExD;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,UAAU,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,GAAG,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;CAC/D,CAAC;AAIF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,eAAO,MAAM,OAAO,GAAI,CAAC,EAAE,CAAC,EAC1B,eAAc,CAAC,CAAC,EAAE,CAAC,CAAC,EAAO,EAC3B,SAAS,UAAU,KAClB,WAAW,CAAC,CAAC,EAAE,CAAC,CA0JlB,CAAC"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { type AtomConfig } from "./atom";
|
|
2
|
+
/**
|
|
3
|
+
* A reactive `Set<T>` returned by `setAtom`.
|
|
4
|
+
*
|
|
5
|
+
* Extends the standard `Set<T>` with two extra mutation methods:
|
|
6
|
+
*
|
|
7
|
+
* - `update(fn)` — pass the live set instance into `fn` so you can
|
|
8
|
+
* call any Set method directly (add/delete/clear/has).
|
|
9
|
+
* `fn` returns nothing; mutations are in-place.
|
|
10
|
+
* One notification fires after `fn` returns.
|
|
11
|
+
*
|
|
12
|
+
* - `updateItem(item, fn)` — find the object stored at `item` (by reference)
|
|
13
|
+
* and pass it to `fn` for in-place mutation.
|
|
14
|
+
* Only meaningful when `T` is an object type.
|
|
15
|
+
* Use `set.delete(old); set.add(new)` to replace
|
|
16
|
+
* primitive values.
|
|
17
|
+
*/
|
|
18
|
+
export type SetAtomType<T> = Set<T> & {
|
|
19
|
+
/**
|
|
20
|
+
* Receive the live `Set<T>` instance and mutate it directly.
|
|
21
|
+
* `fn` may call any Set method (`add`, `delete`, `clear`, `has`, …).
|
|
22
|
+
* No return value — mutations are in-place.
|
|
23
|
+
* One reactive notification fires after `fn` returns.
|
|
24
|
+
*
|
|
25
|
+
* ```ts
|
|
26
|
+
* const ids = setAtom([1, 2, 3]);
|
|
27
|
+
*
|
|
28
|
+
* ids.update((set) => {
|
|
29
|
+
* set.add(4);
|
|
30
|
+
* set.delete(1);
|
|
31
|
+
* });
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* @param fn - Receives the live set and should mutate it in place.
|
|
35
|
+
* @returns The set instance for chaining.
|
|
36
|
+
*/
|
|
37
|
+
update(fn: (set: Set<T>) => void): SetAtomType<T>;
|
|
38
|
+
/**
|
|
39
|
+
* Find `item` in the set (by reference) and pass it to `fn` for in-place
|
|
40
|
+
* mutation. `fn` returns nothing — the object is mutated directly.
|
|
41
|
+
* One reactive notification fires after `fn` returns.
|
|
42
|
+
*
|
|
43
|
+
* Only meaningful when `T` is an object type. Because Set uses reference
|
|
44
|
+
* equality the mutated object stays in the set automatically — no
|
|
45
|
+
* delete/re-add needed.
|
|
46
|
+
* No-op when `item` is not an object or is `null`.
|
|
47
|
+
*
|
|
48
|
+
* ```ts
|
|
49
|
+
* const alice = { id: 1, name: "Alice", score: 0 };
|
|
50
|
+
* const users = setAtom([alice, { id: 2, name: "Bob", score: 5 }]);
|
|
51
|
+
*
|
|
52
|
+
* users.updateItem(alice, (user) => {
|
|
53
|
+
* user.score += 10;
|
|
54
|
+
* user.name = user.name.toUpperCase();
|
|
55
|
+
* });
|
|
56
|
+
*
|
|
57
|
+
* // alice is still in the set, now { id: 1, name: "ALICE", score: 10 }
|
|
58
|
+
* ```
|
|
59
|
+
*
|
|
60
|
+
* @param item - The object already stored in the set (matched by reference).
|
|
61
|
+
* @param fn - Receives the item and should mutate it in place.
|
|
62
|
+
* @returns The set instance for chaining.
|
|
63
|
+
*/
|
|
64
|
+
updateItem(item: T, fn: (item: T) => void): SetAtomType<T>;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Creates a reactive `Set<T>` whose mutations automatically notify subscribers.
|
|
68
|
+
*
|
|
69
|
+
* **Mutations** — each triggers a notification so subscribers are informed:
|
|
70
|
+
* - `add(value)`, `delete(value)`, `clear()`
|
|
71
|
+
* - `update(fn)` — in-place whole-set mutation
|
|
72
|
+
* - `updateItem(item, fn)` — in-place mutation of a single object item
|
|
73
|
+
*
|
|
74
|
+
* **Reads** — each registers a reactive dependency:
|
|
75
|
+
* - `has(value)`, `size`, `entries()`, `values()`, `keys()`,
|
|
76
|
+
* `forEach()`, `[Symbol.iterator]()`
|
|
77
|
+
*
|
|
78
|
+
* The underlying atom is accessible via two non-enumerable properties:
|
|
79
|
+
* - `s.__isAtom___` — the raw `AtomType<Set<T>>` for manual subscriptions
|
|
80
|
+
* - `s.__version__` — current version counter of the underlying atom
|
|
81
|
+
*
|
|
82
|
+
* @param initialState - Optional array of initial values (defaults to `[]`).
|
|
83
|
+
* @param config - Optional atom configuration.
|
|
84
|
+
* @returns A `SetAtomType<T>` instance with reactive tracking.
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```ts
|
|
88
|
+
* const tags = setAtom(["typescript", "javascript"]);
|
|
89
|
+
*
|
|
90
|
+
* // Replace / add primitives
|
|
91
|
+
* tags.add("rust");
|
|
92
|
+
* tags.delete("javascript");
|
|
93
|
+
*
|
|
94
|
+
* // Mutate the whole set in one go
|
|
95
|
+
* tags.update((set) => {
|
|
96
|
+
* set.add("go");
|
|
97
|
+
* set.delete("typescript");
|
|
98
|
+
* });
|
|
99
|
+
*
|
|
100
|
+
* // Mutate one object item in place
|
|
101
|
+
* const user = { id: 1, name: "Alice" };
|
|
102
|
+
* const users = setAtom([user]);
|
|
103
|
+
* users.updateItem(user, (u) => { u.name = "ALICE"; });
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
106
|
+
export declare const setAtom: <T>(initialState?: T[], config?: AtomConfig) => SetAtomType<T>;
|
|
107
|
+
//# sourceMappingURL=setAtom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setAtom.d.ts","sourceRoot":"","sources":["../../../../../../lib/Mutables/atom/setAtom.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAQ,MAAM,QAAQ,CAAC;AAI/C;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG;IACpC;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;IAElD;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,UAAU,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;CAC5D,CAAC;AAIF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,eAAO,MAAM,OAAO,GAAI,CAAC,EACvB,eAAc,CAAC,EAAO,EACtB,SAAS,UAAU,KAClB,WAAW,CAAC,CAAC,CAmJf,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type AtomType } from "./atom";
|
|
2
|
+
export type StorageValue = Record<string, unknown>;
|
|
3
|
+
export type StorageAtomType = AtomType<StorageValue | null>;
|
|
4
|
+
/**
|
|
5
|
+
* A reactive atom backed by `localStorage["mates"]`.
|
|
6
|
+
*
|
|
7
|
+
* A single shared instance — import and use directly, no factory call needed.
|
|
8
|
+
*
|
|
9
|
+
* - Hydrates from `localStorage` on module load.
|
|
10
|
+
* - Every `set()` / `update()` persists the new value to `localStorage["mates"]`.
|
|
11
|
+
* - Changes made in another tab are synced automatically via the `storage` event.
|
|
12
|
+
* - Only manages the single `"mates"` key — it does not expose or interact with
|
|
13
|
+
* any other localStorage entries.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* import { lsAtom } from "./storageAtom";
|
|
17
|
+
*
|
|
18
|
+
* lsAtom.set({ theme: "dark", lang: "en" });
|
|
19
|
+
* lsAtom.update(d => { d.lang = "fr"; });
|
|
20
|
+
* lsAtom(); // { theme: "dark", lang: "fr" }
|
|
21
|
+
* lsAtom.get(); // same
|
|
22
|
+
* lsAtom.val; // same
|
|
23
|
+
*/
|
|
24
|
+
export declare const lsAtom: StorageAtomType;
|
|
25
|
+
/**
|
|
26
|
+
* A reactive atom backed by `sessionStorage["mates"]`.
|
|
27
|
+
*
|
|
28
|
+
* A single shared instance — import and use directly, no factory call needed.
|
|
29
|
+
*
|
|
30
|
+
* - Hydrates from `sessionStorage` on module load.
|
|
31
|
+
* - Every `set()` / `update()` persists the new value to `sessionStorage["mates"]`.
|
|
32
|
+
* - `sessionStorage` is tab-scoped so no cross-tab sync occurs.
|
|
33
|
+
* - Only manages the single `"mates"` key — it does not expose or interact with
|
|
34
|
+
* any other sessionStorage entries.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* import { ssAtom } from "./storageAtom";
|
|
38
|
+
*
|
|
39
|
+
* ssAtom.set({ cart: [], user: null });
|
|
40
|
+
* ssAtom.update(d => { d.cart = [item]; });
|
|
41
|
+
* ssAtom(); // { cart: [item], user: null }
|
|
42
|
+
*/
|
|
43
|
+
export declare const ssAtom: StorageAtomType;
|
|
44
|
+
//# sourceMappingURL=storageAtom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storageAtom.d.ts","sourceRoot":"","sources":["../../../../../../lib/Mutables/atom/storageAtom.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAQ,MAAM,QAAQ,CAAC;AAI7C,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACnD,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC;AAwI5D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,MAAM,EAAE,eAMpB,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,MAAM,EAAE,eAMpB,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { AtomConfig, AtomType } from "./atom";
|
|
2
|
+
/**
|
|
3
|
+
* Creates a throttled reactive atom — at most one `set()` or `update()` call
|
|
4
|
+
* fires per `delay` ms window. Additional calls within the same window are
|
|
5
|
+
* dropped; the first call in each window goes through immediately.
|
|
6
|
+
*
|
|
7
|
+
* Accepts either a plain initial value or a source {@link AtomType}. When a
|
|
8
|
+
* source atom is provided the returned atom mirrors the source's value, but
|
|
9
|
+
* propagation to subscribers is throttled so that downstream reactions fire at
|
|
10
|
+
* most once per `delay` ms regardless of how frequently the source changes.
|
|
11
|
+
*
|
|
12
|
+
* Cleanup of the internal throttle timer is registered automatically via
|
|
13
|
+
* `registerCleanup` — no manual teardown is required.
|
|
14
|
+
*
|
|
15
|
+
* @param initialAtomOrState - The initial value for the atom, or a source atom
|
|
16
|
+
* whose value this atom should mirror with throttling applied.
|
|
17
|
+
* @param delay - The minimum number of milliseconds that must elapse between
|
|
18
|
+
* two consecutive `set()`/`update()` calls being forwarded to subscribers.
|
|
19
|
+
* @param config - Optional {@link AtomConfig} forwarded to the underlying atom.
|
|
20
|
+
* @returns A new {@link AtomType} whose `set` and `update` methods are
|
|
21
|
+
* throttled by `delay` ms.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* // Throttle direct writes — only one set fires per 100 ms window:
|
|
25
|
+
* const scrollY = throttledAtom(0, 100);
|
|
26
|
+
* window.addEventListener("scroll", () => scrollY.set(window.scrollY));
|
|
27
|
+
* // Only one set fires per 100ms no matter how fast the user scrolls
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* // Mirror a source atom with throttling applied:
|
|
31
|
+
* const rawScroll = atom(0);
|
|
32
|
+
* const throttled = throttledAtom(rawScroll, 100);
|
|
33
|
+
* // throttled mirrors rawScroll but notifies its own subscribers at most
|
|
34
|
+
* // once every 100 ms
|
|
35
|
+
*/
|
|
36
|
+
export declare const throttledAtom: <T>(initialAtomOrState: T | AtomType<T>, delay: number, config?: AtomConfig) => AtomType<T>;
|
|
37
|
+
//# sourceMappingURL=throttledAtom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"throttledAtom.d.ts","sourceRoot":"","sources":["../../../../../../lib/Mutables/atom/throttledAtom.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAGnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,aAAa,GAAI,CAAC,EAC7B,oBAAoB,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,EACnC,OAAO,MAAM,EACb,SAAS,UAAU,KAClB,QAAQ,CAAC,CAAC,CAEZ,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A singleton reactive atom that mirrors `document.title`.
|
|
3
|
+
*
|
|
4
|
+
* Setting this atom automatically updates the browser tab title via an
|
|
5
|
+
* internal effect. Reading it inside a memo, effect, or component will
|
|
6
|
+
* re-run that context whenever the title changes.
|
|
7
|
+
*
|
|
8
|
+
* On SSR (environments where `document` is not defined) the initial value
|
|
9
|
+
* is `""` and writes to the atom are tracked reactively but do not touch
|
|
10
|
+
* any DOM.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* titleAtom.set("My App - Dashboard"); // document.title === "My App - Dashboard"
|
|
15
|
+
* titleAtom.get(); // "My App - Dashboard"
|
|
16
|
+
* // Reading titleAtom() in a component will re-render whenever the title changes
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare const titleAtom: import("./atom").AtomType<string>;
|
|
20
|
+
//# sourceMappingURL=titleAtom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"titleAtom.d.ts","sourceRoot":"","sources":["../../../../../../lib/Mutables/atom/titleAtom.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,SAAS,mCAAqB,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a reactive side-effect that runs immediately and re-runs whenever
|
|
3
|
+
* its dependencies change.
|
|
4
|
+
*
|
|
5
|
+
* - Runs `fn` immediately on creation.
|
|
6
|
+
* - Automatically tracks any atoms/stores read inside `fn` as dependencies.
|
|
7
|
+
* - Re-runs `fn` whenever any dependency changes (scheduled via the effect scheduler).
|
|
8
|
+
* - If `fn` returns a cleanup function, that cleanup runs before the next execution
|
|
9
|
+
* and when the effect is disposed.
|
|
10
|
+
* - Returns a `dispose` function — call it to stop the effect and run the final cleanup.
|
|
11
|
+
* - `fn` is marked `__isEffect__ = true` so the reactive runner knows it supports cleanup.
|
|
12
|
+
* - Must NOT be called inside a template function (restricted context guard applies
|
|
13
|
+
* via `createReactiveRunner`).
|
|
14
|
+
*
|
|
15
|
+
* @param fn - The side-effect function to run. May return a cleanup function that
|
|
16
|
+
* is called before the next run and on disposal.
|
|
17
|
+
* @returns A `dispose` function that stops the effect and runs the final cleanup.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* const count = atom(0);
|
|
21
|
+
*
|
|
22
|
+
* const stop = effect(() => {
|
|
23
|
+
* console.log("count is", count()); // runs immediately, then on every change
|
|
24
|
+
* return () => console.log("cleanup"); // runs before next execution
|
|
25
|
+
* });
|
|
26
|
+
*
|
|
27
|
+
* count.set(1); // logs "cleanup", then "count is 1"
|
|
28
|
+
* stop(); // dispose — runs final cleanup
|
|
29
|
+
*/
|
|
30
|
+
export declare function effect(fn: () => (() => void) | undefined | void): () => void;
|
|
31
|
+
//# sourceMappingURL=effect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"effect.d.ts","sourceRoot":"","sources":["../../../../../../lib/Mutables/effect/effect.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,IAAI,CAQ5E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../lib/Mutables/effect/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
type EventHandler<T = any> = (data: T) => void;
|
|
2
|
+
export interface EventType<T = any> {
|
|
3
|
+
__subscribe: (fn: EventHandler<T>) => () => void;
|
|
4
|
+
trigger: (data?: T) => void;
|
|
5
|
+
name: string;
|
|
6
|
+
__isEvent___: true;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Creates a typed pub/sub event.
|
|
10
|
+
*
|
|
11
|
+
* @param name - Optional human-readable name for the event. If omitted, a random
|
|
12
|
+
* string is generated. The name appears in devtools traces.
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* - `trigger(data?)` — fires all subscribers synchronously and logs to devtools.
|
|
16
|
+
* - `__subscribe(fn)` — registers a handler and returns an unsubscribe function.
|
|
17
|
+
* - Pass the event as a dependency to `on()` so the callback re-runs whenever
|
|
18
|
+
* the event fires: `on(callback, [myEvent])`.
|
|
19
|
+
* - Cannot be created inside a template function (a restricted-context guard is
|
|
20
|
+
* applied via `assertNotInRestrictedContext`).
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* const userLoggedIn = event<{ userId: string }>("user:login");
|
|
25
|
+
*
|
|
26
|
+
* const unsub = userLoggedIn.__subscribe((data) => {
|
|
27
|
+
* console.log("logged in:", data.userId);
|
|
28
|
+
* });
|
|
29
|
+
*
|
|
30
|
+
* userLoggedIn.trigger({ userId: "abc123" });
|
|
31
|
+
* unsub(); // stop listening
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export declare const event: <T = any>(name?: string) => EventType<T>;
|
|
35
|
+
export interface ChannelType<T = any> {
|
|
36
|
+
join: (handler: EventHandler<T>) => {
|
|
37
|
+
leave: () => void;
|
|
38
|
+
send: (data?: T) => void;
|
|
39
|
+
};
|
|
40
|
+
name?: string;
|
|
41
|
+
__isChannel___: true;
|
|
42
|
+
}
|
|
43
|
+
type CleanupHandler<T = any> = (data: T) => (() => void) | undefined;
|
|
44
|
+
export interface CleanupEventType<T = any> {
|
|
45
|
+
__subscribe: (fn: CleanupHandler<T>) => () => void;
|
|
46
|
+
trigger: (data?: T) => void;
|
|
47
|
+
cleanup: () => void;
|
|
48
|
+
cleanupAndClearSubs: () => void;
|
|
49
|
+
readonly hasSubscribers: boolean;
|
|
50
|
+
name: string;
|
|
51
|
+
__isCleanupEvent___: true;
|
|
52
|
+
__isEvent___: true;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Like `event`, but each subscriber can return a cleanup function that runs
|
|
56
|
+
* automatically before the handler is called again on the next `trigger()`.
|
|
57
|
+
*
|
|
58
|
+
* @param name - Optional human-readable name for the event. If omitted, a random
|
|
59
|
+
* string is generated. The name appears in devtools traces.
|
|
60
|
+
*
|
|
61
|
+
* @remarks
|
|
62
|
+
* - `trigger(data?)` — for every subscriber: runs its previous cleanup (if any),
|
|
63
|
+
* then calls the handler with the new data, and stores whatever the handler
|
|
64
|
+
* returns as the next cleanup.
|
|
65
|
+
* - `__subscribe(fn)` — registers a handler; returns an unsubscribe function that
|
|
66
|
+
* also runs any pending cleanup for that handler.
|
|
67
|
+
* - `cleanup()` — runs all stored cleanups without removing subscribers.
|
|
68
|
+
* - `cleanupAndClearSubs()` — runs all stored cleanups AND removes every subscriber.
|
|
69
|
+
* - `hasSubscribers` — boolean getter; `true` when at least one subscriber is registered.
|
|
70
|
+
* - Cannot be created inside a template function (restricted-context guard applies).
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```ts
|
|
74
|
+
* const tabVisible = cleanupEvent<boolean>("tab:visible");
|
|
75
|
+
*
|
|
76
|
+
* tabVisible.__subscribe((visible) => {
|
|
77
|
+
* const timer = setInterval(() => {}, 1000);
|
|
78
|
+
* return () => clearInterval(timer); // runs before next trigger
|
|
79
|
+
* });
|
|
80
|
+
*
|
|
81
|
+
* tabVisible.trigger(true);
|
|
82
|
+
* tabVisible.trigger(false); // runs previous cleanup first
|
|
83
|
+
* tabVisible.cleanup(); // run all cleanups without removing subs
|
|
84
|
+
* tabVisible.cleanupAndClearSubs(); // run cleanups + remove all subs
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
export declare const cleanupEvent: <T = any>(name?: string) => CleanupEventType<T>;
|
|
88
|
+
/**
|
|
89
|
+
* Creates a many-to-many pub/sub channel where any member can broadcast to all
|
|
90
|
+
* OTHER members — the sender never receives its own message.
|
|
91
|
+
*
|
|
92
|
+
* @remarks
|
|
93
|
+
* - `join(handler)` — adds `handler` to the channel and returns `{ send, leave }`.
|
|
94
|
+
* - `send(data?)` — broadcasts `data` to every member except the caller.
|
|
95
|
+
* - `leave()` — removes the handler from the channel.
|
|
96
|
+
* - Auto-cleanup: when `join()` is called inside a component, `leave()` is
|
|
97
|
+
* automatically registered via `registerCleanup` so the handler is removed when
|
|
98
|
+
* the component unmounts.
|
|
99
|
+
* - Cannot be created inside a template function, and `join()` also enforces the
|
|
100
|
+
* same restricted-context guard.
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```ts
|
|
104
|
+
* const chat = channel<string>();
|
|
105
|
+
*
|
|
106
|
+
* // Component A joins:
|
|
107
|
+
* const { send: sendA, leave: leaveA } = chat.join((msg) => {
|
|
108
|
+
* console.log("A received:", msg);
|
|
109
|
+
* });
|
|
110
|
+
*
|
|
111
|
+
* // Component B joins:
|
|
112
|
+
* const { send: sendB } = chat.join((msg) => {
|
|
113
|
+
* console.log("B received:", msg);
|
|
114
|
+
* });
|
|
115
|
+
*
|
|
116
|
+
* sendA("hello from A"); // only B receives
|
|
117
|
+
* sendB("hello from B"); // only A receives
|
|
118
|
+
* leaveA(); // A leaves the channel
|
|
119
|
+
* ```
|
|
120
|
+
*/
|
|
121
|
+
export declare const channel: <T = any>() => ChannelType<T>;
|
|
122
|
+
export { type XTabEventType, xTabEvent } from "./xTabEvent";
|
|
123
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../../../../lib/Mutables/events/events.ts"],"names":[],"mappings":"AASA,KAAK,YAAY,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC;AAE/C,MAAM,WAAW,SAAS,CAAC,CAAC,GAAG,GAAG;IAChC,WAAW,EAAE,CAAC,EAAE,EAAE,YAAY,CAAC,CAAC,CAAC,KAAK,MAAM,IAAI,CAAC;IACjD,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,IAAI,CAAC;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,IAAI,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,KAAK,GAAI,CAAC,GAAG,GAAG,EAAE,OAAO,MAAM,KAAG,SAAS,CAAC,CAAC,CAgBzD,CAAC;AAEF,MAAM,WAAW,WAAW,CAAC,CAAC,GAAG,GAAG;IAClC,IAAI,EAAE,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,KAAK;QAClC,KAAK,EAAE,MAAM,IAAI,CAAC;QAClB,IAAI,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,IAAI,CAAC;KAC1B,CAAC;IACF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,IAAI,CAAC;CACtB;AAED,KAAK,cAAc,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;AAErE,MAAM,WAAW,gBAAgB,CAAC,CAAC,GAAG,GAAG;IACvC,WAAW,EAAE,CAAC,EAAE,EAAE,cAAc,CAAC,CAAC,CAAC,KAAK,MAAM,IAAI,CAAC;IACnD,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,IAAI,CAAC;IAC5B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,mBAAmB,EAAE,MAAM,IAAI,CAAC;IAChC,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,mBAAmB,EAAE,IAAI,CAAC;IAC1B,YAAY,EAAE,IAAI,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAO,MAAM,YAAY,GAAI,CAAC,GAAG,GAAG,EAAE,OAAO,MAAM,KAAG,gBAAgB,CAAC,CAAC,CAwEvE,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAO,MAAM,OAAO,GAAI,CAAC,GAAG,GAAG,OAAK,WAAW,CAAC,CAAC,CAoChD,CAAC;AAEF,OAAO,EAAE,KAAK,aAAa,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../lib/Mutables/events/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { EventType } from "./events";
|
|
2
|
+
/**
|
|
3
|
+
* Extends `EventType<T>` with cross-tab–specific members.
|
|
4
|
+
* Use `close()` to tear down the underlying `BroadcastChannel` when the event
|
|
5
|
+
* is no longer needed (e.g. in tests or on app teardown).
|
|
6
|
+
*/
|
|
7
|
+
export interface XTabEventType<T = any> extends EventType<T> {
|
|
8
|
+
close: () => void;
|
|
9
|
+
__isXTabEvent___: true;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Creates a **cross-tab** typed pub/sub event backed by the native
|
|
13
|
+
* `BroadcastChannel` API. Satisfies the `EventType<T>` interface, so it
|
|
14
|
+
* works transparently with `on()` — pass it as a dep just like a regular
|
|
15
|
+
* `event()`.
|
|
16
|
+
*
|
|
17
|
+
* **Key difference vs `event()`:** `trigger()` fires handlers in the
|
|
18
|
+
* originating tab *and* posts the message to every other open tab sharing the
|
|
19
|
+
* same `name`. Handlers in remote tabs are called via the `BroadcastChannel`
|
|
20
|
+
* `onmessage` callback.
|
|
21
|
+
*
|
|
22
|
+
* ---
|
|
23
|
+
*
|
|
24
|
+
* ### Members
|
|
25
|
+
*
|
|
26
|
+
* - `trigger(data?)` — posts to the `BroadcastChannel` **and** calls all
|
|
27
|
+
* local in-memory handlers synchronously, so the originating tab also fires.
|
|
28
|
+
* Logs to devtools.
|
|
29
|
+
*
|
|
30
|
+
* - `__subscribe(fn)` — registers a local handler and returns an unsubscribe
|
|
31
|
+
* function. When called inside a component, the unsub is automatically
|
|
32
|
+
* registered via `registerCleanup` so the handler is removed on unmount.
|
|
33
|
+
*
|
|
34
|
+
* - `close()` — closes the underlying `BroadcastChannel`. Useful in tests or
|
|
35
|
+
* on app teardown. Local in-memory handlers are unaffected; they simply
|
|
36
|
+
* stop receiving messages from other tabs.
|
|
37
|
+
*
|
|
38
|
+
* ### SSR / Node fallback
|
|
39
|
+
*
|
|
40
|
+
* When `BroadcastChannel` is not available (SSR, Node, or old browsers) the
|
|
41
|
+
* primitive falls back to **in-memory-only** mode: `trigger()` still fires all
|
|
42
|
+
* local handlers synchronously; `postMessage` and `close()` become no-ops.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* const syncTheme = xTabEvent<"light" | "dark">("app:theme");
|
|
47
|
+
*
|
|
48
|
+
* // Subscribe in a component (auto-cleaned up on unmount)
|
|
49
|
+
* syncTheme.__subscribe((theme) => {
|
|
50
|
+
* document.body.setAttribute("data-theme", theme);
|
|
51
|
+
* });
|
|
52
|
+
*
|
|
53
|
+
* // Trigger — fires all local handlers AND posts to all other open tabs
|
|
54
|
+
* syncTheme.trigger("dark");
|
|
55
|
+
*
|
|
56
|
+
* // Close the BroadcastChannel when done (e.g. in tests)
|
|
57
|
+
* syncTheme.close();
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
export declare const xTabEvent: <T = any>(name: string) => XTabEventType<T>;
|
|
61
|
+
//# sourceMappingURL=xTabEvent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xTabEvent.d.ts","sourceRoot":"","sources":["../../../../../../lib/Mutables/events/xTabEvent.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAI1C;;;;GAIG;AACH,MAAM,WAAW,aAAa,CAAC,CAAC,GAAG,GAAG,CAAE,SAAQ,SAAS,CAAC,CAAC,CAAC;IAC1D,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,gBAAgB,EAAE,IAAI,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,eAAO,MAAM,SAAS,GAAI,CAAC,GAAG,GAAG,EAAE,MAAM,MAAM,KAAG,aAAa,CAAC,CAAC,CA2EhE,CAAC"}
|