UNPKG

@synet/patterns

Version:

Robust, battle-tested collection of stable patterns used in Synet packages

12 lines (11 loc) 319 B
/** * Asynchronous Storage interface */ export interface IStorage<T> { exists(id: string): Promise<boolean>; create(data: T): Promise<void>; get(id: string): Promise<T | null>; delete(id: string): Promise<boolean>; list(): Promise<T[]>; update?(id: string, data: Partial<T>): Promise<void>; }