import { type CommandRunner } from "./process.js"; export declare const MAX_BRANCH_NAME_LENGTH = 255; export declare const MAX_PATH_LENGTH = 4096; export declare const MAX_LABEL_LENGTH = 120; /** Taken from the pattern above, so the schema advertises exactly what the parser accepts. */ export declare const MIN_WORKSPACE_ID_LENGTH = 2; export declare const MAX_WORKSPACE_ID_LENGTH = 17; declare const branchNameBrand: unique symbol; declare const revisionBrand: unique symbol; declare const commitIdBrand: unique symbol; declare const absolutePathBrand: unique symbol; declare const labelBrand: unique symbol; declare const workspaceIdBrand: unique symbol; /** The branch name `git check-ref-format --branch` printed, so shorthand is already expanded. */ export type ParsedBranchName = string & { readonly [branchNameBrand]: true; }; /** A revision that `git rev-parse --verify` resolved to a commit. */ export type ParsedRevision = string & { readonly [revisionBrand]: true; }; /** A full object id that `git rev-parse` printed. */ type ParsedCommitId = string & { readonly [commitIdBrand]: true; }; export type ParsedAbsolutePath = string & { readonly [absolutePathBrand]: true; }; export type ParsedLabel = string & { readonly [labelBrand]: true; }; export type ParsedWorkspaceId = string & { readonly [workspaceIdBrand]: true; }; /** * Every value that may become a command argument. A plain string is not a member, so unparsed * text cannot reach a spawned command. */ export type ParsedArgumentValue = ParsedAbsolutePath | ParsedBranchName | ParsedLabel | ParsedRevision | ParsedWorkspaceId; /** A revision, together with the commit it pointed at when it was parsed. */ export interface ParsedBase { readonly revision: ParsedRevision; readonly commit: ParsedCommitId; } /** The runtime re-check of what the parsed types already promise, for the gate before a spawn. */ export declare function hasParsedArgumentSyntax(value: unknown): value is string; export declare function parseBranchName(runner: CommandRunner, value: unknown, label: string, cwd: string, signal: AbortSignal | undefined): Promise; /** A base for a new worktree only has to resolve to a commit, so tags and SHAs are allowed. */ export declare function parseBase(runner: CommandRunner, value: unknown, label: string, cwd: string, signal: AbortSignal | undefined): Promise; export declare function parseAbsolutePath(value: unknown, label: string): ParsedAbsolutePath; /** A label is display text, so it only has to stay a single argument on one line. */ export declare function parseLabel(value: unknown, label: string): ParsedLabel; export declare function parseWorkspaceId(value: unknown, label: string): ParsedWorkspaceId; export {}; //# sourceMappingURL=argument.d.ts.map