import type { Tagged } from "type-fest"; import type { ParsedScriptMetadata, ValidScriptName } from "./script-name-parsing/index.js"; import type { AbsolutePath, 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; /** * Extracts the basename from a path and returns it as a FileBaseName. * If the input is already a basename (no path separators), it is returned as-is. */ export declare function toFileBaseName(pathOrName: string): FileBaseName; export type SortedScriptNames = Tagged; export type SortedScripts = { scriptDirectory: AbsolutePath; scriptNames: SortedScriptNames; }; /** * Comparison function for sorting scripts in canonical order. * Scripts are sorted lexicographically, which works because script names * are prefixed with timestamps in a sortable format. */ export declare function compareScriptNames(a: FileBaseName, b: FileBaseName): number; export declare function sortScriptNames(scriptNames: readonly ValidScriptName[]): SortedScriptNames; export declare function filterSortedScriptNames(scriptNames: SortedScriptNames, predicate: (scriptName: FileBaseName) => boolean): SortedScriptNames; //# sourceMappingURL=script-generator.d.ts.map