@prestizni-software/server-dem 0.7.3 → 0.7.5
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/AutoUpdateClientManagerClass.d.ts +141 -0
- package/AutoUpdateClientManagerClass.js +656 -0
- package/AutoUpdateClientManagerClass.js.map +1 -0
- package/AutoUpdateManagerClass.d.ts +102 -0
- package/AutoUpdateManagerClass.js +117 -0
- package/AutoUpdateManagerClass.js.map +1 -0
- package/AutoUpdateServerManagerClass.d.ts +208 -0
- package/AutoUpdateServerManagerClass.js +913 -0
- package/AutoUpdateServerManagerClass.js.map +1 -0
- package/AutoUpdatedClientObjectClass.d.ts +215 -0
- package/AutoUpdatedClientObjectClass.js +911 -0
- package/AutoUpdatedClientObjectClass.js.map +1 -0
- package/AutoUpdatedServerObjectClass.d.ts +134 -0
- package/AutoUpdatedServerObjectClass.js +346 -0
- package/AutoUpdatedServerObjectClass.js.map +1 -0
- package/ClientTypes.d.ts +15 -0
- package/ClientTypes.js +52 -0
- package/ClientTypes.js.map +1 -0
- package/CommonTypes.d.ts +259 -0
- package/CommonTypes.js +233 -0
- package/CommonTypes.js.map +1 -0
- package/CommonTypes_server.d.ts +1 -0
- package/CommonTypes_server.js +2 -0
- package/CommonTypes_server.js.map +1 -0
- package/{dist/DEMErrors.d.ts → DEMErrors.d.ts} +22 -2
- package/{dist/DEMErrors.js → DEMErrors.js} +22 -2
- package/{dist/DEMErrors.js.map → DEMErrors.js.map} +1 -1
- package/ServerTypes.d.ts +16 -0
- package/ServerTypes.js +60 -0
- package/ServerTypes.js.map +1 -0
- package/client.d.ts +6 -0
- package/client.js +7 -0
- package/client.js.map +1 -0
- package/coverage/lcov-report/block-navigation.js +71 -0
- package/coverage/lcov-report/block-navigation.js.map +1 -0
- package/coverage/lcov-report/prettify.js +478 -0
- package/coverage/lcov-report/prettify.js.map +1 -0
- package/coverage/lcov-report/sorter.js +177 -0
- package/coverage/lcov-report/sorter.js.map +1 -0
- package/dist/AutoUpdateClientManagerClass.d.ts +20 -0
- package/dist/AutoUpdateClientManagerClass.js +283 -0
- package/dist/AutoUpdateClientManagerClass.js.map +1 -0
- package/dist/AutoUpdateManagerClass.d.ts +17 -31
- package/dist/AutoUpdateManagerClass.js +15 -36
- package/dist/AutoUpdateManagerClass.js.map +1 -1
- package/dist/AutoUpdateServerManagerClass.d.ts +18 -118
- package/dist/AutoUpdateServerManagerClass.js +198 -583
- package/dist/AutoUpdateServerManagerClass.js.map +1 -1
- package/dist/AutoUpdatedClientObjectClass.d.ts +63 -92
- package/dist/AutoUpdatedClientObjectClass.js +660 -599
- package/dist/AutoUpdatedClientObjectClass.js.map +1 -1
- package/dist/AutoUpdatedServerObjectClass.d.ts +13 -33
- package/dist/AutoUpdatedServerObjectClass.js +92 -234
- package/dist/AutoUpdatedServerObjectClass.js.map +1 -1
- package/dist/ClientTypes.d.ts +13 -0
- package/dist/ClientTypes.js +70 -0
- package/dist/ClientTypes.js.map +1 -0
- package/dist/CommonTypes.d.ts +3 -220
- package/dist/CommonTypes.js +4 -188
- package/dist/CommonTypes.js.map +1 -1
- package/dist/CommonTypes_server.d.ts +1 -1
- package/dist/CommonTypes_server.js +2 -1
- package/dist/CommonTypes_server.js.map +1 -1
- package/dist/ServerTypes.d.ts +13 -0
- package/dist/ServerTypes.js +78 -0
- package/dist/ServerTypes.js.map +1 -0
- package/dist/TestTypes.d.ts +1 -0
- package/dist/TestTypes.js +7 -0
- package/dist/TestTypes.js.map +1 -0
- package/dist/client.d.ts +1 -0
- package/dist/client.js +12 -0
- package/dist/client.js.map +1 -0
- package/dist/coverage/lcov-report/block-navigation.d.ts +1 -0
- package/dist/coverage/lcov-report/block-navigation.js +71 -0
- package/dist/coverage/lcov-report/block-navigation.js.map +1 -0
- package/dist/coverage/lcov-report/prettify.d.ts +0 -0
- package/dist/coverage/lcov-report/prettify.js +736 -0
- package/dist/coverage/lcov-report/prettify.js.map +1 -0
- package/dist/coverage/lcov-report/sorter.d.ts +1 -0
- package/dist/coverage/lcov-report/sorter.js +177 -0
- package/dist/coverage/lcov-report/sorter.js.map +1 -0
- package/dist/dist/AutoUpdateClientManagerClass.d.ts +19 -0
- package/dist/dist/AutoUpdateClientManagerClass.js +284 -0
- package/dist/dist/AutoUpdateClientManagerClass.js.map +1 -0
- package/dist/dist/AutoUpdateManagerClass.d.ts +23 -0
- package/dist/dist/AutoUpdateManagerClass.js +60 -0
- package/dist/dist/AutoUpdateManagerClass.js.map +1 -0
- package/dist/dist/AutoUpdateServerManagerClass.d.ts +50 -0
- package/dist/dist/AutoUpdateServerManagerClass.js +413 -0
- package/dist/dist/AutoUpdateServerManagerClass.js.map +1 -0
- package/dist/dist/AutoUpdatedClientObjectClass.d.ts +72 -0
- package/dist/dist/AutoUpdatedClientObjectClass.js +865 -0
- package/dist/dist/AutoUpdatedClientObjectClass.js.map +1 -0
- package/dist/dist/AutoUpdatedServerObjectClass.d.ts +15 -0
- package/dist/dist/AutoUpdatedServerObjectClass.js +124 -0
- package/dist/dist/AutoUpdatedServerObjectClass.js.map +1 -0
- package/dist/dist/ClientTypes.d.ts +13 -0
- package/dist/dist/ClientTypes.js +71 -0
- package/dist/dist/ClientTypes.js.map +1 -0
- package/dist/dist/CommonTypes.d.ts +3 -0
- package/dist/dist/CommonTypes.js +20 -0
- package/dist/dist/CommonTypes.js.map +1 -0
- package/dist/dist/CommonTypes_server.d.ts +1 -0
- package/dist/dist/CommonTypes_server.js +4 -0
- package/dist/dist/CommonTypes_server.js.map +1 -0
- package/dist/dist/ServerTypes.d.ts +13 -0
- package/dist/dist/ServerTypes.js +79 -0
- package/dist/dist/ServerTypes.js.map +1 -0
- package/dist/dist/TestTypes.d.ts +1 -0
- package/dist/dist/TestTypes.js +8 -0
- package/dist/dist/TestTypes.js.map +1 -0
- package/dist/dist/client.d.ts +1 -0
- package/dist/dist/client.js +13 -0
- package/dist/dist/client.js.map +1 -0
- package/dist/dist/coverage/lcov-report/block-navigation.d.ts +1 -0
- package/dist/dist/coverage/lcov-report/block-navigation.js +71 -0
- package/dist/dist/coverage/lcov-report/block-navigation.js.map +1 -0
- package/dist/dist/coverage/lcov-report/prettify.d.ts +0 -0
- package/dist/dist/coverage/lcov-report/prettify.js +736 -0
- package/dist/dist/coverage/lcov-report/prettify.js.map +1 -0
- package/dist/dist/coverage/lcov-report/sorter.d.ts +1 -0
- package/dist/dist/coverage/lcov-report/sorter.js +177 -0
- package/dist/dist/coverage/lcov-report/sorter.js.map +1 -0
- package/dist/dist/dist/AutoUpdateClientManagerClass.d.ts +19 -0
- package/dist/dist/dist/AutoUpdateClientManagerClass.js +285 -0
- package/dist/dist/dist/AutoUpdateClientManagerClass.js.map +1 -0
- package/dist/dist/dist/AutoUpdateManagerClass.d.ts +23 -0
- package/dist/dist/dist/AutoUpdateManagerClass.js +61 -0
- package/dist/dist/dist/AutoUpdateManagerClass.js.map +1 -0
- package/dist/dist/dist/AutoUpdateServerManagerClass.d.ts +158 -0
- package/dist/dist/dist/AutoUpdateServerManagerClass.js +414 -0
- package/dist/dist/dist/AutoUpdateServerManagerClass.js.map +1 -0
- package/dist/dist/dist/AutoUpdatedClientObjectClass.d.ts +72 -0
- package/dist/dist/dist/AutoUpdatedClientObjectClass.js +866 -0
- package/dist/dist/dist/AutoUpdatedClientObjectClass.js.map +1 -0
- package/dist/dist/dist/AutoUpdatedServerObjectClass.d.ts +15 -0
- package/dist/dist/dist/AutoUpdatedServerObjectClass.js +125 -0
- package/dist/dist/dist/AutoUpdatedServerObjectClass.js.map +1 -0
- package/dist/dist/dist/ClientTypes.d.ts +13 -0
- package/dist/dist/dist/ClientTypes.js +72 -0
- package/dist/dist/dist/ClientTypes.js.map +1 -0
- package/dist/dist/dist/CommonTypes.d.ts +3 -0
- package/dist/dist/dist/CommonTypes.js +21 -0
- package/dist/dist/dist/CommonTypes.js.map +1 -0
- package/dist/dist/dist/CommonTypes_server.d.ts +1 -0
- package/dist/dist/dist/CommonTypes_server.js +5 -0
- package/dist/dist/dist/CommonTypes_server.js.map +1 -0
- package/dist/dist/dist/ServerTypes.d.ts +13 -0
- package/dist/dist/dist/ServerTypes.js +80 -0
- package/dist/dist/dist/ServerTypes.js.map +1 -0
- package/dist/dist/dist/TestTypes.d.ts +1 -0
- package/dist/dist/dist/TestTypes.js +9 -0
- package/dist/dist/dist/TestTypes.js.map +1 -0
- package/dist/dist/dist/client.d.ts +1 -0
- package/dist/dist/dist/client.js +14 -0
- package/dist/dist/dist/client.js.map +1 -0
- package/dist/dist/dist/coverage/lcov-report/block-navigation.d.ts +1 -0
- package/dist/dist/dist/coverage/lcov-report/block-navigation.js +71 -0
- package/dist/dist/dist/coverage/lcov-report/block-navigation.js.map +1 -0
- package/dist/dist/dist/coverage/lcov-report/prettify.d.ts +0 -0
- package/dist/dist/dist/coverage/lcov-report/prettify.js +736 -0
- package/dist/dist/dist/coverage/lcov-report/prettify.js.map +1 -0
- package/dist/dist/dist/coverage/lcov-report/sorter.d.ts +1 -0
- package/dist/dist/dist/coverage/lcov-report/sorter.js +177 -0
- package/dist/dist/dist/coverage/lcov-report/sorter.js.map +1 -0
- package/dist/dist/dist/expo-test/app/(tabs)/_layout.d.ts +1 -0
- package/dist/dist/dist/expo-test/app/(tabs)/_layout.js +27 -0
- package/dist/dist/dist/expo-test/app/(tabs)/_layout.js.map +1 -0
- package/dist/dist/dist/expo-test/app/(tabs)/explore.d.ts +1 -0
- package/dist/dist/dist/expo-test/app/(tabs)/explore.js +95 -0
- package/dist/dist/dist/expo-test/app/(tabs)/explore.js.map +1 -0
- package/dist/dist/dist/expo-test/app/(tabs)/index.d.ts +1 -0
- package/dist/dist/dist/expo-test/app/(tabs)/index.js +81 -0
- package/dist/dist/dist/expo-test/app/(tabs)/index.js.map +1 -0
- package/dist/dist/dist/expo-test/app/_layout.d.ts +4 -0
- package/dist/dist/dist/expo-test/app/_layout.js +22 -0
- package/dist/dist/dist/expo-test/app/_layout.js.map +1 -0
- package/dist/dist/dist/expo-test/app/modal.d.ts +1 -0
- package/dist/dist/dist/expo-test/app/modal.js +28 -0
- package/dist/dist/dist/expo-test/app/modal.js.map +1 -0
- package/dist/dist/dist/expo-test/components/external-link.d.ts +4 -0
- package/dist/dist/dist/expo-test/components/external-link.js +18 -0
- package/dist/dist/dist/expo-test/components/external-link.js.map +1 -0
- package/dist/dist/dist/expo-test/components/haptic-tab.d.ts +1 -0
- package/dist/dist/dist/expo-test/components/haptic-tab.js +15 -0
- package/dist/dist/dist/expo-test/components/haptic-tab.js.map +1 -0
- package/dist/dist/dist/expo-test/components/hello-wave.d.ts +1 -0
- package/dist/dist/dist/expo-test/components/hello-wave.js +19 -0
- package/dist/dist/dist/expo-test/components/hello-wave.js.map +1 -0
- package/dist/dist/dist/expo-test/components/parallax-scroll-view.d.ts +5 -0
- package/dist/dist/dist/expo-test/components/parallax-scroll-view.js +53 -0
- package/dist/dist/dist/expo-test/components/parallax-scroll-view.js.map +1 -0
- package/dist/dist/dist/expo-test/components/themed-text.d.ts +7 -0
- package/dist/dist/dist/expo-test/components/themed-text.js +43 -0
- package/dist/dist/dist/expo-test/components/themed-text.js.map +1 -0
- package/dist/dist/dist/expo-test/components/themed-view.d.ts +6 -0
- package/dist/dist/dist/expo-test/components/themed-view.js +10 -0
- package/dist/dist/dist/expo-test/components/themed-view.js.map +1 -0
- package/dist/dist/dist/expo-test/components/ui/collapsible.d.ts +4 -0
- package/dist/dist/dist/expo-test/components/ui/collapsible.js +34 -0
- package/dist/dist/dist/expo-test/components/ui/collapsible.js.map +1 -0
- package/dist/dist/dist/expo-test/components/ui/icon-symbol.d.ts +11 -0
- package/dist/dist/dist/expo-test/components/ui/icon-symbol.ios.d.ts +7 -0
- package/dist/dist/dist/expo-test/components/ui/icon-symbol.ios.js +14 -0
- package/dist/dist/dist/expo-test/components/ui/icon-symbol.ios.js.map +1 -0
- package/dist/dist/dist/expo-test/components/ui/icon-symbol.js +25 -0
- package/dist/dist/dist/expo-test/components/ui/icon-symbol.js.map +1 -0
- package/dist/dist/dist/expo-test/constants/theme.d.ts +26 -0
- package/dist/dist/dist/expo-test/constants/theme.js +53 -0
- package/dist/dist/dist/expo-test/constants/theme.js.map +1 -0
- package/dist/dist/dist/expo-test/eslint.config.d.ts +2 -0
- package/dist/dist/dist/expo-test/eslint.config.js +11 -0
- package/dist/dist/dist/expo-test/eslint.config.js.map +1 -0
- package/dist/dist/dist/expo-test/hooks/use-color-scheme.d.ts +1 -0
- package/dist/dist/dist/expo-test/hooks/use-color-scheme.js +5 -0
- package/dist/dist/dist/expo-test/hooks/use-color-scheme.js.map +1 -0
- package/dist/dist/dist/expo-test/hooks/use-color-scheme.web.d.ts +4 -0
- package/dist/dist/dist/expo-test/hooks/use-color-scheme.web.js +20 -0
- package/dist/dist/dist/expo-test/hooks/use-color-scheme.web.js.map +1 -0
- package/dist/dist/dist/expo-test/hooks/use-theme-color.d.ts +1 -0
- package/dist/dist/dist/expo-test/hooks/use-theme-color.js +20 -0
- package/dist/dist/dist/expo-test/hooks/use-theme-color.js.map +1 -0
- package/dist/dist/dist/expo-test/scripts/reset-project.d.ts +2 -0
- package/dist/dist/dist/expo-test/scripts/reset-project.js +98 -0
- package/dist/dist/dist/expo-test/scripts/reset-project.js.map +1 -0
- package/dist/dist/dist/jest.config.d.ts +21 -0
- package/dist/dist/dist/jest.config.js +20 -0
- package/dist/dist/dist/jest.config.js.map +1 -0
- package/dist/dist/dist/server.d.ts +1 -0
- package/dist/dist/dist/server.js +16 -0
- package/dist/dist/dist/server.js.map +1 -0
- package/dist/dist/dist/socket_test.d.ts +1 -0
- package/dist/dist/dist/socket_test.js +24 -0
- package/dist/dist/dist/socket_test.js.map +1 -0
- package/dist/dist/dist/test.d.ts +1 -0
- package/dist/dist/dist/test.js +7 -0
- package/dist/dist/dist/test.js.map +1 -0
- package/dist/dist/dist/test_client.d.ts +1 -0
- package/dist/dist/dist/test_client.js +26 -0
- package/dist/dist/dist/test_client.js.map +1 -0
- package/dist/dist/dist/test_lib.d.ts +2 -0
- package/dist/dist/dist/test_lib.js +85 -0
- package/dist/dist/dist/test_lib.js.map +1 -0
- package/dist/dist/dist/test_server.d.ts +1 -0
- package/dist/dist/dist/test_server.js +54 -0
- package/dist/dist/dist/test_server.js.map +1 -0
- package/dist/dist/dist/tests/dem.test.d.ts +1 -0
- package/dist/dist/dist/tests/dem.test.js +341 -0
- package/dist/dist/dist/tests/dem.test.js.map +1 -0
- package/dist/dist/expo-test/app/(tabs)/_layout.d.ts +1 -0
- package/dist/dist/expo-test/app/(tabs)/_layout.js +26 -0
- package/dist/dist/expo-test/app/(tabs)/_layout.js.map +1 -0
- package/dist/dist/expo-test/app/(tabs)/explore.d.ts +1 -0
- package/dist/dist/expo-test/app/(tabs)/explore.js +94 -0
- package/dist/dist/expo-test/app/(tabs)/explore.js.map +1 -0
- package/dist/dist/expo-test/app/(tabs)/index.d.ts +1 -0
- package/dist/dist/expo-test/app/(tabs)/index.js +80 -0
- package/dist/dist/expo-test/app/(tabs)/index.js.map +1 -0
- package/dist/dist/expo-test/app/_layout.d.ts +4 -0
- package/dist/dist/expo-test/app/_layout.js +21 -0
- package/dist/dist/expo-test/app/_layout.js.map +1 -0
- package/dist/dist/expo-test/app/modal.d.ts +1 -0
- package/dist/dist/expo-test/app/modal.js +27 -0
- package/dist/dist/expo-test/app/modal.js.map +1 -0
- package/dist/dist/expo-test/components/external-link.d.ts +4 -0
- package/dist/dist/expo-test/components/external-link.js +17 -0
- package/dist/dist/expo-test/components/external-link.js.map +1 -0
- package/dist/dist/expo-test/components/haptic-tab.d.ts +1 -0
- package/dist/dist/expo-test/components/haptic-tab.js +14 -0
- package/dist/dist/expo-test/components/haptic-tab.js.map +1 -0
- package/dist/dist/expo-test/components/hello-wave.d.ts +1 -0
- package/dist/dist/expo-test/components/hello-wave.js +18 -0
- package/dist/dist/expo-test/components/hello-wave.js.map +1 -0
- package/dist/dist/expo-test/components/parallax-scroll-view.d.ts +5 -0
- package/dist/dist/expo-test/components/parallax-scroll-view.js +52 -0
- package/dist/dist/expo-test/components/parallax-scroll-view.js.map +1 -0
- package/dist/dist/expo-test/components/themed-text.d.ts +7 -0
- package/dist/dist/expo-test/components/themed-text.js +42 -0
- package/dist/dist/expo-test/components/themed-text.js.map +1 -0
- package/dist/dist/expo-test/components/themed-view.d.ts +6 -0
- package/dist/dist/expo-test/components/themed-view.js +9 -0
- package/dist/dist/expo-test/components/themed-view.js.map +1 -0
- package/dist/dist/expo-test/components/ui/collapsible.d.ts +4 -0
- package/dist/dist/expo-test/components/ui/collapsible.js +33 -0
- package/dist/dist/expo-test/components/ui/collapsible.js.map +1 -0
- package/dist/dist/expo-test/components/ui/icon-symbol.d.ts +11 -0
- package/dist/dist/expo-test/components/ui/icon-symbol.ios.d.ts +7 -0
- package/dist/dist/expo-test/components/ui/icon-symbol.ios.js +13 -0
- package/dist/dist/expo-test/components/ui/icon-symbol.ios.js.map +1 -0
- package/dist/dist/expo-test/components/ui/icon-symbol.js +24 -0
- package/dist/dist/expo-test/components/ui/icon-symbol.js.map +1 -0
- package/dist/dist/expo-test/constants/theme.d.ts +26 -0
- package/dist/dist/expo-test/constants/theme.js +52 -0
- package/dist/dist/expo-test/constants/theme.js.map +1 -0
- package/dist/dist/expo-test/eslint.config.d.ts +2 -0
- package/dist/dist/expo-test/eslint.config.js +11 -0
- package/dist/dist/expo-test/eslint.config.js.map +1 -0
- package/dist/dist/expo-test/hooks/use-color-scheme.d.ts +1 -0
- package/dist/dist/expo-test/hooks/use-color-scheme.js +4 -0
- package/dist/dist/expo-test/hooks/use-color-scheme.js.map +1 -0
- package/dist/dist/expo-test/hooks/use-color-scheme.web.d.ts +4 -0
- package/dist/dist/expo-test/hooks/use-color-scheme.web.js +19 -0
- package/dist/dist/expo-test/hooks/use-color-scheme.web.js.map +1 -0
- package/dist/dist/expo-test/hooks/use-theme-color.d.ts +1 -0
- package/dist/dist/expo-test/hooks/use-theme-color.js +19 -0
- package/dist/dist/expo-test/hooks/use-theme-color.js.map +1 -0
- package/dist/dist/expo-test/scripts/reset-project.d.ts +2 -0
- package/dist/dist/expo-test/scripts/reset-project.js +98 -0
- package/dist/dist/expo-test/scripts/reset-project.js.map +1 -0
- package/dist/dist/jest.config.d.ts +21 -0
- package/dist/dist/jest.config.js +19 -0
- package/dist/dist/jest.config.js.map +1 -0
- package/dist/dist/server.d.ts +1 -0
- package/dist/dist/server.js +15 -0
- package/dist/dist/server.js.map +1 -0
- package/dist/dist/socket_test.d.ts +1 -0
- package/dist/dist/socket_test.js +23 -0
- package/dist/dist/socket_test.js.map +1 -0
- package/dist/dist/test.d.ts +1 -0
- package/dist/dist/test.js +6 -0
- package/dist/dist/test.js.map +1 -0
- package/dist/dist/test_client.d.ts +1 -0
- package/dist/dist/test_client.js +25 -0
- package/dist/dist/test_client.js.map +1 -0
- package/dist/dist/test_lib.d.ts +2 -0
- package/dist/dist/test_lib.js +84 -0
- package/dist/dist/test_lib.js.map +1 -0
- package/dist/dist/test_server.d.ts +1 -0
- package/dist/dist/test_server.js +53 -0
- package/dist/dist/test_server.js.map +1 -0
- package/dist/dist/tests/dem.test.d.ts +1 -0
- package/dist/dist/tests/dem.test.js +340 -0
- package/dist/dist/tests/dem.test.js.map +1 -0
- package/dist/expo-test/app/(tabs)/_layout.d.ts +1 -0
- package/dist/expo-test/app/(tabs)/_layout.js +25 -0
- package/dist/expo-test/app/(tabs)/_layout.js.map +1 -0
- package/dist/expo-test/app/(tabs)/explore.d.ts +1 -0
- package/dist/expo-test/app/(tabs)/explore.js +93 -0
- package/dist/expo-test/app/(tabs)/explore.js.map +1 -0
- package/dist/expo-test/app/(tabs)/index.d.ts +1 -0
- package/dist/expo-test/app/(tabs)/index.js +79 -0
- package/dist/expo-test/app/(tabs)/index.js.map +1 -0
- package/dist/expo-test/app/_layout.d.ts +4 -0
- package/dist/expo-test/app/_layout.js +20 -0
- package/dist/expo-test/app/_layout.js.map +1 -0
- package/dist/expo-test/app/modal.d.ts +1 -0
- package/dist/expo-test/app/modal.js +26 -0
- package/dist/expo-test/app/modal.js.map +1 -0
- package/dist/expo-test/components/external-link.d.ts +4 -0
- package/dist/expo-test/components/external-link.js +16 -0
- package/dist/expo-test/components/external-link.js.map +1 -0
- package/dist/expo-test/components/haptic-tab.d.ts +1 -0
- package/dist/expo-test/components/haptic-tab.js +13 -0
- package/dist/expo-test/components/haptic-tab.js.map +1 -0
- package/dist/expo-test/components/hello-wave.d.ts +1 -0
- package/dist/expo-test/components/hello-wave.js +17 -0
- package/dist/expo-test/components/hello-wave.js.map +1 -0
- package/dist/expo-test/components/parallax-scroll-view.d.ts +5 -0
- package/dist/expo-test/components/parallax-scroll-view.js +51 -0
- package/dist/expo-test/components/parallax-scroll-view.js.map +1 -0
- package/dist/expo-test/components/themed-text.d.ts +7 -0
- package/dist/expo-test/components/themed-text.js +41 -0
- package/dist/expo-test/components/themed-text.js.map +1 -0
- package/dist/expo-test/components/themed-view.d.ts +6 -0
- package/dist/expo-test/components/themed-view.js +8 -0
- package/dist/expo-test/components/themed-view.js.map +1 -0
- package/dist/expo-test/components/ui/collapsible.d.ts +4 -0
- package/dist/expo-test/components/ui/collapsible.js +32 -0
- package/dist/expo-test/components/ui/collapsible.js.map +1 -0
- package/dist/expo-test/components/ui/icon-symbol.d.ts +11 -0
- package/dist/expo-test/components/ui/icon-symbol.ios.d.ts +7 -0
- package/dist/expo-test/components/ui/icon-symbol.ios.js +12 -0
- package/dist/expo-test/components/ui/icon-symbol.ios.js.map +1 -0
- package/dist/expo-test/components/ui/icon-symbol.js +23 -0
- package/dist/expo-test/components/ui/icon-symbol.js.map +1 -0
- package/dist/expo-test/constants/theme.d.ts +26 -0
- package/dist/expo-test/constants/theme.js +51 -0
- package/dist/expo-test/constants/theme.js.map +1 -0
- package/dist/expo-test/eslint.config.d.ts +2 -0
- package/dist/expo-test/eslint.config.js +11 -0
- package/dist/expo-test/eslint.config.js.map +1 -0
- package/dist/expo-test/hooks/use-color-scheme.d.ts +1 -0
- package/dist/expo-test/hooks/use-color-scheme.js +3 -0
- package/dist/expo-test/hooks/use-color-scheme.js.map +1 -0
- package/dist/expo-test/hooks/use-color-scheme.web.d.ts +4 -0
- package/dist/expo-test/hooks/use-color-scheme.web.js +18 -0
- package/dist/expo-test/hooks/use-color-scheme.web.js.map +1 -0
- package/dist/expo-test/hooks/use-theme-color.d.ts +1 -0
- package/dist/expo-test/hooks/use-theme-color.js +18 -0
- package/dist/expo-test/hooks/use-theme-color.js.map +1 -0
- package/dist/expo-test/scripts/reset-project.d.ts +2 -0
- package/dist/expo-test/scripts/reset-project.js +98 -0
- package/dist/expo-test/scripts/reset-project.js.map +1 -0
- package/dist/jest.config.d.ts +21 -0
- package/dist/jest.config.js +18 -0
- package/dist/jest.config.js.map +1 -0
- package/dist/server.d.ts +1 -8
- package/dist/server.js +13 -8
- package/dist/server.js.map +1 -1
- package/dist/socket_test.d.ts +1 -0
- package/dist/socket_test.js +22 -0
- package/dist/socket_test.js.map +1 -0
- package/dist/test.d.ts +1 -0
- package/dist/test.js +5 -0
- package/dist/test.js.map +1 -0
- package/dist/test_client.d.ts +1 -0
- package/dist/test_client.js +24 -0
- package/dist/test_client.js.map +1 -0
- package/dist/test_lib.d.ts +12 -0
- package/dist/test_lib.js +83 -0
- package/dist/test_lib.js.map +1 -0
- package/dist/test_server.d.ts +1 -0
- package/dist/test_server.js +52 -0
- package/dist/test_server.js.map +1 -0
- package/dist/tests/dem.test.d.ts +1 -0
- package/dist/tests/dem.test.js +339 -0
- package/dist/tests/dem.test.js.map +1 -0
- package/expo-test/app/(tabs)/_layout.d.ts +2 -0
- package/expo-test/app/(tabs)/_layout.js +24 -0
- package/expo-test/app/(tabs)/_layout.js.map +1 -0
- package/expo-test/app/(tabs)/explore.d.ts +1 -0
- package/expo-test/app/(tabs)/explore.js +92 -0
- package/expo-test/app/(tabs)/explore.js.map +1 -0
- package/expo-test/app/(tabs)/index.d.ts +1 -0
- package/expo-test/app/(tabs)/index.js +78 -0
- package/expo-test/app/(tabs)/index.js.map +1 -0
- package/expo-test/app/_layout.d.ts +5 -0
- package/expo-test/app/_layout.js +19 -0
- package/expo-test/app/_layout.js.map +1 -0
- package/expo-test/app/modal.d.ts +1 -0
- package/expo-test/app/modal.js +25 -0
- package/expo-test/app/modal.js.map +1 -0
- package/expo-test/components/external-link.d.ts +7 -0
- package/expo-test/components/external-link.js +15 -0
- package/expo-test/components/external-link.js.map +1 -0
- package/expo-test/components/haptic-tab.d.ts +2 -0
- package/expo-test/components/haptic-tab.js +12 -0
- package/expo-test/components/haptic-tab.js.map +1 -0
- package/expo-test/components/hello-wave.d.ts +1 -0
- package/expo-test/components/hello-wave.js +16 -0
- package/expo-test/components/hello-wave.js.map +1 -0
- package/expo-test/components/parallax-scroll-view.d.ts +10 -0
- package/expo-test/components/parallax-scroll-view.js +50 -0
- package/expo-test/components/parallax-scroll-view.js.map +1 -0
- package/expo-test/components/themed-text.d.ts +7 -0
- package/expo-test/components/themed-text.js +40 -0
- package/expo-test/components/themed-text.js.map +1 -0
- package/expo-test/components/themed-view.d.ts +6 -0
- package/expo-test/components/themed-view.js +7 -0
- package/expo-test/components/themed-view.js.map +1 -0
- package/expo-test/components/ui/collapsible.d.ts +4 -0
- package/expo-test/components/ui/collapsible.js +31 -0
- package/expo-test/components/ui/collapsible.js.map +1 -0
- package/expo-test/components/ui/icon-symbol.d.ts +25 -0
- package/expo-test/components/ui/icon-symbol.ios.d.ts +9 -0
- package/expo-test/components/ui/icon-symbol.ios.js +11 -0
- package/expo-test/components/ui/icon-symbol.ios.js.map +1 -0
- package/expo-test/components/ui/icon-symbol.js +22 -0
- package/expo-test/components/ui/icon-symbol.js.map +1 -0
- package/expo-test/constants/theme.d.ts +32 -0
- package/expo-test/constants/theme.js +50 -0
- package/expo-test/constants/theme.js.map +1 -0
- package/expo-test/eslint.config.d.ts +2 -0
- package/expo-test/eslint.config.js +11 -0
- package/expo-test/eslint.config.js.map +1 -0
- package/expo-test/hooks/use-color-scheme.d.ts +1 -0
- package/expo-test/hooks/use-color-scheme.js +2 -0
- package/expo-test/hooks/use-color-scheme.js.map +1 -0
- package/expo-test/hooks/use-color-scheme.web.d.ts +4 -0
- package/expo-test/hooks/use-color-scheme.web.js +17 -0
- package/expo-test/hooks/use-color-scheme.web.js.map +1 -0
- package/expo-test/hooks/use-theme-color.d.ts +9 -0
- package/expo-test/hooks/use-theme-color.js +17 -0
- package/expo-test/hooks/use-theme-color.js.map +1 -0
- package/expo-test/scripts/reset-project.d.ts +2 -0
- package/expo-test/scripts/reset-project.js +98 -0
- package/expo-test/scripts/reset-project.js.map +1 -0
- package/index.d.ts +4 -0
- package/index.js +5 -0
- package/index.js.map +1 -0
- package/jest.config.d.ts +3 -0
- package/jest.config.js +17 -0
- package/jest.config.js.map +1 -0
- package/package.json +23 -42
- package/server.d.ts +8 -0
- package/server.js +9 -0
- package/server.js.map +1 -0
- package/{dist/sync → sync}/ClientStateReconciler.d.ts +20 -0
- package/{dist/sync → sync}/ClientStateReconciler.js +20 -0
- package/sync/ClientStateReconciler.js.map +1 -0
- package/{dist/sync → sync}/ServerChangeTracker.d.ts +46 -0
- package/{dist/sync → sync}/ServerChangeTracker.js +46 -0
- package/sync/ServerChangeTracker.js.map +1 -0
- package/sync/storage/IndexedDbStorageAdapter.d.ts +53 -0
- package/{dist/sync → sync}/storage/IndexedDbStorageAdapter.js +31 -0
- package/sync/storage/IndexedDbStorageAdapter.js.map +1 -0
- package/sync/storage/LocalStorageAdapter.d.ts +59 -0
- package/{dist/sync → sync}/storage/LocalStorageAdapter.js +32 -0
- package/sync/storage/LocalStorageAdapter.js.map +1 -0
- package/sync/storage/MemoryStorageAdapter.d.ts +34 -0
- package/sync/storage/MemoryStorageAdapter.js +45 -0
- package/sync/storage/MemoryStorageAdapter.js.map +1 -0
- package/version.d.ts +21 -0
- package/version.js +22 -0
- package/version.js.map +1 -0
- package/README.md +0 -18
- package/dist/sync/ClientStateReconciler.js.map +0 -1
- package/dist/sync/ServerChangeTracker.js.map +0 -1
- package/dist/sync/storage/IndexedDbStorageAdapter.d.ts +0 -22
- package/dist/sync/storage/IndexedDbStorageAdapter.js.map +0 -1
- package/dist/sync/storage/LocalStorageAdapter.d.ts +0 -27
- package/dist/sync/storage/LocalStorageAdapter.js.map +0 -1
- package/dist/sync/storage/MemoryStorageAdapter.d.ts +0 -13
- package/dist/sync/storage/MemoryStorageAdapter.js +0 -25
- package/dist/sync/storage/MemoryStorageAdapter.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
- /package/{dist/sync → sync}/index.d.ts +0 -0
- /package/{dist/sync → sync}/index.js +0 -0
- /package/{dist/sync → sync}/index.js.map +0 -0
- /package/{dist/sync → sync}/storage/IClientStorageAdapter.d.ts +0 -0
- /package/{dist/sync → sync}/storage/IClientStorageAdapter.js +0 -0
- /package/{dist/sync → sync}/storage/IClientStorageAdapter.js.map +0 -0
- /package/{dist/sync → sync}/types.d.ts +0 -0
- /package/{dist/sync → sync}/types.js +0 -0
- /package/{dist/sync → sync}/types.js.map +0 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
/**
|
|
4
|
+
* This script is used to reset the project to a blank state.
|
|
5
|
+
* It deletes or moves the /app, /components, /hooks, /scripts, and /constants directories to /app-example based on user input and creates a new /app directory with an index.tsx and _layout.tsx file.
|
|
6
|
+
* You can remove the `reset-project` script from package.json and safely delete this file after running it.
|
|
7
|
+
*/
|
|
8
|
+
const fs = require("fs");
|
|
9
|
+
const path = require("path");
|
|
10
|
+
const readline = require("readline");
|
|
11
|
+
const root = process.cwd();
|
|
12
|
+
const oldDirs = ["app", "components", "hooks", "constants", "scripts"];
|
|
13
|
+
const exampleDir = "app-example";
|
|
14
|
+
const newAppDir = "app";
|
|
15
|
+
const exampleDirPath = path.join(root, exampleDir);
|
|
16
|
+
const indexContent = `import { Text, View } from "react-native";
|
|
17
|
+
|
|
18
|
+
export default function Index() {
|
|
19
|
+
return (
|
|
20
|
+
<View
|
|
21
|
+
style={{
|
|
22
|
+
flex: 1,
|
|
23
|
+
justifyContent: "center",
|
|
24
|
+
alignItems: "center",
|
|
25
|
+
}}
|
|
26
|
+
>
|
|
27
|
+
<Text>Edit app/index.tsx to edit this screen.</Text>
|
|
28
|
+
</View>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
`;
|
|
32
|
+
const layoutContent = `import { Stack } from "expo-router";
|
|
33
|
+
|
|
34
|
+
export default function RootLayout() {
|
|
35
|
+
return <Stack />;
|
|
36
|
+
}
|
|
37
|
+
`;
|
|
38
|
+
const rl = readline.createInterface({
|
|
39
|
+
input: process.stdin,
|
|
40
|
+
output: process.stdout,
|
|
41
|
+
});
|
|
42
|
+
const moveDirectories = async (userInput) => {
|
|
43
|
+
try {
|
|
44
|
+
if (userInput === "y") {
|
|
45
|
+
// Create the app-example directory
|
|
46
|
+
await fs.promises.mkdir(exampleDirPath, { recursive: true });
|
|
47
|
+
console.log(`📁 /${exampleDir} directory created.`);
|
|
48
|
+
}
|
|
49
|
+
// Move old directories to new app-example directory or delete them
|
|
50
|
+
for (const dir of oldDirs) {
|
|
51
|
+
const oldDirPath = path.join(root, dir);
|
|
52
|
+
if (fs.existsSync(oldDirPath)) {
|
|
53
|
+
if (userInput === "y") {
|
|
54
|
+
const newDirPath = path.join(root, exampleDir, dir);
|
|
55
|
+
await fs.promises.rename(oldDirPath, newDirPath);
|
|
56
|
+
console.log(`➡️ /${dir} moved to /${exampleDir}/${dir}.`);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
await fs.promises.rm(oldDirPath, { recursive: true, force: true });
|
|
60
|
+
console.log(`❌ /${dir} deleted.`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
console.log(`➡️ /${dir} does not exist, skipping.`);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
// Create new /app directory
|
|
68
|
+
const newAppDirPath = path.join(root, newAppDir);
|
|
69
|
+
await fs.promises.mkdir(newAppDirPath, { recursive: true });
|
|
70
|
+
console.log("\n📁 New /app directory created.");
|
|
71
|
+
// Create index.tsx
|
|
72
|
+
const indexPath = path.join(newAppDirPath, "index.tsx");
|
|
73
|
+
await fs.promises.writeFile(indexPath, indexContent);
|
|
74
|
+
console.log("📄 app/index.tsx created.");
|
|
75
|
+
// Create _layout.tsx
|
|
76
|
+
const layoutPath = path.join(newAppDirPath, "_layout.tsx");
|
|
77
|
+
await fs.promises.writeFile(layoutPath, layoutContent);
|
|
78
|
+
console.log("📄 app/_layout.tsx created.");
|
|
79
|
+
console.log("\n✅ Project reset complete. Next steps:");
|
|
80
|
+
console.log(`1. Run \`npx expo start\` to start a development server.\n2. Edit app/index.tsx to edit the main screen.${userInput === "y"
|
|
81
|
+
? `\n3. Delete the /${exampleDir} directory when you're done referencing it.`
|
|
82
|
+
: ""}`);
|
|
83
|
+
}
|
|
84
|
+
catch (error) {
|
|
85
|
+
console.error(`❌ Error during script execution: ${error.message}`);
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
rl.question("Do you want to move existing files to /app-example instead of deleting them? (Y/n): ", (answer) => {
|
|
89
|
+
const userInput = answer.trim().toLowerCase() || "y";
|
|
90
|
+
if (userInput === "y" || userInput === "n") {
|
|
91
|
+
moveDirectories(userInput).finally(() => rl.close());
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
console.log("❌ Invalid input. Please enter 'Y' or 'N'.");
|
|
95
|
+
rl.close();
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
//# sourceMappingURL=reset-project.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reset-project.js","sourceRoot":"","sources":["../../../expo-test/scripts/reset-project.js"],"names":[],"mappings":";;AAEA;;;;GAIG;AAEH,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AACzB,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAC7B,MAAM,QAAQ,GAAG,OAAO,CAAC,UAA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AAC,GAAG,CACT,2GACE,SAAS,KAAK,GAAG;YACf,CAAC,CAAC,oBAAoB,UAAU,6CAA6C;YAC7E,CAAC,CAAC,EACN,EAAE,CACH,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,oCAAoC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;IACrE,CAAC;AACH,CAAC,CAAC;AAEF,EAAE,CAAC,QAAQ,CACT,sFAAsF,EACtF,CAAC,MAAM,EAAE,EAAE;IACT,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,IAAI,GAAG,CAAC;IACrD,IAAI,SAAS,KAAK,GAAG,IAAI,SAAS,KAAK,GAAG,EAAE,CAAC;QAC3C,eAAe,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC;IACvD,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,2CAA2C,CAAC,CAAC;QACzD,EAAE,CAAC,KAAK,EAAE,CAAC;IACb,CAAC;AACH,CAAC,CACF,CAAC"}
|
package/index.d.ts
ADDED
package/index.js
ADDED
package/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"}
|
package/jest.config.d.ts
ADDED
package/jest.config.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const config = {
|
|
2
|
+
globals: {
|
|
3
|
+
"ts-jest": {
|
|
4
|
+
useESM: true
|
|
5
|
+
}
|
|
6
|
+
},
|
|
7
|
+
transform: { '\\.[jt]s?$': ['ts-jest', { tsconfig: { allowJs: true } }] },
|
|
8
|
+
preset: 'ts-jest/presets/default-esm',
|
|
9
|
+
roots: ["tests/"],
|
|
10
|
+
modulePathIgnorePatterns: [
|
|
11
|
+
"node_modules/"
|
|
12
|
+
], moduleNameMapper: {
|
|
13
|
+
'^(\\.{1,2}/.*)\\.[jt]s$': '$1',
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
export default config;
|
|
17
|
+
//# sourceMappingURL=jest.config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jest.config.js","sourceRoot":"","sources":["../jest.config.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,GAAyB;IACjC,OAAO,EAAE;QACL,SAAS,EAAE;YACP,MAAM,EAAE,IAAI;SACf;KACJ;IACD,SAAS,EAAE,EAAE,YAAY,EAAE,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC,EAAE;IACzE,MAAM,EAAE,6BAA6B;IACrC,KAAK,EAAE,CAAC,QAAQ,CAAC;IACjB,wBAAwB,EAAE;QACtB,eAAe;KAClB,EAAE,gBAAgB,EAAE;QACrB,yBAAyB,EAAE,IAAI;KAChC;CACF,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,42 +1,23 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@prestizni-software/server-dem",
|
|
3
|
-
"version": "0.7.
|
|
4
|
-
"description": "
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"release:patch": "git pull && npm i && npm run build && npx standard-version --release-as patch && git push --follow-tags && npm publish --access public",
|
|
25
|
-
"release:minor": "git pull && npm i && npm run build && npx standard-version --release-as minor && git push --follow-tags && npm publish --access public",
|
|
26
|
-
"release:major": "git pull && npm i && npm run build && npx standard-version --release-as major && git push --follow-tags && npm publish --access public"
|
|
27
|
-
},
|
|
28
|
-
"dependencies": {
|
|
29
|
-
"@typegoose/typegoose": "^13.3.0",
|
|
30
|
-
"bson": "^7.2.0",
|
|
31
|
-
"eventemitter3": "5.0.4",
|
|
32
|
-
"lodash": "^4.17.23",
|
|
33
|
-
"node-machine-id": "^1.1.12",
|
|
34
|
-
"reflect-metadata": "^0.2.2",
|
|
35
|
-
"socket.io": "^4.8.3",
|
|
36
|
-
"socket.io-client": "^4.8.3",
|
|
37
|
-
"string-similarity-js": "^2.1.4"
|
|
38
|
-
},
|
|
39
|
-
"devDependencies": {
|
|
40
|
-
"@types/lodash": "^4.17.24"
|
|
41
|
-
}
|
|
42
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@prestizni-software/server-dem",
|
|
3
|
+
"version": "0.7.5",
|
|
4
|
+
"description": "Real-time server synchronization library for DEM",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./server.js",
|
|
7
|
+
"types": "./server.d.ts",
|
|
8
|
+
"publishConfig": {
|
|
9
|
+
"access": "public",
|
|
10
|
+
"registry": "https://registry.npmjs.org/"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@typegoose/typegoose": "^13.3.0",
|
|
14
|
+
"bson": "^7.2.0",
|
|
15
|
+
"eventemitter3": "^5.0.4",
|
|
16
|
+
"lodash": "^4.17.23",
|
|
17
|
+
"node-machine-id": "^1.1.12",
|
|
18
|
+
"reflect-metadata": "^0.2.2",
|
|
19
|
+
"socket.io": "^4.8.3",
|
|
20
|
+
"socket.io-client": "^4.8.3",
|
|
21
|
+
"string-similarity-js": "^2.1.4"
|
|
22
|
+
}
|
|
23
|
+
}
|
package/server.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * as AutoUpdatedServerObjectClass from "./AutoUpdatedServerObjectClass.js";
|
|
2
|
+
export * as AutoUpdatedClientObjectClass from "./AutoUpdatedClientObjectClass.js";
|
|
3
|
+
export * as AutoUpdateManagerClass from "./AutoUpdateManagerClass.js";
|
|
4
|
+
export * as AutoUpdateServerManagerClass from "./AutoUpdateServerManagerClass.js";
|
|
5
|
+
export * as CommonTypes from "./CommonTypes.js";
|
|
6
|
+
export * as CommonTypes_server from "./CommonTypes_server.js";
|
|
7
|
+
export * as sync from "./sync/index.js";
|
|
8
|
+
export * from "./DEMErrors.js";
|
package/server.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * as AutoUpdatedServerObjectClass from "./AutoUpdatedServerObjectClass.js";
|
|
2
|
+
export * as AutoUpdatedClientObjectClass from "./AutoUpdatedClientObjectClass.js";
|
|
3
|
+
export * as AutoUpdateManagerClass from "./AutoUpdateManagerClass.js";
|
|
4
|
+
export * as AutoUpdateServerManagerClass from "./AutoUpdateServerManagerClass.js";
|
|
5
|
+
export * as CommonTypes from "./CommonTypes.js";
|
|
6
|
+
export * as CommonTypes_server from "./CommonTypes_server.js";
|
|
7
|
+
export * as sync from "./sync/index.js";
|
|
8
|
+
export * from "./DEMErrors.js";
|
|
9
|
+
//# sourceMappingURL=server.js.map
|
package/server.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,4BAA4B,MAAM,mCAAmC,CAAC;AAClF,OAAO,KAAK,4BAA4B,MAAM,mCAAmC,CAAC;AAClF,OAAO,KAAK,sBAAsB,MAAM,6BAA6B,CAAC;AACtE,OAAO,KAAK,4BAA4B,MAAM,mCAAmC,CAAC;AAClF,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAC;AAChD,OAAO,KAAK,kBAAkB,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AACxC,cAAc,gBAAgB,CAAC"}
|
|
@@ -23,6 +23,10 @@ export interface ReconcilableClientManager<T extends IAutoUpdatedClientObjectBas
|
|
|
23
23
|
export declare class ClientStateReconciler {
|
|
24
24
|
/**
|
|
25
25
|
* Restores client manager objects in-memory from a persistent storage adapter.
|
|
26
|
+
*
|
|
27
|
+
* @param manager - Reconcilable client manager instance.
|
|
28
|
+
* @param storageAdapter - Storage adapter implementing IClientStorageAdapter.
|
|
29
|
+
* @returns Object indicating restoration success, stored revision, and restored entity count.
|
|
26
30
|
*/
|
|
27
31
|
static restoreFromStorage<T extends IAutoUpdatedClientObjectBase>(manager: ReconcilableClientManager<T>, storageAdapter: IClientStorageAdapter): Promise<{
|
|
28
32
|
restored: boolean;
|
|
@@ -31,11 +35,27 @@ export declare class ClientStateReconciler {
|
|
|
31
35
|
}>;
|
|
32
36
|
/**
|
|
33
37
|
* Persists current manager in-memory state to storage adapter.
|
|
38
|
+
*
|
|
39
|
+
* @param manager - Reconcilable client manager instance.
|
|
40
|
+
* @param revision - Monotonic revision number to record with the snapshot.
|
|
41
|
+
* @param storageAdapter - Storage adapter to receive the persisted state.
|
|
34
42
|
*/
|
|
35
43
|
static persistToStorage<T extends IAutoUpdatedClientObjectBase>(manager: ReconcilableClientManager<T>, revision: number, storageAdapter: IClientStorageAdapter): Promise<void>;
|
|
36
44
|
/**
|
|
37
45
|
* Applies a delta changes payload to the in-memory client manager.
|
|
46
|
+
* Handles creates, updates, and deletes with callback dispatch and local state persistence.
|
|
47
|
+
*
|
|
48
|
+
* @param manager - Reconcilable client manager instance.
|
|
49
|
+
* @param payload - Delta sync payload containing status, revision, and changes array.
|
|
50
|
+
* @param storageAdapter - Optional storage adapter to persist reconciled state.
|
|
38
51
|
*/
|
|
39
52
|
static applyDelta<T extends IAutoUpdatedClientObjectBase>(manager: ReconcilableClientManager<T>, payload: DeltaSyncPayload<any>, storageAdapter?: IClientStorageAdapter): Promise<void>;
|
|
53
|
+
/**
|
|
54
|
+
* Patches changed fields onto an existing client object instance and triggers update callback.
|
|
55
|
+
*
|
|
56
|
+
* @param targetObj - Target client object to patch.
|
|
57
|
+
* @param patchData - Key-value map of properties to apply.
|
|
58
|
+
* @param callbacks - Optional manager callbacks interface.
|
|
59
|
+
*/
|
|
40
60
|
private static patchObjectProperties;
|
|
41
61
|
}
|
|
@@ -2,6 +2,10 @@ import { globalCache } from "../CommonTypes.js";
|
|
|
2
2
|
export class ClientStateReconciler {
|
|
3
3
|
/**
|
|
4
4
|
* Restores client manager objects in-memory from a persistent storage adapter.
|
|
5
|
+
*
|
|
6
|
+
* @param manager - Reconcilable client manager instance.
|
|
7
|
+
* @param storageAdapter - Storage adapter implementing IClientStorageAdapter.
|
|
8
|
+
* @returns Object indicating restoration success, stored revision, and restored entity count.
|
|
5
9
|
*/
|
|
6
10
|
static async restoreFromStorage(manager, storageAdapter) {
|
|
7
11
|
try {
|
|
@@ -50,6 +54,10 @@ export class ClientStateReconciler {
|
|
|
50
54
|
}
|
|
51
55
|
/**
|
|
52
56
|
* Persists current manager in-memory state to storage adapter.
|
|
57
|
+
*
|
|
58
|
+
* @param manager - Reconcilable client manager instance.
|
|
59
|
+
* @param revision - Monotonic revision number to record with the snapshot.
|
|
60
|
+
* @param storageAdapter - Storage adapter to receive the persisted state.
|
|
53
61
|
*/
|
|
54
62
|
static async persistToStorage(manager, revision, storageAdapter) {
|
|
55
63
|
try {
|
|
@@ -77,6 +85,11 @@ export class ClientStateReconciler {
|
|
|
77
85
|
}
|
|
78
86
|
/**
|
|
79
87
|
* Applies a delta changes payload to the in-memory client manager.
|
|
88
|
+
* Handles creates, updates, and deletes with callback dispatch and local state persistence.
|
|
89
|
+
*
|
|
90
|
+
* @param manager - Reconcilable client manager instance.
|
|
91
|
+
* @param payload - Delta sync payload containing status, revision, and changes array.
|
|
92
|
+
* @param storageAdapter - Optional storage adapter to persist reconciled state.
|
|
80
93
|
*/
|
|
81
94
|
static async applyDelta(manager, payload, storageAdapter) {
|
|
82
95
|
const changes = payload.changes ?? [];
|
|
@@ -141,6 +154,13 @@ export class ClientStateReconciler {
|
|
|
141
154
|
await this.persistToStorage(manager, payload.revision, storageAdapter);
|
|
142
155
|
}
|
|
143
156
|
}
|
|
157
|
+
/**
|
|
158
|
+
* Patches changed fields onto an existing client object instance and triggers update callback.
|
|
159
|
+
*
|
|
160
|
+
* @param targetObj - Target client object to patch.
|
|
161
|
+
* @param patchData - Key-value map of properties to apply.
|
|
162
|
+
* @param callbacks - Optional manager callbacks interface.
|
|
163
|
+
*/
|
|
144
164
|
static async patchObjectProperties(targetObj, patchData, callbacks) {
|
|
145
165
|
for (const key of Object.keys(patchData)) {
|
|
146
166
|
if (key === "_id")
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClientStateReconciler.js","sourceRoot":"","sources":["../../sync/ClientStateReconciler.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAgC,MAAM,mBAAmB,CAAC;AAoB9E,MAAM,OAAO,qBAAqB;IAChC;;;;;;OAMG;IACI,MAAM,CAAC,KAAK,CAAC,kBAAkB,CACpC,OAAqC,EACrC,cAAqC;QAErC,IAAI,CAAC;YACH,MAAM,KAAK,GAAG,MAAM,cAAc,CAAC,gBAAgB,CAAM,OAAO,CAAC,SAAS,CAAC,CAAC;YAC5E,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAClE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;YACvE,CAAC;YAED,oDAAoD;YACpD,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;gBAClD,OAAO,WAAW,CAAC,O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ACH,CAAC;QAED,IAAI,cAAc,EAAE,CAAC;YACnB,MAAM,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;QACzE,CAAC;IACH,CAAC;IAED;;;;;;OAMG;IACK,MAAM,CAAC,KAAK,CAAC,qBAAqB,CACxC,SAAc,EACd,SAA8B,EAC9B,SAAe;QAEf,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;YACzC,IAAI,GAAG,KAAK,KAAK;gBAAE,SAAS;YAC5B,MAAM,GAAG,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC;YAC3B,IAAI,SAAS,CAAC,IAAI,EAAE,CAAC;gBACnB,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;YAC5B,CAAC;YACD,IAAI,OAAO,SAAS,CAAC,UAAU,KAAK,UAAU,EAAE,CAAC;gBAC/C,MAAM,SAAS,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;YAC7C,CAAC;iBAAM,CAAC;gBACN,SAAS,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;YACvB,CAAC;YACD,SAAS,EAAE,MAAM,EAAE,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;QACtC,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { ChangeEntry, ChangeLogOptions, ChangeType, PruneMode } from "./types.js";
|
|
2
2
|
/**
|
|
3
3
|
* Calculates a fast approximation of the memory/JSON byte footprint of a JavaScript object/value.
|
|
4
|
+
*
|
|
5
|
+
* @param obj - The value or object to estimate.
|
|
6
|
+
* @returns Estimated size in bytes.
|
|
4
7
|
*/
|
|
5
8
|
export declare function estimateObjectSizeBytes(obj: unknown): number;
|
|
6
9
|
export declare class ServerChangeTracker<T = unknown> {
|
|
@@ -13,27 +16,70 @@ export declare class ServerChangeTracker<T = unknown> {
|
|
|
13
16
|
maxSizeBytes?: number;
|
|
14
17
|
maxEntries?: number;
|
|
15
18
|
pruneMode: PruneMode;
|
|
19
|
+
/**
|
|
20
|
+
* Initializes a new ServerChangeTracker instance.
|
|
21
|
+
*
|
|
22
|
+
* @param className - Managed entity class name.
|
|
23
|
+
* @param options - Pruning options such as maxAgeMs, maxSizeBytes, maxEntries, and pruneMode.
|
|
24
|
+
*/
|
|
16
25
|
constructor(className: string, options?: ChangeLogOptions);
|
|
17
26
|
/**
|
|
18
27
|
* Dynamically updates limits (MB size, TTL age, entries, pruneMode) mid-run and triggers pruning.
|
|
28
|
+
*
|
|
29
|
+
* @param options - Partial set of options to overwrite.
|
|
19
30
|
*/
|
|
20
31
|
updateOptions(options: Partial<ChangeLogOptions>): void;
|
|
32
|
+
/**
|
|
33
|
+
* Retrieves the current monotonic revision number.
|
|
34
|
+
*
|
|
35
|
+
* @returns Latest revision counter.
|
|
36
|
+
*/
|
|
21
37
|
getCurrentRevision(): number;
|
|
38
|
+
/**
|
|
39
|
+
* Retrieves the lowest revision number retained in the mutation log.
|
|
40
|
+
*
|
|
41
|
+
* @returns Oldest retained revision number.
|
|
42
|
+
*/
|
|
22
43
|
getLowestRetainedRevision(): number;
|
|
44
|
+
/**
|
|
45
|
+
* Retrieves the estimated total memory usage of all retained entries in bytes.
|
|
46
|
+
*
|
|
47
|
+
* @returns Total bytes consumed by retained entries.
|
|
48
|
+
*/
|
|
23
49
|
getEstimatedSizeBytes(): number;
|
|
50
|
+
/**
|
|
51
|
+
* Retrieves the total count of currently retained change entries.
|
|
52
|
+
*
|
|
53
|
+
* @returns Number of retained mutation entries.
|
|
54
|
+
*/
|
|
24
55
|
getEntryCount(): number;
|
|
25
56
|
/**
|
|
26
57
|
* Records a mutation and assigns a new monotonic revision number.
|
|
58
|
+
*
|
|
59
|
+
* @param type - Mutation type ('create', 'update', or 'delete').
|
|
60
|
+
* @param id - String identifier of mutated entity.
|
|
61
|
+
* @param data - Optional mutated property payload.
|
|
62
|
+
* @returns Assigned monotonic revision number.
|
|
27
63
|
*/
|
|
28
64
|
recordChange(type: ChangeType, id: string, data?: Partial<T>): number;
|
|
29
65
|
/**
|
|
30
66
|
* Records a mutation with an explicit timestamp (useful for testing or replay).
|
|
67
|
+
*
|
|
68
|
+
* @param type - Mutation type ('create', 'update', or 'delete').
|
|
69
|
+
* @param id - String identifier of mutated entity.
|
|
70
|
+
* @param data - Optional mutated property payload.
|
|
71
|
+
* @param timestamp - Explicit Unix timestamp in milliseconds.
|
|
72
|
+
* @returns Assigned monotonic revision number.
|
|
31
73
|
*/
|
|
32
74
|
recordChangeWithTimestamp(type: ChangeType, id: string, data: Partial<T> | undefined, timestamp: number): number;
|
|
33
75
|
/**
|
|
34
76
|
* Retrieves all mutations occurring strictly after `clientRevision`.
|
|
35
77
|
* If `clientRevision` is older than the lowest retained revision in history,
|
|
36
78
|
* returns `isExpired: true` indicating a full sync is necessary.
|
|
79
|
+
*
|
|
80
|
+
* @param clientRevision - The last revision known by the client.
|
|
81
|
+
* @param allowedIds - Optional Set of allowed IDs for permission filtering.
|
|
82
|
+
* @returns Object containing isExpired flag and array of change entries.
|
|
37
83
|
*/
|
|
38
84
|
getChangesSince(clientRevision: number, allowedIds?: Set<string>): {
|
|
39
85
|
isExpired: boolean;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Calculates a fast approximation of the memory/JSON byte footprint of a JavaScript object/value.
|
|
3
|
+
*
|
|
4
|
+
* @param obj - The value or object to estimate.
|
|
5
|
+
* @returns Estimated size in bytes.
|
|
3
6
|
*/
|
|
4
7
|
export function estimateObjectSizeBytes(obj) {
|
|
5
8
|
if (obj === null || obj === undefined)
|
|
@@ -39,6 +42,12 @@ export class ServerChangeTracker {
|
|
|
39
42
|
maxSizeBytes;
|
|
40
43
|
maxEntries;
|
|
41
44
|
pruneMode;
|
|
45
|
+
/**
|
|
46
|
+
* Initializes a new ServerChangeTracker instance.
|
|
47
|
+
*
|
|
48
|
+
* @param className - Managed entity class name.
|
|
49
|
+
* @param options - Pruning options such as maxAgeMs, maxSizeBytes, maxEntries, and pruneMode.
|
|
50
|
+
*/
|
|
42
51
|
constructor(className, options) {
|
|
43
52
|
this.className = className;
|
|
44
53
|
this.maxAgeMs = options?.maxAgeMs;
|
|
@@ -48,6 +57,8 @@ export class ServerChangeTracker {
|
|
|
48
57
|
}
|
|
49
58
|
/**
|
|
50
59
|
* Dynamically updates limits (MB size, TTL age, entries, pruneMode) mid-run and triggers pruning.
|
|
60
|
+
*
|
|
61
|
+
* @param options - Partial set of options to overwrite.
|
|
51
62
|
*/
|
|
52
63
|
updateOptions(options) {
|
|
53
64
|
if (options.maxAgeMs !== undefined)
|
|
@@ -60,26 +71,57 @@ export class ServerChangeTracker {
|
|
|
60
71
|
this.pruneMode = options.pruneMode;
|
|
61
72
|
this.prune();
|
|
62
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* Retrieves the current monotonic revision number.
|
|
76
|
+
*
|
|
77
|
+
* @returns Latest revision counter.
|
|
78
|
+
*/
|
|
63
79
|
getCurrentRevision() {
|
|
64
80
|
return this.currentRevision;
|
|
65
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* Retrieves the lowest revision number retained in the mutation log.
|
|
84
|
+
*
|
|
85
|
+
* @returns Oldest retained revision number.
|
|
86
|
+
*/
|
|
66
87
|
getLowestRetainedRevision() {
|
|
67
88
|
return this.lowestRetainedRevision;
|
|
68
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* Retrieves the estimated total memory usage of all retained entries in bytes.
|
|
92
|
+
*
|
|
93
|
+
* @returns Total bytes consumed by retained entries.
|
|
94
|
+
*/
|
|
69
95
|
getEstimatedSizeBytes() {
|
|
70
96
|
return this.totalEstimatedBytes;
|
|
71
97
|
}
|
|
98
|
+
/**
|
|
99
|
+
* Retrieves the total count of currently retained change entries.
|
|
100
|
+
*
|
|
101
|
+
* @returns Number of retained mutation entries.
|
|
102
|
+
*/
|
|
72
103
|
getEntryCount() {
|
|
73
104
|
return this.entries.length;
|
|
74
105
|
}
|
|
75
106
|
/**
|
|
76
107
|
* Records a mutation and assigns a new monotonic revision number.
|
|
108
|
+
*
|
|
109
|
+
* @param type - Mutation type ('create', 'update', or 'delete').
|
|
110
|
+
* @param id - String identifier of mutated entity.
|
|
111
|
+
* @param data - Optional mutated property payload.
|
|
112
|
+
* @returns Assigned monotonic revision number.
|
|
77
113
|
*/
|
|
78
114
|
recordChange(type, id, data) {
|
|
79
115
|
return this.recordChangeWithTimestamp(type, id, data, Date.now());
|
|
80
116
|
}
|
|
81
117
|
/**
|
|
82
118
|
* Records a mutation with an explicit timestamp (useful for testing or replay).
|
|
119
|
+
*
|
|
120
|
+
* @param type - Mutation type ('create', 'update', or 'delete').
|
|
121
|
+
* @param id - String identifier of mutated entity.
|
|
122
|
+
* @param data - Optional mutated property payload.
|
|
123
|
+
* @param timestamp - Explicit Unix timestamp in milliseconds.
|
|
124
|
+
* @returns Assigned monotonic revision number.
|
|
83
125
|
*/
|
|
84
126
|
recordChangeWithTimestamp(type, id, data, timestamp) {
|
|
85
127
|
this.currentRevision += 1;
|
|
@@ -104,6 +146,10 @@ export class ServerChangeTracker {
|
|
|
104
146
|
* Retrieves all mutations occurring strictly after `clientRevision`.
|
|
105
147
|
* If `clientRevision` is older than the lowest retained revision in history,
|
|
106
148
|
* returns `isExpired: true` indicating a full sync is necessary.
|
|
149
|
+
*
|
|
150
|
+
* @param clientRevision - The last revision known by the client.
|
|
151
|
+
* @param allowedIds - Optional Set of allowed IDs for permission filtering.
|
|
152
|
+
* @returns Object containing isExpired flag and array of change entries.
|
|
107
153
|
*/
|
|
108
154
|
getChangesSince(clientRevision, allowedIds) {
|
|
109
155
|
if (clientRevision >= this.currentRevision) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ServerChangeTracker.js","sourceRoot":"","sources":["../../sync/ServerChangeTracker.ts"],"names":[],"mappings":"AAOA;;;;;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@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { StoredManagerState } from "../types.js";
|
|
2
|
+
import { IClientStorageAdapter } from "./IClientStorageAdapter.js";
|
|
3
|
+
export interface IndexedDbStorageAdapterOptions {
|
|
4
|
+
dbName?: string;
|
|
5
|
+
storeName?: string;
|
|
6
|
+
idbFactory?: IDBFactory;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* IndexedDB storage adapter for client-side DEM caching in browsers.
|
|
10
|
+
*/
|
|
11
|
+
export declare class IndexedDbStorageAdapter implements IClientStorageAdapter {
|
|
12
|
+
private dbName;
|
|
13
|
+
private storeName;
|
|
14
|
+
private idbFactory;
|
|
15
|
+
private dbPromise;
|
|
16
|
+
/**
|
|
17
|
+
* Initializes an IndexedDbStorageAdapter instance.
|
|
18
|
+
*
|
|
19
|
+
* @param options - Configuration options for database name, store name, and IDBFactory.
|
|
20
|
+
*/
|
|
21
|
+
constructor(options?: IndexedDbStorageAdapterOptions);
|
|
22
|
+
/**
|
|
23
|
+
* Retrieves or initializes the underlying IDBDatabase connection.
|
|
24
|
+
*
|
|
25
|
+
* @returns A promise resolving to the IDBDatabase instance.
|
|
26
|
+
* @throws {DEMError} Throws DEMErrorCode.STORAGE_NOT_SUPPORTED when IndexedDB is unavailable.
|
|
27
|
+
*/
|
|
28
|
+
private getDb;
|
|
29
|
+
/**
|
|
30
|
+
* Persists manager state record to IndexedDB object store.
|
|
31
|
+
*
|
|
32
|
+
* @param className - The name identifier of the manager class.
|
|
33
|
+
* @param state - Complete snapshot of the manager state.
|
|
34
|
+
*/
|
|
35
|
+
saveManagerState<T = unknown>(className: string, state: StoredManagerState<T>): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* Retrieves stored manager state from IndexedDB store.
|
|
38
|
+
*
|
|
39
|
+
* @param className - The name identifier of the manager class.
|
|
40
|
+
* @returns Parsed state object or null if absent.
|
|
41
|
+
*/
|
|
42
|
+
loadManagerState<T = unknown>(className: string): Promise<StoredManagerState<T> | null>;
|
|
43
|
+
/**
|
|
44
|
+
* Removes saved manager state for given class name from IndexedDB.
|
|
45
|
+
*
|
|
46
|
+
* @param className - The name identifier of the manager class.
|
|
47
|
+
*/
|
|
48
|
+
clearManagerState(className: string): Promise<void>;
|
|
49
|
+
/**
|
|
50
|
+
* Purges all stored records in the IndexedDB object store.
|
|
51
|
+
*/
|
|
52
|
+
clearAll(): Promise<void>;
|
|
53
|
+
}
|