import type { Tagged } from "type-fest"; import { type ParsedScriptMetadata, type ValidEnvName, type ValidScriptFileName, type ValidScriptFormat } from "./script-name-parsing/index.js"; import { type AbsolutePath, type FileBaseName } from "./utils.js"; /** * Script types that can be created via the `add` command. */ export declare const scriptTypes: readonly ["seed", "migration"]; export type ScriptType = (typeof scriptTypes)[number]; export declare function isParsedSnapshotScript(parsed: ParsedScriptMetadata): boolean; export declare function findScriptsToRun(opts: { sortedScriptSet: SortedScriptFileNames; env: ValidEnvName | undefined; }): SortedScriptFileNames; /** * Load all scripts in the scripts directory; used by subsequent operations. * Will include the snapshot, if any. Will ignore any files that have invalid * names (i.e., that wouldn't be valid for any DatabaseConfig) or use * unsupported formats for the particular DatabaseConfig. */ export declare function loadSortedScripts(scriptsDirectory: string, supportedFormats: readonly ValidScriptFormat[]): Promise; export type SortedScriptFileNames = Tagged; export type SortedScripts = { scriptDirectory: AbsolutePath; scriptNames: SortedScriptFileNames; }; /** * Comparison function for sorting scripts in canonical order. Scripts are * sorted by timestamp first, then by type (migration < seed < snapshot), then * lexicographically for tie-breaking. This ensures snapshots always sort after * the migrations and seeds that the snapshot absorbed, regardless of script * names. */ export declare function compareScriptNames(a: FileBaseName, b: FileBaseName): number; export declare function sortScriptNames(scriptNames: readonly ValidScriptFileName[]): SortedScriptFileNames; export declare function filterSortedScriptNames(scriptNames: SortedScriptFileNames, predicate: (scriptName: FileBaseName) => boolean): SortedScriptFileNames; //# sourceMappingURL=script-utils.d.ts.map