import Dexie from "dexie"; import type { DexieTableConfig } from "./DexieTableTypes"; import { FieldType } from "./DexieTablePrimaryKeyTypes"; /** * Based on an object representing the schema, * with the key being the table name & the value being * `DexieTableConfig`, this type represents a runtime * `Dexie` db with proxied table accessors * * @see DexieTableConfig */ export declare type DexieDatabase = Dexie & { [Name in keyof Schema]: Schema[Name] extends DexieTableConfig ? Dexie.Table : undefined; } : Field extends keyof T ? T[Field] : never> : never; }; /** * All table names for a database schema */ export declare type DexieDatabaseTableNames = DB[K] extends Dexie.Table ? K : never;