import type { Database } from './types.js'; export type MaybePromise = T | Promise; /** * Resolves the database available to one request. * * Bindings are deliberately opaque to the API. A Node adapter can ignore them, * while an edge adapter can read a runtime binding (for example, a Hyperdrive * connection) without coupling Hookfish to that runtime. */ export interface DatabaseBinding { getDatabase(bindings: Bindings): MaybePromise; migrate?(bindings: Bindings): MaybePromise; } /** A ready Hookfish database is also accepted for simple and embedded hosts. */ export type DatabaseInput = Database | Promise | DatabaseBinding; export declare function defineDatabase(getDatabase: (bindings: Bindings) => MaybePromise, migrate?: (bindings: Bindings) => MaybePromise): DatabaseBinding; export declare function resolveDatabase(input: DatabaseInput, bindings: Bindings): Promise; export declare function migrateDatabase(input: DatabaseInput, bindings: Bindings): Promise; //# sourceMappingURL=binding.d.ts.map