import type { AndroidOnboardingErrorCategory, AndroidOnboardingStep } from './android/types.js';
import type { OnboardingErrorCategory, OnboardingStep, Platform } from './types.js';
import type { AppSelectionEvent } from './ui/app-selection-gate.js';
export interface TrackBuilderOnboardingLoginInput {
    apikey: string;
    appId: string;
    journeyId: string;
    method: 'browser' | 'paste';
    retryCount: number;
    durationMs: number;
}
/** Login happens before platform and owner-org resolution. Send once a key is valid. */
export declare function trackBuilderOnboardingLogin(input: TrackBuilderOnboardingLoginInput): Promise<void>;
export declare function trackBuilderOnboardingAppSelection(input: AppSelectionEvent & {
    apikey: string;
    appId: string;
    journeyId: string;
}): Promise<void>;
export interface TrackBuilderOnboardingStepInput {
    apikey: string;
    appId: string;
    orgId: string;
    /** Correlation id tying every event from one onboarding run together. */
    journeyId: string;
    platform: Platform;
    step: OnboardingStep | AndroidOnboardingStep;
    durationMs?: number;
    /** Step whose elapsed time is represented by durationMs. */
    durationStep?: OnboardingStep | AndroidOnboardingStep;
    /** Raw caught error — mapped via the platform's category mapper. Use this OR errorCategory, not both. */
    error?: unknown;
    /** Pre-computed category. Takes precedence over `error` if both are present. */
    errorCategory?: OnboardingErrorCategory | AndroidOnboardingErrorCategory;
    replaySessionId?: string;
}
export type BuilderOnboardingAction = 'resume_prompt_decision' | 'question_shown' | 'question_answered' | 'question_skipped' | 'android_sa_method_selected' | 'android_sa_validation_recovery_selected' | 'android_sa_validation_result' | 'credential_verified' | 'credential_verification_failed' | 'certificate_prepared' | 'certificate_preparation_failed' | 'keystore_prepared' | 'keystore_preparation_failed';
export interface TrackBuilderOnboardingActionInput {
    apikey: string;
    appId: string;
    orgId: string;
    /** Correlation id tying every event from one onboarding run together. */
    journeyId: string;
    platform: Platform;
    step: OnboardingStep | AndroidOnboardingStep;
    action: BuilderOnboardingAction;
    tags?: Record<string, boolean | number | string>;
    replaySessionId?: string;
}
export declare function trackBuilderOnboardingStep(input: TrackBuilderOnboardingStepInput): Promise<void>;
export declare function trackBuilderOnboardingAction(input: TrackBuilderOnboardingActionInput): Promise<void>;
export interface TrackBuilderOnboardingCancelledInput {
    apikey: string;
    appId: string;
    /** May be undefined when the owner org couldn't be resolved post-exit. */
    orgId?: string;
    /** Correlation id tying every event from one onboarding run together. */
    journeyId: string;
    /**
     * The platform being onboarded, or undefined when the user quit BEFORE
     * choosing one (e.g. on the platform picker). The undefined case is itself a
     * useful signal — it isolates "left at the very first screen" drop-off.
     */
    platform?: Platform;
    /** The step the user was on when they quit, when known. */
    lastStep?: string;
    /** Total wall-clock duration of the journey, from launch to quit. */
    durationMs?: number;
    /**
     * Abort signal used to time-box the post-quit flush so a stalled network
     * can't keep the CLI alive after the user has already exited the wizard.
     */
    signal?: AbortSignal;
    replaySessionId?: string;
}
/**
 * Emits the terminal "Builder Onboarding Quit" event when a journey ends
 * without reaching build-complete (user cancel, Ctrl+C, missing platform, or a
 * fatal error that exits). Fired ONCE from command.ts after the wizard tears
 * down — never mid-flow — so each journey has at most one quit marker. Unlike
 * the per-step events this carries no org-scoped requirement: it sends with
 * whatever org id could be resolved (possibly none) rather than dropping the
 * event, because a quit is exactly when we most want the funnel exit recorded.
 */
export declare function trackBuilderOnboardingCancelled(input: TrackBuilderOnboardingCancelledInput): Promise<void>;
