index.d.ts 1.04 KB
import { IDriver } from "./drivers/IDriver";
export { IDriver } from "./drivers/IDriver";
export { SqliteDriver } from "./drivers/SqliteDriver";
export { MySQLDriver } from "./drivers/MySQLDriver";
export interface IQuickDBOptions {
    filePath?: string;
    table?: string;
    driver?: IDriver;
}
export declare class QuickDB {
    options: IQuickDBOptions;
    tableName: string;
    driver: IDriver;
    constructor(options?: IQuickDBOptions);
    private addSubtract;
    private getArray;
    all(): Promise<{
        id: string;
        value: any;
    }[]>;
    get<T>(key: string): Promise<T | null>;
    set<T>(key: string, value: any): Promise<T>;
    has(key: string): Promise<boolean>;
    delete(key: string): Promise<number>;
    deleteAll(): Promise<number>;
    add(key: string, value: number): Promise<number>;
    sub(key: string, value: number): Promise<number>;
    push<T>(key: string, value: any | any[]): Promise<T[]>;
    pull<T>(key: string, value: any | any[] | ((data: any) => boolean)): Promise<T[]>;
    table(table: string): QuickDB;
}