/** * * Copyright © 2025-2026 Ping Identity Corporation. All right reserved. * * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. * **/ import type { SignalsInitializationOptions } from '@forgerock/protect/types'; import type { z } from 'zod'; import type { loggerConfigSchema, middlewareSchema, serverConfigSchema, storageConfigSchema } from './widget.config'; import type { captchaConfigSchema } from './core/captcha.config'; import type { partialLinksSchema } from './core/links.store'; import type { partialStringsSchema } from './core/locale.store'; import type { OAuthTokenStoreValue } from './core/oauth/oauth.store'; import type { oidcClientConfigSchema } from './core/oidc/oidc.store'; import type { ProtectConfig } from './core/protect/protect.store'; import type { partialStyleSchema } from './core/style.store'; import type { UserStoreValue } from './core/user/user.store'; import type { journeyConfigSchema } from './core/journey/config.store'; import type { JourneyStoreValue } from './core/journey/journey.interfaces'; export interface JourneyOptions { oauth?: boolean; user?: boolean; } export interface JourneyOptionsChange { journey: string; query?: Record; } export interface JourneyOptionsStart { journey?: string; query?: Record; resumeUrl?: string; recaptchaAction?: string; } export interface ModalApi { close(args?: { reason: 'auto' | 'external' | 'user'; }): void; onClose(fn: (args: { reason: 'auto' | 'external' | 'user'; }) => void): void; onMount(fn: () => void): void; open(options?: JourneyOptions): void; } export interface Response { journey?: JourneyStoreValue; oauth?: OAuthTokenStoreValue; user?: UserStoreValue; } export interface Protect { start: (config: ProtectConfig | SignalsInitializationOptions) => Promise; resumeBehavioralData: () => void | { error: string; }; pauseBehavioralData: () => void | { error: string; }; getData: () => Promise; } export interface WidgetConfigOptions { serverConfig: z.infer; logger?: z.infer; middleware?: z.infer; storage?: z.infer; captcha?: z.infer; oidcClient?: Omit, 'serverConfig'>; content?: z.infer; journeys?: z.infer; links?: z.infer; style?: z.infer; }