UNPKG

@synet/patterns

Version:

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

14 lines (13 loc) 464 B
import type { Result } from "../../patterns/result"; /** * Interface for a generic indexer */ export interface IIndexer<T> { exists(): Promise<Result<boolean>>; create(entry: T): Promise<Result<void>>; get(idOrAlias: string): Promise<Result<T | null>>; find(keyword: string): Promise<Result<T | null>>; delete(idOrAlias: string): Promise<Result<boolean>>; list(): Promise<Result<T[]>>; rebuild(entries: T[]): Promise<Result<void>>; }