UNPKG

@darlean/core

Version:

Darlean core functionality for creating applications that define, expose and host actors

29 lines (28 loc) 1.82 kB
import { IPersistable, IPersistence, IPersistenceQueryOptions, IPersistenceQueryResult } from '@darlean/base'; export declare class MemoryPersistence<T> implements IPersistence<T> { protected values: Map<string, Map<string, unknown>>; constructor(); query(_options: IPersistenceQueryOptions): Promise<IPersistenceQueryResult<T>>; persistable(partitionKey: string[] | undefined, sortKey: string[] | undefined, value: T | undefined): IPersistable<T>; load(partitionKey?: string[], sortKey?: string[]): Promise<IPersistable<T>>; loadImpl(partitionKey?: string[], sortKey?: string[]): Promise<[value: T | undefined, version: string | undefined]>; storeImpl(partitionKey: string[] | undefined, sortKey: string[] | undefined, value: T | undefined, _version: string | undefined): Promise<void>; sub(partitionKey?: string[]): IPersistence<T>; clear(): void; } export declare class SubPersistence<T> implements IPersistence<T> { protected superPersistence: IPersistence<T>; protected basePartitionKey: string[]; constructor(superPersistence: IPersistence<T>, basePartitionKey?: string[]); query(options: IPersistenceQueryOptions): Promise<IPersistenceQueryResult<T>>; persistable(partitionKey: string[] | undefined, sortKey: string[] | undefined, value: T | undefined): IPersistable<T>; load(partitionKey?: string[], sortKey?: string[]): Promise<IPersistable<T>>; sub(partitionKey?: string[]): IPersistence<T>; protected deriveKeys(partitionKey: string[] | undefined): { pk: string[]; }; } export declare function idToText(id: string[]): string; export declare function idFromText(text: string): string[]; export declare function idToText2(id: string[]): string; export declare function idFromText2(text: string): string[];