UNPKG

@skypilot/scraper

Version:
26 lines (25 loc) 1.01 kB
import type { Integer } from '@skypilot/common-types'; import type { DbRecord, DbRecordInput } from 'src/_types'; import type { Dict, Serializable } from 'src/_types/pseudotypes'; interface LowDbOptions { createIfNotFound?: boolean; defaultData?: Dict; deleteExisting?: boolean; } export declare class LowDb { filePath: string; readonly native: any; private readonly adapter; constructor(filePath: string, options?: LowDbOptions); add<R extends { [key: string]: Serializable; }>(collectionPath: string, recordInput: DbRecordInput<R>): Promise<DbRecord<R>>; count(collectionPath: string): Promise<Integer>; get<T = Serializable>(objectPath: string): Promise<T>; initialize(defaultData: Record<string, unknown | unknown[]>): unknown; set(objectPath: string, value: Serializable): Promise<void>; update<R extends { [key: string]: Serializable; }>(collectionPath: string, recordInput: DbRecordInput<R>): Promise<DbRecord<R>>; } export {};