@keepkit/core 0.28.9 → 0.28.11

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.
@@ -1,46 +0,0 @@
1
- import { S as SyncScope, a as StorageAdapter, K as KeepCollectionDefinition, b as KeepCollectionMembership, c as KeepItem, d as SyncQueueAdapter, e as KeepSyncQueueOperation } from './types-GTCMFt5T.js';
2
-
3
- type KeepScope = SyncScope;
4
- /** Return a stable, human-readable namespace for browser storage and queues. */
5
- declare function getKeepScopeKey(scope?: KeepScope): string;
6
- declare function isSameKeepScope(left: KeepScope | undefined, right: KeepScope | undefined): boolean;
7
- /**
8
- * Adds an isolated user/tenant view over any StorageAdapter. Writes preserve
9
- * records belonging to other scopes, which makes account switching safe even
10
- * when applications share one physical localStorage key.
11
- */
12
- declare class ScopedStorageAdapter<TMeta = Record<string, unknown>> implements StorageAdapter<TMeta> {
13
- readonly scope?: KeepScope;
14
- readonly storageKey?: string;
15
- readonly getCollections?: () => Promise<KeepCollectionDefinition[]>;
16
- readonly setCollection?: (collection: KeepCollectionDefinition) => Promise<void>;
17
- readonly removeCollection?: (id: string, scope?: SyncScope) => Promise<void>;
18
- readonly getCollectionMemberships?: () => Promise<KeepCollectionMembership[]>;
19
- readonly setCollectionMembership?: (membership: KeepCollectionMembership) => Promise<void>;
20
- readonly removeCollectionMembership?: (collectionId: string, itemId: string, scope?: SyncScope) => Promise<void>;
21
- private readonly base;
22
- constructor(base: StorageAdapter<TMeta>, scope?: KeepScope);
23
- getAll(): Promise<KeepItem<TMeta>[]>;
24
- set(item: KeepItem<TMeta>): Promise<void>;
25
- setMany(items: KeepItem<TMeta>[]): Promise<void>;
26
- remove(id: string): Promise<void>;
27
- removeMany(ids: string[]): Promise<void>;
28
- clear(): Promise<void>;
29
- merge(items: KeepItem<TMeta>[]): Promise<KeepItem<TMeta>[]>;
30
- subscribe(listener: () => void): () => void;
31
- private removeMembershipsForItems;
32
- private clearMembershipsForScope;
33
- }
34
- declare function createScopedStorageAdapter<TMeta = Record<string, unknown>>(base: StorageAdapter<TMeta>, scope?: KeepScope): ScopedStorageAdapter<TMeta>;
35
- /** Scope a durable synchronization queue so a user switch cannot flush another user's operations. */
36
- declare class ScopedSyncQueueAdapter<TMeta = Record<string, unknown>> implements SyncQueueAdapter<TMeta> {
37
- private readonly base;
38
- private readonly scope?;
39
- constructor(base: SyncQueueAdapter<TMeta>, scope?: KeepScope);
40
- getAll(): Promise<KeepSyncQueueOperation<TMeta>[]>;
41
- setMany(operations: KeepSyncQueueOperation<TMeta>[]): Promise<void>;
42
- remove(operationIds: string[]): Promise<void>;
43
- clear(): Promise<void>;
44
- }
45
-
46
- export { type KeepScope as K, ScopedStorageAdapter as S, ScopedSyncQueueAdapter as a, createScopedStorageAdapter as c, getKeepScopeKey as g, isSameKeepScope as i };