@forgerock/login-widget 1.2.1 → 2.0.0

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.
@@ -0,0 +1,72 @@
1
+ /**
2
+ *
3
+ * Copyright © 2025-2026 Ping Identity Corporation. All right reserved.
4
+ *
5
+ * This software may be modified and distributed under the terms
6
+ * of the MIT license. See the LICENSE file for details.
7
+ *
8
+ **/
9
+ import type { SignalsInitializationOptions } from '@forgerock/protect/types';
10
+ import type { z } from 'zod';
11
+ import type { captchaConfigSchema } from './core/captcha.config';
12
+ import type { partialLinksSchema } from './core/links.store';
13
+ import type { partialStringsSchema } from './core/locale.store';
14
+ import type { OAuthTokenStoreValue } from './core/oauth/oauth.store';
15
+ import type { oidcClientConfigSchema } from './core/oidc/oidc.store';
16
+ import type { ProtectConfig } from './core/protect/protect.store';
17
+ import type { partialStyleSchema } from './core/style.store';
18
+ import type { UserStoreValue } from './core/user/user.store';
19
+ import type { journeyConfigSchema } from './core/journey/config.store';
20
+ import type { JourneyStoreValue } from './core/journey/journey.interfaces';
21
+ export interface JourneyOptions {
22
+ oauth?: boolean;
23
+ user?: boolean;
24
+ }
25
+ export interface JourneyOptionsChange {
26
+ journey: string;
27
+ query?: Record<string, string>;
28
+ }
29
+ export interface JourneyOptionsStart {
30
+ journey?: string;
31
+ query?: Record<string, string>;
32
+ resumeUrl?: string;
33
+ recaptchaAction?: string;
34
+ }
35
+ export interface ModalApi {
36
+ close(args?: {
37
+ reason: 'auto' | 'external' | 'user';
38
+ }): void;
39
+ onClose(fn: (args: {
40
+ reason: 'auto' | 'external' | 'user';
41
+ }) => void): void;
42
+ onMount(fn: () => void): void;
43
+ open(options?: JourneyOptions): void;
44
+ }
45
+ export interface Response {
46
+ journey?: JourneyStoreValue;
47
+ oauth?: OAuthTokenStoreValue;
48
+ user?: UserStoreValue;
49
+ }
50
+ export interface Protect {
51
+ start: (config: ProtectConfig | SignalsInitializationOptions) => Promise<void | {
52
+ error: string;
53
+ }>;
54
+ resumeBehavioralData: () => void | {
55
+ error: string;
56
+ };
57
+ pauseBehavioralData: () => void | {
58
+ error: string;
59
+ };
60
+ getData: () => Promise<string | {
61
+ error: string;
62
+ }>;
63
+ }
64
+ export interface WidgetConfigOptions {
65
+ wellknown: string;
66
+ captcha?: z.infer<typeof captchaConfigSchema>;
67
+ oidcClient?: Omit<z.infer<typeof oidcClientConfigSchema>, 'serverConfig'>;
68
+ content?: z.infer<typeof partialStringsSchema>;
69
+ journeys?: z.infer<typeof journeyConfigSchema>;
70
+ links?: z.infer<typeof partialLinksSchema>;
71
+ style?: z.infer<typeof partialStyleSchema>;
72
+ }