import type { Theme, Navigation } from '../capture-api';
import type { CrossDeviceMethod } from './CrossDeviceConnect.types';
import type { FeatureFlags } from './FeatureFlags';
import type { V15Theme } from './v15Typing';
export type ModuleError = {
    type: 'no_camera';
    message?: string;
};
export type ModuleFinish = {
    type: 'finish';
    output: Output;
    options?: ModuleFinishOptions;
};
export type ModuleUnsupported = {
    type: 'unsupported';
    data?: unknown;
};
export type Outputs = ModuleFinish | ModuleUnsupported;
export type Output = object | object[];
export type ModuleFinishOptions = {
    complete?: boolean;
};
export type SharedFrameMethod = 'moduleVisibility' | 'loaderVisibility' | 'tearDown' | 'waitForModule';
export type ExecutorMethod = 'bootstrap' | 'ping' | 'start';
export type CrossDeviceExecutorMethod = 'crossDevice.update' | 'crossDevice.abort' | 'crossDevice.tokenGenerated';
export type RunnerMethod = 'moduleState.update' | 'captureModule.finish' | 'captureModule.error' | 'captureModule.unsupported' | 'crossDevice.start' | 'crossDevice.preload' | 'crossDevice.verify' | 'crossDevice.abort' | 'crossDevice.regenerate' | 'crossDevice.requestToken' | 'analytics.send' | 'analyticsV2.send' | 'analytics.userAnalytics' | 'navigation.back' | 'navigation.exit' | 'navigation.externalLink' | 'navigation.closeExternalLink' | 'customCallback.invoke' | 'passkey.create' | 'passkey.get' | 'crossDevice.browserReload';
export type Configuration<T = unknown> = {
    translations?: T;
    theme?: Theme & {
        version?: string;
    };
    language?: string;
    workflowRunId?: string;
    taskId?: string;
    taskDefinitionId?: string;
};
export type Input = Record<string, unknown>;
export type Empty = Record<string, never>;
export type LocaleDirection = 'ltr' | 'rtl';
export type TranslationData<T> = T & {
    meta?: {
        legacy: Record<string, unknown>;
        fallback?: Record<string, unknown>;
        direction?: LocaleDirection;
        convertLegacyTranslations?: boolean;
    };
};
export type TranslationItem<T> = T | (() => Promise<T>);
export type Translations<T = unknown> = Record<string, TranslationItem<T>>;
export type Optional<T> = undefined | T;
export type RecursivePartial<T> = {
    [P in keyof T]?: T[P] extends (infer U)[] ? RecursivePartial<U>[] : T[P] extends object | undefined ? RecursivePartial<T[P]> : T[P];
};
export declare enum Platform {
    WEB = "web",
    IOS = "ios",
    ANDROID = "android"
}
export declare enum OnfidoIntegrationType {
    SmartCaptureLinkGeneric = "smart-capture-link-generic",
    SmartCaptureLinkUnique = "smart-capture-link-unique"
}
type ExecutionContextConfiguration = {
    crossDevicePolicy?: CrossDevicePolicy;
    supportsCrossDevice?: boolean;
    supportsBack?: boolean;
    supportsExit?: boolean;
    supportsExternalLink?: boolean;
    globalKit?: boolean;
};
export type CustomCallbacks = {
    names: string[];
};
export type Permission = {
    alwaysRequestPermissions?: boolean;
};
export type WebContext = {
    version: string;
    integration?: OnfidoIntegrationType;
};
export type Integration = {
    name: string;
    version: string;
};
export type ExecutionContext = {
    web: WebContext;
    platform: Platform;
    version: string;
    integration?: Integration | undefined;
    module?: CaptureModule;
    os?: {
        name?: string;
        version?: string;
    };
    configuration?: ExecutionContextConfiguration;
    permission?: Permission;
    customCallbacks?: CustomCallbacks;
    currentScriptHostname?: string;
    previousState?: unknown;
};
export type UserDetails = {
    smsNumber?: string;
};
export type ClientConfiguration = {
    token: string;
    sdkToken: SdkToken;
    featureFlags: FeatureFlags & Partial<Record<string, unknown>>;
    theme?: V15Theme;
    language?: string;
    translations?: Translations;
    navigation?: Navigation;
    analytics?: {
        enabled: boolean;
        anonymousUuid: string;
        sessionUuid: string;
        workflowRunId: string | undefined;
        steps: LegacyStepDefinition[];
        roomId?: string;
        referrer?: string;
        domain?: string;
    };
    source: {
        platform: string;
        version: string;
        sdk_environment: string;
        distribution_source: string;
        integration_source?: OnfidoIntegrationType;
        pinned_version?: string;
    };
    logger: {
        enabled: boolean;
        levels: string[];
    };
    deviceInfo?: DeviceInfo;
    crossDevice?: {
        verification?: boolean;
        confirmation?: boolean;
        desktopInfo?: DeviceInfo['environment'];
        linkMethods: CrossDeviceMethod[];
        qrRefresh?: boolean;
    };
    enterpriseFeatures?: EnterpriseFeatures;
    crossDeviceClientIntroProductName?: string;
    crossDeviceClientIntroProductLogoSrc?: string;
    smsNumberCountryCode?: string;
    userDetails?: UserDetails;
    integration?: OnfidoIntegrationType;
};
export type SdkToken = {
    exp: number;
    sub?: UUID;
    payload: Payload;
    enterpriseFeatures?: TokenEnterpriseFeatures;
    urls: {
        detectDocumentUrl: URL;
        /**
         * @deprecated
         */
        syncUrl: URL;
        hostedSdkUrl: URL;
        authUrl: URL;
        onfidoApiUrl: URL;
        telephonyUrl: URL;
        crossDeviceUrl?: URL;
    };
    type: 'studio' | 'sdk';
};
export type UUID = string;
export type URL = string;
export type Payload = {
    applicantUuid: UUID;
    applicationId?: string;
    clientUuid: UUID;
    isSandbox: boolean;
    isTrial: boolean;
};
export type EnterpriseFeatures = {
    hideOnfidoLogo?: boolean;
    cobrand?: {
        text?: string;
    };
    logoCobrand?: {
        lightLogoSrc?: string;
        darkLogoSrc?: string;
    };
};
export type TokenEnterpriseFeatures = {
    cobrand: boolean;
    logoCobrand: boolean;
    hideOnfidoLogo: boolean;
    useCustomizedApiRequests: boolean;
};
export type JWT = {
    iss?: string;
    exp: number;
    payload: {
        app: UUID;
        application_id?: string;
        client_uuid: UUID;
        is_sandbox: boolean;
        is_trial: boolean;
        ref: string;
        sardine_session: UUID;
    };
    enterprise_features: TokenEnterpriseFeatures;
    urls: {
        detect_document_url: URL;
        sync_url: URL;
        hosted_sdk_url: URL;
        auth_url: URL;
        onfido_api_url: URL;
        telephony_url: URL;
        cross_device_url?: URL;
    };
};
export type TrackedEventTypes = 'screen' | 'action' | 'flow' | 'view';
export type AnalyticsEvent = {
    eventName: string;
    eventType: TrackedEventTypes;
};
export type UserAnalyticsEvent<N extends string = string, P extends Record<string, unknown> = Record<string, unknown>> = {
    eventName: N;
    properties: P;
};
export type DeviceTypes = 'desktop' | 'mobile';
export type TrackedEnvironmentData = {
    device?: DeviceTypes;
    os?: string;
    os_version?: string;
    browser?: string;
    browser_version?: string;
    brand?: string;
    model?: string;
};
export type DeviceInfo = {
    environment: TrackedEnvironmentData;
    isDesktop: boolean;
    isIOS: boolean;
    isAndroid: boolean;
    isWindows: boolean;
    isMacOS: boolean;
    isSafari: boolean;
    isSamsung: boolean;
    isEdge: boolean;
    isChrome: boolean;
    isFirefox: boolean;
    isWebview: boolean;
};
export declare enum CrossDeviceVerificationStatus {
    VALID = "VALID",
    INVALID = "INVALID",
    PENDING = "PENDING",
    ABORT = "ABORT"
}
export type CrossDeviceInitialState = unknown;
export type ConnectResult = {
    roomId: string;
    tokenRoomId?: string;
    pollPeriod?: number;
};
export type CrossDeviceDetails = ConnectResult & {
    connected: boolean;
    link: string;
    code?: string;
    verificationStatus?: CrossDeviceVerificationStatus;
};
export type CrossDeviceInput = {
    backActionType?: 'module' | 'cross-module';
    details: CrossDeviceDetails;
};
export declare enum CaptureModuleType {
    HOSTED = "hosted",
    EXTERNAL = "external"
}
export type ModuleType<T extends CaptureModuleType> = {
    type: T;
};
export type HostedModule = {
    version?: string;
    module: string;
} & ModuleType<CaptureModuleType.HOSTED>;
export type ExternalModule = {
    url: string;
} & ModuleType<CaptureModuleType.EXTERNAL>;
export type CaptureModule = HostedModule | ExternalModule;
export type CrossDevicePolicy = 'enable' | 'force' | 'disable';
export type LegacyStepType = 'welcome' | 'complete' | 'face' | 'consent' | 'document' | 'poa';
export type LegacyStepDefinition = LegacyStepType | StepDefinition;
export type StepDefinition = {
    type: LegacyStepType | string;
    options?: Record<string, unknown>;
    module?: CaptureModule;
    /**
     * the key used to serialize the output for onComplete
     */
    key?: string;
};
export type ExternalLinkTarget = 'overlay' | 'browser';
export type ExternalLinkHandle = {
    window?: Window;
};
export {};
