/** * * Copyright © 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 { z } from 'zod'; import type { Protect, SignalsInitializationOptions } from '@forgerock/protect/types'; import type { Readable } from 'svelte/store'; /** * Public API config schema. Requires `envId`; types the fields we know. * * `z.looseObject` keeps unlisted keys (unlike `z.object`, which drops them). We list only * a subset of the fields AM sends, and the SDK forwards them all to `_pingOneSignals.init()` * unvalidated — so extra keys like `customHost` must pass through untouched. * @see https://zod.dev/api#zlooseobject (`z.looseObject` — allow unknown keys through) * @see https://github.com/ForgeRock/ping-javascript-sdk/blob/@forgerock/protect@2.1.0/packages/protect/src/lib/protect.types.ts#L20 (SDK ProtectConfig — only envId required) * @see https://github.com/ForgeRock/ping-javascript-sdk/blob/@forgerock/journey-client@2.1.0/packages/journey-client/src/lib/callbacks/ping-protect-initialize-callback.ts#L38-L49 (AM callback fields we don't list) */ export declare const protectConfigSchema: z.ZodObject<{ envId: z.ZodString; waitForWindowLoad: z.ZodOptional; hubUrl: z.ZodOptional; disableHub: z.ZodOptional; deviceAttributesToIgnore: z.ZodOptional>; behavioralDataCollection: z.ZodOptional; disableTags: z.ZodOptional; externalIdentifiers: z.ZodOptional>; universalDeviceIdentification: z.ZodOptional; agentIdentification: z.ZodOptional; agentTimeout: z.ZodOptional; agentPort: z.ZodOptional; consoleLogEnabled: z.ZodOptional; }, z.core.$loose>; /** * Schema for callback-provided PingOne Signals initialization options. * The Ping JS SDK defines this as an arbitrary string key-value map. */ export declare const signalsInitializationOptionsSchema: z.ZodRecord; /** * Schema for all supported Protect start config shapes. * This replaces the previous manual `'envId' in config` branching. */ export declare const protectStartConfigSchema: z.ZodUnion; hubUrl: z.ZodOptional; disableHub: z.ZodOptional; deviceAttributesToIgnore: z.ZodOptional>; behavioralDataCollection: z.ZodOptional; disableTags: z.ZodOptional; externalIdentifiers: z.ZodOptional>; universalDeviceIdentification: z.ZodOptional; agentIdentification: z.ZodOptional; agentTimeout: z.ZodOptional; agentPort: z.ZodOptional; consoleLogEnabled: z.ZodOptional; }, z.core.$loose>, z.ZodRecord]>; export type ProtectConfig = z.infer; export type ProtectStartConfig = z.infer; export interface ProtectStore extends Readable { start: (config: ProtectConfig | SignalsInitializationOptions) => Promise; getData: () => Promise; pauseBehavioralData: () => void | { error: string; }; resumeBehavioralData: () => void | { error: string; }; } export declare const protectStore: ProtectStore;