@incodetech/core 2.0.0-alpha.1 → 2.0.0-alpha.11
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/dist/Manager-Cy9-TMC9.d.ts +19 -0
- package/dist/OpenViduLogger-20ZYS-mT.esm.js +3 -0
- package/dist/OpenViduLogger-5b7KqNTo.esm.js +803 -0
- package/dist/StateMachine-BqPpBhOz.d.ts +2 -0
- package/dist/addEvent-s2Za-pK3.esm.js +16 -0
- package/dist/chunk-C_Yo44FK.esm.js +49 -0
- package/dist/deepsightLoader-Bn2D0REl.esm.js +25 -0
- package/dist/email.d.ts +264 -0
- package/dist/email.esm.js +479 -0
- package/dist/endpoints-B0ltwtb5.esm.js +2335 -0
- package/dist/flow.d.ts +578 -0
- package/dist/flow.esm.js +628 -0
- package/dist/getBrowser-CLEzz0Hi.esm.js +8 -0
- package/dist/index.d.ts +226 -0
- package/dist/index.esm.js +156 -0
- package/dist/lib-CykGFCEr.esm.js +11700 -0
- package/dist/permissionServices-BhD0KxsO.esm.js +66 -0
- package/dist/phone.d.ts +292 -0
- package/dist/phone.esm.js +550 -0
- package/dist/recordingsRepository-CTjaf-ER.esm.js +256 -0
- package/dist/selfie.d.ts +821 -0
- package/dist/selfie.esm.js +1087 -0
- package/dist/types-Dif6MQmX.d.ts +5 -0
- package/dist/warmup-Cijuyvoc.d.ts +55 -0
- package/dist/xstate.esm-2T5fOCTq.esm.js +3261 -0
- package/package.json +14 -11
- package/src/camera/cameraActor.ts +0 -21
- package/src/camera/cameraService.test.ts +0 -437
- package/src/camera/cameraService.ts +0 -165
- package/src/camera/cameraServices.test.ts +0 -66
- package/src/camera/cameraServices.ts +0 -26
- package/src/camera/cameraStateMachine.test.ts +0 -602
- package/src/camera/cameraStateMachine.ts +0 -264
- package/src/camera/index.ts +0 -5
- package/src/camera/types.ts +0 -17
- package/src/device/getBrowser.ts +0 -31
- package/src/device/getDeviceClass.ts +0 -29
- package/src/device/index.ts +0 -2
- package/src/email/__mocks__/emailMocks.ts +0 -59
- package/src/email/emailActor.ts +0 -15
- package/src/email/emailManager.test.ts +0 -573
- package/src/email/emailManager.ts +0 -427
- package/src/email/emailServices.ts +0 -66
- package/src/email/emailStateMachine.test.ts +0 -741
- package/src/email/emailStateMachine.ts +0 -367
- package/src/email/index.ts +0 -39
- package/src/email/types.ts +0 -60
- package/src/events/addEvent.ts +0 -20
- package/src/events/types.ts +0 -7
- package/src/flow/__mocks__/flowMocks.ts +0 -84
- package/src/flow/flowActor.ts +0 -13
- package/src/flow/flowAnalyzer.test.ts +0 -266
- package/src/flow/flowAnalyzer.ts +0 -37
- package/src/flow/flowCompletionService.ts +0 -21
- package/src/flow/flowManager.test.ts +0 -560
- package/src/flow/flowManager.ts +0 -235
- package/src/flow/flowServices.test.ts +0 -109
- package/src/flow/flowServices.ts +0 -13
- package/src/flow/flowStateMachine.test.ts +0 -334
- package/src/flow/flowStateMachine.ts +0 -182
- package/src/flow/index.ts +0 -21
- package/src/flow/moduleLoader.test.ts +0 -136
- package/src/flow/moduleLoader.ts +0 -73
- package/src/flow/orchestratedFlowManager.test.ts +0 -240
- package/src/flow/orchestratedFlowManager.ts +0 -231
- package/src/flow/orchestratedFlowStateMachine.test.ts +0 -199
- package/src/flow/orchestratedFlowStateMachine.ts +0 -325
- package/src/flow/types.ts +0 -434
- package/src/http/__mocks__/api.ts +0 -88
- package/src/http/api.test.ts +0 -231
- package/src/http/api.ts +0 -90
- package/src/http/endpoints.ts +0 -17
- package/src/index.ts +0 -33
- package/src/permissions/index.ts +0 -2
- package/src/permissions/permissionServices.ts +0 -31
- package/src/permissions/types.ts +0 -3
- package/src/phone/__mocks__/phoneMocks.ts +0 -71
- package/src/phone/index.ts +0 -39
- package/src/phone/phoneActor.ts +0 -15
- package/src/phone/phoneManager.test.ts +0 -393
- package/src/phone/phoneManager.ts +0 -458
- package/src/phone/phoneServices.ts +0 -98
- package/src/phone/phoneStateMachine.test.ts +0 -918
- package/src/phone/phoneStateMachine.ts +0 -422
- package/src/phone/types.ts +0 -83
- package/src/recordings/recordingsRepository.test.ts +0 -87
- package/src/recordings/recordingsRepository.ts +0 -48
- package/src/recordings/streamingEvents.ts +0 -10
- package/src/selfie/__mocks__/selfieMocks.ts +0 -26
- package/src/selfie/index.ts +0 -14
- package/src/selfie/selfieActor.ts +0 -17
- package/src/selfie/selfieErrorUtils.test.ts +0 -116
- package/src/selfie/selfieErrorUtils.ts +0 -66
- package/src/selfie/selfieManager.test.ts +0 -297
- package/src/selfie/selfieManager.ts +0 -301
- package/src/selfie/selfieServices.ts +0 -362
- package/src/selfie/selfieStateMachine.test.ts +0 -283
- package/src/selfie/selfieStateMachine.ts +0 -804
- package/src/selfie/selfieUploadService.test.ts +0 -90
- package/src/selfie/selfieUploadService.ts +0 -81
- package/src/selfie/types.ts +0 -103
- package/src/session/index.ts +0 -5
- package/src/session/sessionService.ts +0 -78
- package/src/setup.test.ts +0 -61
- package/src/setup.ts +0 -171
- package/tsconfig.json +0 -13
- package/tsdown.config.ts +0 -22
- package/vitest.config.ts +0 -37
- package/vitest.setup.ts +0 -135
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { _ as queryCameraPermission, v as requestCameraAccess, y as stopCameraStream } from "./endpoints-B0ltwtb5.esm.js";
|
|
2
|
+
import { t as getUserAgent } from "./getBrowser-CLEzz0Hi.esm.js";
|
|
3
|
+
|
|
4
|
+
//#region ../infra/src/device/getDeviceClass.ts
|
|
5
|
+
function getDeviceInfo() {
|
|
6
|
+
if (typeof navigator === "undefined") return {
|
|
7
|
+
userAgent: "",
|
|
8
|
+
platform: "",
|
|
9
|
+
maxTouchPoints: 0
|
|
10
|
+
};
|
|
11
|
+
return {
|
|
12
|
+
userAgent: navigator.userAgent,
|
|
13
|
+
platform: navigator.platform,
|
|
14
|
+
maxTouchPoints: navigator.maxTouchPoints
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region src/internal/device/getBrowser.ts
|
|
20
|
+
function getBrowser() {
|
|
21
|
+
const userAgent = getUserAgent();
|
|
22
|
+
if (!userAgent) return "other";
|
|
23
|
+
const ua = userAgent.toLowerCase();
|
|
24
|
+
if (ua.includes("edg/")) return "edge";
|
|
25
|
+
if (ua.includes("chrome") && !ua.includes("edg/")) return "chrome";
|
|
26
|
+
if (ua.includes("firefox")) return "firefox";
|
|
27
|
+
if (ua.includes("safari") && !ua.includes("chrome")) return "safari";
|
|
28
|
+
return "other";
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/internal/device/getDeviceClass.ts
|
|
33
|
+
function getDeviceClass() {
|
|
34
|
+
const { userAgent, platform, maxTouchPoints } = getDeviceInfo();
|
|
35
|
+
if (!userAgent) return "desktop";
|
|
36
|
+
const ua = userAgent.toLowerCase();
|
|
37
|
+
if (/iphone|ipad|ipod/.test(ua) || platform === "MacIntel" && maxTouchPoints > 1) return "ios";
|
|
38
|
+
if (/android/.test(ua)) return "android";
|
|
39
|
+
return "desktop";
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
//#endregion
|
|
43
|
+
//#region src/internal/permissions/permissionServices.ts
|
|
44
|
+
/**
|
|
45
|
+
* Checks the current camera permission state without prompting the user.
|
|
46
|
+
*/
|
|
47
|
+
async function checkPermission() {
|
|
48
|
+
return queryCameraPermission();
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Requests camera permission by attempting to access the camera, then immediately
|
|
52
|
+
* stops the obtained stream. This function does not keep or return the stream.
|
|
53
|
+
*/
|
|
54
|
+
async function requestPermission() {
|
|
55
|
+
try {
|
|
56
|
+
stopCameraStream(await requestCameraAccess({ video: true }));
|
|
57
|
+
return "granted";
|
|
58
|
+
} catch (error) {
|
|
59
|
+
const name = error instanceof Error ? error.name : void 0;
|
|
60
|
+
if (name === "NotAllowedError" || name === "PermissionDeniedError") return "denied";
|
|
61
|
+
return "prompt";
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
//#endregion
|
|
66
|
+
export { getBrowser as i, requestPermission as n, getDeviceClass as r, checkPermission as t };
|
package/dist/phone.d.ts
ADDED
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
import { t as Manager } from "./Manager-Cy9-TMC9.js";
|
|
2
|
+
|
|
3
|
+
//#region src/modules/phone/types.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Configuration options for phone verification.
|
|
7
|
+
*
|
|
8
|
+
* @example Standard OTP verification
|
|
9
|
+
* ```typescript
|
|
10
|
+
* const config: PhoneConfig = {
|
|
11
|
+
* otpVerification: true,
|
|
12
|
+
* otpExpirationInMinutes: 5,
|
|
13
|
+
* prefill: false,
|
|
14
|
+
* };
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @example With all options
|
|
18
|
+
* ```typescript
|
|
19
|
+
* const config: PhoneConfig = {
|
|
20
|
+
* otpVerification: true,
|
|
21
|
+
* otpExpirationInMinutes: 10,
|
|
22
|
+
* prefill: true,
|
|
23
|
+
* isInstantVerify: false,
|
|
24
|
+
* optinEnabled: true,
|
|
25
|
+
* maxOtpAttempts: 3,
|
|
26
|
+
* };
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
type PhoneConfig = {
|
|
30
|
+
/**
|
|
31
|
+
* Whether to require OTP (SMS code) verification.
|
|
32
|
+
* If false, phone is verified immediately after submission.
|
|
33
|
+
*/
|
|
34
|
+
otpVerification: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* How long the OTP code remains valid, in minutes.
|
|
37
|
+
* After expiration, user must request a new code.
|
|
38
|
+
*/
|
|
39
|
+
otpExpirationInMinutes: number;
|
|
40
|
+
/**
|
|
41
|
+
* Whether to pre-populate with user's previously stored phone number.
|
|
42
|
+
* Useful for returning users.
|
|
43
|
+
*/
|
|
44
|
+
prefill: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Use carrier-based instant verification instead of OTP.
|
|
47
|
+
* Not available in all regions.
|
|
48
|
+
* @default false
|
|
49
|
+
*/
|
|
50
|
+
isInstantVerify?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Show a marketing opt-in checkbox in the UI.
|
|
53
|
+
* User's preference is sent with the phone submission.
|
|
54
|
+
* @default false
|
|
55
|
+
*/
|
|
56
|
+
optinEnabled?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Maximum number of OTP verification attempts before lockout.
|
|
59
|
+
* After exhausting attempts, user sees an error state.
|
|
60
|
+
* @default 3
|
|
61
|
+
*/
|
|
62
|
+
maxOtpAttempts?: number;
|
|
63
|
+
};
|
|
64
|
+
//#endregion
|
|
65
|
+
//#region src/modules/phone/phoneStateMachine.d.ts
|
|
66
|
+
|
|
67
|
+
declare const phoneMachine: any;
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region src/modules/phone/phoneActor.d.ts
|
|
70
|
+
type CreatePhoneActorOptions = {
|
|
71
|
+
config: PhoneConfig;
|
|
72
|
+
};
|
|
73
|
+
//#endregion
|
|
74
|
+
//#region src/modules/phone/phoneManager.d.ts
|
|
75
|
+
/** Phone manager is in initial state, waiting for `load()` to be called */
|
|
76
|
+
type PhoneIdleState = {
|
|
77
|
+
status: 'idle';
|
|
78
|
+
};
|
|
79
|
+
/** Loading prefilled phone number from backend (if prefill is enabled) */
|
|
80
|
+
type PhoneLoadingPrefillState = {
|
|
81
|
+
status: 'loadingPrefill';
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Ready for phone input - use `setPhoneNumber()` and `submit()`
|
|
85
|
+
* @property countryCode - ISO country code (e.g., 'US', 'MX')
|
|
86
|
+
* @property phonePrefix - International dialing prefix (e.g., '+1', '+52')
|
|
87
|
+
* @property prefilledPhone - Pre-populated phone number (if prefill enabled)
|
|
88
|
+
* @property phoneError - Validation error message if phone was rejected
|
|
89
|
+
*/
|
|
90
|
+
type PhoneInputtingState = {
|
|
91
|
+
status: 'inputting';
|
|
92
|
+
countryCode: string;
|
|
93
|
+
phonePrefix: string;
|
|
94
|
+
prefilledPhone?: string;
|
|
95
|
+
phoneError?: string;
|
|
96
|
+
};
|
|
97
|
+
/** Phone number is being submitted to the backend */
|
|
98
|
+
type PhoneSubmittingState = {
|
|
99
|
+
status: 'submitting';
|
|
100
|
+
};
|
|
101
|
+
/** OTP is being sent to the phone number */
|
|
102
|
+
type PhoneSendingOtpState = {
|
|
103
|
+
status: 'sendingOtp';
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* Waiting for OTP code - use `submitOtp()`, `resendOtp()`, or `back()`
|
|
107
|
+
* @property resendTimer - Seconds remaining before resend is allowed
|
|
108
|
+
* @property canResend - Whether the resend button should be enabled
|
|
109
|
+
* @property attemptsRemaining - Number of OTP verification attempts left
|
|
110
|
+
*/
|
|
111
|
+
type PhoneAwaitingOtpState = {
|
|
112
|
+
status: 'awaitingOtp';
|
|
113
|
+
resendTimer: number;
|
|
114
|
+
canResend: boolean;
|
|
115
|
+
attemptsRemaining: number;
|
|
116
|
+
};
|
|
117
|
+
/** OTP code is being verified against the backend */
|
|
118
|
+
type PhoneVerifyingOtpState = {
|
|
119
|
+
status: 'verifyingOtp';
|
|
120
|
+
};
|
|
121
|
+
/**
|
|
122
|
+
* OTP verification failed - user can retry with `submitOtp()`
|
|
123
|
+
* @property error - Error message describing why verification failed
|
|
124
|
+
* @property attemptsRemaining - Number of remaining attempts before lockout
|
|
125
|
+
*/
|
|
126
|
+
type PhoneOtpErrorState = {
|
|
127
|
+
status: 'otpError';
|
|
128
|
+
error: string;
|
|
129
|
+
attemptsRemaining: number;
|
|
130
|
+
};
|
|
131
|
+
/** Phone verification completed successfully - call `reset()` to start over */
|
|
132
|
+
type PhoneSuccessState = {
|
|
133
|
+
status: 'success';
|
|
134
|
+
};
|
|
135
|
+
/**
|
|
136
|
+
* Fatal error occurred - call `reset()` to start over
|
|
137
|
+
* @property error - Error message describing what went wrong
|
|
138
|
+
*/
|
|
139
|
+
type PhoneErrorState = {
|
|
140
|
+
status: 'error';
|
|
141
|
+
error: string;
|
|
142
|
+
};
|
|
143
|
+
/**
|
|
144
|
+
* Union of all possible phone manager states.
|
|
145
|
+
* Use discriminated union pattern to narrow the type:
|
|
146
|
+
*
|
|
147
|
+
* @example
|
|
148
|
+
* ```typescript
|
|
149
|
+
* const state = phoneManager.getState();
|
|
150
|
+
* if (state.status === 'inputting') {
|
|
151
|
+
* // TypeScript knows state has countryCode, phonePrefix, etc.
|
|
152
|
+
* console.log(state.countryCode);
|
|
153
|
+
* }
|
|
154
|
+
* ```
|
|
155
|
+
*/
|
|
156
|
+
type PhoneState = PhoneIdleState | PhoneLoadingPrefillState | PhoneInputtingState | PhoneSubmittingState | PhoneSendingOtpState | PhoneAwaitingOtpState | PhoneVerifyingOtpState | PhoneOtpErrorState | PhoneSuccessState | PhoneErrorState;
|
|
157
|
+
/**
|
|
158
|
+
* Creates a phone verification manager for headless or UI-driven usage.
|
|
159
|
+
*
|
|
160
|
+
* The manager provides a state machine-based API for phone number verification
|
|
161
|
+
* with optional OTP (one-time password) verification.
|
|
162
|
+
*
|
|
163
|
+
* @param options - Configuration options
|
|
164
|
+
* @param options.config - Phone verification configuration
|
|
165
|
+
* @param options.config.otpVerification - Whether to require OTP verification
|
|
166
|
+
* @param options.config.otpExpirationInMinutes - How long the OTP is valid
|
|
167
|
+
* @param options.config.prefill - Whether to fetch a pre-filled phone number
|
|
168
|
+
* @param options.config.isInstantVerify - Use instant verification API
|
|
169
|
+
* @param options.config.optinEnabled - Show marketing opt-in checkbox
|
|
170
|
+
* @param options.config.maxOtpAttempts - Maximum OTP verification attempts (default: 3)
|
|
171
|
+
*
|
|
172
|
+
* @returns Phone manager with state, API methods, and subscription
|
|
173
|
+
*
|
|
174
|
+
* @example Headless usage
|
|
175
|
+
* ```typescript
|
|
176
|
+
* const manager = createPhoneManager({
|
|
177
|
+
* config: { otpVerification: true, otpExpirationInMinutes: 5, prefill: false },
|
|
178
|
+
* });
|
|
179
|
+
*
|
|
180
|
+
* manager.subscribe((state) => console.log(state.status));
|
|
181
|
+
* manager.load();
|
|
182
|
+
* manager.setPhoneNumber('+14155551234', true);
|
|
183
|
+
* manager.submit();
|
|
184
|
+
* // ... wait for 'awaitingOtp' state ...
|
|
185
|
+
* manager.submitOtp('ABC123');
|
|
186
|
+
* manager.stop();
|
|
187
|
+
* ```
|
|
188
|
+
*
|
|
189
|
+
* @example With React/Preact UI hook
|
|
190
|
+
* ```tsx
|
|
191
|
+
* const [state, manager] = useManager(() => createPhoneManager({ config }));
|
|
192
|
+
*
|
|
193
|
+
* if (state.status === 'inputting') {
|
|
194
|
+
* return <input onChange={(e) => manager.setPhoneNumber(e.target.value, true)} />;
|
|
195
|
+
* }
|
|
196
|
+
* ```
|
|
197
|
+
*/
|
|
198
|
+
declare function createPhoneManager(options: CreatePhoneActorOptions): Manager<PhoneState> & {
|
|
199
|
+
/**
|
|
200
|
+
* Initializes the phone verification flow.
|
|
201
|
+
* Transitions from 'idle' to 'loadingPrefill' or 'inputting'.
|
|
202
|
+
* Must be called before any other method.
|
|
203
|
+
*/
|
|
204
|
+
load(): void;
|
|
205
|
+
/**
|
|
206
|
+
* Sets the phone number for verification.
|
|
207
|
+
* Should be called when state is 'inputting'.
|
|
208
|
+
*
|
|
209
|
+
* @param phone - Full phone number with country code (e.g., '+14155551234')
|
|
210
|
+
* @param isValid - Whether the phone number passes validation
|
|
211
|
+
*
|
|
212
|
+
* @example
|
|
213
|
+
* ```typescript
|
|
214
|
+
* // Using libphonenumber-js for validation
|
|
215
|
+
* import { isValidPhoneNumber } from 'libphonenumber-js';
|
|
216
|
+
* const phone = '+14155551234';
|
|
217
|
+
* phoneManager.setPhoneNumber(phone, isValidPhoneNumber(phone));
|
|
218
|
+
* ```
|
|
219
|
+
*/
|
|
220
|
+
setPhoneNumber(phone: string, isValid: boolean): void;
|
|
221
|
+
/**
|
|
222
|
+
* Sets the marketing opt-in preference.
|
|
223
|
+
* Only relevant if `config.optinEnabled` is true.
|
|
224
|
+
*
|
|
225
|
+
* @param granted - Whether the user consented to receive marketing messages
|
|
226
|
+
*/
|
|
227
|
+
setOptInGranted(granted: boolean): void;
|
|
228
|
+
/**
|
|
229
|
+
* Submits the phone number for verification.
|
|
230
|
+
* Requires a valid phone number to be set via `setPhoneNumber()`.
|
|
231
|
+
* Transitions to 'submitting', then to 'sendingOtp' or 'success' (if no OTP).
|
|
232
|
+
*/
|
|
233
|
+
submit(): void;
|
|
234
|
+
/**
|
|
235
|
+
* Sets the OTP code without submitting.
|
|
236
|
+
* Use this for controlled input components.
|
|
237
|
+
*
|
|
238
|
+
* @param code - The OTP code entered by the user
|
|
239
|
+
*/
|
|
240
|
+
setOtpCode(code: string): void;
|
|
241
|
+
/**
|
|
242
|
+
* Sets and submits the OTP code in one call.
|
|
243
|
+
* Should be called when state is 'awaitingOtp' or 'otpError'.
|
|
244
|
+
*
|
|
245
|
+
* @param code - The complete OTP code (typically 6 alphanumeric characters)
|
|
246
|
+
*
|
|
247
|
+
* @example
|
|
248
|
+
* ```typescript
|
|
249
|
+
* // Submit OTP when user completes entry
|
|
250
|
+
* phoneManager.submitOtp('HH36LP');
|
|
251
|
+
* ```
|
|
252
|
+
*/
|
|
253
|
+
submitOtp(code: string): void;
|
|
254
|
+
/**
|
|
255
|
+
* Requests a new OTP code to be sent.
|
|
256
|
+
* Only works when state is 'awaitingOtp' and `canResend` is true.
|
|
257
|
+
* Resets the resend timer.
|
|
258
|
+
*/
|
|
259
|
+
resendOtp(): void;
|
|
260
|
+
/**
|
|
261
|
+
* Returns to the phone input screen from OTP entry.
|
|
262
|
+
* Allows the user to change their phone number.
|
|
263
|
+
* Transitions from 'awaitingOtp' or 'otpError' back to 'inputting'.
|
|
264
|
+
*/
|
|
265
|
+
back(): void;
|
|
266
|
+
/**
|
|
267
|
+
* Resets the manager to initial state.
|
|
268
|
+
* Can be called from 'success' or 'error' states to start over.
|
|
269
|
+
* Clears all stored data including phone number and OTP.
|
|
270
|
+
*/
|
|
271
|
+
reset(): void;
|
|
272
|
+
};
|
|
273
|
+
/**
|
|
274
|
+
* Type representing a phone manager instance.
|
|
275
|
+
* Includes state access, API methods, and lifecycle management.
|
|
276
|
+
*
|
|
277
|
+
* @property getState - Returns the current PhoneState
|
|
278
|
+
* @property subscribe - Subscribes to state changes, returns unsubscribe function
|
|
279
|
+
* @property stop - Stops the manager and cleans up resources
|
|
280
|
+
* @property load - Initializes the verification flow
|
|
281
|
+
* @property setPhoneNumber - Sets the phone number
|
|
282
|
+
* @property setOptInGranted - Sets marketing opt-in preference
|
|
283
|
+
* @property submit - Submits the phone number
|
|
284
|
+
* @property setOtpCode - Sets OTP code without submitting
|
|
285
|
+
* @property submitOtp - Sets and submits OTP code
|
|
286
|
+
* @property resendOtp - Requests new OTP code
|
|
287
|
+
* @property back - Returns to phone input from OTP screen
|
|
288
|
+
* @property reset - Resets to initial state
|
|
289
|
+
*/
|
|
290
|
+
type PhoneManager = ReturnType<typeof createPhoneManager>;
|
|
291
|
+
//#endregion
|
|
292
|
+
export { type PhoneConfig, type PhoneManager, type PhoneState, createPhoneManager, phoneMachine };
|