/** * Shared CLI flag parsing utilities. * * Centralizes numeric flag validation to prevent parseInt/parseFloat NaN bugs. */ import type { TaskId } from "@jamesaphoenix/tx/types"; export type Flags = Record; /** * Get a string flag value from parsed flags, checking multiple names. * Returns undefined if no matching flag is found or if the flag is boolean. */ export declare function opt(flags: Flags, ...names: string[]): string | undefined; /** * Check if a boolean flag is set, checking multiple names. */ export declare function flag(flags: Flags, ...names: string[]): boolean; /** * Parse an optional integer flag from CLI flags. * * Returns undefined if the flag is not present. * Exits with an error if the value is not a valid integer. * * @example * const limit = parseIntOpt(flags, "limit", "limit", "n") ?? 10 * const score = parseIntOpt(flags, "score", "score", "s") */ export declare function parseIntOpt(flags: Flags, flagName: string, ...names: string[]): number | undefined; /** * Parse an optional float flag from CLI flags. * * Returns undefined if the flag is not present. * Exits with an error if the value is not a valid number. * * @example * const minScore = parseFloatOpt(flags, "min-score", "min-score") ?? 0.3 */ export declare function parseFloatOpt(flags: Flags, flagName: string, ...names: string[]): number | undefined; /** * Validate a task ID string matches the tx-[a-z0-9]{6,12} format. * * Throws CliExitError if the format is invalid, preventing confusing * "Task not found" errors from reaching the database layer. */ export declare function parseTaskId(id: string): TaskId; //# sourceMappingURL=parse.d.ts.map