/**
 * API Client for CLI Commands
 * Issue #518: HTTP communication layer with auth, error handling
 *
 * [DR1-01] Responsibilities separated:
 * - resolveAuthToken(): Token resolution (--token > CM_AUTH_TOKEN)
 * - handleApiError(): Error classification and user-friendly messages
 * - ApiClient: HTTP get/post with base URL and auth headers
 */
/** Maximum stop-pattern length [SEC4-06] */
export declare const MAX_STOP_PATTERN_LENGTH = 500;
/**
 * Validate worktree ID format [SEC4-04]
 * @param id - Worktree ID to validate
 * @returns True if valid
 */
export declare function isValidWorktreeId(id: string): boolean;
/**
 * Resolve authentication token from options or environment.
 * [SEC4-01] Warns on stderr when --token flag is used.
 *
 * @param options - Options object with optional token
 * @returns Resolved token or undefined
 */
export declare function resolveAuthToken(options?: {
    token?: string;
}): string | undefined;
/**
 * Error result from API operations
 */
export interface ApiErrorResult {
    message: string;
    exitCode: number;
}
/**
 * Classify API errors into user-friendly messages and exit codes.
 * [IA3-09] Covers: ECONNREFUSED, 400, 401/403, 404, 429, 500, timeout
 *
 * @param error - Error object or unknown
 * @param status - HTTP status code if available
 * @returns User-friendly error message and exit code
 */
export declare function handleApiError(error: unknown, status?: number): ApiErrorResult;
/**
 * API Client for CLI HTTP communication.
 * Uses Node.js built-in fetch. Handles auth headers and error mapping.
 */
export declare class ApiClient {
    private baseUrl;
    private token?;
    constructor(options?: {
        baseUrl?: string;
        token?: string;
    });
    private getHeaders;
    /**
     * HTTP GET request
     * [DR1-05] Generic type parameter specified at call site
     */
    get<T>(path: string): Promise<T>;
    /**
     * HTTP POST request
     * [DR1-05] Generic type parameter specified at call site
     */
    post<T>(path: string, body?: unknown): Promise<T>;
}
/**
 * API Error with exit code for CLI process.exit()
 */
export declare class ApiError extends Error {
    readonly exitCode: number;
    readonly statusCode?: number | undefined;
    constructor(message: string, exitCode: number, statusCode?: number | undefined);
}
//# sourceMappingURL=api-client.d.ts.map