import { type DatabaseIntrospector, type Dialect, type DialectAdapter, type Driver, type Kysely, type QueryCompiler } from 'kysely'; /** * Structural types for the D1 Workers binding. * * Declared locally rather than imported from `@cloudflare/workers-types` so `@taprootcms/core` can be * consumed without that package installed, and so the exact surface we rely on is documented. */ export interface D1PreparedStatement { bind(...values: unknown[]): D1PreparedStatement; all(): Promise>; } export interface D1Result { results: T[]; success: boolean; meta: { changes?: number; last_row_id?: number; rows_read?: number; rows_written?: number; duration?: number; }; } export interface D1DatabaseLike { prepare(sql: string): D1PreparedStatement; batch(statements: D1PreparedStatement[]): Promise[]>; } /** * A Kysely dialect over the Cloudflare D1 Workers binding. * * Written in-tree rather than depending on the community `kysely-d1` package, which was last * published in April 2025 and is unmaintained. Since D1 is the v1 production target, an * unmaintained dependency on the critical path is not a good trade — and the driver is small, * because everything except the driver is Kysely's own SQLite implementation. */ export declare class D1Dialect implements Dialect { #private; constructor(config: { database: D1DatabaseLike; }); createDriver(): Driver; createQueryCompiler(): QueryCompiler; createAdapter(): DialectAdapter; createIntrospector(db: Kysely): DatabaseIntrospector; }