export declare class IndexedDB { private readonly database; private db?; constructor(database: string); /** * The createObjectStore function creates an object store in the indexeddb. * * * @param tableNames T[] Create the object store * @param version Determine if the database needs to be upgraded * * @return A boolean flag * */ createObjectStore(tableNames: T[], version?: number): Promise; /** * The getValue function retrieves a value from the indexeddb. * * * @param tableName T Specify the type of data that is being stored in the database * @param id number to get the value from the object store * * @return A promise that resolves to a value * */ getValue(tableName: T, id: number): Promise; /** * The getAllValue function returns all the values in a given table. * * * @param tableName T Specify the table name * * @return All the values in the table * */ getAllValue(tableName: T): Promise; /** * The putValue function is used to add a new value to the indexeddb. * * * @param tableName T Specify the table that we want to get data from * @param value object Pass in the object to be stored * * @return A promise that resolves to the key of the record that was just added * */ putValue(tableName: T, value: object): Promise; /** * The putBulkValue function takes in a table name and an array of objects. * It then creates a transaction with the given table name, and opens up an object store. * For each value in the values array, it puts that value into the object store. * Finally, it returns all the values from that table using getAllValue(). * * @param tableName T Specify the table name * @param values object[] Pass in an array of objects to be added to the database * * @return The result of the getAllValue function * */ putBulkValue(tableName: T, values: object[]): Promise; /** * The deleteValue function deletes a value from the indexeddb. * * * @param tableName T Tell the function what table to use * @param id number Identify the value to be deleted * * @return The id of the deleted value * */ deleteValue(tableName: T, id: number): Promise; }