Interface: StorageAdapter
Defined in: contract.ts:185
@rasd/storage — the public entry point.
This package owns three things and nothing else: the frozen StorageAdapter
contract, a reference implementation of it, and the suite that proves any
other implementation matches. It deliberately has no dependency on
@rasd/license — that is what makes export() available in every licence
state a property of the module graph rather than a promise (docs/09 §10).
Extended by
Properties
attachments
attachments: BlobStore;
Defined in: contract.ts:193
datasets
datasets: DatasetRepo;
Defined in: contract.ts:194
forms
forms: FormRepo;
Defined in: contract.ts:191
kind
readonly kind: "dexie" | "sqlite" | "memory" | string & object;
Defined in: contract.ts:186
kv
kv: KeyValueStore;
Defined in: contract.ts:196
outbox
outbox: OutboxQueue;
Defined in: contract.ts:195
state
readonly state: "blocked" | "closed" | "opening" | "open";
Defined in: contract.ts:187
submissions
submissions: SubmissionRepo;
Defined in: contract.ts:192
Methods
close()
close(): Promise<void>;
Defined in: contract.ts:189
Returns
Promise<void>
estimate()
estimate(): Promise<RasdStorageEstimate>;
Defined in: contract.ts:199
Returns
Promise<RasdStorageEstimate>
export()
export(): AsyncIterable<ExportChunk>;
Defined in: contract.ts:204
JSONL + blobs. Must work in every licence state, including limited.
Returns
AsyncIterable<ExportChunk>
import()
import(chunks, opts?): Promise<ImportReport>;
Defined in: contract.ts:205
Parameters
| Parameter | Type |
|---|---|
chunks | AsyncIterable<ExportChunk> |
opts? | { overwrite?: boolean; } |
opts.overwrite? | boolean |
Returns
Promise<ImportReport>
on()
on(event, handler): Unsubscribe;
Defined in: contract.ts:201
Parameters
| Parameter | Type |
|---|---|
event | "change" | "blocked" | "quota" | "error" | "migration" |
handler | (e) => void |
Returns
open()
open(opts): Promise<void>;
Defined in: contract.ts:188
Parameters
| Parameter | Type |
|---|---|
opts | OpenOptions |
Returns
Promise<void>
securityReport()
securityReport(): Promise<StorageSecurityReport>;
Defined in: contract.ts:200
Returns
Promise<StorageSecurityReport>
transaction()
transaction<T>(scopes, fn): Promise<T>;
Defined in: contract.ts:198
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
scopes | StorageScope[] |
fn | () => Promise<T> |
Returns
Promise<T>
wipe()
wipe(): Promise<void>;
Defined in: contract.ts:206
Returns
Promise<void>