import type { EidVerificationConfig, EidVerificationResult, EidPrepareResult, EidState, EidProviderInfo, EidStepRefreshResponse } from "./eid.types"; interface TruliooSessionClient { authorizedPost(path: string, body: Req): Promise; authorizedGet(path: string): Promise; } export declare const EID_ENDPOINTS: { readonly providers: "/transactions/eid/providers"; readonly init: "/transactions/eid/init"; readonly exchange: "/transactions/eid/exchange"; readonly verify: "/transactions/eid/verify"; readonly refreshStep: "/transactions/eid/refresh-step"; readonly sessionEvent: "/transactions/eid/session-event"; readonly poll: (txnId: string) => string; /** Allowed paths for session client creation (excludes result). */ readonly allPaths: string[]; }; /** * EID verification module for Web — Trulioo SDK, Trinsic-backed. * * ## Flow * 1. Call `prepare(config)` when the EID screen appears. * 2. Call `start(config)` when the user confirms. * * ## Provider selection * Provider selection is server-driven: pass `countryCode` and services-apps * selects the healthiest licensed Trinsic provider automatically via * GET /api/v1/providers?licensed=true (5-min TTL catalog). * * ## Trinsic session contract * - services-apps calls Trinsic.CreateHostedProviderSession → returns `launchUrl`. * - SDK opens `launchUrl` in a popup. * - Trinsic's hosted page sends a postMessage: `{sessionId, resultsAccessKey, state}`. * - SDK posts these to `/transactions/eid/exchange` for server-side SQS handoff. * - SDK polls `/transactions/{id}/eid` until terminal status. */ export declare class TruliooEid { private client; private _state; private cachedSession; private stateListeners; /** UUID generated at prepare() time, threaded to the redirect URL so the hosted callback * page can open a BroadcastChannel keyed to this session. */ private channelKey; /** Abort controller for cancelling PollResult polling. */ private pollAbortController; constructor(client: TruliooSessionClient); get state(): EidState; onStateChange(listener: (state: EidState) => void): () => void; private setState; /** * List licensed Trinsic providers for a country. * * Optional — if you just call `prepare()` / `start()` with `countryCode`, * the server selects the healthiest provider automatically. Use this to * display a provider picker when multiple providers exist for a country. */ listProviders(countryCode: string): Promise; /** Pre-warm EID verification. Call when the EID UI screen appears. */ prepare(config: EidVerificationConfig): Promise; /** * Start an interactive EID verification. * * For CaptureRedirect providers: Opens `launchUrl` in a popup. The hosted Trinsic * callback page sends a postMessage with `{sessionId, resultsAccessKey, state}`. * SDK posts these to `/transactions/eid/exchange` then polls for the final result. * * For PollResult providers (e.g. Yoti): Opens the deep link / provider URL, then * skips the redirect exchange and polls directly — the server already dispatched * processing at init time. */ start(config: EidVerificationConfig): Promise; /** * PollResult flow — for providers like Yoti where no redirect occurs. * Opens the provider URL (deep link on mobile, QR display on desktop via hosted fallback), * then polls the Trulioo backend for the server-side result. * * If `stepContentTtlSeconds` is set, the deep link URL will expire after that duration. * On web, Trinsic's hosted fallback handles QR refresh internally. On native platforms, * the SDK should re-prepare after TTL expiry if the user hasn't completed verification. */ private startPollResultFlow; /** * CaptureRedirect flow — original popup-based redirect exchange. */ private startCaptureRedirectFlow; /** Non-interactive verification — for server-side-only provider flows. */ submitNonInteractive(config: EidVerificationConfig): Promise; /** * Refresh expiring step content (deep link URL, QR code) for an active session. * * Call this when `EidPrepareResult.stepContentTtlSeconds` is non-null and the content * is approaching expiry. Returns a fresh `providerUrl` and updated TTL. The app layer * should update the displayed URL/QR code with the returned value. * * Only valid for active direct-mode PollResult sessions (e.g. Yoti deep links with 180s TTL). */ refreshStepContent(): Promise; /** * Cancel an in-progress PollResult verification. * * Aborts the local polling loop and signals the server to cancel the Trinsic session. * After cancellation, the session transitions to DENIED and cannot be resumed. */ cancelPollResult(): Promise; /** * Sends a session lifecycle event to the server. * Fire-and-forget semantics — failures are swallowed to avoid breaking the main flow. */ private sendSessionEvent; reset(): void; private isSessionExpired; } export {};