import debug from 'debug';
export declare const telemetryDebug: debug.Debugger;
export declare const isDev: boolean;
export interface CLIError extends Error {
    _type?: 'error';
    cliRunDuration?: number | string;
    code?: string;
    context?: {
        isTTY?: boolean;
    };
    http?: {
        statusCode?: number;
    };
    oclif?: {
        exit?: number;
    };
    statusCode?: number;
}
export interface HerokulyticsData {
    _type: 'herokulytics';
    argv: string[];
    Command: {
        id: string;
        plugin?: {
            name: string;
            version: string;
        };
    };
}
export interface Telemetry {
    _type: 'otel';
    cliRunDuration: number;
    command: string;
    commandRunDuration: number;
    exitCode: number;
    exitState: string;
    isTTY: boolean | undefined;
    isVersionOrHelp: boolean;
    lifecycleHookCompletion: {
        command_not_found: boolean;
        init: boolean;
        postrun: boolean;
        prerun: boolean;
    };
    os: string;
    version: string;
}
export type TelemetryData = CLIError | Telemetry;
export interface TelemetryGlobal {
    cliTelemetry?: Telemetry;
}
export type WorkerData = HerokulyticsData | TelemetryData;
/**
 * Compute duration from a start time to now
 */
export declare function computeDuration(cmdStartTime: number): number;
/**
 * Get authentication token, cached to avoid recreating Config/APIClient
 * Lazy-loads @heroku-cli/command and @oclif/core/config to avoid loading them during CLI init
 */
export declare function getToken(): Promise<string | undefined>;
/**
 * Get CLI version
 */
export declare function getVersion(): string;
/**
 * Check if telemetry is enabled based on environment variables
 */
export declare function isTelemetryEnabled(): boolean;
/**
 * Serialize data for telemetry worker, handling Error objects specially
 */
export declare function serializeTelemetryData(data: WorkerData): string;
/**
 * Set CLI version (called once during setup)
 */
export declare function setVersion(v: string): void;
/**
 * Spawn telemetry worker process in background
 * This avoids blocking the main CLI process with telemetry overhead
 */
export declare function spawnTelemetryWorker(data: WorkerData): void;
