UNPKG

timer-db

Version:

A library for cubing timer results storage with CouchDB-based synchronization.

28 lines 1.19 kB
import { RedBlackTreeStructure } from "@collectable/red-black-tree"; import { StoredAttempt } from "../data/Attempt"; import { AttemptUUID, SessionUUID } from "../UUID"; import { Storage } from "./storage"; declare type RedBlackTree = RedBlackTreeStructure<string, StoredAttempt>; export declare class AttemptCache { private storage; private sessionID; private minSize; private midSize; private maxSize; private latestSolves; constructor(storage: Storage, sessionID: SessionUUID, minSize?: number, midSize?: number, maxSize?: number); /******** Functions that don't access `this.latestSolves`. ********/ getLatestFromDB(n: number): Promise<RedBlackTree>; private growToMidSize; private shrinkToMidSize; private maintainSize; /******** Functions that DO access `this.latestSolves`. ********/ debugCurrentSize(): Promise<number>; debugPrint(): Promise<void>; set(storedAttempt: StoredAttempt): Promise<void>; delete(id: AttemptUUID): Promise<void>; kthMostRecent(k: number): Promise<StoredAttempt | null>; nMostRecent(n: number): Promise<StoredAttempt[]>; } export {}; //# sourceMappingURL=AttemptCache.d.ts.map