import type { AccessFunction, AccessorsDictionary } from '../common'; import type { Address } from '../common/shared/models/Address'; import type { Applicant } from '../common/shared/models/Applicant'; import type { CheckSummary } from '../common/shared/models/CheckSummary'; import type { DeviceCheckDetails } from '../common/shared/models/DeviceCheck'; import type { Document } from '../common/shared/models/Document'; import type { ProfileTypeEnumerated } from '../common/shared/models/Profile'; import type { ImplementModuleDefinition, ModuleDefinition } from '../common/types'; import type { Events } from './events'; export declare enum IndividualLevel { BASE64 = "base64", META = "meta" } interface IIndividualModule extends ModuleDefinition { moduleName: 'individual'; category: 'private'; moduleContext: IndividualModuleContext; moduleEvents: Events; moduleOptions: { level?: IndividualLevel; }; } export type IndividualModule = ImplementModuleDefinition; export type IndividualModuleContext = { /** Has already attempted to load any existing data. This is true even when there's no data to load */ isLoading: () => boolean; /** Existing data was found for this individual */ isPreloaded: () => boolean; /** Whenever making any changes to the individual details an "isPersisted" flag is set to "false" until "submit" is called */ isPersisted: () => boolean; /** Add consent string to the entity's list of consents */ addConsent: (type: string) => void; /** Add whole new {@link Document} to entity's list of identity documents */ addDocument: (details: Document) => void; /** Update existing Document object by its documentId */ updateDocument: (id: string | null, details: Document) => void; /** Delete existing Document object by its documentId */ deleteDocument: (id: string) => void; /** Add new address to entity's list of addresses */ addAddress: (details: Address) => void; /** Update existing Address object by its addressId */ updateAddress: (id: string | null, details: Address) => void; addReference: { /** * Attach a new indexable "customer_reference" to the entity. Won't override a previously set customer reference. **/ (customerReference: string): void; /** Attach a new indexable "key" reference to the entity */ (key: string, value: string): void; }; setProfileType: { (profileType: ProfileTypeEnumerated): void; }; getProfileType: () => void; setPhoneNumber: (phone: string | null) => void; getPhoneNumber: () => string | null; setEmail: (email: string | null) => void; getEmail: () => string | null; /** Persist all entity data in this component. Optional parameter { verify: true } may be provided, which will cause this method to resolve to a [Check summary object]{@link CheckSummary} */ submit: (o?: { verify?: T; }, retryOptions?: { maxRetries?: number; backoffDelayMs?: number; }) => Promise; /** Access public property {@link PublicAccessors} */ access: AccessFunction; /** Trigger another search for any existing data for this entity within the service. ! ATTENTION: This will cause a rewrite of any unpersisted information. */ search: () => Promise; runChecks: () => Promise; setExtraData: (data: object) => void; syncEntityId: () => void; /** @deprecated This field is temporary and should not be used. only for form-io */ formIOUpdateDocument: (id: string, details: Document) => void; }; export type PublicAccessors = AccessorsDictionary<{ readonly entityId: Applicant['entityId']; name: Applicant['name']; dateOfBirth: Applicant['dateOfBirth']; consentsGiven: Applicant['consents']; documents: Document[]; addresses: Address[]; profile: Applicant['profile']; phoneNumber: Applicant['phoneNumber']; email: Applicant['email']; extraData: Applicant['extraData']; device: DeviceCheckDetails; /** @deprecated This field is temporary and should not be used */ __deprecated_applicant: Applicant; /** @deprecated This field is temporary and should not be used */ __deprecated_documents: Document[]; /** Internal loading state. Set to false at the start of every call of submit/search methods and set to true on completion. */ readonly isLoading: boolean; readonly isPersisted: boolean; readonly creditHeaderIssue: boolean; }>; export type InternalState = { applicant: Applicant; documents: Document[]; device: DeviceCheckDetails; isLoading: boolean; isPreloaded: boolean; isPersisted: boolean; creditHeaderIssue: boolean; }; export {}; //# sourceMappingURL=definition.d.ts.map