import type Option from './Option'; export declare function removeBrackets(v: string): string; export declare function findAllBrackets(v: string): { required: boolean value: string variadic: boolean }[]; export declare function getMriOptions(options: Option[]): MriOptions; export declare function findLongest(arr: string[]): string; export declare function padRight(str: string, length: number): string; export declare function camelcase(input: string): string; export declare function setDotProp(obj: Record, keys: string[], val: unknown): void; export declare function setByType(obj: Record, transforms: Record): void; export declare function getFileName(input: string): string; export declare function camelcaseOptionName(name: string): string; /** * Type guard for {@link ClappError}. Also matches duck-typed errors from * a duplicated `@stacksjs/clapp` copy (e.g. nested `node_modules`), where * `instanceof` against this module's class would fail. */ export declare function isClappError(err: unknown): err is ClappError; // Thank you to // https://github.com/sindresorhus/is-unicode-supported/blob/main/index.js export declare function isUnicodeSupported(): boolean; /** * Calculate Levenshtein distance between two strings * Used for fuzzy command matching and "did you mean?" suggestions */ export declare function levenshteinDistance(a: string, b: string): number; /** * Find similar commands based on Levenshtein distance * @param input - The command that was not found * @param commands - List of available command names * @param maxDistance - Maximum edit distance to consider (default: 2) * @param maxSuggestions - Maximum number of suggestions to return (default: 3) * @returns Array of suggested command names */ export declare function findSimilarCommands(input: string, commands: string[], maxDistance?: number, maxSuggestions?: number): string[]; // thanks to sisteransi export declare const ESC: string; export declare const CSI: string; export declare const beep: string; export declare const cursor: Cursor; export declare const scroll: Scroll; export declare const erase: Erase; export declare const clear: Clear; declare interface MriOptions { alias: { [k: string]: string[] } boolean: string[] } export declare interface TransformConfig { shouldTransform: boolean transformFunction?: (value: string) => unknown } export declare interface Cursor { to: (x: number, y: number) => string move: (x: number, y: number) => string up: (count?: number) => string down: (count?: number) => string forward: (count?: number) => string backward: (count?: number) => string nextLine: (count?: number) => string prevLine: (count?: number) => string left: string hide: string show: string save: string restore: string } export declare interface Scroll { up: (count?: number) => string down: (count?: number) => string } export declare interface Erase { screen: string up: (count?: number) => string down: (count?: number) => string line: string lineEnd: string lineStart: string lines: (count: number) => string } export declare interface Clear { screen: string } export declare class ClappError extends Error { exitCode: number; isUsageError: boolean; usage?: string; constructor(message: string, usage?: string); format(showStack?: boolean): string; }