import * as Effect from "effect/Effect"; import * as Client from "./SqlClient.js"; import type { SqlError } from "./SqlError.js"; /** * @category model * @since 1.0.0 */ export interface MigratorOptions { readonly loader: Loader; readonly schemaDirectory?: string; readonly table?: string; } /** * @category model * @since 1.0.0 */ export type Loader = Effect.Effect, MigrationError, R>; /** * @category model * @since 1.0.0 */ export type ResolvedMigration = readonly [ id: number, name: string, load: Effect.Effect ]; /** * @category model * @since 1.0.0 */ export interface Migration { readonly id: number; readonly name: string; readonly createdAt: Date; } declare const MigrationError_base: new = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & { readonly _tag: "MigrationError"; } & Readonly; /** * @category errors * @since 1.0.0 */ export declare class MigrationError extends MigrationError_base<{ readonly _tag: "MigrationError"; readonly cause?: unknown; readonly reason: "bad-state" | "import-error" | "failed" | "duplicates" | "locked"; readonly message: string; }> { } /** * @category constructor * @since 1.0.0 */ export declare const make: ({ dumpSchema }: { dumpSchema?: (path: string, migrationsTable: string) => Effect.Effect; }) => ({ loader, schemaDirectory, table }: MigratorOptions) => Effect.Effect, MigrationError | SqlError, Client.SqlClient | RD | R2>; /** * @since 1.0.0 * @category loaders */ export declare const fromGlob: (migrations: Record Promise>) => Loader; /** * @since 1.0.0 * @category loaders */ export declare const fromBabelGlob: (migrations: Record) => Loader; /** * @since 1.0.0 * @category loaders */ export declare const fromRecord: (migrations: Record>) => Loader; export {}; //# sourceMappingURL=Migrator.d.ts.map