type Identity = T; import { KeyValuePair, ScanStorageArgs, WriteOps } from "../../storage/types"; import { FilterTupleValuePairByPrefix, RemoveTupleValuePairPrefix, TuplePrefix, ValueForTuple } from "../typeHelpers"; import { ScanArgs, TxId, Unsubscribe } from "../types"; /** The low-level API for implementing new storage layers. */ export type TupleStorageApi = { scan: (args?: ScanStorageArgs) => Identity; commit: (writes: WriteOps) => Identity; close: () => Identity; }; /** Wraps TupleStorageApi with reactivity and MVCC */ export type TupleDatabaseApi = { scan: (args?: ScanStorageArgs, txId?: TxId) => Identity; commit: (writes: WriteOps, txId?: TxId) => Identity; cancel: (txId: string) => Identity; subscribe: (args: ScanStorageArgs, callback: Callback) => Identity; close: () => Identity; }; /** Wraps TupleDatabaseApi with types, subspaces, transaction objects, and additional read apis. */ export type TupleDatabaseClientApi = { commit: (writes: WriteOps, txId?: TxId) => Identity; cancel: (txId: string) => Identity; scan: >(args?: ScanArgs, txId?: TxId) => Identity[]>; subscribe: >(args: ScanArgs, callback: Callback>) => Identity; close: () => Identity; get: (tuple: T, txId?: TxId) => Identity | undefined>; exists: (tuple: T, txId?: TxId) => Identity; subspace:

>(prefix: P) => TupleDatabaseClientApi>; /** Arguments to transact() are for internal use only. */ transact: (txId?: TxId, writes?: WriteOps) => TupleRootTransactionApi; }; export type TupleRootTransactionApi = { scan: >(args?: ScanArgs) => Identity[]>; get: (tuple: T) => Identity | undefined>; exists: (tuple: T) => Identity; subspace:

>(prefix: P) => TupleTransactionApi>; set: (tuple: Key, value: ValueForTuple) => TupleRootTransactionApi; remove: (tuple: S["key"]) => TupleRootTransactionApi; write: (writes: WriteOps) => TupleRootTransactionApi; commit: () => Identity; cancel: () => Identity; id: TxId; writes: Required>; }; export type TupleTransactionApi = { scan: >(args?: ScanArgs) => Identity[]>; get: (tuple: T) => Identity | undefined>; exists: (tuple: T) => Identity; subspace:

>(prefix: P) => TupleTransactionApi>; set: (tuple: Key, value: ValueForTuple) => TupleTransactionApi; remove: (tuple: S["key"]) => TupleTransactionApi; write: (writes: WriteOps) => TupleTransactionApi; }; /** Useful for indicating that a function does not commit any writes. */ export type ReadOnlyTupleDatabaseClientApi = { scan: >(args?: ScanArgs, txId?: TxId) => Identity[]>; get: (tuple: T, txId?: TxId) => Identity | undefined>; exists: (tuple: T, txId?: TxId) => Identity; subspace:

>(prefix: P) => ReadOnlyTupleDatabaseClientApi>; }; export type Callback = (writes: WriteOps, txId: TxId) => void | Identity; export {}; //# sourceMappingURL=../../../src/database/sync/types.d.ts.map