/** * Device Handler * * SDK-internal handler for device_challenge and setup_device steps. * * - setup_device: Enrollment flow - generate keypair, send keyset, get challenge * - device_challenge: Verification flow - sign challenge with existing key * * Both steps are SDK-internal and never exposed to users. */ import { type DeviceChallengeStep, type ErrorStep, type RequestChallengeAction, type SetupDeviceStep, type SubmitSignatureAction } from "../protocol"; export interface DeviceHandlerConfig { /** Project ID for key scoping */ configId: string; /** User identifier for key lookup */ userIdentifier: string; } export interface SignatureResult { success: true; action: SubmitSignatureAction; } export interface SignatureError { success: false; error: ErrorStep; } export type DeviceHandlerResult = SignatureResult | SignatureError; export interface SetupResult { success: true; action: RequestChallengeAction; } export interface SetupError { success: false; error: ErrorStep; } export type DeviceSetupResult = SetupResult | SetupError; /** * Handle a device_challenge prompt by signing the challenge. * * @param challenge - The device challenge prompt from the server * @param config - Handler configuration * @returns Either a submit_signature action or an error prompt */ export declare function handleDeviceChallenge(challenge: DeviceChallengeStep, config: DeviceHandlerConfig): Promise; /** * Check if the SDK can handle a device challenge for the given user. */ export declare function canHandleDeviceChallenge(configId: string, userIdentifier: string, _keyId: string): Promise; /** * Handle a setup_device prompt by generating ZKP materials and returning * a request_challenge action. * * This is the enrollment flow - generates a new keypair and sends the keyset * to the server to get a challenge to sign. * * @param setup - The setup_device prompt from the server * @param config - Handler configuration * @returns Either a request_challenge action or an error prompt */ export declare function handleSetupDevice(setup: SetupDeviceStep, config: DeviceHandlerConfig): Promise;