tsbase
    Preparing search index...

    Interface IIndexedDb

    interface IIndexedDb {
        Connected: boolean;
        Name: string;
        Version: number;
        Connect(): Promise<Result<null | IDBDatabase>>;
        Delete(deletions: Record<string, string[]>): Promise<Result<null>>;
        Disconnect(): void;
        Get<T>(storeName: string, query: number): Promise<Result<null | T>>;
        Get<T>(storeName: string, query: string): Promise<Result<null | T>>;
        Get<T>(storeName: string, query: (t: T) => boolean): Promise<Result<T[]>>;
        GetAll<T>(storeName: string): Promise<Result<T[]>>;
        Insert(insertions: Record<string, object[]>): Promise<Result<null>>;
        Update(updates: Record<string, object[]>): Promise<Result<null>>;
    }

    Implemented by

    Index

    Properties

    Connected: boolean
    Name: string

    Name of the database to connect to.

    Version: number

    Version of the database to run. Migrations up to and including this version will be executed on connection.

    Methods

    • Deletes a map (storeName => object[]) of objects from the specified store(s).

      Parameters

      • deletions: Record<string, string[]>

      Returns Promise<Result<null>>

    • Inserts a map (storeName => object[]) of objects into the specified store(s).

      Parameters

      • insertions: Record<string, object[]>

      Returns Promise<Result<null>>