@forgerock/login-widget 1.0.2-beta.1 → 1.0.2-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/types.d.ts ADDED
@@ -0,0 +1,2385 @@
1
+ /**
2
+ * An event-handling function.
3
+ */
4
+ declare type Listener = (e: FREvent) => void;
5
+ interface FREvent {
6
+ type: string;
7
+ }
8
+
9
+ /**
10
+ * Event dispatcher for subscribing and publishing categorized events.
11
+ */
12
+ declare class Dispatcher {
13
+ private callbacks;
14
+ /**
15
+ * Subscribes to an event type.
16
+ *
17
+ * @param type The event type
18
+ * @param listener The function to subscribe to events of this type
19
+ */
20
+ addEventListener(type: string, listener: Listener): void;
21
+ /**
22
+ * Unsubscribes from an event type.
23
+ *
24
+ * @param type The event type
25
+ * @param listener The function to unsubscribe from events of this type
26
+ */
27
+ removeEventListener(type: string, listener: Listener): void;
28
+ /**
29
+ * Unsubscribes all listener functions to a single event type or all event types.
30
+ *
31
+ * @param type The event type, or all event types if not specified
32
+ */
33
+ clearEventListeners(type?: string): void;
34
+ /**
35
+ * Publishes an event.
36
+ *
37
+ * @param event The event object to publish
38
+ */
39
+ dispatchEvent<T extends FREvent>(event: T): void;
40
+ }
41
+
42
+ declare enum ActionTypes {
43
+ Authenticate = "AUTHENTICATE",
44
+ Authorize = "AUTHORIZE",
45
+ EndSession = "END_SESSION",
46
+ Logout = "LOGOUT",
47
+ ExchangeToken = "EXCHANGE_TOKEN",
48
+ RefreshToken = "REFRESH_TOKEN",
49
+ ResumeAuthenticate = "RESUME_AUTHENTICATE",
50
+ RevokeToken = "REVOKE_TOKEN",
51
+ StartAuthenticate = "START_AUTHENTICATE",
52
+ UserInfo = "USER_INFO"
53
+ }
54
+
55
+ interface StringDict<T> {
56
+ [name: string]: T;
57
+ }
58
+ interface Tokens {
59
+ accessToken: string;
60
+ idToken?: string;
61
+ refreshToken?: string;
62
+ tokenExpiry?: number;
63
+ }
64
+
65
+ /**
66
+ * Types of callbacks directly supported by the SDK.
67
+ */
68
+ declare enum CallbackType {
69
+ BooleanAttributeInputCallback = "BooleanAttributeInputCallback",
70
+ ChoiceCallback = "ChoiceCallback",
71
+ ConfirmationCallback = "ConfirmationCallback",
72
+ DeviceProfileCallback = "DeviceProfileCallback",
73
+ HiddenValueCallback = "HiddenValueCallback",
74
+ KbaCreateCallback = "KbaCreateCallback",
75
+ MetadataCallback = "MetadataCallback",
76
+ NameCallback = "NameCallback",
77
+ NumberAttributeInputCallback = "NumberAttributeInputCallback",
78
+ PasswordCallback = "PasswordCallback",
79
+ PollingWaitCallback = "PollingWaitCallback",
80
+ ReCaptchaCallback = "ReCaptchaCallback",
81
+ RedirectCallback = "RedirectCallback",
82
+ SelectIdPCallback = "SelectIdPCallback",
83
+ StringAttributeInputCallback = "StringAttributeInputCallback",
84
+ SuspendedTextOutputCallback = "SuspendedTextOutputCallback",
85
+ TermsAndConditionsCallback = "TermsAndConditionsCallback",
86
+ TextInputCallback = "TextInputCallback",
87
+ TextOutputCallback = "TextOutputCallback",
88
+ ValidatedCreatePasswordCallback = "ValidatedCreatePasswordCallback",
89
+ ValidatedCreateUsernameCallback = "ValidatedCreateUsernameCallback"
90
+ }
91
+
92
+ /**
93
+ * Represents the authentication tree API payload schema.
94
+ */
95
+ interface Step$1 {
96
+ authId?: string;
97
+ callbacks?: Callback[];
98
+ code?: number;
99
+ description?: string;
100
+ detail?: StepDetail;
101
+ header?: string;
102
+ message?: string;
103
+ ok?: string;
104
+ realm?: string;
105
+ reason?: string;
106
+ stage?: string;
107
+ status?: number;
108
+ successUrl?: string;
109
+ tokenId?: string;
110
+ }
111
+ /**
112
+ * Represents details of a failure in an authentication step.
113
+ */
114
+ interface StepDetail {
115
+ failedPolicyRequirements?: FailedPolicyRequirement[];
116
+ failureUrl?: string;
117
+ result?: boolean;
118
+ }
119
+ /**
120
+ * Represents configuration overrides used when requesting the next
121
+ * step in an authentication tree.
122
+ */
123
+ interface StepOptions extends ConfigOptions$1 {
124
+ query?: StringDict<string>;
125
+ }
126
+ /**
127
+ * Represents failed policies for a matching property.
128
+ */
129
+ interface FailedPolicyRequirement {
130
+ policyRequirements: PolicyRequirement[];
131
+ property: string;
132
+ }
133
+ /**
134
+ * Represents a failed policy policy and failed policy params.
135
+ */
136
+ interface PolicyRequirement {
137
+ params?: Partial<PolicyParams>;
138
+ policyRequirement: string;
139
+ }
140
+ interface PolicyParams {
141
+ [key: string]: unknown;
142
+ disallowedFields: string;
143
+ duplicateValue: string;
144
+ forbiddenChars: string;
145
+ maxLength: number;
146
+ minLength: number;
147
+ numCaps: number;
148
+ numNums: number;
149
+ }
150
+ /**
151
+ * Represents the authentication tree API callback schema.
152
+ */
153
+ interface Callback {
154
+ _id?: number;
155
+ input?: NameValue[];
156
+ output: NameValue[];
157
+ type: CallbackType;
158
+ }
159
+ /**
160
+ * Represents a name/value pair found in an authentication tree callback.
161
+ */
162
+ interface NameValue {
163
+ name: string;
164
+ value: unknown;
165
+ }
166
+
167
+ /**
168
+ * Base class for authentication tree callback wrappers.
169
+ */
170
+ declare class FRCallback {
171
+ payload: Callback;
172
+ /**
173
+ * @param payload The raw payload returned by OpenAM
174
+ */
175
+ constructor(payload: Callback);
176
+ /**
177
+ * Gets the name of this callback type.
178
+ */
179
+ getType(): string;
180
+ /**
181
+ * Gets the value of the specified input element, or the first element if `selector` is not
182
+ * provided.
183
+ *
184
+ * @param selector The index position or name of the desired element
185
+ */
186
+ getInputValue(selector?: number | string): unknown;
187
+ /**
188
+ * Sets the value of the specified input element, or the first element if `selector` is not
189
+ * provided.
190
+ *
191
+ * @param selector The index position or name of the desired element
192
+ */
193
+ setInputValue(value: unknown, selector?: number | string | RegExp): void;
194
+ /**
195
+ * Gets the value of the specified output element, or the first element if `selector`
196
+ * is not provided.
197
+ *
198
+ * @param selector The index position or name of the desired element
199
+ */
200
+ getOutputValue(selector?: number | string): unknown;
201
+ /**
202
+ * Gets the value of the first output element with the specified name or the
203
+ * specified default value.
204
+ *
205
+ * @param name The name of the desired element
206
+ */
207
+ getOutputByName<T>(name: string, defaultValue: T): T;
208
+ private getArrayElement;
209
+ }
210
+
211
+ declare type FRCallbackFactory = (callback: Callback) => FRCallback;
212
+
213
+ interface Action {
214
+ type: ActionTypes;
215
+ payload: any;
216
+ }
217
+ /**
218
+ * Configuration options.
219
+ */
220
+ interface ConfigOptions$1 {
221
+ callbackFactory?: FRCallbackFactory;
222
+ clientId?: string;
223
+ middleware?: RequestMiddleware[];
224
+ realmPath?: string;
225
+ redirectUri?: string;
226
+ scope?: string;
227
+ serverConfig?: ServerConfig;
228
+ support?: 'modern' | 'legacy' | undefined;
229
+ tokenStore?: TokenStoreObject | 'indexedDB' | 'sessionStorage' | 'localStorage';
230
+ tree?: string;
231
+ type?: string;
232
+ oauthThreshold?: number;
233
+ }
234
+ /**
235
+ * Optional configuration for custom paths for actions
236
+ */
237
+ interface CustomPathConfig {
238
+ authenticate?: string;
239
+ authorize?: string;
240
+ accessToken?: string;
241
+ endSession?: string;
242
+ userInfo?: string;
243
+ revoke?: string;
244
+ sessions?: string;
245
+ }
246
+ declare type RequestMiddleware = (req: RequestObj, action: Action, next: () => RequestObj) => void;
247
+ interface RequestObj {
248
+ url: URL;
249
+ init: RequestInit;
250
+ }
251
+ /**
252
+ * Configuration settings for connecting to a server.
253
+ */
254
+ interface ServerConfig {
255
+ baseUrl: string;
256
+ paths?: CustomPathConfig;
257
+ timeout: number;
258
+ }
259
+ /**
260
+ * API for implementing a custom token store
261
+ */
262
+ interface TokenStoreObject {
263
+ get: (clientId: string) => Promise<Tokens>;
264
+ set: (clientId: string, token: Tokens) => Promise<void>;
265
+ remove: (clientId: string) => Promise<void>;
266
+ }
267
+
268
+ /**
269
+ * Types of steps returned by the authentication tree.
270
+ */
271
+ declare enum StepType {
272
+ LoginFailure = "LoginFailure",
273
+ LoginSuccess = "LoginSuccess",
274
+ Step = "Step"
275
+ }
276
+
277
+ /**
278
+ * Base interface for all types of authentication step responses.
279
+ */
280
+ interface AuthResponse {
281
+ type: StepType;
282
+ }
283
+ /**
284
+ * Represents details of a failure in an authentication step.
285
+ */
286
+ interface FailureDetail {
287
+ failureUrl?: string;
288
+ }
289
+
290
+ /**
291
+ * Represents a single step of an authentication tree.
292
+ */
293
+ declare class FRStep implements AuthResponse {
294
+ payload: Step$1;
295
+ /**
296
+ * The type of step.
297
+ */
298
+ readonly type = StepType.Step;
299
+ /**
300
+ * The callbacks contained in this step.
301
+ */
302
+ callbacks: FRCallback[];
303
+ /**
304
+ * @param payload The raw payload returned by OpenAM
305
+ * @param callbackFactory A function that returns am implementation of FRCallback
306
+ */
307
+ constructor(payload: Step$1, callbackFactory?: FRCallbackFactory);
308
+ /**
309
+ * Gets the first callback of the specified type in this step.
310
+ *
311
+ * @param type The type of callback to find.
312
+ */
313
+ getCallbackOfType<T extends FRCallback>(type: CallbackType): T;
314
+ /**
315
+ * Gets all callbacks of the specified type in this step.
316
+ *
317
+ * @param type The type of callback to find.
318
+ */
319
+ getCallbacksOfType<T extends FRCallback>(type: CallbackType): T[];
320
+ /**
321
+ * Sets the value of the first callback of the specified type in this step.
322
+ *
323
+ * @param type The type of callback to find.
324
+ * @param value The value to set for the callback.
325
+ */
326
+ setCallbackValue(type: CallbackType, value: unknown): void;
327
+ /**
328
+ * Gets the step's description.
329
+ */
330
+ getDescription(): string | undefined;
331
+ /**
332
+ * Gets the step's header.
333
+ */
334
+ getHeader(): string | undefined;
335
+ /**
336
+ * Gets the step's stage.
337
+ */
338
+ getStage(): string | undefined;
339
+ private convertCallbacks;
340
+ }
341
+
342
+ declare type HandleStep = (step: FRStep) => Promise<FRStep>;
343
+ /**
344
+ * Options to use when making an HTTP call.
345
+ */
346
+ interface HttpClientRequestOptions {
347
+ bypassAuthentication?: boolean;
348
+ authorization?: {
349
+ config?: ConfigOptions$1;
350
+ handleStep: HandleStep;
351
+ idToken?: string;
352
+ txnID?: string;
353
+ };
354
+ init: RequestInit;
355
+ requiresNewToken?: RequiresNewTokenFn;
356
+ timeout: number;
357
+ url: string;
358
+ }
359
+ /**
360
+ * A function that determines whether a new token is required based on a HTTP response.
361
+ */
362
+ declare type RequiresNewTokenFn = (res: Response) => boolean;
363
+
364
+ /**
365
+ * HTTP client that includes bearer token injection and refresh.
366
+ * This module also supports authorization for policy protected endpoints.
367
+ *
368
+ * Example:
369
+ *
370
+ * ```js
371
+ * return forgerock.HttpClient.request({
372
+ * url: `https://example.com/protected/resource`,
373
+ * init: {
374
+ * method: 'GET',
375
+ * credentials: 'include',
376
+ * },
377
+ * authorization: {
378
+ * handleStep: async (step) => {
379
+ * step.getCallbackOfType('PasswordCallback').setPassword(pw);
380
+ * return Promise.resolve(step);
381
+ * },
382
+ * },
383
+ * });
384
+ * ```
385
+ */
386
+ declare abstract class HttpClient extends Dispatcher {
387
+ /**
388
+ * Makes a request using the specified options.
389
+ *
390
+ * @param options The options to use when making the request
391
+ */
392
+ static request(options: HttpClientRequestOptions): Promise<Response>;
393
+ private static setAuthHeaders;
394
+ private static stepIterator;
395
+ private static _request;
396
+ }
397
+
398
+ declare function noop(): void;
399
+
400
+ /**
401
+ * INTERNAL, DO NOT USE. Code may change at any time.
402
+ */
403
+ interface Fragment {
404
+ key: string | null;
405
+ first: null;
406
+ c: () => void;
407
+ l: (nodes: any) => void;
408
+ h: () => void;
409
+ m: (target: HTMLElement, anchor: any) => void;
410
+ p: (ctx: T$$['ctx'], dirty: T$$['dirty']) => void;
411
+ r: () => void;
412
+ f: () => void;
413
+ a: () => void;
414
+ i: (local: any) => void;
415
+ o: (local: any) => void;
416
+ d: (detaching: 0 | 1) => void;
417
+ }
418
+ interface T$$ {
419
+ dirty: number[];
420
+ ctx: any[];
421
+ bound: any;
422
+ update: () => void;
423
+ callbacks: any;
424
+ after_update: any[];
425
+ props: Record<string, 0 | string>;
426
+ fragment: null | false | Fragment;
427
+ not_equal: any;
428
+ before_update: any[];
429
+ context: Map<any, any>;
430
+ on_mount: any[];
431
+ on_destroy: any[];
432
+ skip_bound: boolean;
433
+ on_disconnect: any[];
434
+ root: Element | ShadowRoot;
435
+ }
436
+
437
+ /**
438
+ * Base class for Svelte components. Used when dev=false.
439
+ */
440
+ declare class SvelteComponent {
441
+ $$: T$$;
442
+ $$set?: ($$props: any) => void;
443
+ $destroy(): void;
444
+ $on(type: any, callback: any): typeof noop;
445
+ $set($$props: any): void;
446
+ }
447
+
448
+ declare type Props = Record<string, any>;
449
+ interface ComponentConstructorOptions<Props extends Record<string, any> = Record<string, any>> {
450
+ target: Element | ShadowRoot;
451
+ anchor?: Element;
452
+ props?: Props;
453
+ context?: Map<any, any>;
454
+ hydrate?: boolean;
455
+ intro?: boolean;
456
+ $$inline?: boolean;
457
+ }
458
+ interface SvelteComponentDev$1 {
459
+ $set(props?: Props): void;
460
+ $on(event: string, callback: ((event: any) => void) | null | undefined): () => void;
461
+ $destroy(): void;
462
+ [accessor: string]: any;
463
+ }
464
+ /**
465
+ * Base class for Svelte components with some minor dev-enhancements. Used when dev=true.
466
+ */
467
+ declare class SvelteComponentDev$1 extends SvelteComponent {
468
+ /**
469
+ * @private
470
+ * For type checking capabilities only.
471
+ * Does not exist at runtime.
472
+ * ### DO NOT USE!
473
+ */
474
+ $$prop_def: Props;
475
+ /**
476
+ * @private
477
+ * For type checking capabilities only.
478
+ * Does not exist at runtime.
479
+ * ### DO NOT USE!
480
+ */
481
+ $$events_def: any;
482
+ /**
483
+ * @private
484
+ * For type checking capabilities only.
485
+ * Does not exist at runtime.
486
+ * ### DO NOT USE!
487
+ */
488
+ $$slot_def: any;
489
+ constructor(options: ComponentConstructorOptions);
490
+ $capture_state(): void;
491
+ $inject_state(): void;
492
+ }
493
+
494
+ /** Callback to inform of a value updates. */
495
+ declare type Subscriber<T> = (value: T) => void;
496
+ /** Unsubscribes from value updates. */
497
+ declare type Unsubscriber = () => void;
498
+ /** Callback to update a value. */
499
+ declare type Updater<T> = (value: T) => T;
500
+ /** Cleanup logic callback. */
501
+ declare type Invalidator<T> = (value?: T) => void;
502
+ /** Readable interface for subscribing. */
503
+ interface Readable<T> {
504
+ /**
505
+ * Subscribe on value changes.
506
+ * @param run subscription callback
507
+ * @param invalidate cleanup callback
508
+ */
509
+ subscribe(this: void, run: Subscriber<T>, invalidate?: Invalidator<T>): Unsubscriber;
510
+ }
511
+ /** Writable interface for both updating and subscribing. */
512
+ interface Writable<T> extends Readable<T> {
513
+ /**
514
+ * Set value and inform subscribers.
515
+ * @param value to set
516
+ */
517
+ set(this: void, value: T): void;
518
+ /**
519
+ * Update value using callback and inform subscribers.
520
+ * @param updater callback
521
+ */
522
+ update(this: void, updater: Updater<T>): void;
523
+ }
524
+
525
+ interface MessageCreator {
526
+ [key: string]: (propertyName: string, params?: {
527
+ [key: string]: unknown;
528
+ }) => string;
529
+ }
530
+ interface ProcessedPropertyError {
531
+ detail: FailedPolicyRequirement;
532
+ messages: string[];
533
+ }
534
+
535
+ declare class FRLoginFailure implements AuthResponse {
536
+ payload: Step$1;
537
+ /**
538
+ * The type of step.
539
+ */
540
+ readonly type = StepType.LoginFailure;
541
+ /**
542
+ * @param payload The raw payload returned by OpenAM
543
+ */
544
+ constructor(payload: Step$1);
545
+ /**
546
+ * Gets the error code.
547
+ */
548
+ getCode(): number;
549
+ /**
550
+ * Gets the failure details.
551
+ */
552
+ getDetail(): FailureDetail | undefined;
553
+ /**
554
+ * Gets the failure message.
555
+ */
556
+ getMessage(): string | undefined;
557
+ /**
558
+ * Gets processed failure message.
559
+ */
560
+ getProcessedMessage(messageCreator?: MessageCreator): ProcessedPropertyError[];
561
+ /**
562
+ * Gets the failure reason.
563
+ */
564
+ getReason(): string | undefined;
565
+ }
566
+
567
+ declare class FRLoginSuccess implements AuthResponse {
568
+ payload: Step$1;
569
+ /**
570
+ * The type of step.
571
+ */
572
+ readonly type = StepType.LoginSuccess;
573
+ /**
574
+ * @param payload The raw payload returned by OpenAM
575
+ */
576
+ constructor(payload: Step$1);
577
+ /**
578
+ * Gets the step's realm.
579
+ */
580
+ getRealm(): string | undefined;
581
+ /**
582
+ * Gets the step's session token.
583
+ */
584
+ getSessionToken(): string | undefined;
585
+ /**
586
+ * Gets the step's success URL.
587
+ */
588
+ getSuccessUrl(): string | undefined;
589
+ }
590
+
591
+ /**
592
+ * Tokens returned after successful authentication.
593
+ */
594
+ interface OAuth2Tokens$1 {
595
+ accessToken: string;
596
+ idToken?: string;
597
+ refreshToken?: string;
598
+ tokenExpiry?: number;
599
+ }
600
+
601
+ interface GetTokensOptions extends ConfigOptions$1 {
602
+ forceRenew?: boolean;
603
+ login?: 'embedded' | 'redirect' | undefined;
604
+ query?: StringDict<string>;
605
+ }
606
+
607
+ type Maybe<T> = T | null | undefined;
608
+
609
+ interface UserStore extends Pick<Writable<UserStoreValue$1>, 'subscribe'> {
610
+ get: (getOptions?: ConfigOptions$1) => void;
611
+ reset: () => void;
612
+ }
613
+ interface UserStoreValue$1 {
614
+ completed: boolean;
615
+ error: Maybe<{
616
+ code?: Maybe<number>;
617
+ message: Maybe<string>;
618
+ troubleshoot: Maybe<string>;
619
+ }>;
620
+ loading: boolean;
621
+ successful: boolean;
622
+ response: unknown;
623
+ }
624
+
625
+ interface OAuthStore extends Pick<Writable<OAuthTokenStoreValue$1>, 'subscribe'> {
626
+ get: (getOptions?: GetTokensOptions) => void;
627
+ reset: () => void;
628
+ }
629
+ interface OAuthTokenStoreValue$1 {
630
+ completed: boolean;
631
+ error: Maybe<{
632
+ code?: Maybe<number>;
633
+ message: Maybe<string>;
634
+ troubleshoot: Maybe<string>;
635
+ }>;
636
+ loading: boolean;
637
+ successful: boolean;
638
+ response: Maybe<OAuth2Tokens$1> | void;
639
+ }
640
+
641
+ interface CallbackMetadata {
642
+ derived: {
643
+ canForceUserInputOptionality: boolean;
644
+ isFirstInvalidInput: boolean;
645
+ isReadyForSubmission: boolean;
646
+ isSelfSubmitting: boolean;
647
+ isUserInputRequired: boolean;
648
+ };
649
+ idx: number;
650
+ platform?: Record<string, unknown>;
651
+ }
652
+ interface JourneyStore extends Pick<Writable<JourneyStoreValue$1>, 'subscribe'> {
653
+ next: (prevStep?: StepTypes, nextOptions?: StepOptions) => void;
654
+ pop: () => void;
655
+ push: (changeOptions: StepOptions) => void;
656
+ reset: () => void;
657
+ resume: (url: string, resumeOptions?: StepOptions) => void;
658
+ start: (startOptions?: StepOptions) => void;
659
+ }
660
+ interface JourneyStoreValue$1 {
661
+ completed: boolean;
662
+ error: Maybe<{
663
+ code: Maybe<number>;
664
+ message: Maybe<string>;
665
+ stage: Maybe<string>;
666
+ troubleshoot: Maybe<string>;
667
+ }>;
668
+ loading: boolean;
669
+ metadata: {
670
+ callbacks: CallbackMetadata[];
671
+ step: StepMetadata;
672
+ } | null;
673
+ step: StepTypes;
674
+ successful: boolean;
675
+ response: Maybe<Step$1>;
676
+ }
677
+ interface StepMetadata {
678
+ derived: {
679
+ isUserInputOptional: boolean;
680
+ isStepSelfSubmittable: boolean;
681
+ numOfCallbacks: number;
682
+ numOfSelfSubmittableCbs: number;
683
+ numOfUserInputCbs: number;
684
+ };
685
+ platform?: Record<string, unknown>;
686
+ }
687
+ type StepTypes = FRStep | FRLoginSuccess | FRLoginFailure | null;
688
+
689
+
690
+ interface ComponentStoreValue {
691
+ lastAction: 'close' | 'open' | 'mount' | null;
692
+ error: {
693
+ code: string;
694
+ message: string;
695
+ } | null;
696
+ modal: {
697
+ component: SvelteComponentDev$1;
698
+ element: HTMLDialogElement;
699
+ } | null;
700
+ mounted: boolean;
701
+ open: boolean | null;
702
+ reason: 'auto' | 'external' | 'user' | null;
703
+ type: 'inline' | 'modal' | null;
704
+ }
705
+
706
+ declare type Primitive = string | number | symbol | bigint | boolean | null | undefined;
707
+
708
+ declare namespace util {
709
+ type AssertEqual<T, U> = (<V>() => V extends T ? 1 : 2) extends <V>() => V extends U ? 1 : 2 ? true : false;
710
+ export type isAny<T> = 0 extends 1 & T ? true : false;
711
+ export const assertEqual: <A, B>(val: AssertEqual<A, B>) => AssertEqual<A, B>;
712
+ export function assertIs<T>(_arg: T): void;
713
+ export function assertNever(_x: never): never;
714
+ export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
715
+ export type OmitKeys<T, K extends string> = Pick<T, Exclude<keyof T, K>>;
716
+ export type MakePartial<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
717
+ export const arrayToEnum: <T extends string, U extends [T, ...T[]]>(items: U) => { [k in U[number]]: k; };
718
+ export const getValidEnumValues: (obj: any) => any[];
719
+ export const objectValues: (obj: any) => any[];
720
+ export const objectKeys: ObjectConstructor["keys"];
721
+ export const find: <T>(arr: T[], checker: (arg: T) => any) => T | undefined;
722
+ export type identity<T> = objectUtil.identity<T>;
723
+ export type flatten<T> = objectUtil.flatten<T>;
724
+ export type noUndefined<T> = T extends undefined ? never : T;
725
+ export const isInteger: NumberConstructor["isInteger"];
726
+ export function joinValues<T extends any[]>(array: T, separator?: string): string;
727
+ export const jsonStringifyReplacer: (_: string, value: any) => any;
728
+ export {};
729
+ }
730
+ declare namespace objectUtil {
731
+ export type MergeShapes<U, V> = {
732
+ [k in Exclude<keyof U, keyof V>]: U[k];
733
+ } & V;
734
+ type requiredKeys<T extends object> = {
735
+ [k in keyof T]: undefined extends T[k] ? never : k;
736
+ }[keyof T];
737
+ export type addQuestionMarks<T extends object, R extends keyof T = requiredKeys<T>> = Pick<Required<T>, R> & Partial<T>;
738
+ export type identity<T> = T;
739
+ export type flatten<T> = identity<{
740
+ [k in keyof T]: T[k];
741
+ }>;
742
+ export type noNeverKeys<T> = {
743
+ [k in keyof T]: [T[k]] extends [never] ? never : k;
744
+ }[keyof T];
745
+ export type noNever<T> = identity<{
746
+ [k in noNeverKeys<T>]: k extends keyof T ? T[k] : never;
747
+ }>;
748
+ export const mergeShapes: <U, T>(first: U, second: T) => T & U;
749
+ export type extendShape<A, B> = flatten<Omit<A, keyof B> & B>;
750
+ export {};
751
+ }
752
+ declare const ZodParsedType: {
753
+ function: "function";
754
+ number: "number";
755
+ string: "string";
756
+ nan: "nan";
757
+ integer: "integer";
758
+ float: "float";
759
+ boolean: "boolean";
760
+ date: "date";
761
+ bigint: "bigint";
762
+ symbol: "symbol";
763
+ undefined: "undefined";
764
+ null: "null";
765
+ array: "array";
766
+ object: "object";
767
+ unknown: "unknown";
768
+ promise: "promise";
769
+ void: "void";
770
+ never: "never";
771
+ map: "map";
772
+ set: "set";
773
+ };
774
+ declare type ZodParsedType = keyof typeof ZodParsedType;
775
+
776
+ declare type allKeys<T> = T extends any ? keyof T : never;
777
+ declare type typeToFlattenedError<T, U = string> = {
778
+ formErrors: U[];
779
+ fieldErrors: {
780
+ [P in allKeys<T>]?: U[];
781
+ };
782
+ };
783
+ declare const ZodIssueCode: {
784
+ invalid_type: "invalid_type";
785
+ invalid_literal: "invalid_literal";
786
+ custom: "custom";
787
+ invalid_union: "invalid_union";
788
+ invalid_union_discriminator: "invalid_union_discriminator";
789
+ invalid_enum_value: "invalid_enum_value";
790
+ unrecognized_keys: "unrecognized_keys";
791
+ invalid_arguments: "invalid_arguments";
792
+ invalid_return_type: "invalid_return_type";
793
+ invalid_date: "invalid_date";
794
+ invalid_string: "invalid_string";
795
+ too_small: "too_small";
796
+ too_big: "too_big";
797
+ invalid_intersection_types: "invalid_intersection_types";
798
+ not_multiple_of: "not_multiple_of";
799
+ not_finite: "not_finite";
800
+ };
801
+ declare type ZodIssueCode = keyof typeof ZodIssueCode;
802
+ declare type ZodIssueBase = {
803
+ path: (string | number)[];
804
+ message?: string;
805
+ };
806
+ interface ZodInvalidTypeIssue extends ZodIssueBase {
807
+ code: typeof ZodIssueCode.invalid_type;
808
+ expected: ZodParsedType;
809
+ received: ZodParsedType;
810
+ }
811
+ interface ZodInvalidLiteralIssue extends ZodIssueBase {
812
+ code: typeof ZodIssueCode.invalid_literal;
813
+ expected: unknown;
814
+ received: unknown;
815
+ }
816
+ interface ZodUnrecognizedKeysIssue extends ZodIssueBase {
817
+ code: typeof ZodIssueCode.unrecognized_keys;
818
+ keys: string[];
819
+ }
820
+ interface ZodInvalidUnionIssue extends ZodIssueBase {
821
+ code: typeof ZodIssueCode.invalid_union;
822
+ unionErrors: ZodError[];
823
+ }
824
+ interface ZodInvalidUnionDiscriminatorIssue extends ZodIssueBase {
825
+ code: typeof ZodIssueCode.invalid_union_discriminator;
826
+ options: Primitive[];
827
+ }
828
+ interface ZodInvalidEnumValueIssue extends ZodIssueBase {
829
+ received: string | number;
830
+ code: typeof ZodIssueCode.invalid_enum_value;
831
+ options: (string | number)[];
832
+ }
833
+ interface ZodInvalidArgumentsIssue extends ZodIssueBase {
834
+ code: typeof ZodIssueCode.invalid_arguments;
835
+ argumentsError: ZodError;
836
+ }
837
+ interface ZodInvalidReturnTypeIssue extends ZodIssueBase {
838
+ code: typeof ZodIssueCode.invalid_return_type;
839
+ returnTypeError: ZodError;
840
+ }
841
+ interface ZodInvalidDateIssue extends ZodIssueBase {
842
+ code: typeof ZodIssueCode.invalid_date;
843
+ }
844
+ declare type StringValidation = "email" | "url" | "emoji" | "uuid" | "regex" | "cuid" | "cuid2" | "ulid" | "datetime" | "ip" | {
845
+ includes: string;
846
+ position?: number;
847
+ } | {
848
+ startsWith: string;
849
+ } | {
850
+ endsWith: string;
851
+ };
852
+ interface ZodInvalidStringIssue extends ZodIssueBase {
853
+ code: typeof ZodIssueCode.invalid_string;
854
+ validation: StringValidation;
855
+ }
856
+ interface ZodTooSmallIssue extends ZodIssueBase {
857
+ code: typeof ZodIssueCode.too_small;
858
+ minimum: number | bigint;
859
+ inclusive: boolean;
860
+ exact?: boolean;
861
+ type: "array" | "string" | "number" | "set" | "date" | "bigint";
862
+ }
863
+ interface ZodTooBigIssue extends ZodIssueBase {
864
+ code: typeof ZodIssueCode.too_big;
865
+ maximum: number | bigint;
866
+ inclusive: boolean;
867
+ exact?: boolean;
868
+ type: "array" | "string" | "number" | "set" | "date" | "bigint";
869
+ }
870
+ interface ZodInvalidIntersectionTypesIssue extends ZodIssueBase {
871
+ code: typeof ZodIssueCode.invalid_intersection_types;
872
+ }
873
+ interface ZodNotMultipleOfIssue extends ZodIssueBase {
874
+ code: typeof ZodIssueCode.not_multiple_of;
875
+ multipleOf: number | bigint;
876
+ }
877
+ interface ZodNotFiniteIssue extends ZodIssueBase {
878
+ code: typeof ZodIssueCode.not_finite;
879
+ }
880
+ interface ZodCustomIssue extends ZodIssueBase {
881
+ code: typeof ZodIssueCode.custom;
882
+ params?: {
883
+ [k: string]: any;
884
+ };
885
+ }
886
+ declare type ZodIssueOptionalMessage = ZodInvalidTypeIssue | ZodInvalidLiteralIssue | ZodUnrecognizedKeysIssue | ZodInvalidUnionIssue | ZodInvalidUnionDiscriminatorIssue | ZodInvalidEnumValueIssue | ZodInvalidArgumentsIssue | ZodInvalidReturnTypeIssue | ZodInvalidDateIssue | ZodInvalidStringIssue | ZodTooSmallIssue | ZodTooBigIssue | ZodInvalidIntersectionTypesIssue | ZodNotMultipleOfIssue | ZodNotFiniteIssue | ZodCustomIssue;
887
+ declare type ZodIssue = ZodIssueOptionalMessage & {
888
+ fatal?: boolean;
889
+ message: string;
890
+ };
891
+ declare type recursiveZodFormattedError<T> = T extends [any, ...any[]] ? {
892
+ [K in keyof T]?: ZodFormattedError<T[K]>;
893
+ } : T extends any[] ? {
894
+ [k: number]: ZodFormattedError<T[number]>;
895
+ } : T extends object ? {
896
+ [K in keyof T]?: ZodFormattedError<T[K]>;
897
+ } : unknown;
898
+ declare type ZodFormattedError<T, U = string> = {
899
+ _errors: U[];
900
+ } & recursiveZodFormattedError<NonNullable<T>>;
901
+ declare class ZodError<T = any> extends Error {
902
+ issues: ZodIssue[];
903
+ get errors(): ZodIssue[];
904
+ constructor(issues: ZodIssue[]);
905
+ format(): ZodFormattedError<T>;
906
+ format<U>(mapper: (issue: ZodIssue) => U): ZodFormattedError<T, U>;
907
+ static create: (issues: ZodIssue[]) => ZodError<any>;
908
+ toString(): string;
909
+ get message(): string;
910
+ get isEmpty(): boolean;
911
+ addIssue: (sub: ZodIssue) => void;
912
+ addIssues: (subs?: ZodIssue[]) => void;
913
+ flatten(): typeToFlattenedError<T>;
914
+ flatten<U>(mapper?: (issue: ZodIssue) => U): typeToFlattenedError<T, U>;
915
+ get formErrors(): typeToFlattenedError<T, string>;
916
+ }
917
+ declare type stripPath<T extends object> = T extends any ? util.OmitKeys<T, "path"> : never;
918
+ declare type IssueData = stripPath<ZodIssueOptionalMessage> & {
919
+ path?: (string | number)[];
920
+ fatal?: boolean;
921
+ };
922
+ declare type ErrorMapCtx = {
923
+ defaultError: string;
924
+ data: any;
925
+ };
926
+ declare type ZodErrorMap = (issue: ZodIssueOptionalMessage, _ctx: ErrorMapCtx) => {
927
+ message: string;
928
+ };
929
+
930
+ declare type ParseParams = {
931
+ path: (string | number)[];
932
+ errorMap: ZodErrorMap;
933
+ async: boolean;
934
+ };
935
+ declare type ParsePathComponent = string | number;
936
+ declare type ParsePath = ParsePathComponent[];
937
+ interface ParseContext {
938
+ readonly common: {
939
+ readonly issues: ZodIssue[];
940
+ readonly contextualErrorMap?: ZodErrorMap;
941
+ readonly async: boolean;
942
+ };
943
+ readonly path: ParsePath;
944
+ readonly schemaErrorMap?: ZodErrorMap;
945
+ readonly parent: ParseContext | null;
946
+ readonly data: any;
947
+ readonly parsedType: ZodParsedType;
948
+ }
949
+ declare type ParseInput = {
950
+ data: any;
951
+ path: (string | number)[];
952
+ parent: ParseContext;
953
+ };
954
+ declare class ParseStatus {
955
+ value: "aborted" | "dirty" | "valid";
956
+ dirty(): void;
957
+ abort(): void;
958
+ static mergeArray(status: ParseStatus, results: SyncParseReturnType<any>[]): SyncParseReturnType;
959
+ static mergeObjectAsync(status: ParseStatus, pairs: {
960
+ key: ParseReturnType<any>;
961
+ value: ParseReturnType<any>;
962
+ }[]): Promise<SyncParseReturnType<any>>;
963
+ static mergeObjectSync(status: ParseStatus, pairs: {
964
+ key: SyncParseReturnType<any>;
965
+ value: SyncParseReturnType<any>;
966
+ alwaysSet?: boolean;
967
+ }[]): SyncParseReturnType;
968
+ }
969
+ declare type INVALID = {
970
+ status: "aborted";
971
+ };
972
+ declare const INVALID: INVALID;
973
+ declare type DIRTY<T> = {
974
+ status: "dirty";
975
+ value: T;
976
+ };
977
+ declare const DIRTY: <T>(value: T) => DIRTY<T>;
978
+ declare type OK<T> = {
979
+ status: "valid";
980
+ value: T;
981
+ };
982
+ declare const OK: <T>(value: T) => OK<T>;
983
+ declare type SyncParseReturnType<T = any> = OK<T> | DIRTY<T> | INVALID;
984
+ declare type AsyncParseReturnType<T> = Promise<SyncParseReturnType<T>>;
985
+ declare type ParseReturnType<T> = SyncParseReturnType<T> | AsyncParseReturnType<T>;
986
+
987
+ declare namespace enumUtil {
988
+ type UnionToIntersectionFn<T> = (T extends unknown ? (k: () => T) => void : never) extends (k: infer Intersection) => void ? Intersection : never;
989
+ type GetUnionLast<T> = UnionToIntersectionFn<T> extends () => infer Last ? Last : never;
990
+ type UnionToTuple<T, Tuple extends unknown[] = []> = [T] extends [never] ? Tuple : UnionToTuple<Exclude<T, GetUnionLast<T>>, [GetUnionLast<T>, ...Tuple]>;
991
+ type CastToStringTuple<T> = T extends [string, ...string[]] ? T : never;
992
+ export type UnionToTupleString<T> = CastToStringTuple<UnionToTuple<T>>;
993
+ export {};
994
+ }
995
+
996
+ declare namespace errorUtil {
997
+ type ErrMessage = string | {
998
+ message?: string;
999
+ };
1000
+ const errToObj: (message?: ErrMessage | undefined) => {
1001
+ message?: string | undefined;
1002
+ };
1003
+ const toString: (message?: ErrMessage | undefined) => string | undefined;
1004
+ }
1005
+
1006
+ declare namespace partialUtil {
1007
+ type DeepPartial<T extends ZodTypeAny> = T extends ZodObject<ZodRawShape> ? ZodObject<{
1008
+ [k in keyof T["shape"]]: ZodOptional<DeepPartial<T["shape"][k]>>;
1009
+ }, T["_def"]["unknownKeys"], T["_def"]["catchall"]> : T extends ZodArray<infer Type, infer Card> ? ZodArray<DeepPartial<Type>, Card> : T extends ZodOptional<infer Type> ? ZodOptional<DeepPartial<Type>> : T extends ZodNullable<infer Type> ? ZodNullable<DeepPartial<Type>> : T extends ZodTuple<infer Items> ? {
1010
+ [k in keyof Items]: Items[k] extends ZodTypeAny ? DeepPartial<Items[k]> : never;
1011
+ } extends infer PI ? PI extends ZodTupleItems ? ZodTuple<PI> : never : never : T;
1012
+ }
1013
+
1014
+ declare type RefinementCtx = {
1015
+ addIssue: (arg: IssueData) => void;
1016
+ path: (string | number)[];
1017
+ };
1018
+ declare type ZodRawShape = {
1019
+ [k: string]: ZodTypeAny;
1020
+ };
1021
+ declare type ZodTypeAny = ZodType<any, any, any>;
1022
+ declare type TypeOf<T extends ZodType<any, any, any>> = T["_output"];
1023
+ declare type input<T extends ZodType<any, any, any>> = T["_input"];
1024
+ declare type output<T extends ZodType<any, any, any>> = T["_output"];
1025
+
1026
+ declare type CustomErrorParams = Partial<util.Omit<ZodCustomIssue, "code">>;
1027
+ interface ZodTypeDef {
1028
+ errorMap?: ZodErrorMap;
1029
+ description?: string;
1030
+ }
1031
+ declare type RawCreateParams = {
1032
+ errorMap?: ZodErrorMap;
1033
+ invalid_type_error?: string;
1034
+ required_error?: string;
1035
+ description?: string;
1036
+ } | undefined;
1037
+ declare type SafeParseSuccess<Output> = {
1038
+ success: true;
1039
+ data: Output;
1040
+ };
1041
+ declare type SafeParseError<Input> = {
1042
+ success: false;
1043
+ error: ZodError<Input>;
1044
+ };
1045
+ declare type SafeParseReturnType<Input, Output> = SafeParseSuccess<Output> | SafeParseError<Input>;
1046
+ declare abstract class ZodType<Output = any, Def extends ZodTypeDef = ZodTypeDef, Input = Output> {
1047
+ readonly _type: Output;
1048
+ readonly _output: Output;
1049
+ readonly _input: Input;
1050
+ readonly _def: Def;
1051
+ get description(): string | undefined;
1052
+ abstract _parse(input: ParseInput): ParseReturnType<Output>;
1053
+ _getType(input: ParseInput): string;
1054
+ _getOrReturnCtx(input: ParseInput, ctx?: ParseContext | undefined): ParseContext;
1055
+ _processInputParams(input: ParseInput): {
1056
+ status: ParseStatus;
1057
+ ctx: ParseContext;
1058
+ };
1059
+ _parseSync(input: ParseInput): SyncParseReturnType<Output>;
1060
+ _parseAsync(input: ParseInput): AsyncParseReturnType<Output>;
1061
+ parse(data: unknown, params?: Partial<ParseParams>): Output;
1062
+ safeParse(data: unknown, params?: Partial<ParseParams>): SafeParseReturnType<Input, Output>;
1063
+ parseAsync(data: unknown, params?: Partial<ParseParams>): Promise<Output>;
1064
+ safeParseAsync(data: unknown, params?: Partial<ParseParams>): Promise<SafeParseReturnType<Input, Output>>;
1065
+ spa: (data: unknown, params?: Partial<ParseParams> | undefined) => Promise<SafeParseReturnType<Input, Output>>;
1066
+ refine<RefinedOutput extends Output>(check: (arg: Output) => arg is RefinedOutput, message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)): ZodEffects<this, RefinedOutput, Input>;
1067
+ refine(check: (arg: Output) => unknown | Promise<unknown>, message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)): ZodEffects<this, Output, Input>;
1068
+ refinement<RefinedOutput extends Output>(check: (arg: Output) => arg is RefinedOutput, refinementData: IssueData | ((arg: Output, ctx: RefinementCtx) => IssueData)): ZodEffects<this, RefinedOutput, Input>;
1069
+ refinement(check: (arg: Output) => boolean, refinementData: IssueData | ((arg: Output, ctx: RefinementCtx) => IssueData)): ZodEffects<this, Output, Input>;
1070
+ _refinement(refinement: RefinementEffect<Output>["refinement"]): ZodEffects<this, Output, Input>;
1071
+ superRefine<RefinedOutput extends Output>(refinement: (arg: Output, ctx: RefinementCtx) => arg is RefinedOutput): ZodEffects<this, RefinedOutput, Input>;
1072
+ superRefine(refinement: (arg: Output, ctx: RefinementCtx) => void): ZodEffects<this, Output, Input>;
1073
+ constructor(def: Def);
1074
+ optional(): ZodOptional<this>;
1075
+ nullable(): ZodNullable<this>;
1076
+ nullish(): ZodOptional<ZodNullable<this>>;
1077
+ array(): ZodArray<this>;
1078
+ promise(): ZodPromise<this>;
1079
+ or<T extends ZodTypeAny>(option: T): ZodUnion<[this, T]>;
1080
+ and<T extends ZodTypeAny>(incoming: T): ZodIntersection<this, T>;
1081
+ transform<NewOut>(transform: (arg: Output, ctx: RefinementCtx) => NewOut | Promise<NewOut>): ZodEffects<this, NewOut>;
1082
+ default(def: util.noUndefined<Input>): ZodDefault<this>;
1083
+ default(def: () => util.noUndefined<Input>): ZodDefault<this>;
1084
+ brand<B extends string | number | symbol>(brand?: B): ZodBranded<this, B>;
1085
+ catch(def: Output): ZodCatch<this>;
1086
+ catch(def: (ctx: {
1087
+ error: ZodError;
1088
+ input: Input;
1089
+ }) => Output): ZodCatch<this>;
1090
+ describe(description: string): this;
1091
+ pipe<T extends ZodTypeAny>(target: T): ZodPipeline<this, T>;
1092
+ isOptional(): boolean;
1093
+ isNullable(): boolean;
1094
+ }
1095
+ declare type IpVersion = "v4" | "v6";
1096
+ declare type ZodStringCheck = {
1097
+ kind: "min";
1098
+ value: number;
1099
+ message?: string;
1100
+ } | {
1101
+ kind: "max";
1102
+ value: number;
1103
+ message?: string;
1104
+ } | {
1105
+ kind: "length";
1106
+ value: number;
1107
+ message?: string;
1108
+ } | {
1109
+ kind: "email";
1110
+ message?: string;
1111
+ } | {
1112
+ kind: "url";
1113
+ message?: string;
1114
+ } | {
1115
+ kind: "emoji";
1116
+ message?: string;
1117
+ } | {
1118
+ kind: "uuid";
1119
+ message?: string;
1120
+ } | {
1121
+ kind: "cuid";
1122
+ message?: string;
1123
+ } | {
1124
+ kind: "includes";
1125
+ value: string;
1126
+ position?: number;
1127
+ message?: string;
1128
+ } | {
1129
+ kind: "cuid2";
1130
+ message?: string;
1131
+ } | {
1132
+ kind: "ulid";
1133
+ message?: string;
1134
+ } | {
1135
+ kind: "startsWith";
1136
+ value: string;
1137
+ message?: string;
1138
+ } | {
1139
+ kind: "endsWith";
1140
+ value: string;
1141
+ message?: string;
1142
+ } | {
1143
+ kind: "regex";
1144
+ regex: RegExp;
1145
+ message?: string;
1146
+ } | {
1147
+ kind: "trim";
1148
+ message?: string;
1149
+ } | {
1150
+ kind: "toLowerCase";
1151
+ message?: string;
1152
+ } | {
1153
+ kind: "toUpperCase";
1154
+ message?: string;
1155
+ } | {
1156
+ kind: "datetime";
1157
+ offset: boolean;
1158
+ precision: number | null;
1159
+ message?: string;
1160
+ } | {
1161
+ kind: "ip";
1162
+ version?: IpVersion;
1163
+ message?: string;
1164
+ };
1165
+ interface ZodStringDef extends ZodTypeDef {
1166
+ checks: ZodStringCheck[];
1167
+ typeName: ZodFirstPartyTypeKind.ZodString;
1168
+ coerce: boolean;
1169
+ }
1170
+ declare class ZodString extends ZodType<string, ZodStringDef> {
1171
+ _parse(input: ParseInput): ParseReturnType<string>;
1172
+ protected _regex: (regex: RegExp, validation: StringValidation, message?: errorUtil.ErrMessage | undefined) => ZodEffects<this, string, string>;
1173
+ _addCheck(check: ZodStringCheck): ZodString;
1174
+ email(message?: errorUtil.ErrMessage): ZodString;
1175
+ url(message?: errorUtil.ErrMessage): ZodString;
1176
+ emoji(message?: errorUtil.ErrMessage): ZodString;
1177
+ uuid(message?: errorUtil.ErrMessage): ZodString;
1178
+ cuid(message?: errorUtil.ErrMessage): ZodString;
1179
+ cuid2(message?: errorUtil.ErrMessage): ZodString;
1180
+ ulid(message?: errorUtil.ErrMessage): ZodString;
1181
+ ip(options?: string | {
1182
+ version?: "v4" | "v6";
1183
+ message?: string;
1184
+ }): ZodString;
1185
+ datetime(options?: string | {
1186
+ message?: string | undefined;
1187
+ precision?: number | null;
1188
+ offset?: boolean;
1189
+ }): ZodString;
1190
+ regex(regex: RegExp, message?: errorUtil.ErrMessage): ZodString;
1191
+ includes(value: string, options?: {
1192
+ message?: string;
1193
+ position?: number;
1194
+ }): ZodString;
1195
+ startsWith(value: string, message?: errorUtil.ErrMessage): ZodString;
1196
+ endsWith(value: string, message?: errorUtil.ErrMessage): ZodString;
1197
+ min(minLength: number, message?: errorUtil.ErrMessage): ZodString;
1198
+ max(maxLength: number, message?: errorUtil.ErrMessage): ZodString;
1199
+ length(len: number, message?: errorUtil.ErrMessage): ZodString;
1200
+ nonempty: (message?: errorUtil.ErrMessage | undefined) => ZodString;
1201
+ trim: () => ZodString;
1202
+ toLowerCase: () => ZodString;
1203
+ toUpperCase: () => ZodString;
1204
+ get isDatetime(): boolean;
1205
+ get isEmail(): boolean;
1206
+ get isURL(): boolean;
1207
+ get isEmoji(): boolean;
1208
+ get isUUID(): boolean;
1209
+ get isCUID(): boolean;
1210
+ get isCUID2(): boolean;
1211
+ get isULID(): boolean;
1212
+ get isIP(): boolean;
1213
+ get minLength(): number | null;
1214
+ get maxLength(): number | null;
1215
+ static create: (params?: ({
1216
+ errorMap?: ZodErrorMap | undefined;
1217
+ invalid_type_error?: string | undefined;
1218
+ required_error?: string | undefined;
1219
+ description?: string | undefined;
1220
+ } & {
1221
+ coerce?: true | undefined;
1222
+ }) | undefined) => ZodString;
1223
+ }
1224
+ declare type ZodNumberCheck = {
1225
+ kind: "min";
1226
+ value: number;
1227
+ inclusive: boolean;
1228
+ message?: string;
1229
+ } | {
1230
+ kind: "max";
1231
+ value: number;
1232
+ inclusive: boolean;
1233
+ message?: string;
1234
+ } | {
1235
+ kind: "int";
1236
+ message?: string;
1237
+ } | {
1238
+ kind: "multipleOf";
1239
+ value: number;
1240
+ message?: string;
1241
+ } | {
1242
+ kind: "finite";
1243
+ message?: string;
1244
+ };
1245
+ interface ZodNumberDef extends ZodTypeDef {
1246
+ checks: ZodNumberCheck[];
1247
+ typeName: ZodFirstPartyTypeKind.ZodNumber;
1248
+ coerce: boolean;
1249
+ }
1250
+ declare class ZodNumber extends ZodType<number, ZodNumberDef> {
1251
+ _parse(input: ParseInput): ParseReturnType<number>;
1252
+ static create: (params?: ({
1253
+ errorMap?: ZodErrorMap | undefined;
1254
+ invalid_type_error?: string | undefined;
1255
+ required_error?: string | undefined;
1256
+ description?: string | undefined;
1257
+ } & {
1258
+ coerce?: boolean | undefined;
1259
+ }) | undefined) => ZodNumber;
1260
+ gte(value: number, message?: errorUtil.ErrMessage): ZodNumber;
1261
+ min: (value: number, message?: errorUtil.ErrMessage | undefined) => ZodNumber;
1262
+ gt(value: number, message?: errorUtil.ErrMessage): ZodNumber;
1263
+ lte(value: number, message?: errorUtil.ErrMessage): ZodNumber;
1264
+ max: (value: number, message?: errorUtil.ErrMessage | undefined) => ZodNumber;
1265
+ lt(value: number, message?: errorUtil.ErrMessage): ZodNumber;
1266
+ protected setLimit(kind: "min" | "max", value: number, inclusive: boolean, message?: string): ZodNumber;
1267
+ _addCheck(check: ZodNumberCheck): ZodNumber;
1268
+ int(message?: errorUtil.ErrMessage): ZodNumber;
1269
+ positive(message?: errorUtil.ErrMessage): ZodNumber;
1270
+ negative(message?: errorUtil.ErrMessage): ZodNumber;
1271
+ nonpositive(message?: errorUtil.ErrMessage): ZodNumber;
1272
+ nonnegative(message?: errorUtil.ErrMessage): ZodNumber;
1273
+ multipleOf(value: number, message?: errorUtil.ErrMessage): ZodNumber;
1274
+ step: (value: number, message?: errorUtil.ErrMessage | undefined) => ZodNumber;
1275
+ finite(message?: errorUtil.ErrMessage): ZodNumber;
1276
+ safe(message?: errorUtil.ErrMessage): ZodNumber;
1277
+ get minValue(): number | null;
1278
+ get maxValue(): number | null;
1279
+ get isInt(): boolean;
1280
+ get isFinite(): boolean;
1281
+ }
1282
+ interface ZodBooleanDef extends ZodTypeDef {
1283
+ typeName: ZodFirstPartyTypeKind.ZodBoolean;
1284
+ coerce: boolean;
1285
+ }
1286
+ declare class ZodBoolean extends ZodType<boolean, ZodBooleanDef> {
1287
+ _parse(input: ParseInput): ParseReturnType<boolean>;
1288
+ static create: (params?: ({
1289
+ errorMap?: ZodErrorMap | undefined;
1290
+ invalid_type_error?: string | undefined;
1291
+ required_error?: string | undefined;
1292
+ description?: string | undefined;
1293
+ } & {
1294
+ coerce?: boolean | undefined;
1295
+ }) | undefined) => ZodBoolean;
1296
+ }
1297
+ interface ZodUnknownDef extends ZodTypeDef {
1298
+ typeName: ZodFirstPartyTypeKind.ZodUnknown;
1299
+ }
1300
+ declare class ZodUnknown extends ZodType<unknown, ZodUnknownDef> {
1301
+ _unknown: true;
1302
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
1303
+ static create: (params?: RawCreateParams) => ZodUnknown;
1304
+ }
1305
+ interface ZodVoidDef extends ZodTypeDef {
1306
+ typeName: ZodFirstPartyTypeKind.ZodVoid;
1307
+ }
1308
+ declare class ZodVoid extends ZodType<void, ZodVoidDef> {
1309
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
1310
+ static create: (params?: RawCreateParams) => ZodVoid;
1311
+ }
1312
+ interface ZodArrayDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
1313
+ type: T;
1314
+ typeName: ZodFirstPartyTypeKind.ZodArray;
1315
+ exactLength: {
1316
+ value: number;
1317
+ message?: string;
1318
+ } | null;
1319
+ minLength: {
1320
+ value: number;
1321
+ message?: string;
1322
+ } | null;
1323
+ maxLength: {
1324
+ value: number;
1325
+ message?: string;
1326
+ } | null;
1327
+ }
1328
+ declare type ArrayCardinality = "many" | "atleastone";
1329
+ declare type arrayOutputType<T extends ZodTypeAny, Cardinality extends ArrayCardinality = "many"> = Cardinality extends "atleastone" ? [T["_output"], ...T["_output"][]] : T["_output"][];
1330
+ declare class ZodArray<T extends ZodTypeAny, Cardinality extends ArrayCardinality = "many"> extends ZodType<arrayOutputType<T, Cardinality>, ZodArrayDef<T>, Cardinality extends "atleastone" ? [T["_input"], ...T["_input"][]] : T["_input"][]> {
1331
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
1332
+ get element(): T;
1333
+ min(minLength: number, message?: errorUtil.ErrMessage): this;
1334
+ max(maxLength: number, message?: errorUtil.ErrMessage): this;
1335
+ length(len: number, message?: errorUtil.ErrMessage): this;
1336
+ nonempty(message?: errorUtil.ErrMessage): ZodArray<T, "atleastone">;
1337
+ static create: <T_1 extends ZodTypeAny>(schema: T_1, params?: RawCreateParams) => ZodArray<T_1, "many">;
1338
+ }
1339
+ declare type UnknownKeysParam = "passthrough" | "strict" | "strip";
1340
+ interface ZodObjectDef<T extends ZodRawShape = ZodRawShape, UnknownKeys extends UnknownKeysParam = UnknownKeysParam, Catchall extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
1341
+ typeName: ZodFirstPartyTypeKind.ZodObject;
1342
+ shape: () => T;
1343
+ catchall: Catchall;
1344
+ unknownKeys: UnknownKeys;
1345
+ }
1346
+ declare type objectOutputType<Shape extends ZodRawShape, Catchall extends ZodTypeAny, UnknownKeys extends UnknownKeysParam = UnknownKeysParam> = objectUtil.flatten<objectUtil.addQuestionMarks<baseObjectOutputType<Shape>>> & CatchallOutput<Catchall> & PassthroughType<UnknownKeys>;
1347
+ declare type baseObjectOutputType<Shape extends ZodRawShape> = {
1348
+ [k in keyof Shape]: Shape[k]["_output"];
1349
+ };
1350
+ declare type objectInputType<Shape extends ZodRawShape, Catchall extends ZodTypeAny, UnknownKeys extends UnknownKeysParam = UnknownKeysParam> = objectUtil.flatten<baseObjectInputType<Shape>> & CatchallInput<Catchall> & PassthroughType<UnknownKeys>;
1351
+ declare type baseObjectInputType<Shape extends ZodRawShape> = objectUtil.addQuestionMarks<{
1352
+ [k in keyof Shape]: Shape[k]["_input"];
1353
+ }>;
1354
+ declare type CatchallOutput<T extends ZodTypeAny> = ZodTypeAny extends T ? unknown : {
1355
+ [k: string]: T["_output"];
1356
+ };
1357
+ declare type CatchallInput<T extends ZodTypeAny> = ZodTypeAny extends T ? unknown : {
1358
+ [k: string]: T["_input"];
1359
+ };
1360
+ declare type PassthroughType<T extends UnknownKeysParam> = T extends "passthrough" ? {
1361
+ [k: string]: unknown;
1362
+ } : unknown;
1363
+ declare type deoptional<T extends ZodTypeAny> = T extends ZodOptional<infer U> ? deoptional<U> : T extends ZodNullable<infer U> ? ZodNullable<deoptional<U>> : T;
1364
+ declare class ZodObject<T extends ZodRawShape, UnknownKeys extends UnknownKeysParam = UnknownKeysParam, Catchall extends ZodTypeAny = ZodTypeAny, Output = objectOutputType<T, Catchall, UnknownKeys>, Input = objectInputType<T, Catchall, UnknownKeys>> extends ZodType<Output, ZodObjectDef<T, UnknownKeys, Catchall>, Input> {
1365
+ private _cached;
1366
+ _getCached(): {
1367
+ shape: T;
1368
+ keys: string[];
1369
+ };
1370
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
1371
+ get shape(): T;
1372
+ strict(message?: errorUtil.ErrMessage): ZodObject<T, "strict", Catchall>;
1373
+ strip(): ZodObject<T, "strip", Catchall>;
1374
+ passthrough(): ZodObject<T, "passthrough", Catchall>;
1375
+ nonstrict: () => ZodObject<T, "passthrough", Catchall>;
1376
+ extend<Augmentation extends ZodRawShape>(augmentation: Augmentation): ZodObject<objectUtil.extendShape<T, Augmentation>, UnknownKeys, Catchall>;
1377
+ augment: <Augmentation extends ZodRawShape>(augmentation: Augmentation) => ZodObject<{ [k in keyof (Omit<T, keyof Augmentation> & Augmentation)]: (Omit<T, keyof Augmentation> & Augmentation)[k]; }, UnknownKeys, Catchall, objectOutputType<{ [k in keyof (Omit<T, keyof Augmentation> & Augmentation)]: (Omit<T, keyof Augmentation> & Augmentation)[k]; }, Catchall, UnknownKeys>, objectInputType<{ [k in keyof (Omit<T, keyof Augmentation> & Augmentation)]: (Omit<T, keyof Augmentation> & Augmentation)[k]; }, Catchall, UnknownKeys>>;
1378
+ merge<Incoming extends AnyZodObject, Augmentation extends Incoming["shape"]>(merging: Incoming): ZodObject<objectUtil.extendShape<T, Augmentation>, Incoming["_def"]["unknownKeys"], Incoming["_def"]["catchall"]>;
1379
+ setKey<Key extends string, Schema extends ZodTypeAny>(key: Key, schema: Schema): ZodObject<T & {
1380
+ [k in Key]: Schema;
1381
+ }, UnknownKeys, Catchall>;
1382
+ catchall<Index extends ZodTypeAny>(index: Index): ZodObject<T, UnknownKeys, Index>;
1383
+ pick<Mask extends {
1384
+ [k in keyof T]?: true;
1385
+ }>(mask: Mask): ZodObject<Pick<T, Extract<keyof T, keyof Mask>>, UnknownKeys, Catchall>;
1386
+ omit<Mask extends {
1387
+ [k in keyof T]?: true;
1388
+ }>(mask: Mask): ZodObject<Omit<T, keyof Mask>, UnknownKeys, Catchall>;
1389
+ deepPartial(): partialUtil.DeepPartial<this>;
1390
+ partial(): ZodObject<{
1391
+ [k in keyof T]: ZodOptional<T[k]>;
1392
+ }, UnknownKeys, Catchall>;
1393
+ partial<Mask extends {
1394
+ [k in keyof T]?: true;
1395
+ }>(mask: Mask): ZodObject<objectUtil.noNever<{
1396
+ [k in keyof T]: k extends keyof Mask ? ZodOptional<T[k]> : T[k];
1397
+ }>, UnknownKeys, Catchall>;
1398
+ required(): ZodObject<{
1399
+ [k in keyof T]: deoptional<T[k]>;
1400
+ }, UnknownKeys, Catchall>;
1401
+ required<Mask extends {
1402
+ [k in keyof T]?: true;
1403
+ }>(mask: Mask): ZodObject<objectUtil.noNever<{
1404
+ [k in keyof T]: k extends keyof Mask ? deoptional<T[k]> : T[k];
1405
+ }>, UnknownKeys, Catchall>;
1406
+ keyof(): ZodEnum<enumUtil.UnionToTupleString<keyof T>>;
1407
+ static create: <T_1 extends ZodRawShape>(shape: T_1, params?: RawCreateParams) => ZodObject<T_1, "strip", ZodTypeAny, { [k_1 in keyof objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, { [k in keyof baseObjectOutputType<T_1>]: undefined extends baseObjectOutputType<T_1>[k] ? never : k; }[keyof T_1]>]: objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, { [k in keyof baseObjectOutputType<T_1>]: undefined extends baseObjectOutputType<T_1>[k] ? never : k; }[keyof T_1]>[k_1]; }, { [k_2 in keyof baseObjectInputType<T_1>]: baseObjectInputType<T_1>[k_2]; }>;
1408
+ static strictCreate: <T_1 extends ZodRawShape>(shape: T_1, params?: RawCreateParams) => ZodObject<T_1, "strict", ZodTypeAny, { [k_1 in keyof objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, { [k in keyof baseObjectOutputType<T_1>]: undefined extends baseObjectOutputType<T_1>[k] ? never : k; }[keyof T_1]>]: objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, { [k in keyof baseObjectOutputType<T_1>]: undefined extends baseObjectOutputType<T_1>[k] ? never : k; }[keyof T_1]>[k_1]; }, { [k_2 in keyof baseObjectInputType<T_1>]: baseObjectInputType<T_1>[k_2]; }>;
1409
+ static lazycreate: <T_1 extends ZodRawShape>(shape: () => T_1, params?: RawCreateParams) => ZodObject<T_1, "strip", ZodTypeAny, { [k_1 in keyof objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, { [k in keyof baseObjectOutputType<T_1>]: undefined extends baseObjectOutputType<T_1>[k] ? never : k; }[keyof T_1]>]: objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, { [k in keyof baseObjectOutputType<T_1>]: undefined extends baseObjectOutputType<T_1>[k] ? never : k; }[keyof T_1]>[k_1]; }, { [k_2 in keyof baseObjectInputType<T_1>]: baseObjectInputType<T_1>[k_2]; }>;
1410
+ }
1411
+ declare type AnyZodObject = ZodObject<any, any, any>;
1412
+ declare type ZodUnionOptions = Readonly<[ZodTypeAny, ...ZodTypeAny[]]>;
1413
+ interface ZodUnionDef<T extends ZodUnionOptions = Readonly<[
1414
+ ZodTypeAny,
1415
+ ZodTypeAny,
1416
+ ...ZodTypeAny[]
1417
+ ]>> extends ZodTypeDef {
1418
+ options: T;
1419
+ typeName: ZodFirstPartyTypeKind.ZodUnion;
1420
+ }
1421
+ declare class ZodUnion<T extends ZodUnionOptions> extends ZodType<T[number]["_output"], ZodUnionDef<T>, T[number]["_input"]> {
1422
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
1423
+ get options(): T;
1424
+ static create: <T_1 extends readonly [ZodTypeAny, ZodTypeAny, ...ZodTypeAny[]]>(types: T_1, params?: RawCreateParams) => ZodUnion<T_1>;
1425
+ }
1426
+ interface ZodIntersectionDef<T extends ZodTypeAny = ZodTypeAny, U extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
1427
+ left: T;
1428
+ right: U;
1429
+ typeName: ZodFirstPartyTypeKind.ZodIntersection;
1430
+ }
1431
+ declare class ZodIntersection<T extends ZodTypeAny, U extends ZodTypeAny> extends ZodType<T["_output"] & U["_output"], ZodIntersectionDef<T, U>, T["_input"] & U["_input"]> {
1432
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
1433
+ static create: <T_1 extends ZodTypeAny, U_1 extends ZodTypeAny>(left: T_1, right: U_1, params?: RawCreateParams) => ZodIntersection<T_1, U_1>;
1434
+ }
1435
+ declare type ZodTupleItems = [ZodTypeAny, ...ZodTypeAny[]];
1436
+ declare type AssertArray<T> = T extends any[] ? T : never;
1437
+ declare type OutputTypeOfTuple<T extends ZodTupleItems | []> = AssertArray<{
1438
+ [k in keyof T]: T[k] extends ZodType<any, any> ? T[k]["_output"] : never;
1439
+ }>;
1440
+ declare type OutputTypeOfTupleWithRest<T extends ZodTupleItems | [], Rest extends ZodTypeAny | null = null> = Rest extends ZodTypeAny ? [...OutputTypeOfTuple<T>, ...Rest["_output"][]] : OutputTypeOfTuple<T>;
1441
+ declare type InputTypeOfTuple<T extends ZodTupleItems | []> = AssertArray<{
1442
+ [k in keyof T]: T[k] extends ZodType<any, any> ? T[k]["_input"] : never;
1443
+ }>;
1444
+ declare type InputTypeOfTupleWithRest<T extends ZodTupleItems | [], Rest extends ZodTypeAny | null = null> = Rest extends ZodTypeAny ? [...InputTypeOfTuple<T>, ...Rest["_input"][]] : InputTypeOfTuple<T>;
1445
+ interface ZodTupleDef<T extends ZodTupleItems | [] = ZodTupleItems, Rest extends ZodTypeAny | null = null> extends ZodTypeDef {
1446
+ items: T;
1447
+ rest: Rest;
1448
+ typeName: ZodFirstPartyTypeKind.ZodTuple;
1449
+ }
1450
+ declare type AnyZodTuple = ZodTuple<[
1451
+ ZodTypeAny,
1452
+ ...ZodTypeAny[]
1453
+ ] | [], ZodTypeAny | null>;
1454
+ declare class ZodTuple<T extends [ZodTypeAny, ...ZodTypeAny[]] | [] = [ZodTypeAny, ...ZodTypeAny[]], Rest extends ZodTypeAny | null = null> extends ZodType<OutputTypeOfTupleWithRest<T, Rest>, ZodTupleDef<T, Rest>, InputTypeOfTupleWithRest<T, Rest>> {
1455
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
1456
+ get items(): T;
1457
+ rest<Rest extends ZodTypeAny>(rest: Rest): ZodTuple<T, Rest>;
1458
+ static create: <T_1 extends [] | [ZodTypeAny, ...ZodTypeAny[]]>(schemas: T_1, params?: RawCreateParams) => ZodTuple<T_1, null>;
1459
+ }
1460
+ interface ZodFunctionDef<Args extends ZodTuple<any, any> = ZodTuple<any, any>, Returns extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
1461
+ args: Args;
1462
+ returns: Returns;
1463
+ typeName: ZodFirstPartyTypeKind.ZodFunction;
1464
+ }
1465
+ declare type OuterTypeOfFunction<Args extends ZodTuple<any, any>, Returns extends ZodTypeAny> = Args["_input"] extends Array<any> ? (...args: Args["_input"]) => Returns["_output"] : never;
1466
+ declare type InnerTypeOfFunction<Args extends ZodTuple<any, any>, Returns extends ZodTypeAny> = Args["_output"] extends Array<any> ? (...args: Args["_output"]) => Returns["_input"] : never;
1467
+ declare class ZodFunction<Args extends ZodTuple<any, any>, Returns extends ZodTypeAny> extends ZodType<OuterTypeOfFunction<Args, Returns>, ZodFunctionDef<Args, Returns>, InnerTypeOfFunction<Args, Returns>> {
1468
+ _parse(input: ParseInput): ParseReturnType<any>;
1469
+ parameters(): Args;
1470
+ returnType(): Returns;
1471
+ args<Items extends Parameters<(typeof ZodTuple)["create"]>[0]>(...items: Items): ZodFunction<ZodTuple<Items, ZodUnknown>, Returns>;
1472
+ returns<NewReturnType extends ZodType<any, any>>(returnType: NewReturnType): ZodFunction<Args, NewReturnType>;
1473
+ implement<F extends InnerTypeOfFunction<Args, Returns>>(func: F): ReturnType<F> extends Returns["_output"] ? (...args: Args["_input"]) => ReturnType<F> : OuterTypeOfFunction<Args, Returns>;
1474
+ strictImplement(func: InnerTypeOfFunction<Args, Returns>): InnerTypeOfFunction<Args, Returns>;
1475
+ validate: <F extends InnerTypeOfFunction<Args, Returns>>(func: F) => ReturnType<F> extends Returns["_output"] ? (...args: Args["_input"]) => ReturnType<F> : OuterTypeOfFunction<Args, Returns>;
1476
+ static create(): ZodFunction<ZodTuple<[], ZodUnknown>, ZodUnknown>;
1477
+ static create<T extends AnyZodTuple = ZodTuple<[], ZodUnknown>>(args: T): ZodFunction<T, ZodUnknown>;
1478
+ static create<T extends AnyZodTuple, U extends ZodTypeAny>(args: T, returns: U): ZodFunction<T, U>;
1479
+ static create<T extends AnyZodTuple = ZodTuple<[], ZodUnknown>, U extends ZodTypeAny = ZodUnknown>(args: T, returns: U, params?: RawCreateParams): ZodFunction<T, U>;
1480
+ }
1481
+ interface ZodLiteralDef<T = any> extends ZodTypeDef {
1482
+ value: T;
1483
+ typeName: ZodFirstPartyTypeKind.ZodLiteral;
1484
+ }
1485
+ declare class ZodLiteral<T> extends ZodType<T, ZodLiteralDef<T>> {
1486
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
1487
+ get value(): T;
1488
+ static create: <T_1 extends Primitive>(value: T_1, params?: RawCreateParams) => ZodLiteral<T_1>;
1489
+ }
1490
+ declare type EnumValues = [string, ...string[]];
1491
+ declare type Values<T extends EnumValues> = {
1492
+ [k in T[number]]: k;
1493
+ };
1494
+ interface ZodEnumDef<T extends EnumValues = EnumValues> extends ZodTypeDef {
1495
+ values: T;
1496
+ typeName: ZodFirstPartyTypeKind.ZodEnum;
1497
+ }
1498
+ declare type Writeable<T> = {
1499
+ -readonly [P in keyof T]: T[P];
1500
+ };
1501
+ declare type FilterEnum<Values, ToExclude> = Values extends [] ? [] : Values extends [infer Head, ...infer Rest] ? Head extends ToExclude ? FilterEnum<Rest, ToExclude> : [Head, ...FilterEnum<Rest, ToExclude>] : never;
1502
+ declare type typecast<A, T> = A extends T ? A : never;
1503
+ declare function createZodEnum<U extends string, T extends Readonly<[U, ...U[]]>>(values: T, params?: RawCreateParams): ZodEnum<Writeable<T>>;
1504
+ declare function createZodEnum<U extends string, T extends [U, ...U[]]>(values: T, params?: RawCreateParams): ZodEnum<T>;
1505
+ declare class ZodEnum<T extends [string, ...string[]]> extends ZodType<T[number], ZodEnumDef<T>> {
1506
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
1507
+ get options(): T;
1508
+ get enum(): Values<T>;
1509
+ get Values(): Values<T>;
1510
+ get Enum(): Values<T>;
1511
+ extract<ToExtract extends readonly [T[number], ...T[number][]]>(values: ToExtract): ZodEnum<Writeable<ToExtract>>;
1512
+ exclude<ToExclude extends readonly [T[number], ...T[number][]]>(values: ToExclude): ZodEnum<typecast<Writeable<FilterEnum<T, ToExclude[number]>>, [string, ...string[]]>>;
1513
+ static create: typeof createZodEnum;
1514
+ }
1515
+ interface ZodNativeEnumDef<T extends EnumLike = EnumLike> extends ZodTypeDef {
1516
+ values: T;
1517
+ typeName: ZodFirstPartyTypeKind.ZodNativeEnum;
1518
+ }
1519
+ declare type EnumLike = {
1520
+ [k: string]: string | number;
1521
+ [nu: number]: string;
1522
+ };
1523
+ declare class ZodNativeEnum<T extends EnumLike> extends ZodType<T[keyof T], ZodNativeEnumDef<T>> {
1524
+ _parse(input: ParseInput): ParseReturnType<T[keyof T]>;
1525
+ get enum(): T;
1526
+ static create: <T_1 extends EnumLike>(values: T_1, params?: RawCreateParams) => ZodNativeEnum<T_1>;
1527
+ }
1528
+ interface ZodPromiseDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
1529
+ type: T;
1530
+ typeName: ZodFirstPartyTypeKind.ZodPromise;
1531
+ }
1532
+ declare class ZodPromise<T extends ZodTypeAny> extends ZodType<Promise<T["_output"]>, ZodPromiseDef<T>, Promise<T["_input"]>> {
1533
+ unwrap(): T;
1534
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
1535
+ static create: <T_1 extends ZodTypeAny>(schema: T_1, params?: RawCreateParams) => ZodPromise<T_1>;
1536
+ }
1537
+ declare type RefinementEffect<T> = {
1538
+ type: "refinement";
1539
+ refinement: (arg: T, ctx: RefinementCtx) => any;
1540
+ };
1541
+ declare type TransformEffect<T> = {
1542
+ type: "transform";
1543
+ transform: (arg: T, ctx: RefinementCtx) => any;
1544
+ };
1545
+ declare type PreprocessEffect<T> = {
1546
+ type: "preprocess";
1547
+ transform: (arg: T) => any;
1548
+ };
1549
+ declare type Effect<T> = RefinementEffect<T> | TransformEffect<T> | PreprocessEffect<T>;
1550
+ interface ZodEffectsDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
1551
+ schema: T;
1552
+ typeName: ZodFirstPartyTypeKind.ZodEffects;
1553
+ effect: Effect<any>;
1554
+ }
1555
+ declare class ZodEffects<T extends ZodTypeAny, Output = output<T>, Input = input<T>> extends ZodType<Output, ZodEffectsDef<T>, Input> {
1556
+ innerType(): T;
1557
+ sourceType(): T;
1558
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
1559
+ static create: <I extends ZodTypeAny>(schema: I, effect: Effect<I["_output"]>, params?: RawCreateParams) => ZodEffects<I, I["_output"], input<I>>;
1560
+ static createWithPreprocess: <I extends ZodTypeAny>(preprocess: (arg: unknown) => unknown, schema: I, params?: RawCreateParams) => ZodEffects<I, I["_output"], unknown>;
1561
+ }
1562
+
1563
+ interface ZodOptionalDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
1564
+ innerType: T;
1565
+ typeName: ZodFirstPartyTypeKind.ZodOptional;
1566
+ }
1567
+ declare class ZodOptional<T extends ZodTypeAny> extends ZodType<T["_output"] | undefined, ZodOptionalDef<T>, T["_input"] | undefined> {
1568
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
1569
+ unwrap(): T;
1570
+ static create: <T_1 extends ZodTypeAny>(type: T_1, params?: RawCreateParams) => ZodOptional<T_1>;
1571
+ }
1572
+ interface ZodNullableDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
1573
+ innerType: T;
1574
+ typeName: ZodFirstPartyTypeKind.ZodNullable;
1575
+ }
1576
+ declare class ZodNullable<T extends ZodTypeAny> extends ZodType<T["_output"] | null, ZodNullableDef<T>, T["_input"] | null> {
1577
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
1578
+ unwrap(): T;
1579
+ static create: <T_1 extends ZodTypeAny>(type: T_1, params?: RawCreateParams) => ZodNullable<T_1>;
1580
+ }
1581
+ interface ZodDefaultDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
1582
+ innerType: T;
1583
+ defaultValue: () => util.noUndefined<T["_input"]>;
1584
+ typeName: ZodFirstPartyTypeKind.ZodDefault;
1585
+ }
1586
+ declare class ZodDefault<T extends ZodTypeAny> extends ZodType<util.noUndefined<T["_output"]>, ZodDefaultDef<T>, T["_input"] | undefined> {
1587
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
1588
+ removeDefault(): T;
1589
+ static create: <T_1 extends ZodTypeAny>(type: T_1, params: {
1590
+ errorMap?: ZodErrorMap | undefined;
1591
+ invalid_type_error?: string | undefined;
1592
+ required_error?: string | undefined;
1593
+ description?: string | undefined;
1594
+ } & {
1595
+ default: T_1["_input"] | (() => util.noUndefined<T_1["_input"]>);
1596
+ }) => ZodDefault<T_1>;
1597
+ }
1598
+ interface ZodCatchDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
1599
+ innerType: T;
1600
+ catchValue: (ctx: {
1601
+ error: ZodError;
1602
+ input: unknown;
1603
+ }) => T["_input"];
1604
+ typeName: ZodFirstPartyTypeKind.ZodCatch;
1605
+ }
1606
+ declare class ZodCatch<T extends ZodTypeAny> extends ZodType<T["_output"], ZodCatchDef<T>, unknown> {
1607
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
1608
+ removeCatch(): T;
1609
+ static create: <T_1 extends ZodTypeAny>(type: T_1, params: {
1610
+ errorMap?: ZodErrorMap | undefined;
1611
+ invalid_type_error?: string | undefined;
1612
+ required_error?: string | undefined;
1613
+ description?: string | undefined;
1614
+ } & {
1615
+ catch: T_1["_output"] | (() => T_1["_output"]);
1616
+ }) => ZodCatch<T_1>;
1617
+ }
1618
+ interface ZodBrandedDef<T extends ZodTypeAny> extends ZodTypeDef {
1619
+ type: T;
1620
+ typeName: ZodFirstPartyTypeKind.ZodBranded;
1621
+ }
1622
+ declare const BRAND: unique symbol;
1623
+ declare type BRAND<T extends string | number | symbol> = {
1624
+ [BRAND]: {
1625
+ [k in T]: true;
1626
+ };
1627
+ };
1628
+ declare class ZodBranded<T extends ZodTypeAny, B extends string | number | symbol> extends ZodType<T["_output"] & BRAND<B>, ZodBrandedDef<T>, T["_input"]> {
1629
+ _parse(input: ParseInput): ParseReturnType<any>;
1630
+ unwrap(): T;
1631
+ }
1632
+ interface ZodPipelineDef<A extends ZodTypeAny, B extends ZodTypeAny> extends ZodTypeDef {
1633
+ in: A;
1634
+ out: B;
1635
+ typeName: ZodFirstPartyTypeKind.ZodPipeline;
1636
+ }
1637
+ declare class ZodPipeline<A extends ZodTypeAny, B extends ZodTypeAny> extends ZodType<B["_output"], ZodPipelineDef<A, B>, A["_input"]> {
1638
+ _parse(input: ParseInput): ParseReturnType<any>;
1639
+ static create<A extends ZodTypeAny, B extends ZodTypeAny>(a: A, b: B): ZodPipeline<A, B>;
1640
+ }
1641
+ declare enum ZodFirstPartyTypeKind {
1642
+ ZodString = "ZodString",
1643
+ ZodNumber = "ZodNumber",
1644
+ ZodNaN = "ZodNaN",
1645
+ ZodBigInt = "ZodBigInt",
1646
+ ZodBoolean = "ZodBoolean",
1647
+ ZodDate = "ZodDate",
1648
+ ZodSymbol = "ZodSymbol",
1649
+ ZodUndefined = "ZodUndefined",
1650
+ ZodNull = "ZodNull",
1651
+ ZodAny = "ZodAny",
1652
+ ZodUnknown = "ZodUnknown",
1653
+ ZodNever = "ZodNever",
1654
+ ZodVoid = "ZodVoid",
1655
+ ZodArray = "ZodArray",
1656
+ ZodObject = "ZodObject",
1657
+ ZodUnion = "ZodUnion",
1658
+ ZodDiscriminatedUnion = "ZodDiscriminatedUnion",
1659
+ ZodIntersection = "ZodIntersection",
1660
+ ZodTuple = "ZodTuple",
1661
+ ZodRecord = "ZodRecord",
1662
+ ZodMap = "ZodMap",
1663
+ ZodSet = "ZodSet",
1664
+ ZodFunction = "ZodFunction",
1665
+ ZodLazy = "ZodLazy",
1666
+ ZodLiteral = "ZodLiteral",
1667
+ ZodEnum = "ZodEnum",
1668
+ ZodEffects = "ZodEffects",
1669
+ ZodNativeEnum = "ZodNativeEnum",
1670
+ ZodOptional = "ZodOptional",
1671
+ ZodNullable = "ZodNullable",
1672
+ ZodDefault = "ZodDefault",
1673
+ ZodCatch = "ZodCatch",
1674
+ ZodPromise = "ZodPromise",
1675
+ ZodBranded = "ZodBranded",
1676
+ ZodPipeline = "ZodPipeline"
1677
+ }
1678
+
1679
+ declare const partialConfigSchema: ZodObject<{
1680
+ callbackFactory: ZodOptional<ZodOptional<ZodFunction<ZodTuple<[ZodObject<{
1681
+ _id: ZodOptional<ZodNumber>;
1682
+ input: ZodOptional<ZodArray<ZodObject<{
1683
+ name: ZodString;
1684
+ value: ZodUnknown;
1685
+ }, "strip", ZodTypeAny, {
1686
+ name: string;
1687
+ value?: unknown;
1688
+ }, {
1689
+ name: string;
1690
+ value?: unknown;
1691
+ }>, "many">>;
1692
+ output: ZodArray<ZodObject<{
1693
+ name: ZodString;
1694
+ value: ZodUnknown;
1695
+ }, "strip", ZodTypeAny, {
1696
+ name: string;
1697
+ value?: unknown;
1698
+ }, {
1699
+ name: string;
1700
+ value?: unknown;
1701
+ }>, "many">;
1702
+ type: ZodNativeEnum<typeof CallbackType>;
1703
+ }, "strip", ZodTypeAny, {
1704
+ type: CallbackType;
1705
+ output: {
1706
+ name: string;
1707
+ value?: unknown;
1708
+ }[];
1709
+ _id?: number | undefined;
1710
+ input?: {
1711
+ name: string;
1712
+ value?: unknown;
1713
+ }[] | undefined;
1714
+ }, {
1715
+ type: CallbackType;
1716
+ output: {
1717
+ name: string;
1718
+ value?: unknown;
1719
+ }[];
1720
+ _id?: number | undefined;
1721
+ input?: {
1722
+ name: string;
1723
+ value?: unknown;
1724
+ }[] | undefined;
1725
+ }>], ZodUnknown>, ZodType<FRCallback, ZodTypeDef, FRCallback>>>>;
1726
+ clientId: ZodOptional<ZodOptional<ZodString>>;
1727
+ middleware: ZodOptional<ZodOptional<ZodArray<ZodFunction<ZodTuple<[], ZodUnknown>, ZodUnknown>, "many">>>;
1728
+ realmPath: ZodOptional<ZodString>;
1729
+ redirectUri: ZodOptional<ZodOptional<ZodString>>;
1730
+ scope: ZodOptional<ZodOptional<ZodString>>;
1731
+ serverConfig: ZodOptional<ZodObject<{
1732
+ baseUrl: ZodString;
1733
+ paths: ZodOptional<ZodObject<{
1734
+ authenticate: ZodString;
1735
+ authorize: ZodString;
1736
+ accessToken: ZodString;
1737
+ endSession: ZodString;
1738
+ userInfo: ZodString;
1739
+ revoke: ZodString;
1740
+ sessions: ZodString;
1741
+ }, "strip", ZodTypeAny, {
1742
+ authenticate: string;
1743
+ authorize: string;
1744
+ accessToken: string;
1745
+ endSession: string;
1746
+ userInfo: string;
1747
+ revoke: string;
1748
+ sessions: string;
1749
+ }, {
1750
+ authenticate: string;
1751
+ authorize: string;
1752
+ accessToken: string;
1753
+ endSession: string;
1754
+ userInfo: string;
1755
+ revoke: string;
1756
+ sessions: string;
1757
+ }>>;
1758
+ timeout: ZodNumber;
1759
+ }, "strip", ZodTypeAny, {
1760
+ timeout: number;
1761
+ baseUrl: string;
1762
+ paths?: {
1763
+ authenticate: string;
1764
+ authorize: string;
1765
+ accessToken: string;
1766
+ endSession: string;
1767
+ userInfo: string;
1768
+ revoke: string;
1769
+ sessions: string;
1770
+ } | undefined;
1771
+ }, {
1772
+ timeout: number;
1773
+ baseUrl: string;
1774
+ paths?: {
1775
+ authenticate: string;
1776
+ authorize: string;
1777
+ accessToken: string;
1778
+ endSession: string;
1779
+ userInfo: string;
1780
+ revoke: string;
1781
+ sessions: string;
1782
+ } | undefined;
1783
+ }>>;
1784
+ support: ZodOptional<ZodOptional<ZodUnion<[ZodLiteral<"legacy">, ZodLiteral<"modern">]>>>;
1785
+ tokenStore: ZodOptional<ZodOptional<ZodUnion<[ZodObject<{
1786
+ get: ZodFunction<ZodTuple<[ZodString], ZodUnknown>, ZodPromise<ZodObject<{
1787
+ accessToken: ZodString;
1788
+ idToken: ZodOptional<ZodString>;
1789
+ refreshToken: ZodOptional<ZodString>;
1790
+ tokenExpiry: ZodOptional<ZodNumber>;
1791
+ }, "strip", ZodTypeAny, {
1792
+ accessToken: string;
1793
+ idToken?: string | undefined;
1794
+ refreshToken?: string | undefined;
1795
+ tokenExpiry?: number | undefined;
1796
+ }, {
1797
+ accessToken: string;
1798
+ idToken?: string | undefined;
1799
+ refreshToken?: string | undefined;
1800
+ tokenExpiry?: number | undefined;
1801
+ }>>>;
1802
+ set: ZodFunction<ZodTuple<[ZodString], ZodUnknown>, ZodPromise<ZodVoid>>;
1803
+ remove: ZodFunction<ZodTuple<[ZodString], ZodUnknown>, ZodPromise<ZodVoid>>;
1804
+ }, "strip", ZodTypeAny, {
1805
+ set: (args_0: string, ...args_1: unknown[]) => Promise<void>;
1806
+ remove: (args_0: string, ...args_1: unknown[]) => Promise<void>;
1807
+ get: (args_0: string, ...args_1: unknown[]) => Promise<{
1808
+ accessToken: string;
1809
+ idToken?: string | undefined;
1810
+ refreshToken?: string | undefined;
1811
+ tokenExpiry?: number | undefined;
1812
+ }>;
1813
+ }, {
1814
+ set: (args_0: string, ...args_1: unknown[]) => Promise<void>;
1815
+ remove: (args_0: string, ...args_1: unknown[]) => Promise<void>;
1816
+ get: (args_0: string, ...args_1: unknown[]) => Promise<{
1817
+ accessToken: string;
1818
+ idToken?: string | undefined;
1819
+ refreshToken?: string | undefined;
1820
+ tokenExpiry?: number | undefined;
1821
+ }>;
1822
+ }>, ZodLiteral<"indexedDB">, ZodLiteral<"sessionStorage">, ZodLiteral<"localStorage">]>>>;
1823
+ tree: ZodOptional<ZodOptional<ZodString>>;
1824
+ type: ZodOptional<ZodOptional<ZodString>>;
1825
+ oauthThreshold: ZodOptional<ZodOptional<ZodNumber>>;
1826
+ }, "strict", ZodTypeAny, {
1827
+ callbackFactory?: ((args_0: {
1828
+ type: CallbackType;
1829
+ output: {
1830
+ name: string;
1831
+ value?: unknown;
1832
+ }[];
1833
+ _id?: number | undefined;
1834
+ input?: {
1835
+ name: string;
1836
+ value?: unknown;
1837
+ }[] | undefined;
1838
+ }, ...args_1: unknown[]) => FRCallback) | undefined;
1839
+ clientId?: string | undefined;
1840
+ middleware?: ((...args: unknown[]) => unknown)[] | undefined;
1841
+ realmPath?: string | undefined;
1842
+ redirectUri?: string | undefined;
1843
+ scope?: string | undefined;
1844
+ serverConfig?: {
1845
+ timeout: number;
1846
+ baseUrl: string;
1847
+ paths?: {
1848
+ authenticate: string;
1849
+ authorize: string;
1850
+ accessToken: string;
1851
+ endSession: string;
1852
+ userInfo: string;
1853
+ revoke: string;
1854
+ sessions: string;
1855
+ } | undefined;
1856
+ } | undefined;
1857
+ support?: "modern" | "legacy" | undefined;
1858
+ tokenStore?: "localStorage" | "indexedDB" | "sessionStorage" | {
1859
+ set: (args_0: string, ...args_1: unknown[]) => Promise<void>;
1860
+ remove: (args_0: string, ...args_1: unknown[]) => Promise<void>;
1861
+ get: (args_0: string, ...args_1: unknown[]) => Promise<{
1862
+ accessToken: string;
1863
+ idToken?: string | undefined;
1864
+ refreshToken?: string | undefined;
1865
+ tokenExpiry?: number | undefined;
1866
+ }>;
1867
+ } | undefined;
1868
+ tree?: string | undefined;
1869
+ type?: string | undefined;
1870
+ oauthThreshold?: number | undefined;
1871
+ }, {
1872
+ callbackFactory?: ((args_0: {
1873
+ type: CallbackType;
1874
+ output: {
1875
+ name: string;
1876
+ value?: unknown;
1877
+ }[];
1878
+ _id?: number | undefined;
1879
+ input?: {
1880
+ name: string;
1881
+ value?: unknown;
1882
+ }[] | undefined;
1883
+ }, ...args_1: unknown[]) => FRCallback) | undefined;
1884
+ clientId?: string | undefined;
1885
+ middleware?: ((...args: unknown[]) => unknown)[] | undefined;
1886
+ realmPath?: string | undefined;
1887
+ redirectUri?: string | undefined;
1888
+ scope?: string | undefined;
1889
+ serverConfig?: {
1890
+ timeout: number;
1891
+ baseUrl: string;
1892
+ paths?: {
1893
+ authenticate: string;
1894
+ authorize: string;
1895
+ accessToken: string;
1896
+ endSession: string;
1897
+ userInfo: string;
1898
+ revoke: string;
1899
+ sessions: string;
1900
+ } | undefined;
1901
+ } | undefined;
1902
+ support?: "modern" | "legacy" | undefined;
1903
+ tokenStore?: "localStorage" | "indexedDB" | "sessionStorage" | {
1904
+ set: (args_0: string, ...args_1: unknown[]) => Promise<void>;
1905
+ remove: (args_0: string, ...args_1: unknown[]) => Promise<void>;
1906
+ get: (args_0: string, ...args_1: unknown[]) => Promise<{
1907
+ accessToken: string;
1908
+ idToken?: string | undefined;
1909
+ refreshToken?: string | undefined;
1910
+ tokenExpiry?: number | undefined;
1911
+ }>;
1912
+ } | undefined;
1913
+ tree?: string | undefined;
1914
+ type?: string | undefined;
1915
+ oauthThreshold?: number | undefined;
1916
+ }>;
1917
+
1918
+ declare const journeyConfigSchema: ZodObject<{
1919
+ forgotPassword: ZodOptional<ZodObject<{
1920
+ journey: ZodOptional<ZodString>;
1921
+ match: ZodArray<ZodString, "many">;
1922
+ }, "strip", ZodTypeAny, {
1923
+ match: string[];
1924
+ journey?: string | undefined;
1925
+ }, {
1926
+ match: string[];
1927
+ journey?: string | undefined;
1928
+ }>>;
1929
+ forgotUsername: ZodOptional<ZodObject<{
1930
+ journey: ZodOptional<ZodString>;
1931
+ match: ZodArray<ZodString, "many">;
1932
+ }, "strip", ZodTypeAny, {
1933
+ match: string[];
1934
+ journey?: string | undefined;
1935
+ }, {
1936
+ match: string[];
1937
+ journey?: string | undefined;
1938
+ }>>;
1939
+ login: ZodOptional<ZodObject<{
1940
+ journey: ZodOptional<ZodString>;
1941
+ match: ZodArray<ZodString, "many">;
1942
+ }, "strip", ZodTypeAny, {
1943
+ match: string[];
1944
+ journey?: string | undefined;
1945
+ }, {
1946
+ match: string[];
1947
+ journey?: string | undefined;
1948
+ }>>;
1949
+ register: ZodOptional<ZodObject<{
1950
+ journey: ZodOptional<ZodString>;
1951
+ match: ZodArray<ZodString, "many">;
1952
+ }, "strip", ZodTypeAny, {
1953
+ match: string[];
1954
+ journey?: string | undefined;
1955
+ }, {
1956
+ match: string[];
1957
+ journey?: string | undefined;
1958
+ }>>;
1959
+ }, "strip", ZodTypeAny, {
1960
+ forgotPassword?: {
1961
+ match: string[];
1962
+ journey?: string | undefined;
1963
+ } | undefined;
1964
+ forgotUsername?: {
1965
+ match: string[];
1966
+ journey?: string | undefined;
1967
+ } | undefined;
1968
+ login?: {
1969
+ match: string[];
1970
+ journey?: string | undefined;
1971
+ } | undefined;
1972
+ register?: {
1973
+ match: string[];
1974
+ journey?: string | undefined;
1975
+ } | undefined;
1976
+ }, {
1977
+ forgotPassword?: {
1978
+ match: string[];
1979
+ journey?: string | undefined;
1980
+ } | undefined;
1981
+ forgotUsername?: {
1982
+ match: string[];
1983
+ journey?: string | undefined;
1984
+ } | undefined;
1985
+ login?: {
1986
+ match: string[];
1987
+ journey?: string | undefined;
1988
+ } | undefined;
1989
+ register?: {
1990
+ match: string[];
1991
+ journey?: string | undefined;
1992
+ } | undefined;
1993
+ }>;
1994
+
1995
+ declare const partialLinksSchema: ZodObject<{
1996
+ termsAndConditions: ZodOptional<ZodString>;
1997
+ }, "strict", ZodTypeAny, {
1998
+ termsAndConditions?: string | undefined;
1999
+ }, {
2000
+ termsAndConditions?: string | undefined;
2001
+ }>;
2002
+
2003
+ declare const partialStringsSchema: ZodObject<{
2004
+ alreadyHaveAnAccount: ZodOptional<ZodString>;
2005
+ backToDefault: ZodOptional<ZodString>;
2006
+ backToLogin: ZodOptional<ZodString>;
2007
+ dontHaveAnAccount: ZodOptional<ZodString>;
2008
+ closeModal: ZodOptional<ZodString>;
2009
+ charactersCannotRepeatMoreThan: ZodOptional<ZodString>;
2010
+ charactersCannotRepeatMoreThanCaseInsensitive: ZodOptional<ZodString>;
2011
+ chooseDifferentUsername: ZodOptional<ZodString>;
2012
+ confirmPassword: ZodOptional<ZodString>;
2013
+ constraintViolationForPassword: ZodOptional<ZodString>;
2014
+ constraintViolationForValue: ZodOptional<ZodString>;
2015
+ continueWith: ZodOptional<ZodString>;
2016
+ customSecurityQuestion: ZodOptional<ZodString>;
2017
+ doesNotMeetMinimumCharacterLength: ZodOptional<ZodString>;
2018
+ ensurePasswordIsMoreThan: ZodOptional<ZodString>;
2019
+ ensurePasswordHasOne: ZodOptional<ZodString>;
2020
+ enterVerificationCode: ZodOptional<ZodString>;
2021
+ exceedsMaximumCharacterLength: ZodOptional<ZodString>;
2022
+ fieldCanNotContainFollowingCharacters: ZodOptional<ZodString>;
2023
+ fieldCanNotContainFollowingValues: ZodOptional<ZodString>;
2024
+ forgotPassword: ZodOptional<ZodString>;
2025
+ forgotUsername: ZodOptional<ZodString>;
2026
+ givenName: ZodOptional<ZodString>;
2027
+ inputRequiredError: ZodOptional<ZodString>;
2028
+ loading: ZodOptional<ZodString>;
2029
+ loginButton: ZodOptional<ZodString>;
2030
+ loginFailure: ZodOptional<ZodString>;
2031
+ loginHeader: ZodOptional<ZodString>;
2032
+ loginSuccess: ZodOptional<ZodString>;
2033
+ mail: ZodOptional<ZodString>;
2034
+ minimumNumberOfNumbers: ZodOptional<ZodString>;
2035
+ minimumNumberOfLowercase: ZodOptional<ZodString>;
2036
+ minimumNumberOfUppercase: ZodOptional<ZodString>;
2037
+ minimumNumberOfSymbols: ZodOptional<ZodString>;
2038
+ nameCallback: ZodOptional<ZodString>;
2039
+ nextButton: ZodOptional<ZodString>;
2040
+ notToExceedMaximumCharacterLength: ZodOptional<ZodString>;
2041
+ noLessThanMinimumCharacterLength: ZodOptional<ZodString>;
2042
+ passwordCallback: ZodOptional<ZodString>;
2043
+ passwordCannotContainCommonPasswords: ZodOptional<ZodString>;
2044
+ passwordCannotContainCommonPasswordsOrBeReversible: ZodOptional<ZodString>;
2045
+ passwordCannotContainCommonPasswordsOrBeReversibleStringsLessThan: ZodOptional<ZodString>;
2046
+ passwordRequirements: ZodOptional<ZodString>;
2047
+ pleaseCheckValue: ZodOptional<ZodString>;
2048
+ pleaseConfirm: ZodOptional<ZodString>;
2049
+ preferencesMarketing: ZodOptional<ZodString>;
2050
+ preferencesUpdates: ZodOptional<ZodString>;
2051
+ provideCustomQuestion: ZodOptional<ZodString>;
2052
+ redirectingTo: ZodOptional<ZodString>;
2053
+ registerButton: ZodOptional<ZodString>;
2054
+ registerHeader: ZodOptional<ZodString>;
2055
+ registerSuccess: ZodOptional<ZodString>;
2056
+ requiredField: ZodOptional<ZodString>;
2057
+ securityAnswer: ZodOptional<ZodString>;
2058
+ securityQuestions: ZodOptional<ZodString>;
2059
+ securityQuestionsPrompt: ZodOptional<ZodString>;
2060
+ shouldContainANumber: ZodOptional<ZodString>;
2061
+ shouldContainAnUppercase: ZodOptional<ZodString>;
2062
+ shouldContainALowercase: ZodOptional<ZodString>;
2063
+ shouldContainASymbol: ZodOptional<ZodString>;
2064
+ showPassword: ZodOptional<ZodString>;
2065
+ sn: ZodOptional<ZodString>;
2066
+ submitButton: ZodOptional<ZodString>;
2067
+ successMessage: ZodOptional<ZodString>;
2068
+ termsAndConditions: ZodOptional<ZodString>;
2069
+ termsAndConditionsLinkText: ZodOptional<ZodString>;
2070
+ tryAgain: ZodOptional<ZodString>;
2071
+ twoFactorAuthentication: ZodOptional<ZodString>;
2072
+ useValidEmail: ZodOptional<ZodString>;
2073
+ unrecoverableError: ZodOptional<ZodString>;
2074
+ unknownLoginError: ZodOptional<ZodString>;
2075
+ unknownNetworkError: ZodOptional<ZodString>;
2076
+ userName: ZodOptional<ZodString>;
2077
+ usernameRequirements: ZodOptional<ZodString>;
2078
+ useTheAuthenticatorAppOnYourPhone: ZodOptional<ZodString>;
2079
+ validatedCreatePasswordCallback: ZodOptional<ZodString>;
2080
+ validatedCreateUsernameCallback: ZodOptional<ZodString>;
2081
+ valueRequirements: ZodOptional<ZodString>;
2082
+ }, "strict", ZodTypeAny, {
2083
+ alreadyHaveAnAccount?: string | undefined;
2084
+ backToDefault?: string | undefined;
2085
+ backToLogin?: string | undefined;
2086
+ dontHaveAnAccount?: string | undefined;
2087
+ closeModal?: string | undefined;
2088
+ charactersCannotRepeatMoreThan?: string | undefined;
2089
+ charactersCannotRepeatMoreThanCaseInsensitive?: string | undefined;
2090
+ chooseDifferentUsername?: string | undefined;
2091
+ confirmPassword?: string | undefined;
2092
+ constraintViolationForPassword?: string | undefined;
2093
+ constraintViolationForValue?: string | undefined;
2094
+ continueWith?: string | undefined;
2095
+ customSecurityQuestion?: string | undefined;
2096
+ doesNotMeetMinimumCharacterLength?: string | undefined;
2097
+ ensurePasswordIsMoreThan?: string | undefined;
2098
+ ensurePasswordHasOne?: string | undefined;
2099
+ enterVerificationCode?: string | undefined;
2100
+ exceedsMaximumCharacterLength?: string | undefined;
2101
+ fieldCanNotContainFollowingCharacters?: string | undefined;
2102
+ fieldCanNotContainFollowingValues?: string | undefined;
2103
+ forgotPassword?: string | undefined;
2104
+ forgotUsername?: string | undefined;
2105
+ givenName?: string | undefined;
2106
+ inputRequiredError?: string | undefined;
2107
+ loading?: string | undefined;
2108
+ loginButton?: string | undefined;
2109
+ loginFailure?: string | undefined;
2110
+ loginHeader?: string | undefined;
2111
+ loginSuccess?: string | undefined;
2112
+ mail?: string | undefined;
2113
+ minimumNumberOfNumbers?: string | undefined;
2114
+ minimumNumberOfLowercase?: string | undefined;
2115
+ minimumNumberOfUppercase?: string | undefined;
2116
+ minimumNumberOfSymbols?: string | undefined;
2117
+ nameCallback?: string | undefined;
2118
+ nextButton?: string | undefined;
2119
+ notToExceedMaximumCharacterLength?: string | undefined;
2120
+ noLessThanMinimumCharacterLength?: string | undefined;
2121
+ passwordCallback?: string | undefined;
2122
+ passwordCannotContainCommonPasswords?: string | undefined;
2123
+ passwordCannotContainCommonPasswordsOrBeReversible?: string | undefined;
2124
+ passwordCannotContainCommonPasswordsOrBeReversibleStringsLessThan?: string | undefined;
2125
+ passwordRequirements?: string | undefined;
2126
+ pleaseCheckValue?: string | undefined;
2127
+ pleaseConfirm?: string | undefined;
2128
+ preferencesMarketing?: string | undefined;
2129
+ preferencesUpdates?: string | undefined;
2130
+ provideCustomQuestion?: string | undefined;
2131
+ redirectingTo?: string | undefined;
2132
+ registerButton?: string | undefined;
2133
+ registerHeader?: string | undefined;
2134
+ registerSuccess?: string | undefined;
2135
+ requiredField?: string | undefined;
2136
+ securityAnswer?: string | undefined;
2137
+ securityQuestions?: string | undefined;
2138
+ securityQuestionsPrompt?: string | undefined;
2139
+ shouldContainANumber?: string | undefined;
2140
+ shouldContainAnUppercase?: string | undefined;
2141
+ shouldContainALowercase?: string | undefined;
2142
+ shouldContainASymbol?: string | undefined;
2143
+ showPassword?: string | undefined;
2144
+ sn?: string | undefined;
2145
+ submitButton?: string | undefined;
2146
+ successMessage?: string | undefined;
2147
+ termsAndConditions?: string | undefined;
2148
+ termsAndConditionsLinkText?: string | undefined;
2149
+ tryAgain?: string | undefined;
2150
+ twoFactorAuthentication?: string | undefined;
2151
+ useValidEmail?: string | undefined;
2152
+ unrecoverableError?: string | undefined;
2153
+ unknownLoginError?: string | undefined;
2154
+ unknownNetworkError?: string | undefined;
2155
+ userName?: string | undefined;
2156
+ usernameRequirements?: string | undefined;
2157
+ useTheAuthenticatorAppOnYourPhone?: string | undefined;
2158
+ validatedCreatePasswordCallback?: string | undefined;
2159
+ validatedCreateUsernameCallback?: string | undefined;
2160
+ valueRequirements?: string | undefined;
2161
+ }, {
2162
+ alreadyHaveAnAccount?: string | undefined;
2163
+ backToDefault?: string | undefined;
2164
+ backToLogin?: string | undefined;
2165
+ dontHaveAnAccount?: string | undefined;
2166
+ closeModal?: string | undefined;
2167
+ charactersCannotRepeatMoreThan?: string | undefined;
2168
+ charactersCannotRepeatMoreThanCaseInsensitive?: string | undefined;
2169
+ chooseDifferentUsername?: string | undefined;
2170
+ confirmPassword?: string | undefined;
2171
+ constraintViolationForPassword?: string | undefined;
2172
+ constraintViolationForValue?: string | undefined;
2173
+ continueWith?: string | undefined;
2174
+ customSecurityQuestion?: string | undefined;
2175
+ doesNotMeetMinimumCharacterLength?: string | undefined;
2176
+ ensurePasswordIsMoreThan?: string | undefined;
2177
+ ensurePasswordHasOne?: string | undefined;
2178
+ enterVerificationCode?: string | undefined;
2179
+ exceedsMaximumCharacterLength?: string | undefined;
2180
+ fieldCanNotContainFollowingCharacters?: string | undefined;
2181
+ fieldCanNotContainFollowingValues?: string | undefined;
2182
+ forgotPassword?: string | undefined;
2183
+ forgotUsername?: string | undefined;
2184
+ givenName?: string | undefined;
2185
+ inputRequiredError?: string | undefined;
2186
+ loading?: string | undefined;
2187
+ loginButton?: string | undefined;
2188
+ loginFailure?: string | undefined;
2189
+ loginHeader?: string | undefined;
2190
+ loginSuccess?: string | undefined;
2191
+ mail?: string | undefined;
2192
+ minimumNumberOfNumbers?: string | undefined;
2193
+ minimumNumberOfLowercase?: string | undefined;
2194
+ minimumNumberOfUppercase?: string | undefined;
2195
+ minimumNumberOfSymbols?: string | undefined;
2196
+ nameCallback?: string | undefined;
2197
+ nextButton?: string | undefined;
2198
+ notToExceedMaximumCharacterLength?: string | undefined;
2199
+ noLessThanMinimumCharacterLength?: string | undefined;
2200
+ passwordCallback?: string | undefined;
2201
+ passwordCannotContainCommonPasswords?: string | undefined;
2202
+ passwordCannotContainCommonPasswordsOrBeReversible?: string | undefined;
2203
+ passwordCannotContainCommonPasswordsOrBeReversibleStringsLessThan?: string | undefined;
2204
+ passwordRequirements?: string | undefined;
2205
+ pleaseCheckValue?: string | undefined;
2206
+ pleaseConfirm?: string | undefined;
2207
+ preferencesMarketing?: string | undefined;
2208
+ preferencesUpdates?: string | undefined;
2209
+ provideCustomQuestion?: string | undefined;
2210
+ redirectingTo?: string | undefined;
2211
+ registerButton?: string | undefined;
2212
+ registerHeader?: string | undefined;
2213
+ registerSuccess?: string | undefined;
2214
+ requiredField?: string | undefined;
2215
+ securityAnswer?: string | undefined;
2216
+ securityQuestions?: string | undefined;
2217
+ securityQuestionsPrompt?: string | undefined;
2218
+ shouldContainANumber?: string | undefined;
2219
+ shouldContainAnUppercase?: string | undefined;
2220
+ shouldContainALowercase?: string | undefined;
2221
+ shouldContainASymbol?: string | undefined;
2222
+ showPassword?: string | undefined;
2223
+ sn?: string | undefined;
2224
+ submitButton?: string | undefined;
2225
+ successMessage?: string | undefined;
2226
+ termsAndConditions?: string | undefined;
2227
+ termsAndConditionsLinkText?: string | undefined;
2228
+ tryAgain?: string | undefined;
2229
+ twoFactorAuthentication?: string | undefined;
2230
+ useValidEmail?: string | undefined;
2231
+ unrecoverableError?: string | undefined;
2232
+ unknownLoginError?: string | undefined;
2233
+ unknownNetworkError?: string | undefined;
2234
+ userName?: string | undefined;
2235
+ usernameRequirements?: string | undefined;
2236
+ useTheAuthenticatorAppOnYourPhone?: string | undefined;
2237
+ validatedCreatePasswordCallback?: string | undefined;
2238
+ validatedCreateUsernameCallback?: string | undefined;
2239
+ valueRequirements?: string | undefined;
2240
+ }>;
2241
+
2242
+ declare const partialStyleSchema: ZodObject<{
2243
+ checksAndRadios: ZodOptional<ZodOptional<ZodUnion<[ZodLiteral<"animated">, ZodLiteral<"standard">]>>>;
2244
+ labels: ZodOptional<ZodOptional<ZodUnion<[ZodOptional<ZodLiteral<"floating">>, ZodLiteral<"stacked">]>>>;
2245
+ logo: ZodOptional<ZodOptional<ZodObject<{
2246
+ dark: ZodOptional<ZodString>;
2247
+ height: ZodOptional<ZodNumber>;
2248
+ light: ZodOptional<ZodString>;
2249
+ width: ZodOptional<ZodNumber>;
2250
+ }, "strict", ZodTypeAny, {
2251
+ dark?: string | undefined;
2252
+ height?: number | undefined;
2253
+ light?: string | undefined;
2254
+ width?: number | undefined;
2255
+ }, {
2256
+ dark?: string | undefined;
2257
+ height?: number | undefined;
2258
+ light?: string | undefined;
2259
+ width?: number | undefined;
2260
+ }>>>;
2261
+ sections: ZodOptional<ZodOptional<ZodObject<{
2262
+ header: ZodOptional<ZodBoolean>;
2263
+ }, "strip", ZodTypeAny, {
2264
+ header?: boolean | undefined;
2265
+ }, {
2266
+ header?: boolean | undefined;
2267
+ }>>>;
2268
+ stage: ZodOptional<ZodOptional<ZodObject<{
2269
+ icon: ZodOptional<ZodBoolean>;
2270
+ }, "strip", ZodTypeAny, {
2271
+ icon?: boolean | undefined;
2272
+ }, {
2273
+ icon?: boolean | undefined;
2274
+ }>>>;
2275
+ }, "strict", ZodTypeAny, {
2276
+ checksAndRadios?: "standard" | "animated" | undefined;
2277
+ labels?: "floating" | "stacked" | undefined;
2278
+ logo?: {
2279
+ dark?: string | undefined;
2280
+ height?: number | undefined;
2281
+ light?: string | undefined;
2282
+ width?: number | undefined;
2283
+ } | undefined;
2284
+ sections?: {
2285
+ header?: boolean | undefined;
2286
+ } | undefined;
2287
+ stage?: {
2288
+ icon?: boolean | undefined;
2289
+ } | undefined;
2290
+ }, {
2291
+ checksAndRadios?: "standard" | "animated" | undefined;
2292
+ labels?: "floating" | "stacked" | undefined;
2293
+ logo?: {
2294
+ dark?: string | undefined;
2295
+ height?: number | undefined;
2296
+ light?: string | undefined;
2297
+ width?: number | undefined;
2298
+ } | undefined;
2299
+ sections?: {
2300
+ header?: boolean | undefined;
2301
+ } | undefined;
2302
+ stage?: {
2303
+ icon?: boolean | undefined;
2304
+ } | undefined;
2305
+ }>;
2306
+
2307
+ interface JourneyOptions$1 {
2308
+ oauth?: boolean;
2309
+ user?: boolean;
2310
+ }
2311
+ interface JourneyOptionsChange$1 {
2312
+ forgerock?: StepOptions;
2313
+ journey: string;
2314
+ }
2315
+ interface JourneyOptionsStart$1 {
2316
+ forgerock?: StepOptions;
2317
+ journey?: string;
2318
+ resumeUrl?: string;
2319
+ }
2320
+ interface WidgetConfigOptions$1 {
2321
+ forgerock?: TypeOf<typeof partialConfigSchema>;
2322
+ content?: TypeOf<typeof partialStringsSchema>;
2323
+ journeys?: TypeOf<typeof journeyConfigSchema>;
2324
+ links?: TypeOf<typeof partialLinksSchema>;
2325
+ style?: TypeOf<typeof partialStyleSchema>;
2326
+ }
2327
+
2328
+ declare const api: {
2329
+ component: {
2330
+ close: (args?: {
2331
+ reason: "auto" | "external" | "user";
2332
+ } | undefined) => void;
2333
+ open: () => void;
2334
+ subscribe: (this: void, run: Subscriber<Pick<ComponentStoreValue, "reason" | "error" | "open" | "lastAction" | "mounted">>, invalidate?: ((value?: Pick<ComponentStoreValue, "reason" | "error" | "open" | "lastAction" | "mounted"> | undefined) => void) | undefined) => Unsubscriber;
2335
+ };
2336
+ configuration: (options?: WidgetConfigOptions$1 | undefined) => {
2337
+ set(setOptions?: WidgetConfigOptions$1 | undefined): void;
2338
+ };
2339
+ getStores: () => {
2340
+ journeyStore: JourneyStore;
2341
+ oauthStore: OAuthStore;
2342
+ userStore: UserStore;
2343
+ };
2344
+ journey: (options?: JourneyOptions$1 | undefined) => {
2345
+ change: (changeOptions: JourneyOptionsChange$1) => Promise<unknown>;
2346
+ start: (startOptions?: JourneyOptionsStart$1 | undefined) => Promise<unknown>;
2347
+ subscribe: (this: void, run: Subscriber<{
2348
+ journey: JourneyStoreValue$1;
2349
+ oauth: OAuthTokenStoreValue$1;
2350
+ user: UserStoreValue$1;
2351
+ }>, invalidate?: ((value?: {
2352
+ journey: JourneyStoreValue$1;
2353
+ oauth: OAuthTokenStoreValue$1;
2354
+ user: UserStoreValue$1;
2355
+ } | undefined) => void) | undefined) => Unsubscriber;
2356
+ };
2357
+ request: typeof HttpClient.request;
2358
+ user: {
2359
+ info(): {
2360
+ get: (options?: ConfigOptions$1 | undefined) => Promise<unknown>;
2361
+ subscribe: (this: void, run: Subscriber<UserStoreValue$1>, invalidate?: ((value?: UserStoreValue$1 | undefined) => void) | undefined) => Unsubscriber;
2362
+ };
2363
+ logout(): Promise<void>;
2364
+ tokens(): {
2365
+ get: (options?: ConfigOptions$1 | undefined) => Promise<unknown>;
2366
+ subscribe: (this: void, run: Subscriber<OAuthTokenStoreValue$1>, invalidate?: ((value?: OAuthTokenStoreValue$1 | undefined) => void) | undefined) => Unsubscriber;
2367
+ };
2368
+ };
2369
+ };
2370
+ type ConfigurationApi = ReturnType<typeof api.configuration>;
2371
+ type JourneyApi = ReturnType<typeof api.journey>;
2372
+ type UserInfoApi = ReturnType<typeof api.user.info>;
2373
+ type UserTokensApi = ReturnType<typeof api.user.tokens>;
2374
+ type JourneyOptions = JourneyOptions$1;
2375
+ type JourneyOptionsChange = JourneyOptionsChange$1;
2376
+ type JourneyOptionsStart = JourneyOptionsStart$1;
2377
+ type WidgetConfigOptions = WidgetConfigOptions$1;
2378
+ type JourneyStoreValue = JourneyStoreValue$1;
2379
+ type OAuthTokenStoreValue = OAuthTokenStoreValue$1;
2380
+ type UserStoreValue = UserStoreValue$1;
2381
+ type ConfigOptions = ConfigOptions$1;
2382
+ type OAuth2Tokens = OAuth2Tokens$1;
2383
+ type Step = Step$1;
2384
+
2385
+ export { ConfigOptions, ConfigurationApi, JourneyApi, JourneyOptions, JourneyOptionsChange, JourneyOptionsStart, JourneyStoreValue, OAuth2Tokens, OAuthTokenStoreValue, Step, UserInfoApi, UserStoreValue, UserTokensApi, WidgetConfigOptions };