import { SdkSardineSettings } from '../types'; /** The two VeroCompliance calls the device session makes. Neither may throw into the KYC flow. */ export interface SardineDeviceApi { /** The applicant's live Sardine session: the same key while it lives, a new one after. Null: no Sardine. */ refresh(applicantId: number): Promise; /** Tells VeroCompliance whether the device script loaded for the key, so its calls expect device data or not. */ report(applicantId: number, sessionKey: string, loaded: boolean): Promise; } /** * Sardine's device script for the whole KYC session. * * VeroCompliance decides whether it runs and with what: the SDK state carries the tenant's Sardine client, * environment and region, the live session key and the customer id. The script starts as soon as the session * does, on every step of a run that can reach Sardine, not only the identity step. Every server call on the run * uses the same key, so Sardine can join the device data to each of them. * * - `userIdHash` is the customer id the server calls use. * - The key is swapped for a fresh one before it expires. * - The `flow` label stays the page path, which is how Sardine's own examples key device timings. * - The KYC flow never waits for the script. If it can't load (an ad blocker, a network filter), * VeroCompliance is told, so its calls stop expecting device data. * * One instance lives as long as the `VeroComplianceProvider`. Host config (`identityProviders.sardinai`) plays no * part here: without settings from VeroCompliance there are no server calls to join, so no script runs. */ export declare class SardineDeviceSession { private readonly api; private provider; private applicantId; private key; /** Whether the script loaded: null while it is still loading. */ private loaded; private timer; /** Bumped by stop(), so work started before it can tell it is stale. */ private generation; constructor(api: SardineDeviceApi); /** The key the device script currently runs with, or null when none runs. */ get sessionKey(): string | null; get isRunning(): boolean; /** * Starts the device script with the settings VeroCompliance sent, or moves a running one onto them. Resolves * once the script has loaded or failed to; it never rejects. */ start(applicantId: number, settings: SdkSardineSettings): Promise; /** * Follows the SDK onto another applicant (a new one after the create form, or after a workflow switch): * asks VeroCompliance for that applicant's Sardine settings and starts or moves the script onto them. */ follow(applicantId: number): Promise; /** * Moves the script onto a key VeroCompliance handed out elsewhere, for example with the identity step's token, * so the device data joins the call that key belongs to. */ adopt(sessionKey: string | null | undefined): void; /** Stops the refresh timer and lets go of the script. start() can run again afterwards. */ stop(): void; private apply; private schedule; private refreshNow; private askForSession; private report; } //# sourceMappingURL=sardine-device-session.d.ts.map