tsdf 17.0.2 → 17.0.4
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/async-storage.d.ts +1 -1
- package/dist/{asyncStorageAdapter-DuAUANgu.d.ts → asyncStorageAdapter-CMohMeKm.d.ts} +1 -1
- package/dist/indexed-db-storage.d.ts +1 -1
- package/dist/main.d.ts +28 -32
- package/dist/main.js +46 -46
- package/dist/opfs-storage.d.ts +1 -1
- package/dist/{opfsPersistentStorage-BB0qqnRz.d.ts → opfsPersistentStorage-Ci0JcCo5.d.ts} +1 -1
- package/dist/src/async-storage.d.ts +1 -0
- package/dist/src/cacheLimits/lruCacheRuntime.d.ts +9 -0
- package/dist/src/cacheLimits/scheduleIdleThrottled.d.ts +1 -0
- package/dist/src/cacheLimits/useRegisterActiveKeys.d.ts +1 -0
- package/dist/src/collectionStore/collectionCacheLimits.d.ts +1 -0
- package/dist/src/collectionStore/collectionStore.d.ts +385 -0
- package/dist/src/collectionStore/executeBatchFetch.d.ts +6 -0
- package/dist/src/collectionStore/useItem.d.ts +15 -0
- package/dist/src/collectionStore/useMultipleItems.d.ts +35 -0
- package/dist/src/debug.d.ts +30 -0
- package/dist/src/documentStore.d.ts +290 -0
- package/dist/src/hooks/useListItem.d.ts +22 -0
- package/dist/src/hooks/useListItemIsDeleted.d.ts +13 -0
- package/dist/src/hooks/useListItemIsLoading.d.ts +16 -0
- package/dist/src/indexed-db-storage.d.ts +1 -0
- package/dist/src/internal/offlineTestInstrumentation.d.ts +12 -0
- package/dist/src/internal/testTimelineTypes.d.ts +1 -0
- package/dist/src/invalidationUtils.d.ts +8 -0
- package/dist/src/isOffScreenContext.d.ts +16 -0
- package/dist/src/listQueryStore/createFetchApi.d.ts +1 -0
- package/dist/src/listQueryStore/createMutationApi.d.ts +1 -0
- package/dist/src/listQueryStore/executeItemBatchFetch.d.ts +20 -0
- package/dist/src/listQueryStore/executeQueryFetch.d.ts +7 -0
- package/dist/src/listQueryStore/itemFieldUtils.d.ts +77 -0
- package/dist/src/listQueryStore/listQueryCacheLimits.d.ts +1 -0
- package/dist/src/listQueryStore/listQueryStore.d.ts +538 -0
- package/dist/src/listQueryStore/types.d.ts +347 -0
- package/dist/src/listQueryStore/useFindItem.d.ts +7 -0
- package/dist/src/listQueryStore/useItem.d.ts +29 -0
- package/dist/src/listQueryStore/useListQuery.d.ts +29 -0
- package/dist/src/listQueryStore/useMultipleItems.d.ts +44 -0
- package/dist/src/listQueryStore/useMultipleListQueries.d.ts +46 -0
- package/dist/src/listQueryStore/usePendingOfflineItems.d.ts +19 -0
- package/dist/src/main.d.ts +23 -0
- package/dist/src/opfs-storage.d.ts +1 -0
- package/dist/src/persistentStorage/asyncStorageAdapter.d.ts +95 -0
- package/dist/src/persistentStorage/asyncStorageAdapters.d.ts +2 -0
- package/dist/src/persistentStorage/asyncStorageShared.d.ts +23 -0
- package/dist/src/persistentStorage/collectionStorePersistence.d.ts +26 -0
- package/dist/src/persistentStorage/compactListQueryLocalStorageEntry.d.ts +11 -0
- package/dist/src/persistentStorage/compactLocalStorageEntry.d.ts +8 -0
- package/dist/src/persistentStorage/documentEntryKey.d.ts +1 -0
- package/dist/src/persistentStorage/documentStorePersistence.d.ts +17 -0
- package/dist/src/persistentStorage/indexedDbAsyncStorageAdapter.d.ts +165 -0
- package/dist/src/persistentStorage/indexedDbPersistentStorage.d.ts +6 -0
- package/dist/src/persistentStorage/listQueryStorePersistence.d.ts +37 -0
- package/dist/src/persistentStorage/localStorageMetadata.d.ts +126 -0
- package/dist/src/persistentStorage/navigatorLocks.d.ts +3 -0
- package/dist/src/persistentStorage/offline/entityMetadata.d.ts +12 -0
- package/dist/src/persistentStorage/offline/fetchRuntime.d.ts +35 -0
- package/dist/src/persistentStorage/offline/mutationRuntime.d.ts +31 -0
- package/dist/src/persistentStorage/offline/offlineResolution.typeGuards.d.ts +1 -0
- package/dist/src/persistentStorage/offline/overlayStoreLifecycle.d.ts +13 -0
- package/dist/src/persistentStorage/offline/sessionCoordinator.d.ts +94 -0
- package/dist/src/persistentStorage/offline/sessionProtectionRegistry.d.ts +11 -0
- package/dist/src/persistentStorage/offline/storeController.d.ts +86 -0
- package/dist/src/persistentStorage/offline/types.d.ts +1255 -0
- package/dist/src/persistentStorage/offlineUploadRegistry.d.ts +11 -0
- package/dist/src/persistentStorage/offlineUploadTypes.d.ts +97 -0
- package/dist/src/persistentStorage/offlineUploadsShared.d.ts +4 -0
- package/dist/src/persistentStorage/opfsAsyncStorageAdapter.d.ts +24 -0
- package/dist/src/persistentStorage/opfsFileNaming.d.ts +23 -0
- package/dist/src/persistentStorage/opfsHelpers.d.ts +3 -0
- package/dist/src/persistentStorage/opfsOfflineUploadAdapter.d.ts +2 -0
- package/dist/src/persistentStorage/opfsPersistentStorage.d.ts +2 -0
- package/dist/src/persistentStorage/parsePersistedData.d.ts +45 -0
- package/dist/src/persistentStorage/persistenceUtils.d.ts +52 -0
- package/dist/src/persistentStorage/persistentStorageDefaults.d.ts +4 -0
- package/dist/src/persistentStorage/persistentStorageManager.d.ts +197 -0
- package/dist/src/persistentStorage/quotaDebug.d.ts +16 -0
- package/dist/src/persistentStorage/scheduleIdleCleanup.d.ts +28 -0
- package/dist/src/persistentStorage/storageAdapter.d.ts +41 -0
- package/dist/src/persistentStorage/storageEntryPrefixes.d.ts +16 -0
- package/dist/src/persistentStorage/types.d.ts +412 -0
- package/dist/src/persistentStorage/validateWithSchema.d.ts +12 -0
- package/dist/src/requestScheduler.d.ts +81 -0
- package/dist/src/storeManager.d.ts +160 -0
- package/dist/src/utils/automaticFetchPolicy.d.ts +29 -0
- package/dist/src/utils/browserTabsPriority.d.ts +43 -0
- package/dist/src/utils/browserTabsSync.d.ts +33 -0
- package/dist/src/utils/optimisticMutationTracker.d.ts +20 -0
- package/dist/src/utils/optimisticRollback.d.ts +11 -0
- package/dist/src/utils/payloadDebounce.d.ts +5 -0
- package/dist/src/utils/performMutation.d.ts +19 -0
- package/dist/src/utils/reusePrevIfEqual.d.ts +1 -0
- package/dist/src/utils/storeFocusLifecycle.d.ts +1 -0
- package/dist/src/utils/storeShared.d.ts +126 -0
- package/dist/src/utils/useEnsureIsLoaded.d.ts +6 -0
- package/dist/src/utils/useRequireFreshData.d.ts +6 -0
- package/dist/tests/basic-functionality/collection-store.test.d.ts +1 -0
- package/dist/tests/basic-functionality/document-store.test.d.ts +1 -0
- package/dist/tests/basic-functionality/list-query-state-manipulation.test.d.ts +1 -0
- package/dist/tests/basic-functionality/list-query-store.test.d.ts +1 -0
- package/dist/tests/browser-tabs/browser-tabs-background-rtu-batch.test.d.ts +1 -0
- package/dist/tests/browser-tabs/browser-tabs-background-rtu.test.d.ts +1 -0
- package/dist/tests/browser-tabs/browser-tabs-background-scheduling.test.d.ts +1 -0
- package/dist/tests/browser-tabs/browser-tabs-list-query-pagination.test.d.ts +1 -0
- package/dist/tests/browser-tabs/browser-tabs-non-cancelable-fetches.test.d.ts +1 -0
- package/dist/tests/browser-tabs/browser-tabs-optimistic-sync.test.d.ts +1 -0
- package/dist/tests/browser-tabs/browser-tabs-partial-resources.test.d.ts +1 -0
- package/dist/tests/browser-tabs/browser-tabs-priority.test.d.ts +1 -0
- package/dist/tests/browser-tabs/browser-tabs-snapshot-consistency.test.d.ts +1 -0
- package/dist/tests/browser-tabs/browser-tabs-state-methods.test.d.ts +1 -0
- package/dist/tests/browser-tabs/browser-tabs-sync-coordinator.test.d.ts +1 -0
- package/dist/tests/browser-tabs/browser-tabs-test-helpers.d.ts +69 -0
- package/dist/tests/browser-tabs/focus-coordinator.test.d.ts +1 -0
- package/dist/tests/hooks/collection-hooks-2.test.d.ts +1 -0
- package/dist/tests/hooks/collection-hooks.test.d.ts +1 -0
- package/dist/tests/hooks/collection-useListItem.test.d.ts +1 -0
- package/dist/tests/hooks/debounce-payload-hooks.test.d.ts +1 -0
- package/dist/tests/hooks/disable-refetches.test.d.ts +1 -0
- package/dist/tests/hooks/document-hooks-2.test.d.ts +1 -0
- package/dist/tests/hooks/document-hooks.test.d.ts +1 -0
- package/dist/tests/hooks/document-useListItem.test.d.ts +1 -0
- package/dist/tests/hooks/fetch-error-recovery.test.d.ts +1 -0
- package/dist/tests/hooks/hook-memoization.test.d.ts +1 -0
- package/dist/tests/hooks/list-query-hooks-2.test.d.ts +1 -0
- package/dist/tests/hooks/list-query-hooks-3.test.d.ts +1 -0
- package/dist/tests/hooks/list-query-hooks-mutations.test.d.ts +1 -0
- package/dist/tests/hooks/list-query-hooks.test.d.ts +1 -0
- package/dist/tests/hooks/list-query-pending-offline-items.test.d.ts +1 -0
- package/dist/tests/hooks/off-screen-context.test.d.ts +1 -0
- package/dist/tests/list-query-features/list-query-derived-queries.test.d.ts +1 -0
- package/dist/tests/list-query-features/list-query-offset-pagination.test.d.ts +1 -0
- package/dist/tests/list-query-features/list-query-optimistic-filters.test.d.ts +1 -0
- package/dist/tests/list-query-features/list-query-partial-resources-2.test.d.ts +1 -0
- package/dist/tests/list-query-features/list-query-partial-resources-3.test.d.ts +1 -0
- package/dist/tests/list-query-features/list-query-partial-resources-regressions.test.d.ts +1 -0
- package/dist/tests/list-query-features/list-query-partial-resources-show-partial-status.test.d.ts +1 -0
- package/dist/tests/list-query-features/list-query-partial-resources.test.d.ts +1 -0
- package/dist/tests/list-query-features/list-query-size-coalescing-partial-resources.test.d.ts +1 -0
- package/dist/tests/mocks/browserTabsTestUtils.d.ts +17 -0
- package/dist/tests/mocks/collectionStoreTestEnv.d.ts +265 -0
- package/dist/tests/mocks/documentStoreTestEnv.d.ts +140 -0
- package/dist/tests/mocks/duplicateStoreGuard.test.d.ts +1 -0
- package/dist/tests/mocks/listQueryStoreTestEnv.d.ts +295 -0
- package/dist/tests/mocks/mockBrowserOpfs.d.ts +70 -0
- package/dist/tests/mocks/mockBrowserOpfs.test.d.ts +1 -0
- package/dist/tests/mocks/mockLocalStorageStore.d.ts +61 -0
- package/dist/tests/mocks/seedScenarioPersistentStorage.d.ts +51 -0
- package/dist/tests/mocks/serverMock.d.ts +56 -0
- package/dist/tests/mocks/serverTableMock.d.ts +174 -0
- package/dist/tests/mocks/testEnvUtils.d.ts +120 -0
- package/dist/tests/mocks/testScenarioPersistentStorage.test.d.ts +1 -0
- package/dist/tests/offline/offline-fetching-scenarios.test.d.ts +1 -0
- package/dist/tests/offline/offline-mixed-adapter-storage.test.d.ts +1 -0
- package/dist/tests/offline/offline-mutation-fallback.test.d.ts +1 -0
- package/dist/tests/offline/offline-network-recovery.test.d.ts +1 -0
- package/dist/tests/offline/offline-outage.test.d.ts +1 -0
- package/dist/tests/offline/offline-overlays.test.d.ts +1 -0
- package/dist/tests/offline/offline-query-replay.test.d.ts +1 -0
- package/dist/tests/offline/offline-reads.test.d.ts +1 -0
- package/dist/tests/offline/offline-replay-conflicts.test.d.ts +1 -0
- package/dist/tests/offline/offline-replay-queueing.test.d.ts +1 -0
- package/dist/tests/offline/offline-resolution-dependencies.test.d.ts +1 -0
- package/dist/tests/offline/offline-runtime-controls.test.d.ts +1 -0
- package/dist/tests/offline/offline-session-and-global-state.test.d.ts +1 -0
- package/dist/tests/offline/offline-storage.test.d.ts +1 -0
- package/dist/tests/offline/offline-uploads.test.d.ts +1 -0
- package/dist/tests/offline/offlineReplayTestShared.d.ts +292 -0
- package/dist/tests/offline/offlineTestShared.d.ts +156 -0
- package/dist/tests/perform-mutation/mutation-error-rollback.test.d.ts +1 -0
- package/dist/tests/perform-mutation/perform-mutation-block-window-close.test.d.ts +1 -0
- package/dist/tests/perform-mutation/perform-mutation-debounce.test.d.ts +1 -0
- package/dist/tests/perform-mutation/store-events.test.d.ts +1 -0
- package/dist/tests/persistent-storage/async-storage-efficiency/collection.test.d.ts +1 -0
- package/dist/tests/persistent-storage/async-storage-efficiency/document.test.d.ts +1 -0
- package/dist/tests/persistent-storage/async-storage-efficiency/list-query.test.d.ts +1 -0
- package/dist/tests/persistent-storage/async-storage-efficiency/maintenance.test.d.ts +1 -0
- package/dist/tests/persistent-storage/async-storage-efficiency/shared.d.ts +804 -0
- package/dist/tests/persistent-storage/async-storage-shared.test.d.ts +1 -0
- package/dist/tests/persistent-storage/collection-store-persistence.converted.opfs.test.d.ts +1 -0
- package/dist/tests/persistent-storage/collection-store-persistence.converted.test.d.ts +1 -0
- package/dist/tests/persistent-storage/collection-store-persistence.opfs.test.d.ts +1 -0
- package/dist/tests/persistent-storage/collection-store-persistence.test.d.ts +1 -0
- package/dist/tests/persistent-storage/document-store-persistence.converted.opfs.test.d.ts +1 -0
- package/dist/tests/persistent-storage/document-store-persistence.converted.test.d.ts +1 -0
- package/dist/tests/persistent-storage/document-store-persistence.opfs.test.d.ts +1 -0
- package/dist/tests/persistent-storage/document-store-persistence.test.d.ts +1 -0
- package/dist/tests/persistent-storage/expiration-scan.test.d.ts +1 -0
- package/dist/tests/persistent-storage/indexeddb-async-storage-efficiency/collection.test.d.ts +1 -0
- package/dist/tests/persistent-storage/indexeddb-async-storage-efficiency/document.test.d.ts +1 -0
- package/dist/tests/persistent-storage/indexeddb-async-storage-efficiency/list-query.test.d.ts +1 -0
- package/dist/tests/persistent-storage/indexeddb-async-storage-efficiency/maintenance.test.d.ts +1 -0
- package/dist/tests/persistent-storage/indexeddb-async-storage-efficiency/shared.d.ts +780 -0
- package/dist/tests/persistent-storage/indexeddb-storage-adapter.test.d.ts +1 -0
- package/dist/tests/persistent-storage/list-query-store-persistence.converted.opfs.test.d.ts +1 -0
- package/dist/tests/persistent-storage/list-query-store-persistence.converted.test.d.ts +1 -0
- package/dist/tests/persistent-storage/list-query-store-persistence.opfs.test.d.ts +1 -0
- package/dist/tests/persistent-storage/list-query-store-persistence.test.d.ts +1 -0
- package/dist/tests/persistent-storage/persistence-with-tabs-sync.test.d.ts +1 -0
- package/dist/tests/persistent-storage/persistentStorageByteBudgetTestUtils.d.ts +18 -0
- package/dist/tests/persistent-storage/quota-exceeded-recovery-no-locks.test.d.ts +1 -0
- package/dist/tests/persistent-storage/quota-exceeded-recovery.test.d.ts +1 -0
- package/dist/tests/persistent-storage/quotaRecoveryTestUtils.d.ts +228 -0
- package/dist/tests/persistent-storage/storage-adapter.test.d.ts +1 -0
- package/dist/tests/persistent-storage/sync-storage-efficiency/collection.test.d.ts +1 -0
- package/dist/tests/persistent-storage/sync-storage-efficiency/document.test.d.ts +1 -0
- package/dist/tests/persistent-storage/sync-storage-efficiency/list-query.test.d.ts +1 -0
- package/dist/tests/persistent-storage/sync-storage-efficiency/maintenance.test.d.ts +1 -0
- package/dist/tests/persistent-storage/sync-storage-efficiency/shared.d.ts +784 -0
- package/dist/tests/playwright/browser-tabs.spec.d.ts +1 -0
- package/dist/tests/playwright/persistent-storage.spec.d.ts +1 -0
- package/dist/tests/request-schedulling/batch-medium-priority.test.d.ts +1 -0
- package/dist/tests/request-schedulling/batch-realtime-updates.test.d.ts +1 -0
- package/dist/tests/request-schedulling/collection-batch-coalescing.test.d.ts +1 -0
- package/dist/tests/request-schedulling/collection-batch-key-grouping.test.d.ts +1 -0
- package/dist/tests/request-schedulling/collection-fetch-orchestration.test.d.ts +1 -0
- package/dist/tests/request-schedulling/document-await-fetch.test.d.ts +1 -0
- package/dist/tests/request-schedulling/document-base-coalescing.test.d.ts +1 -0
- package/dist/tests/request-schedulling/document-fetch-orchestration.test.d.ts +1 -0
- package/dist/tests/request-schedulling/document-medium-priority-fetch.test.d.ts +1 -0
- package/dist/tests/request-schedulling/document-realtime-updates.test.d.ts +1 -0
- package/dist/tests/request-schedulling/list-query-item-batch-coalescing.test.d.ts +1 -0
- package/dist/tests/request-schedulling/list-query-item-batch-key-grouping.test.d.ts +1 -0
- package/dist/tests/request-schedulling/list-query-size-coalescing.test.d.ts +1 -0
- package/dist/tests/request-schedulling/medium-vs-realtime.test.d.ts +1 -0
- package/dist/tests/request-schedulling/request-scheduler-cross-tab-sync.test.d.ts +1 -0
- package/dist/tests/request-schedulling/window-focus.test.d.ts +1 -0
- package/dist/tests/store-manager.test.d.ts +1 -0
- package/dist/tests/user-facing-api/collection-offline-usage.test.d.ts +1 -0
- package/dist/tests/user-facing-api/document-offline-usage.test.d.ts +1 -0
- package/dist/tests/user-facing-api/list-query-offline-usage.test.d.ts +1 -0
- package/dist/tests/user-facing-api/result-returning-callbacks.test.d.ts +1 -0
- package/dist/tests/utils/genericTestUtils.d.ts +6 -0
- package/dist/tests/utils/indexedDbPersistentStorageOptimizationTestUtils.d.ts +79 -0
- package/dist/tests/utils/indexedDbPersistentStorageTestStore.d.ts +181 -0
- package/dist/tests/utils/listQueryHooksTestUtils.d.ts +8 -0
- package/dist/tests/utils/networkMock.d.ts +11 -0
- package/dist/tests/utils/opfsPersistentStorageTestStore.d.ts +220 -0
- package/dist/tests/utils/persistentStorageOptimizationTestUtils.d.ts +54 -0
- package/dist/tests/utils/persistentStorageOptimizationTestUtils.test.d.ts +1 -0
- package/dist/tests/utils/persistentStorageTestStore.d.ts +66 -0
- package/dist/tests/utils/resetSessionForTests.d.ts +3 -0
- package/dist/tests/utils/withSuppressedActError.d.ts +4 -0
- package/dist/{types-aWgyZHLj.d.ts → types-D0ttVGmj.d.ts} +1 -1
- package/docs/browser-tabs-sync.md +2 -0
- package/docs/mutations.md +7 -3
- package/docs/persistent-storage.md +2 -0
- package/package.json +6 -3
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { evtmitter } from 'evtmitter';
|
|
2
|
+
import type { StoreError } from '../../src/utils/storeShared';
|
|
3
|
+
export declare const DEFAULT_FETCH_DURATION_MS = 800;
|
|
4
|
+
export type FilterOperator = {
|
|
5
|
+
op: 'eq';
|
|
6
|
+
field: string;
|
|
7
|
+
value: unknown;
|
|
8
|
+
} | {
|
|
9
|
+
op: 'neq';
|
|
10
|
+
field: string;
|
|
11
|
+
value: unknown;
|
|
12
|
+
} | {
|
|
13
|
+
op: 'gt';
|
|
14
|
+
field: string;
|
|
15
|
+
value: number;
|
|
16
|
+
} | {
|
|
17
|
+
op: 'gte';
|
|
18
|
+
field: string;
|
|
19
|
+
value: number;
|
|
20
|
+
} | {
|
|
21
|
+
op: 'lt';
|
|
22
|
+
field: string;
|
|
23
|
+
value: number;
|
|
24
|
+
} | {
|
|
25
|
+
op: 'lte';
|
|
26
|
+
field: string;
|
|
27
|
+
value: number;
|
|
28
|
+
} | {
|
|
29
|
+
op: 'range';
|
|
30
|
+
field: string;
|
|
31
|
+
min: number;
|
|
32
|
+
max: number;
|
|
33
|
+
} | {
|
|
34
|
+
op: 'in';
|
|
35
|
+
field: string;
|
|
36
|
+
values: unknown[];
|
|
37
|
+
} | {
|
|
38
|
+
op: 'startsWith';
|
|
39
|
+
field: string;
|
|
40
|
+
value: string;
|
|
41
|
+
};
|
|
42
|
+
type ListQueryOptions = {
|
|
43
|
+
offset?: number;
|
|
44
|
+
limit?: number;
|
|
45
|
+
itemIds?: string[];
|
|
46
|
+
filters?: FilterOperator[];
|
|
47
|
+
tableId?: string;
|
|
48
|
+
fields?: string[];
|
|
49
|
+
batchKey?: string;
|
|
50
|
+
};
|
|
51
|
+
type ListQueryResult<ItemData> = {
|
|
52
|
+
items: Array<{
|
|
53
|
+
itemId: string;
|
|
54
|
+
data: ItemData;
|
|
55
|
+
}>;
|
|
56
|
+
hasMore: boolean;
|
|
57
|
+
};
|
|
58
|
+
type MutationOptions = {
|
|
59
|
+
duration?: number;
|
|
60
|
+
setDataAt?: number;
|
|
61
|
+
triggerRTUEvent?: boolean;
|
|
62
|
+
addServerDataChangeAction?: boolean;
|
|
63
|
+
mutationId?: string | number;
|
|
64
|
+
};
|
|
65
|
+
type FetchErrorConfig = {
|
|
66
|
+
message: string;
|
|
67
|
+
path?: string;
|
|
68
|
+
method?: StoreError['method'];
|
|
69
|
+
code?: number;
|
|
70
|
+
};
|
|
71
|
+
type AddActionFn = (action: string, options?: {
|
|
72
|
+
id?: string | number;
|
|
73
|
+
actionValue?: unknown;
|
|
74
|
+
itemId?: string;
|
|
75
|
+
}) => void;
|
|
76
|
+
type ServerTableEvents<ItemData> = {
|
|
77
|
+
data_changed: {
|
|
78
|
+
itemId: string;
|
|
79
|
+
data: ItemData;
|
|
80
|
+
};
|
|
81
|
+
item_deleted: {
|
|
82
|
+
itemId: string;
|
|
83
|
+
};
|
|
84
|
+
item_added: {
|
|
85
|
+
itemId: string;
|
|
86
|
+
data: ItemData;
|
|
87
|
+
};
|
|
88
|
+
list_changed: undefined;
|
|
89
|
+
};
|
|
90
|
+
export type ServerTableSharedState<ItemData extends Record<string, unknown>> = {
|
|
91
|
+
items: Map<string, ItemData>;
|
|
92
|
+
knownTableIds: Set<string>;
|
|
93
|
+
itemHistory: Map<string, ItemData[]>;
|
|
94
|
+
wsEvents: ReturnType<typeof evtmitter<ServerTableEvents<ItemData>>>;
|
|
95
|
+
};
|
|
96
|
+
export declare function createSharedServerTableState<ItemData extends Record<string, unknown>>(initialItems: Record<string, ItemData>): ServerTableSharedState<ItemData>;
|
|
97
|
+
export declare function createServerTableMock<ItemData extends Record<string, unknown>>(initialItems: Record<string, ItemData>, addAction?: AddActionFn, sharedState?: ServerTableSharedState<ItemData>): {
|
|
98
|
+
fetch: (itemId: string, signal?: AbortSignal | undefined, options?: {
|
|
99
|
+
fields?: string[] | undefined;
|
|
100
|
+
} | undefined) => Promise<ItemData>;
|
|
101
|
+
list: (options?: ListQueryOptions | undefined, signal?: AbortSignal | undefined) => Promise<ListQueryResult<ItemData>>;
|
|
102
|
+
listSync: (options?: ListQueryOptions | undefined) => ListQueryResult<ItemData>;
|
|
103
|
+
get: (itemId: string) => ItemData | undefined;
|
|
104
|
+
getAll: () => Record<string, ItemData>;
|
|
105
|
+
getByPrefix: (prefix: string) => {
|
|
106
|
+
itemId: string;
|
|
107
|
+
data: ItemData;
|
|
108
|
+
}[];
|
|
109
|
+
entries: () => [string, ItemData][];
|
|
110
|
+
delayedSetItem(itemId: string, data: ItemData, options?: {
|
|
111
|
+
durationMs?: number | undefined;
|
|
112
|
+
}): Promise<void>;
|
|
113
|
+
delayedUpdateItem(itemId: string, data: Partial<ItemData>, options?: {
|
|
114
|
+
durationMs?: number | undefined;
|
|
115
|
+
}): Promise<void>;
|
|
116
|
+
delayedRemoveItem(itemId: string, options?: {
|
|
117
|
+
durationMs?: number | undefined;
|
|
118
|
+
}): Promise<void>;
|
|
119
|
+
setItem: (itemId: string, data: ItemData, options?: {
|
|
120
|
+
triggerRTUEvent?: "for_all_items" | boolean | undefined;
|
|
121
|
+
prepend?: boolean | undefined;
|
|
122
|
+
} | undefined) => void;
|
|
123
|
+
removeItem: (itemId: string) => void;
|
|
124
|
+
updateItem: (itemId: string, data: Partial<ItemData>) => void;
|
|
125
|
+
emulateClientMutation: (itemId: string, newData: ItemData, options?: MutationOptions) => Promise<ItemData>;
|
|
126
|
+
addItem: (itemId: string, data: ItemData, options?: MutationOptions) => Promise<void>;
|
|
127
|
+
addItemWithAutoGeneratedKey: (tableId: string, createData: (id: number, itemId: string) => ItemData, options?: MutationOptions) => Promise<{
|
|
128
|
+
id: number;
|
|
129
|
+
itemId: string;
|
|
130
|
+
data: ItemData;
|
|
131
|
+
}>;
|
|
132
|
+
deleteItem: (itemId: string, options?: MutationOptions) => Promise<void>;
|
|
133
|
+
wsEvents: import("evtmitter").Emitter<ServerTableEvents<ItemData>>;
|
|
134
|
+
getItemHistory: (itemId: string) => ItemData[];
|
|
135
|
+
setFetchDurations(itemId: string, ...durations: number[]): void;
|
|
136
|
+
setNextFetchError(itemId: string, error: string | FetchErrorConfig): void;
|
|
137
|
+
addListFetchStartDelay(delayMs: number): void;
|
|
138
|
+
setNextListFetchError(error: string | FetchErrorConfig): void;
|
|
139
|
+
getNextFetchError(itemId: string): FetchErrorConfig | undefined;
|
|
140
|
+
readonly numOfStartedFetches: number;
|
|
141
|
+
readonly numOfFinishedFetches: number;
|
|
142
|
+
fetchHistory: ({
|
|
143
|
+
type: "fetch";
|
|
144
|
+
itemId: string;
|
|
145
|
+
fields: string[] | undefined;
|
|
146
|
+
result: "aborted" | "error" | ItemData;
|
|
147
|
+
startedAt: number;
|
|
148
|
+
duration: number;
|
|
149
|
+
} | {
|
|
150
|
+
type: "list";
|
|
151
|
+
itemIds: string[] | undefined;
|
|
152
|
+
offset: number;
|
|
153
|
+
limit: number | undefined;
|
|
154
|
+
fields: string[] | undefined;
|
|
155
|
+
filters: FilterOperator[] | undefined;
|
|
156
|
+
batchKey: string | undefined;
|
|
157
|
+
startedAt: number;
|
|
158
|
+
duration: number;
|
|
159
|
+
results: "aborted" | {
|
|
160
|
+
itemId: string;
|
|
161
|
+
data: "error" | ItemData;
|
|
162
|
+
}[];
|
|
163
|
+
})[];
|
|
164
|
+
clearFetchHistory(): void;
|
|
165
|
+
getRequestHistory(fetchType?: "all" | "item" | "list", options?: {
|
|
166
|
+
includeTime?: boolean | undefined;
|
|
167
|
+
} | undefined): {
|
|
168
|
+
_type: "item" | "list" | undefined;
|
|
169
|
+
payload: unknown;
|
|
170
|
+
time?: string | undefined;
|
|
171
|
+
returned_items?: number | undefined;
|
|
172
|
+
}[];
|
|
173
|
+
};
|
|
174
|
+
export {};
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import type { TestOfflineTimelineEvent, TestSessionKeyChangedEvent } from '../../src/internal/testTimelineTypes';
|
|
2
|
+
import type { OfflineSessionConfig } from '../../src/persistentStorage/offline/types';
|
|
3
|
+
import type { StorageAdapter } from '../../src/persistentStorage/types';
|
|
4
|
+
import type { ScheduleFetchResults } from '../../src/requestScheduler';
|
|
5
|
+
import type { StoreError } from '../../src/utils/storeShared';
|
|
6
|
+
export declare const TEST_INITIAL_TIME: number;
|
|
7
|
+
/** Sets the global default `lowPriorityThrottleMs` used by all test env creators. */
|
|
8
|
+
export declare function setDefaultLowPriorityThrottleMs(ms: number): void;
|
|
9
|
+
/** Returns the current global default `lowPriorityThrottleMs`. */
|
|
10
|
+
export declare function getDefaultLowPriorityThrottleMs(): number;
|
|
11
|
+
/**
|
|
12
|
+
* Custom error class that carries path and method information for testing
|
|
13
|
+
*/
|
|
14
|
+
export declare class FetchError extends Error {
|
|
15
|
+
path: string;
|
|
16
|
+
method: StoreError['method'];
|
|
17
|
+
code: number;
|
|
18
|
+
constructor(message: string, { path, method, code }: {
|
|
19
|
+
path: string;
|
|
20
|
+
method?: StoreError['method'];
|
|
21
|
+
code?: number;
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Normalizes an error to StoreError format, extracting path/method if available
|
|
26
|
+
*/
|
|
27
|
+
export declare function normalizeError(exception: Error): StoreError;
|
|
28
|
+
type CommentInput = string | {
|
|
29
|
+
comment: string;
|
|
30
|
+
deltaMs?: number;
|
|
31
|
+
};
|
|
32
|
+
type Action = {
|
|
33
|
+
action: string;
|
|
34
|
+
time: number;
|
|
35
|
+
uiValue: unknown;
|
|
36
|
+
actionValue?: unknown;
|
|
37
|
+
id?: string | number;
|
|
38
|
+
itemId?: string;
|
|
39
|
+
/** Batch UI values for multiple items in a single action (e.g. timeline-cleared) */
|
|
40
|
+
itemUiValues?: Record<string, unknown>;
|
|
41
|
+
};
|
|
42
|
+
type ActionReference = Pick<Action, 'id' | 'action'>;
|
|
43
|
+
type ResolutionTimelineItem = {
|
|
44
|
+
id: string;
|
|
45
|
+
operation: string;
|
|
46
|
+
};
|
|
47
|
+
export declare function createOfflineTimelineTestLogger(args: {
|
|
48
|
+
addAction: (action: string) => void;
|
|
49
|
+
getSessionKey: () => string | false;
|
|
50
|
+
}): {
|
|
51
|
+
onSessionKeyChanged(event: TestSessionKeyChangedEvent): void;
|
|
52
|
+
onOfflineTimelineEvent(event: TestOfflineTimelineEvent): void;
|
|
53
|
+
attachResolutionObserver(argsToObserve: {
|
|
54
|
+
getOfflineResolutions: () => ResolutionTimelineItem[];
|
|
55
|
+
adapter: StorageAdapter;
|
|
56
|
+
config: OfflineSessionConfig;
|
|
57
|
+
}): void;
|
|
58
|
+
handleSessionKeyChangedForResolutionObserver(argsToObserve: {
|
|
59
|
+
event: TestSessionKeyChangedEvent;
|
|
60
|
+
getOfflineResolutions: () => ResolutionTimelineItem[];
|
|
61
|
+
adapter: StorageAdapter;
|
|
62
|
+
config: OfflineSessionConfig;
|
|
63
|
+
}): void;
|
|
64
|
+
dispose(): void;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Creates an action tracker for managing test timeline actions
|
|
68
|
+
*/
|
|
69
|
+
export declare function createActionTracker(): {
|
|
70
|
+
actionsHistory: Action[];
|
|
71
|
+
addAction: (action: string, { uiValue, actionValue, time, id, itemId, }?: {
|
|
72
|
+
uiValue?: unknown;
|
|
73
|
+
actionValue?: unknown;
|
|
74
|
+
time?: number | undefined;
|
|
75
|
+
id?: string | number | undefined;
|
|
76
|
+
itemId?: string | undefined;
|
|
77
|
+
}) => void;
|
|
78
|
+
addTimelineComments: (reference: "afterLastAction" | "beforeNextAction" | ActionReference, comments: CommentInput[]) => void;
|
|
79
|
+
getTimelineString: () => string;
|
|
80
|
+
getRelativeTime: () => number;
|
|
81
|
+
clearTimeline: () => void;
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Creates a UI change tracker
|
|
85
|
+
*/
|
|
86
|
+
export declare function createUITracker<T>(addAction: (action: string, options?: {
|
|
87
|
+
uiValue?: unknown;
|
|
88
|
+
time?: number;
|
|
89
|
+
itemId?: string;
|
|
90
|
+
}) => void, getRelativeTime: () => number, actionsHistory: Action[]): {
|
|
91
|
+
uiChanges: T[];
|
|
92
|
+
trackUIChanges: (value: T, itemId?: string | undefined) => void;
|
|
93
|
+
};
|
|
94
|
+
export declare function createPerItemUITracker(addAction: (action: string, options?: {
|
|
95
|
+
uiValue?: unknown;
|
|
96
|
+
time?: number;
|
|
97
|
+
itemId?: string;
|
|
98
|
+
}) => void, getRelativeTime: () => number, actionsHistory: Action[]): {
|
|
99
|
+
uiChanges: Record<string, unknown>[];
|
|
100
|
+
trackItemUI: (itemId: string, value: unknown) => unknown;
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* Creates emoji cyclers for fetches and mutations
|
|
104
|
+
*/
|
|
105
|
+
export declare function createEmojiCyclers(): {
|
|
106
|
+
getFetchEmoji: () => string | undefined;
|
|
107
|
+
getMutationEmoji: () => string | undefined;
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
* Logs schedule fetch result as an action
|
|
111
|
+
*/
|
|
112
|
+
export declare function logScheduleFetchResult(result: ScheduleFetchResults, addAction: (action: string) => void): void;
|
|
113
|
+
/**
|
|
114
|
+
* Logs scheduler events as actions
|
|
115
|
+
*/
|
|
116
|
+
export declare function logSchedulerEvent(event: string, addAction: (action: string) => void, data?: {
|
|
117
|
+
delayMs?: number;
|
|
118
|
+
}): void;
|
|
119
|
+
export declare function formatTimeMs(ms: number): string;
|
|
120
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
import type { CollectionOfflineOperationDefinition, DocumentOfflineOperationDefinition, ListQueryOfflineOperationDefinition } from '../../src/main';
|
|
2
|
+
import type { ListQueryParams } from '../mocks/listQueryStoreTestEnv';
|
|
3
|
+
export type CreateUserOperations = {
|
|
4
|
+
createUser: CollectionOfflineOperationDefinition<{
|
|
5
|
+
value: {
|
|
6
|
+
name: string;
|
|
7
|
+
};
|
|
8
|
+
}, string, {
|
|
9
|
+
name: string;
|
|
10
|
+
}, unknown, {
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
}>;
|
|
14
|
+
};
|
|
15
|
+
export type UpdateValueOperations = {
|
|
16
|
+
updateValue: DocumentOfflineOperationDefinition<{
|
|
17
|
+
value: number;
|
|
18
|
+
}, {
|
|
19
|
+
input: {
|
|
20
|
+
value: number;
|
|
21
|
+
};
|
|
22
|
+
}>;
|
|
23
|
+
};
|
|
24
|
+
export type UpdateValueExecuteContext = Parameters<UpdateValueOperations['updateValue']['execute']>[0];
|
|
25
|
+
export type UpdateValueConflictOperations = {
|
|
26
|
+
updateValue: DocumentOfflineOperationDefinition<{
|
|
27
|
+
value: number;
|
|
28
|
+
}, {
|
|
29
|
+
input: {
|
|
30
|
+
value: number;
|
|
31
|
+
};
|
|
32
|
+
conflict: {
|
|
33
|
+
reason: string;
|
|
34
|
+
};
|
|
35
|
+
}>;
|
|
36
|
+
};
|
|
37
|
+
export type PatchUserOperations = {
|
|
38
|
+
patchUserName: ListQueryOfflineOperationDefinition<{
|
|
39
|
+
id: number;
|
|
40
|
+
name: string;
|
|
41
|
+
}, ListQueryParams, string, {
|
|
42
|
+
itemId: string;
|
|
43
|
+
name: string;
|
|
44
|
+
}, unknown>;
|
|
45
|
+
};
|
|
46
|
+
export type CreateListQueryUserOperations = {
|
|
47
|
+
createUser: ListQueryOfflineOperationDefinition<{
|
|
48
|
+
id: number;
|
|
49
|
+
name: string;
|
|
50
|
+
}, ListQueryParams, string, {
|
|
51
|
+
name: string;
|
|
52
|
+
}, unknown, {
|
|
53
|
+
id: number;
|
|
54
|
+
name: string;
|
|
55
|
+
}>;
|
|
56
|
+
};
|
|
57
|
+
export declare const userPatchSchema: {
|
|
58
|
+
__rc_type: (t: {
|
|
59
|
+
itemId: string;
|
|
60
|
+
name: string;
|
|
61
|
+
}) => {
|
|
62
|
+
itemId: string;
|
|
63
|
+
name: string;
|
|
64
|
+
};
|
|
65
|
+
readonly withFallback: (fallback: {
|
|
66
|
+
itemId: string;
|
|
67
|
+
name: string;
|
|
68
|
+
} | ((invalidInput: unknown) => {
|
|
69
|
+
itemId: string;
|
|
70
|
+
name: string;
|
|
71
|
+
})) => import("runcheck").RcType<{
|
|
72
|
+
itemId: string;
|
|
73
|
+
name: string;
|
|
74
|
+
}>;
|
|
75
|
+
readonly where: (predicate: (input: {
|
|
76
|
+
itemId: string;
|
|
77
|
+
name: string;
|
|
78
|
+
}) => boolean | {
|
|
79
|
+
error: string;
|
|
80
|
+
}) => import("runcheck").RcType<{
|
|
81
|
+
itemId: string;
|
|
82
|
+
name: string;
|
|
83
|
+
}>;
|
|
84
|
+
readonly optional: () => import("runcheck").RcType<{
|
|
85
|
+
itemId: string;
|
|
86
|
+
name: string;
|
|
87
|
+
} | undefined>;
|
|
88
|
+
readonly optionalKey: () => import("runcheck").RcOptionalKeyType<{
|
|
89
|
+
itemId: string;
|
|
90
|
+
name: string;
|
|
91
|
+
} | undefined>;
|
|
92
|
+
readonly orNull: () => import("runcheck").RcType<{
|
|
93
|
+
itemId: string;
|
|
94
|
+
name: string;
|
|
95
|
+
} | null>;
|
|
96
|
+
readonly orNullish: () => import("runcheck").RcType<{
|
|
97
|
+
itemId: string;
|
|
98
|
+
name: string;
|
|
99
|
+
} | null | undefined>;
|
|
100
|
+
readonly withAutofix: (customAutofix: (input: unknown) => import("runcheck").AutoFixResult<{
|
|
101
|
+
itemId: string;
|
|
102
|
+
name: string;
|
|
103
|
+
}>) => import("runcheck").RcType<{
|
|
104
|
+
itemId: string;
|
|
105
|
+
name: string;
|
|
106
|
+
}>;
|
|
107
|
+
readonly default: <D extends {
|
|
108
|
+
itemId: string;
|
|
109
|
+
name: string;
|
|
110
|
+
}>(defaultValue: D | (() => D)) => import("runcheck").RcType<{
|
|
111
|
+
itemId: string;
|
|
112
|
+
name: string;
|
|
113
|
+
} | (D extends never[] ? never : D)>;
|
|
114
|
+
readonly nullishDefault: <D extends {
|
|
115
|
+
itemId: string;
|
|
116
|
+
name: string;
|
|
117
|
+
}>(defaultValue: D | (() => D)) => import("runcheck").RcType<{
|
|
118
|
+
itemId: string;
|
|
119
|
+
name: string;
|
|
120
|
+
} | (D extends never[] ? never : D)>;
|
|
121
|
+
readonly or: <O>(schema: import("runcheck").RcType<O>) => import("runcheck").RcType<O | {
|
|
122
|
+
itemId: string;
|
|
123
|
+
name: string;
|
|
124
|
+
}>;
|
|
125
|
+
readonly parse: (input: unknown, options?: {
|
|
126
|
+
noWarnings?: boolean | undefined;
|
|
127
|
+
} | undefined) => import("runcheck").RcParseResult<{
|
|
128
|
+
itemId: string;
|
|
129
|
+
name: string;
|
|
130
|
+
}>;
|
|
131
|
+
readonly parseJson: (jsonString: string, options?: {
|
|
132
|
+
noWarnings?: boolean | undefined;
|
|
133
|
+
} | undefined) => import("runcheck").RcParseResult<{
|
|
134
|
+
itemId: string;
|
|
135
|
+
name: string;
|
|
136
|
+
}>;
|
|
137
|
+
readonly _optional_key_?: false | undefined;
|
|
138
|
+
};
|
|
139
|
+
export declare const deleteItemInputSchema: {
|
|
140
|
+
__rc_type: (t: {
|
|
141
|
+
itemId: string;
|
|
142
|
+
}) => {
|
|
143
|
+
itemId: string;
|
|
144
|
+
};
|
|
145
|
+
readonly withFallback: (fallback: {
|
|
146
|
+
itemId: string;
|
|
147
|
+
} | ((invalidInput: unknown) => {
|
|
148
|
+
itemId: string;
|
|
149
|
+
})) => import("runcheck").RcType<{
|
|
150
|
+
itemId: string;
|
|
151
|
+
}>;
|
|
152
|
+
readonly where: (predicate: (input: {
|
|
153
|
+
itemId: string;
|
|
154
|
+
}) => boolean | {
|
|
155
|
+
error: string;
|
|
156
|
+
}) => import("runcheck").RcType<{
|
|
157
|
+
itemId: string;
|
|
158
|
+
}>;
|
|
159
|
+
readonly optional: () => import("runcheck").RcType<{
|
|
160
|
+
itemId: string;
|
|
161
|
+
} | undefined>;
|
|
162
|
+
readonly optionalKey: () => import("runcheck").RcOptionalKeyType<{
|
|
163
|
+
itemId: string;
|
|
164
|
+
} | undefined>;
|
|
165
|
+
readonly orNull: () => import("runcheck").RcType<{
|
|
166
|
+
itemId: string;
|
|
167
|
+
} | null>;
|
|
168
|
+
readonly orNullish: () => import("runcheck").RcType<{
|
|
169
|
+
itemId: string;
|
|
170
|
+
} | null | undefined>;
|
|
171
|
+
readonly withAutofix: (customAutofix: (input: unknown) => import("runcheck").AutoFixResult<{
|
|
172
|
+
itemId: string;
|
|
173
|
+
}>) => import("runcheck").RcType<{
|
|
174
|
+
itemId: string;
|
|
175
|
+
}>;
|
|
176
|
+
readonly default: <D extends {
|
|
177
|
+
itemId: string;
|
|
178
|
+
}>(defaultValue: D | (() => D)) => import("runcheck").RcType<{
|
|
179
|
+
itemId: string;
|
|
180
|
+
} | (D extends never[] ? never : D)>;
|
|
181
|
+
readonly nullishDefault: <D extends {
|
|
182
|
+
itemId: string;
|
|
183
|
+
}>(defaultValue: D | (() => D)) => import("runcheck").RcType<{
|
|
184
|
+
itemId: string;
|
|
185
|
+
} | (D extends never[] ? never : D)>;
|
|
186
|
+
readonly or: <O>(schema: import("runcheck").RcType<O>) => import("runcheck").RcType<O | {
|
|
187
|
+
itemId: string;
|
|
188
|
+
}>;
|
|
189
|
+
readonly parse: (input: unknown, options?: {
|
|
190
|
+
noWarnings?: boolean | undefined;
|
|
191
|
+
} | undefined) => import("runcheck").RcParseResult<{
|
|
192
|
+
itemId: string;
|
|
193
|
+
}>;
|
|
194
|
+
readonly parseJson: (jsonString: string, options?: {
|
|
195
|
+
noWarnings?: boolean | undefined;
|
|
196
|
+
} | undefined) => import("runcheck").RcParseResult<{
|
|
197
|
+
itemId: string;
|
|
198
|
+
}>;
|
|
199
|
+
readonly _optional_key_?: false | undefined;
|
|
200
|
+
};
|
|
201
|
+
export declare const userRowSchema: {
|
|
202
|
+
__rc_type: (t: {
|
|
203
|
+
id: number;
|
|
204
|
+
name: string;
|
|
205
|
+
}) => {
|
|
206
|
+
id: number;
|
|
207
|
+
name: string;
|
|
208
|
+
};
|
|
209
|
+
readonly withFallback: (fallback: {
|
|
210
|
+
id: number;
|
|
211
|
+
name: string;
|
|
212
|
+
} | ((invalidInput: unknown) => {
|
|
213
|
+
id: number;
|
|
214
|
+
name: string;
|
|
215
|
+
})) => import("runcheck").RcType<{
|
|
216
|
+
id: number;
|
|
217
|
+
name: string;
|
|
218
|
+
}>;
|
|
219
|
+
readonly where: (predicate: (input: {
|
|
220
|
+
id: number;
|
|
221
|
+
name: string;
|
|
222
|
+
}) => boolean | {
|
|
223
|
+
error: string;
|
|
224
|
+
}) => import("runcheck").RcType<{
|
|
225
|
+
id: number;
|
|
226
|
+
name: string;
|
|
227
|
+
}>;
|
|
228
|
+
readonly optional: () => import("runcheck").RcType<{
|
|
229
|
+
id: number;
|
|
230
|
+
name: string;
|
|
231
|
+
} | undefined>;
|
|
232
|
+
readonly optionalKey: () => import("runcheck").RcOptionalKeyType<{
|
|
233
|
+
id: number;
|
|
234
|
+
name: string;
|
|
235
|
+
} | undefined>;
|
|
236
|
+
readonly orNull: () => import("runcheck").RcType<{
|
|
237
|
+
id: number;
|
|
238
|
+
name: string;
|
|
239
|
+
} | null>;
|
|
240
|
+
readonly orNullish: () => import("runcheck").RcType<{
|
|
241
|
+
id: number;
|
|
242
|
+
name: string;
|
|
243
|
+
} | null | undefined>;
|
|
244
|
+
readonly withAutofix: (customAutofix: (input: unknown) => import("runcheck").AutoFixResult<{
|
|
245
|
+
id: number;
|
|
246
|
+
name: string;
|
|
247
|
+
}>) => import("runcheck").RcType<{
|
|
248
|
+
id: number;
|
|
249
|
+
name: string;
|
|
250
|
+
}>;
|
|
251
|
+
readonly default: <D extends {
|
|
252
|
+
id: number;
|
|
253
|
+
name: string;
|
|
254
|
+
}>(defaultValue: D | (() => D)) => import("runcheck").RcType<{
|
|
255
|
+
id: number;
|
|
256
|
+
name: string;
|
|
257
|
+
} | (D extends never[] ? never : D)>;
|
|
258
|
+
readonly nullishDefault: <D extends {
|
|
259
|
+
id: number;
|
|
260
|
+
name: string;
|
|
261
|
+
}>(defaultValue: D | (() => D)) => import("runcheck").RcType<{
|
|
262
|
+
id: number;
|
|
263
|
+
name: string;
|
|
264
|
+
} | (D extends never[] ? never : D)>;
|
|
265
|
+
readonly or: <O>(schema: import("runcheck").RcType<O>) => import("runcheck").RcType<O | {
|
|
266
|
+
id: number;
|
|
267
|
+
name: string;
|
|
268
|
+
}>;
|
|
269
|
+
readonly parse: (input: unknown, options?: {
|
|
270
|
+
noWarnings?: boolean | undefined;
|
|
271
|
+
} | undefined) => import("runcheck").RcParseResult<{
|
|
272
|
+
id: number;
|
|
273
|
+
name: string;
|
|
274
|
+
}>;
|
|
275
|
+
readonly parseJson: (jsonString: string, options?: {
|
|
276
|
+
noWarnings?: boolean | undefined;
|
|
277
|
+
} | undefined) => import("runcheck").RcParseResult<{
|
|
278
|
+
id: number;
|
|
279
|
+
name: string;
|
|
280
|
+
}>;
|
|
281
|
+
readonly _optional_key_?: false | undefined;
|
|
282
|
+
};
|
|
283
|
+
export declare function getLocalStorageKeys(): string[];
|
|
284
|
+
export declare function getOfflineQueueEntries(sessionKey: string, storeName: string): Array<Record<string, unknown>>;
|
|
285
|
+
export declare function getOfflineQueueEntryData(entry: Record<string, unknown>): Record<string, unknown>;
|
|
286
|
+
/**
|
|
287
|
+
* Returns the persisted offline queue entries sorted by queue order, with only
|
|
288
|
+
* the specified fields from the entry data. Removes `queueOrder` from the
|
|
289
|
+
* output since it's only used for sorting.
|
|
290
|
+
*/
|
|
291
|
+
export declare function getSortedQueueSummary(sessionKey: string, storeName: string, fields?: string[]): Array<Record<string, unknown>>;
|
|
292
|
+
export declare function getSortedSessionQueueSummary(sessionKey: string, fields?: string[]): Array<Record<string, unknown>>;
|