import { DEFAULT_WASM_VERSION } from '@incodetech/core/wasm'; import { FeatureManagementRedactedUserInfo } from '@incodetech/core/feature-management'; import { FunctionComponent } from 'preact'; import { i18n } from 'i18next'; import { SVGProps } from 'preact/compat'; import { WasmConfig } from '@incodetech/core/wasm'; /** * Allowlisted keys for overridable Lottie animations */ export declare type AnimationKey = 'id.tutorial.front' | 'id.tutorial.back' | 'id.tutorial.passport' | 'id.flip' | 'id.processing' | 'selfie.tutorial' | 'loader.spinner'; /** * A customer-supplied replacement for a built-in Lottie animation. * * - `LottieAnimationData` — a parsed Lottie JSON object. * - `{ url }` — fetched and cached at runtime. * - `{ animationData }` — explicit object form. */ export declare type AnimationOverride = LottieAnimationData | { url: string; } | { animationData: LottieAnimationData; }; export declare type AnimationOverrides = Partial>; /** * Allowlisted keys for overridable branded SVG illustrations */ export declare type AssetKey = 'faceMatch.success' | 'faceMatch.fail' | 'documentCapture.tutorial' | 'id.uploadScreen' | 'id.ageVerification.dob' | 'id.ageVerification.scan' | 'id.ageVerification.privacy' | 'videoSelfie.success' | 'videoSelfie.fail' | 'videoSelfie.tutorial.permission' | 'videoSelfie.tutorial.selfie' | 'videoSelfie.tutorial.frontId' | 'videoSelfie.tutorial.backId' | 'videoSelfie.tutorial.poa' | 'videoSelfie.tutorial.questions' | 'videoSelfie.tutorial.speech' | 'loader.spinner'; /** * A customer-supplied replacement for a built-in SVG illustration. * * - `string` — a URL, or raw `` markup (detected by a leading `<`). * - `{ url }` — fetched and rendered via ``; no script execution. * - `{ raw }` — inline markup; sanitized before injection. * - `{ svg }` — a precompiled component, for build-time integrations. */ export declare type AssetOverride = string | { url: string; } | { raw: string; } | { svg: SvgComponent; }; export declare type AssetOverrides = Partial>; export declare function createI18n(options?: I18nOptions): i18n; export { DEFAULT_WASM_VERSION } /** * Object form of the `featureManagement` option. Mirrors the core * `FeatureManagementSetupOptions` shape — see the core `SetupOptions.featureManagement` * docs for the full behavior (identity model, lock semantics, privacy flags). */ declare type FeatureManagementSetupOptions = { clientExperimentId?: string; disableStableId?: boolean; disablePersistence?: boolean; redactedUserInfo?: FeatureManagementRedactedUserInfo; }; declare type FlowSetup = false | { preload?: boolean; mergeConfig?: boolean; }; export declare type I18nOptions = { lang?: string; loadPath?: string; skipRemoteLoad?: boolean; translations?: Translations; }; declare type LanguageTranslations = Record; declare type LottieAnimationData = { fr: number; v: string; ip: number; op: number; w: number; h: number; }; export declare function setI18nInstance(instance: i18n): void; /** * Sets global UI configuration defaults for `@incodetech/ui`. * * Replaces (does not merge with) the previous host-supplied config, so omitting * a field clears it. The dashboard theme is held separately and is unaffected. */ export declare function setUiConfig(next: UiConfig): void; export declare function setup({ apiURL, token, customHeaders, timeout, wasm, ipLookup, fingerprint, devMode, featureManagement, environment, i18n, uiConfig, flow, theme, }: SetupOptions): Promise; declare type SetupOptions = { apiURL: string; token: string; customHeaders?: Record; timeout?: number; wasm?: WasmConfig | false; ipLookup?: boolean; /** * Disables client-side device-fingerprint submission. Forwarded to core * `setup()` — see the core `SetupOptions.fingerprint` docs for the full * behavior (transition flag; also affects the Deepsight metadata bundle * and mandatory-consent auto-injection). */ fingerprint?: boolean; /** * Disables the browser devtools detector for local development. Forwarded to * core `setup()`. Leave `false` (default) in production — see the core * `SetupOptions.devMode` docs. WASM logging is controlled via `wasm.showLogs`. */ devMode?: boolean; /** * Enables feature management. Forwarded to core `setup()` — see the core * `SetupOptions.featureManagement` docs for the full behavior (identity * model, lock semantics, privacy flags, opt-out semantics). Default: `true`. */ featureManagement?: boolean | FeatureManagementSetupOptions; /** * Coarse deployment tier. Forwarded to core `setup()` — see the core * `SetupOptions.environment` docs. Default: `'production'`. */ environment?: 'development' | 'staging' | 'production'; i18n?: I18nOptions; uiConfig?: UiConfig; /** * Controls Flow-backed standalone module configuration. Omit or pass `{}` * for lazy resolution, use `preload` to fetch Flow during setup, use * `mergeConfig` to merge supplied partial config over Flow config, or pass * `false` to disable Flow-backed standalone configuration. */ flow?: FlowSetup; /** * Controls the session dashboard theme independently from Flow. Omit or * pass `{}` for compatibility-safe lazy loading, use `preload` to fetch and * apply it during setup, or pass `false` to disable it. */ theme?: ThemeSetup; }; /** * The presentation fields plus the legacy inline copy accepted by * `` / ``. */ export declare type SpinnerConfig = SpinnerPresentation & { /** * @deprecated Set loader copy via i18n translations (`loadingCircle.holdOn`). * TODO(2.3.0): remove. */ title?: string; /** * @deprecated Set loader copy via i18n translations (`loadingCircle.validating`). * TODO(2.3.0): remove. */ subtitle?: string; }; /** * Host-facing loader presentation, settable globally via * `setup({ uiConfig: { spinner } })` or per element via `config.spinner`. * * Copy is deliberately absent. Loader text comes from i18n (`loadingCircle.*`), * which keeps it localizable — a literal string here would freeze in whatever * language the host typed it in when the user switches language mid-flow — and * leaves one source of truth for user-facing strings. */ export declare type SpinnerPresentation = { renderMode?: SpinnerRenderMode; size?: SpinnerSize; }; /** * Which parts of a loader render. * * An enum rather than a pair of booleans so the meaningless fourth state — * neither icon nor text, i.e. a blank screen — is unrepresentable. */ export declare type SpinnerRenderMode = 'spinnerAndText' | 'spinnerOnly' | 'textOnly'; export declare type SpinnerSize = 'small' | 'medium' | 'large'; /** An SVG imported as a Preact component (the `?react` import shape). */ export declare type SvgComponent = FunctionComponent>; declare type ThemeSetup = false | { preload?: boolean; }; declare type Translations = Partial>; declare type TranslationValue = string | Record; export declare type UiConfig = { logoSrc?: string; logoHeight?: string; subtitle?: string; hideHeader?: boolean; hideFooterBranding?: boolean; assets?: AssetOverrides; animations?: AnimationOverrides; /** * Global loader presentation. Copy stays in i18n — see * {@link SpinnerPresentation}. */ spinner?: SpinnerPresentation; }; export { }