/** * CliExecution - parse CLI options and orchestrate username checks. */ import type { UsernameChecker } from './UsernameChecker.js'; import type { CheckProgress, DebugOptions, CheckResult } from './types.js'; import { type OutputFormat, type UsernameReport } from './CliReporting.js'; export interface CliSummary { available: number; taken: number; errors: number; total: number; } export interface CliExecutionOptions { usernames: string[]; sites?: string[]; includeNSFW: boolean; includeExcluded: boolean; availableOnly: boolean; takenOnly: boolean; format: OutputFormat; outputFile?: string; outputDir?: string; stdout: boolean; write: boolean; jsonFile?: string; csvFile?: string; verbose: boolean; debug?: DebugOptions; signal?: AbortSignal; } export interface ParsedCliOptions extends CliExecutionOptions { timeout: number; maxConcurrency: number; retries: number; useTor: boolean; proxy?: string; } export interface RawCliActionOptions { format?: string; json?: string; csv?: string; output?: string; outputDir?: string; cache?: string; cacheDir?: string; cacheTtl?: string; config?: boolean; stdout?: boolean; write?: boolean; timeout: string; concurrency: string; retries: string; nsfw?: boolean; includeExcluded?: boolean; tor?: boolean; proxy?: string; sites?: string; verbose?: boolean; availableOnly?: boolean; takenOnly?: boolean; debug?: boolean; debugHeaders?: boolean; debugBody?: boolean; debugMaxBody?: string; } export interface CliExecutionHooks { onUsernameStart?: (username: string, index: number, total: number) => void; onUsernameComplete?: (username: string, index: number, total: number, results: CheckResult[]) => void; onProgress?: (progress: CheckProgress) => void; onStdout?: (output: string) => void; onFilesWritten?: (filesWritten: string[]) => void; onNoFilesWritten?: () => void; onSummary?: (summary: CliSummary) => void; onDebugOutput?: (output: string) => void; } export interface CliExecutionResult { reports: UsernameReport[]; filesWritten: string[]; primaryOutput: string; debugOutput?: string; summary: CliSummary; } export declare function parseOutputFormat(format: string | undefined): OutputFormat; export declare function parseNumericOption(name: string, value: string, minimum: number): number; export declare function buildDebugOptions(options: RawCliActionOptions): DebugOptions | undefined; export declare function parseCliOptions(usernames: string[], options: RawCliActionOptions): ParsedCliOptions; export declare function filterResults(results: CheckResult[], options: { availableOnly: boolean; takenOnly: boolean; }): CheckResult[]; export declare function summarizeReports(reports: UsernameReport[]): CliSummary; export declare function printProgress(progress: CheckProgress, verbose: boolean, theme: typeof import('chalk').default): void; export declare function runCliExecution(checker: UsernameChecker, options: CliExecutionOptions, hooks?: CliExecutionHooks): Promise;