@splpi/estore-shared-components 7.0.3 → 7.0.5
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/index.d.mts +105 -7
- package/dist/index.d.ts +105 -7
- package/dist/index.js +844 -583
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +451 -204
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import React$1 from 'react';
|
|
3
|
+
import * as axios from 'axios';
|
|
4
|
+
import { AxiosRequestConfig } from 'axios';
|
|
3
5
|
import { IconType } from 'react-icons';
|
|
4
6
|
|
|
5
7
|
interface IPersonalInfo {
|
|
@@ -96,6 +98,8 @@ interface IParsedAddress {
|
|
|
96
98
|
}
|
|
97
99
|
|
|
98
100
|
interface LifePlanApplication2Props {
|
|
101
|
+
/** Saved address, shown when the user comes back to this form. */
|
|
102
|
+
initialData?: IAddress;
|
|
99
103
|
onAddressUpdate?: (address: IAddress) => void;
|
|
100
104
|
/**
|
|
101
105
|
* Optional address parser from the host app (e.g. GeoApifyService.parseAddress).
|
|
@@ -103,7 +107,7 @@ interface LifePlanApplication2Props {
|
|
|
103
107
|
*/
|
|
104
108
|
parseAddress?: (addressLine: string) => Promise<IParsedAddress>;
|
|
105
109
|
}
|
|
106
|
-
declare const LifePlanApplication2: ({ onAddressUpdate, parseAddress, }: LifePlanApplication2Props) => react_jsx_runtime.JSX.Element;
|
|
110
|
+
declare const LifePlanApplication2: ({ initialData, onAddressUpdate, parseAddress, }: LifePlanApplication2Props) => react_jsx_runtime.JSX.Element;
|
|
107
111
|
|
|
108
112
|
interface LifePlanApplication3Props {
|
|
109
113
|
initialData?: IEmployment;
|
|
@@ -123,7 +127,7 @@ declare const LifePlanApplicationFormWrapper: ({ openSection, openSectionKey, on
|
|
|
123
127
|
openSectionKey?: number;
|
|
124
128
|
onValidChange?: (valid: boolean) => void;
|
|
125
129
|
parseAddress?: (addressLine: string) => Promise<IParsedAddress>;
|
|
126
|
-
}) => react_jsx_runtime.JSX.Element;
|
|
130
|
+
}) => react_jsx_runtime.JSX.Element | null;
|
|
127
131
|
|
|
128
132
|
interface CartItem {
|
|
129
133
|
planDesc: string;
|
|
@@ -154,10 +158,10 @@ type SharedLifePlanApplicationProps = {
|
|
|
154
158
|
onPaymentError?: (error: unknown) => void;
|
|
155
159
|
/**
|
|
156
160
|
* Called on the payment step with the cart items and application data.
|
|
157
|
-
* Must return the checkout URL
|
|
161
|
+
* Must return the checkout URL. Defaults to the built-in PayMongoService (test account).
|
|
158
162
|
*/
|
|
159
163
|
onCheckout?: (request: NewSalesCheckoutRequest) => Promise<string | undefined>;
|
|
160
|
-
/**
|
|
164
|
+
/** Address parser used to fill the address form from the scanned ID. Defaults to GeoApifyService.parseAddress. */
|
|
161
165
|
parseAddress?: (addressLine: string) => Promise<IParsedAddress>;
|
|
162
166
|
};
|
|
163
167
|
declare const SharedLifePlanApplication: ({ title, description, onPaymentError, onCheckout, parseAddress, }: SharedLifePlanApplicationProps) => react_jsx_runtime.JSX.Element;
|
|
@@ -190,8 +194,8 @@ declare function useOcr(scanIdFn: ScanIdFn): {
|
|
|
190
194
|
|
|
191
195
|
type GetStartedNotifyType = "info" | "error";
|
|
192
196
|
type GetStartedProps = {
|
|
193
|
-
/**
|
|
194
|
-
scanId
|
|
197
|
+
/** ID scanner. Defaults to the built-in `OcrService.scanId`. The result is saved for form autofill. */
|
|
198
|
+
scanId?: ScanIdFn;
|
|
195
199
|
/** Called on Skip / Continue in the Referral Agent dialog, e.g. `() => router.push("/lifeplan-application")`. */
|
|
196
200
|
onContinue?: () => void;
|
|
197
201
|
/** Shows a message to the user, e.g. `(type, msg) => toast[type](msg)`. Defaults to console. */
|
|
@@ -229,6 +233,81 @@ declare function DocumentUploadCard({ config, onStatusChange, onProcess, onError
|
|
|
229
233
|
onError?: (message: string) => void;
|
|
230
234
|
}): react_jsx_runtime.JSX.Element;
|
|
231
235
|
|
|
236
|
+
declare class APIError extends Error {
|
|
237
|
+
status?: number | undefined;
|
|
238
|
+
constructor(message: string, status?: number);
|
|
239
|
+
}
|
|
240
|
+
declare const apiClient: axios.AxiosInstance;
|
|
241
|
+
/** Sets the API base URL used by the shared services (OCR, address, PayMongo). */
|
|
242
|
+
declare const configureApi: (options: {
|
|
243
|
+
baseUrl: string;
|
|
244
|
+
}) => void;
|
|
245
|
+
declare const api: {
|
|
246
|
+
get: <TResponse>(url: string, params?: Record<string, unknown>, config?: AxiosRequestConfig) => Promise<TResponse>;
|
|
247
|
+
post: <TResponse, TPayload = unknown>(url: string, payload?: TPayload, config?: AxiosRequestConfig) => Promise<TResponse>;
|
|
248
|
+
put: <TResponse, TPayload = unknown>(url: string, payload?: TPayload, config?: AxiosRequestConfig) => Promise<TResponse>;
|
|
249
|
+
delete: <TResponse>(url: string, config?: AxiosRequestConfig) => Promise<TResponse>;
|
|
250
|
+
};
|
|
251
|
+
|
|
252
|
+
type OcrDocType = "ID" | "LPA";
|
|
253
|
+
type OcrSource = File | string;
|
|
254
|
+
declare const OcrService: {
|
|
255
|
+
scan(docType: OcrDocType, source: OcrSource): Promise<unknown>;
|
|
256
|
+
scanId(source: OcrSource): Promise<IOcrValue>;
|
|
257
|
+
scanLpa(source: OcrSource): Promise<unknown>;
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
declare const GeoApifyService: {
|
|
261
|
+
parseAddress(text: string): Promise<IParsedAddress>;
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* PayMongoService
|
|
266
|
+
* ---------------
|
|
267
|
+
* Creates a PayMongo checkout through the C# API (eStoreV2API -> PayMongoAPIController)
|
|
268
|
+
* and returns the payment page link.
|
|
269
|
+
*
|
|
270
|
+
* C# endpoint: POST /CheckOut
|
|
271
|
+
* C# expects: { items: [{ planDesc, productCode, contractPrice, ipInstAmt, planTerm, quantity }] }
|
|
272
|
+
* C# returns: { checkoutUrl: "https://checkout.paymongo.com/..." }
|
|
273
|
+
*
|
|
274
|
+
* Example:
|
|
275
|
+
* const { checkoutUrl } = await PayMongoService.createCheckout([{ planDesc: "ST. ANNE", ipInstAmt: 1500, quantity: 1 }]);
|
|
276
|
+
* window.location.href = checkoutUrl;
|
|
277
|
+
*/
|
|
278
|
+
interface ICheckoutItem {
|
|
279
|
+
planDesc: string;
|
|
280
|
+
ipInstAmt: number;
|
|
281
|
+
quantity: number;
|
|
282
|
+
planTerm?: string | number;
|
|
283
|
+
productCode?: string;
|
|
284
|
+
contractPrice?: number;
|
|
285
|
+
}
|
|
286
|
+
interface ICheckoutResult {
|
|
287
|
+
checkoutUrl?: string | undefined;
|
|
288
|
+
}
|
|
289
|
+
interface INewSalesCheckoutItem {
|
|
290
|
+
planDesc: string;
|
|
291
|
+
mode: string;
|
|
292
|
+
ipInstAmt: number;
|
|
293
|
+
quantity: number;
|
|
294
|
+
planTerm?: string | number;
|
|
295
|
+
}
|
|
296
|
+
interface INewSalesCheckoutRequest {
|
|
297
|
+
items: INewSalesCheckoutItem[];
|
|
298
|
+
application: ITransactionData;
|
|
299
|
+
accountNo?: string;
|
|
300
|
+
empCode?: string;
|
|
301
|
+
}
|
|
302
|
+
interface INewSalesCheckoutResult {
|
|
303
|
+
checkoutUrl?: string | undefined;
|
|
304
|
+
requestId?: string | undefined;
|
|
305
|
+
}
|
|
306
|
+
declare const PayMongoService: {
|
|
307
|
+
createCheckout(items: ICheckoutItem[]): Promise<ICheckoutResult>;
|
|
308
|
+
createNewSalesCheckout(request: INewSalesCheckoutRequest): Promise<INewSalesCheckoutResult>;
|
|
309
|
+
};
|
|
310
|
+
|
|
232
311
|
type QuickAction = {
|
|
233
312
|
/** React Icons icon component */
|
|
234
313
|
icon: IconType;
|
|
@@ -311,8 +390,27 @@ interface ReusableProfileProps {
|
|
|
311
390
|
}
|
|
312
391
|
declare function ReusableProfile({ user, colorMode: controlledColorMode, onColorModeChange, initialTwoFactorEnabled, initialQuickNavHrefs, availableNavOptions, maxQuickNavItems, enableLocalStorage, storageKey, onSaveAccount, onChangePassword, onSignOut, onTwoFactorChange, onToast, }: ReusableProfileProps): react_jsx_runtime.JSX.Element;
|
|
313
392
|
|
|
393
|
+
declare const LIFE_PLAN_APPLICATION_KEY = "LifePlanApplication";
|
|
394
|
+
/** Fired on `window` every time the saved application data changes. */
|
|
395
|
+
declare const APPLICATION_DATA_CHANGE_EVENT = "lifeplan-application:change";
|
|
314
396
|
declare const createEmptyApplicationData: () => IApplicationData;
|
|
397
|
+
/** Reads the saved application data, or null if nothing is saved yet. */
|
|
398
|
+
declare const loadApplicationData: (storageKey?: string) => IApplicationData | null;
|
|
399
|
+
/** Replaces the whole saved application data. */
|
|
400
|
+
declare const saveApplicationData: (data: IApplicationData, storageKey?: string) => void;
|
|
401
|
+
/**
|
|
402
|
+
* Saves only the given sections and keeps the rest as-is,
|
|
403
|
+
* so one form step never wipes another step's data.
|
|
404
|
+
*/
|
|
405
|
+
declare const updateApplicationData: (patch: Partial<IApplicationData>, storageKey?: string) => IApplicationData;
|
|
406
|
+
/** Removes the saved application data (e.g. after a successful payment). */
|
|
407
|
+
declare const clearApplicationData: (storageKey?: string) => void;
|
|
408
|
+
/** @deprecated Kept for older code. Data now lives in sessionStorage; use `loadApplicationData`. */
|
|
315
409
|
declare const loadApplicationDataFromLocalStorage: (storageKey?: string) => IApplicationData | null;
|
|
410
|
+
/** @deprecated Kept for older code. Data now lives in sessionStorage; use `saveApplicationData`. */
|
|
316
411
|
declare const saveApplicationDataToLocalStorage: (data: IApplicationData, storageKey?: string) => void;
|
|
317
412
|
|
|
318
|
-
|
|
413
|
+
/** Returns the saved application data and re-renders whenever it changes. */
|
|
414
|
+
declare function useApplicationData(storageKey?: string): IApplicationData | null;
|
|
415
|
+
|
|
416
|
+
export { APIError, APPLICATION_DATA_CHANGE_EVENT, Beneficiary, type BeneficiaryClass, BottomQuickActions, type CartItem, type DocumentStatus, type DocumentTypeConfig, DocumentUploadCard, GeoApifyService, GetStarted, type GetStartedNotifyType, type GetStartedProps, HealthDeclaration, type IAddress, type IApplicationData, type IBeneficiary, type ICheckoutItem, type ICheckoutResult, type IEmployment, type IHealthDeclaration, type INewSalesCheckoutItem, type INewSalesCheckoutRequest, type INewSalesCheckoutResult, type IOcrValue, type IParsedAddress, type IPersonalInfo, type ITransactionData, LIFE_PLAN_APPLICATION_KEY, LifePlanApplication1, LifePlanApplication2, LifePlanApplication3, LifePlanApplicationFormWrapper, LifePlanApplicationStepWrapper, type NavOptionDef, type NewSalesCheckoutItem, type NewSalesCheckoutRequest, NotifyInstall, OCR_STORAGE_KEY, type OcrDocType, type OcrSection, OcrService, type OcrSource, PayMongoService, type ProfileUser, type ReusableProfileProps, type ScanIdFn, SharedLifePlanApplication, type SharedLifePlanApplicationProps, ReusableProfile as UserProfile, api, apiClient, clearApplicationData, clearOcrResult, configureApi, createEmptyApplicationData, loadApplicationData, loadApplicationDataFromLocalStorage, markOcrApplied, readOcrResult, saveApplicationData, saveApplicationDataToLocalStorage, saveOcrResult, updateApplicationData, useApplicationData, useOcr };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import React$1 from 'react';
|
|
3
|
+
import * as axios from 'axios';
|
|
4
|
+
import { AxiosRequestConfig } from 'axios';
|
|
3
5
|
import { IconType } from 'react-icons';
|
|
4
6
|
|
|
5
7
|
interface IPersonalInfo {
|
|
@@ -96,6 +98,8 @@ interface IParsedAddress {
|
|
|
96
98
|
}
|
|
97
99
|
|
|
98
100
|
interface LifePlanApplication2Props {
|
|
101
|
+
/** Saved address, shown when the user comes back to this form. */
|
|
102
|
+
initialData?: IAddress;
|
|
99
103
|
onAddressUpdate?: (address: IAddress) => void;
|
|
100
104
|
/**
|
|
101
105
|
* Optional address parser from the host app (e.g. GeoApifyService.parseAddress).
|
|
@@ -103,7 +107,7 @@ interface LifePlanApplication2Props {
|
|
|
103
107
|
*/
|
|
104
108
|
parseAddress?: (addressLine: string) => Promise<IParsedAddress>;
|
|
105
109
|
}
|
|
106
|
-
declare const LifePlanApplication2: ({ onAddressUpdate, parseAddress, }: LifePlanApplication2Props) => react_jsx_runtime.JSX.Element;
|
|
110
|
+
declare const LifePlanApplication2: ({ initialData, onAddressUpdate, parseAddress, }: LifePlanApplication2Props) => react_jsx_runtime.JSX.Element;
|
|
107
111
|
|
|
108
112
|
interface LifePlanApplication3Props {
|
|
109
113
|
initialData?: IEmployment;
|
|
@@ -123,7 +127,7 @@ declare const LifePlanApplicationFormWrapper: ({ openSection, openSectionKey, on
|
|
|
123
127
|
openSectionKey?: number;
|
|
124
128
|
onValidChange?: (valid: boolean) => void;
|
|
125
129
|
parseAddress?: (addressLine: string) => Promise<IParsedAddress>;
|
|
126
|
-
}) => react_jsx_runtime.JSX.Element;
|
|
130
|
+
}) => react_jsx_runtime.JSX.Element | null;
|
|
127
131
|
|
|
128
132
|
interface CartItem {
|
|
129
133
|
planDesc: string;
|
|
@@ -154,10 +158,10 @@ type SharedLifePlanApplicationProps = {
|
|
|
154
158
|
onPaymentError?: (error: unknown) => void;
|
|
155
159
|
/**
|
|
156
160
|
* Called on the payment step with the cart items and application data.
|
|
157
|
-
* Must return the checkout URL
|
|
161
|
+
* Must return the checkout URL. Defaults to the built-in PayMongoService (test account).
|
|
158
162
|
*/
|
|
159
163
|
onCheckout?: (request: NewSalesCheckoutRequest) => Promise<string | undefined>;
|
|
160
|
-
/**
|
|
164
|
+
/** Address parser used to fill the address form from the scanned ID. Defaults to GeoApifyService.parseAddress. */
|
|
161
165
|
parseAddress?: (addressLine: string) => Promise<IParsedAddress>;
|
|
162
166
|
};
|
|
163
167
|
declare const SharedLifePlanApplication: ({ title, description, onPaymentError, onCheckout, parseAddress, }: SharedLifePlanApplicationProps) => react_jsx_runtime.JSX.Element;
|
|
@@ -190,8 +194,8 @@ declare function useOcr(scanIdFn: ScanIdFn): {
|
|
|
190
194
|
|
|
191
195
|
type GetStartedNotifyType = "info" | "error";
|
|
192
196
|
type GetStartedProps = {
|
|
193
|
-
/**
|
|
194
|
-
scanId
|
|
197
|
+
/** ID scanner. Defaults to the built-in `OcrService.scanId`. The result is saved for form autofill. */
|
|
198
|
+
scanId?: ScanIdFn;
|
|
195
199
|
/** Called on Skip / Continue in the Referral Agent dialog, e.g. `() => router.push("/lifeplan-application")`. */
|
|
196
200
|
onContinue?: () => void;
|
|
197
201
|
/** Shows a message to the user, e.g. `(type, msg) => toast[type](msg)`. Defaults to console. */
|
|
@@ -229,6 +233,81 @@ declare function DocumentUploadCard({ config, onStatusChange, onProcess, onError
|
|
|
229
233
|
onError?: (message: string) => void;
|
|
230
234
|
}): react_jsx_runtime.JSX.Element;
|
|
231
235
|
|
|
236
|
+
declare class APIError extends Error {
|
|
237
|
+
status?: number | undefined;
|
|
238
|
+
constructor(message: string, status?: number);
|
|
239
|
+
}
|
|
240
|
+
declare const apiClient: axios.AxiosInstance;
|
|
241
|
+
/** Sets the API base URL used by the shared services (OCR, address, PayMongo). */
|
|
242
|
+
declare const configureApi: (options: {
|
|
243
|
+
baseUrl: string;
|
|
244
|
+
}) => void;
|
|
245
|
+
declare const api: {
|
|
246
|
+
get: <TResponse>(url: string, params?: Record<string, unknown>, config?: AxiosRequestConfig) => Promise<TResponse>;
|
|
247
|
+
post: <TResponse, TPayload = unknown>(url: string, payload?: TPayload, config?: AxiosRequestConfig) => Promise<TResponse>;
|
|
248
|
+
put: <TResponse, TPayload = unknown>(url: string, payload?: TPayload, config?: AxiosRequestConfig) => Promise<TResponse>;
|
|
249
|
+
delete: <TResponse>(url: string, config?: AxiosRequestConfig) => Promise<TResponse>;
|
|
250
|
+
};
|
|
251
|
+
|
|
252
|
+
type OcrDocType = "ID" | "LPA";
|
|
253
|
+
type OcrSource = File | string;
|
|
254
|
+
declare const OcrService: {
|
|
255
|
+
scan(docType: OcrDocType, source: OcrSource): Promise<unknown>;
|
|
256
|
+
scanId(source: OcrSource): Promise<IOcrValue>;
|
|
257
|
+
scanLpa(source: OcrSource): Promise<unknown>;
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
declare const GeoApifyService: {
|
|
261
|
+
parseAddress(text: string): Promise<IParsedAddress>;
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* PayMongoService
|
|
266
|
+
* ---------------
|
|
267
|
+
* Creates a PayMongo checkout through the C# API (eStoreV2API -> PayMongoAPIController)
|
|
268
|
+
* and returns the payment page link.
|
|
269
|
+
*
|
|
270
|
+
* C# endpoint: POST /CheckOut
|
|
271
|
+
* C# expects: { items: [{ planDesc, productCode, contractPrice, ipInstAmt, planTerm, quantity }] }
|
|
272
|
+
* C# returns: { checkoutUrl: "https://checkout.paymongo.com/..." }
|
|
273
|
+
*
|
|
274
|
+
* Example:
|
|
275
|
+
* const { checkoutUrl } = await PayMongoService.createCheckout([{ planDesc: "ST. ANNE", ipInstAmt: 1500, quantity: 1 }]);
|
|
276
|
+
* window.location.href = checkoutUrl;
|
|
277
|
+
*/
|
|
278
|
+
interface ICheckoutItem {
|
|
279
|
+
planDesc: string;
|
|
280
|
+
ipInstAmt: number;
|
|
281
|
+
quantity: number;
|
|
282
|
+
planTerm?: string | number;
|
|
283
|
+
productCode?: string;
|
|
284
|
+
contractPrice?: number;
|
|
285
|
+
}
|
|
286
|
+
interface ICheckoutResult {
|
|
287
|
+
checkoutUrl?: string | undefined;
|
|
288
|
+
}
|
|
289
|
+
interface INewSalesCheckoutItem {
|
|
290
|
+
planDesc: string;
|
|
291
|
+
mode: string;
|
|
292
|
+
ipInstAmt: number;
|
|
293
|
+
quantity: number;
|
|
294
|
+
planTerm?: string | number;
|
|
295
|
+
}
|
|
296
|
+
interface INewSalesCheckoutRequest {
|
|
297
|
+
items: INewSalesCheckoutItem[];
|
|
298
|
+
application: ITransactionData;
|
|
299
|
+
accountNo?: string;
|
|
300
|
+
empCode?: string;
|
|
301
|
+
}
|
|
302
|
+
interface INewSalesCheckoutResult {
|
|
303
|
+
checkoutUrl?: string | undefined;
|
|
304
|
+
requestId?: string | undefined;
|
|
305
|
+
}
|
|
306
|
+
declare const PayMongoService: {
|
|
307
|
+
createCheckout(items: ICheckoutItem[]): Promise<ICheckoutResult>;
|
|
308
|
+
createNewSalesCheckout(request: INewSalesCheckoutRequest): Promise<INewSalesCheckoutResult>;
|
|
309
|
+
};
|
|
310
|
+
|
|
232
311
|
type QuickAction = {
|
|
233
312
|
/** React Icons icon component */
|
|
234
313
|
icon: IconType;
|
|
@@ -311,8 +390,27 @@ interface ReusableProfileProps {
|
|
|
311
390
|
}
|
|
312
391
|
declare function ReusableProfile({ user, colorMode: controlledColorMode, onColorModeChange, initialTwoFactorEnabled, initialQuickNavHrefs, availableNavOptions, maxQuickNavItems, enableLocalStorage, storageKey, onSaveAccount, onChangePassword, onSignOut, onTwoFactorChange, onToast, }: ReusableProfileProps): react_jsx_runtime.JSX.Element;
|
|
313
392
|
|
|
393
|
+
declare const LIFE_PLAN_APPLICATION_KEY = "LifePlanApplication";
|
|
394
|
+
/** Fired on `window` every time the saved application data changes. */
|
|
395
|
+
declare const APPLICATION_DATA_CHANGE_EVENT = "lifeplan-application:change";
|
|
314
396
|
declare const createEmptyApplicationData: () => IApplicationData;
|
|
397
|
+
/** Reads the saved application data, or null if nothing is saved yet. */
|
|
398
|
+
declare const loadApplicationData: (storageKey?: string) => IApplicationData | null;
|
|
399
|
+
/** Replaces the whole saved application data. */
|
|
400
|
+
declare const saveApplicationData: (data: IApplicationData, storageKey?: string) => void;
|
|
401
|
+
/**
|
|
402
|
+
* Saves only the given sections and keeps the rest as-is,
|
|
403
|
+
* so one form step never wipes another step's data.
|
|
404
|
+
*/
|
|
405
|
+
declare const updateApplicationData: (patch: Partial<IApplicationData>, storageKey?: string) => IApplicationData;
|
|
406
|
+
/** Removes the saved application data (e.g. after a successful payment). */
|
|
407
|
+
declare const clearApplicationData: (storageKey?: string) => void;
|
|
408
|
+
/** @deprecated Kept for older code. Data now lives in sessionStorage; use `loadApplicationData`. */
|
|
315
409
|
declare const loadApplicationDataFromLocalStorage: (storageKey?: string) => IApplicationData | null;
|
|
410
|
+
/** @deprecated Kept for older code. Data now lives in sessionStorage; use `saveApplicationData`. */
|
|
316
411
|
declare const saveApplicationDataToLocalStorage: (data: IApplicationData, storageKey?: string) => void;
|
|
317
412
|
|
|
318
|
-
|
|
413
|
+
/** Returns the saved application data and re-renders whenever it changes. */
|
|
414
|
+
declare function useApplicationData(storageKey?: string): IApplicationData | null;
|
|
415
|
+
|
|
416
|
+
export { APIError, APPLICATION_DATA_CHANGE_EVENT, Beneficiary, type BeneficiaryClass, BottomQuickActions, type CartItem, type DocumentStatus, type DocumentTypeConfig, DocumentUploadCard, GeoApifyService, GetStarted, type GetStartedNotifyType, type GetStartedProps, HealthDeclaration, type IAddress, type IApplicationData, type IBeneficiary, type ICheckoutItem, type ICheckoutResult, type IEmployment, type IHealthDeclaration, type INewSalesCheckoutItem, type INewSalesCheckoutRequest, type INewSalesCheckoutResult, type IOcrValue, type IParsedAddress, type IPersonalInfo, type ITransactionData, LIFE_PLAN_APPLICATION_KEY, LifePlanApplication1, LifePlanApplication2, LifePlanApplication3, LifePlanApplicationFormWrapper, LifePlanApplicationStepWrapper, type NavOptionDef, type NewSalesCheckoutItem, type NewSalesCheckoutRequest, NotifyInstall, OCR_STORAGE_KEY, type OcrDocType, type OcrSection, OcrService, type OcrSource, PayMongoService, type ProfileUser, type ReusableProfileProps, type ScanIdFn, SharedLifePlanApplication, type SharedLifePlanApplicationProps, ReusableProfile as UserProfile, api, apiClient, clearApplicationData, clearOcrResult, configureApi, createEmptyApplicationData, loadApplicationData, loadApplicationDataFromLocalStorage, markOcrApplied, readOcrResult, saveApplicationData, saveApplicationDataToLocalStorage, saveOcrResult, updateApplicationData, useApplicationData, useOcr };
|