/** * Import the required types */ import { Validator } from './client.types.js'; import type { ActionCollectors, ActionCollectorTypes, InferSingleValueCollectorType, InferMultiValueCollectorType, SingleValueCollectorTypes, MultiValueCollectorTypes, NoValueCollectorTypes, InferNoValueCollectorType, ValidatedBooleanCollector, ValidatedSingleValueCollectorWithValue, ValidatedTextCollector, InferValueObjectCollectorType, ObjectValueCollectorTypes, UnknownCollector, InferAutoCollectorType, PhoneNumberOutputValue, MultiValueCollectors, ObjectValueCollectors, AutoCollectors, SingleValueAutoCollectorTypes, ObjectValueAutoCollectorTypes, ImageCollector, QrCodeCollector, ReadOnlyCollector, RichTextCollector, RichContentLink, PhoneNumberExtensionOutputValue, PasswordCollector, ValidatedPasswordCollector, BooleanCollector } from './collector.types.js'; import type { DeviceAuthenticationField, DeviceRegistrationField, FidoAuthenticationField, FidoRegistrationField, ImageField, MultiSelectField, PasswordField, PhoneNumberField, ProtectField, QrCodeField, PollingField, ReadOnlyField, RedirectField, RichContentReplacement, SingleCheckboxField, SingleSelectField, StandardField, ValidatedField, AgreementField, ReadOnlyFields, PhoneNumberExtensionField } from './davinci.types.js'; /** * @function normalizeReplacements - Flattens the API's keyed * `Record` into an array of `RichContentLink` * with the original key carried on each entry. Hrefs are passed through * unmodified — consumers are responsible for sanitizing before rendering. * * @param {Record} replacements - The replacements map from the API. * @returns {RichContentLink[]} The flattened array of replacement entries. */ export declare function normalizeReplacements(replacements: Record): RichContentLink[]; /** * @function returnActionCollector - Creates an ActionCollector object based on the provided field and index. * @param {DaVinciField} field - The field object containing key, label, type, and links. * @param {number} idx - The index to be used in the id of the ActionCollector. * @param {ActionCollectorTypes} [collectorType] - Optional type of the ActionCollector. * @returns {ActionCollector} The constructed ActionCollector object. */ export declare function returnActionCollector(field: RedirectField | StandardField, idx: number, collectorType: CollectorType): ActionCollectors; /** * @function returnFlowCollector - Returns a flow collector object * @param {DaVinciField} field - The field representing the flow button * @param {number} idx - The index of the field in the form * @returns {FlowCollector} - The flow collector object */ export declare function returnFlowCollector(field: StandardField, idx: number): ActionCollectors; /** * @function returnIdpCollector - Returns a social login collector object * @param {DaVinciField} field - The field representing the social login button * @param {number} idx - The index of the field in the form * @returns {SocialLoginCollector} - The social login collector object */ export declare function returnIdpCollector(field: RedirectField, idx: number): ActionCollectors; /** * @function returnSubmitCollector - Returns a submit collector object * @param {DaVinciField} field - The field representing the submit button * @param {number} idx - The index of the field in the form * @returns {ActionCollector} - The submit collector object */ export declare function returnSubmitCollector(field: StandardField, idx: number): ActionCollectors; /** * @function returnSingleValueCollector - Creates a SingleValueCollector object based on the provided field, index, and optional collector type. * @param {DaVinciField} field - The field object containing key, label, type, and links. * @param {number} idx - The index to be used in the id of the SingleValueCollector. * @param {SingleValueCollectorTypes} [collectorType] - Optional type of the SingleValueCollector. * @returns {SingleValueCollector} The constructed SingleValueCollector object. */ export declare function returnSingleValueCollector(field: Field, idx: number, collectorType: CollectorType, data?: string): import("./collector.types.js").SingleSelectCollector | BooleanCollector | ValidatedBooleanCollector | InferSingleValueCollectorType | ValidatedSingleValueCollectorWithValue<"TextCollector", string>; /** * @function returnSingleValueAutoCollector - Creates a SingleValueAutoCollector object based on the provided field, index, and optional collector type. * @param {DaVinciField} field - The field object containing key, label, type, and links. * @param {number} idx - The index to be used in the id of the AutoCollector. * @param {SingleValueAutoCollectorTypes} [collectorType] - Optional type of the AutoCollector. * @returns {AutoCollector} The constructed AutoCollector object. */ export declare function returnSingleValueAutoCollector(field: Field, idx: number, collectorType: CollectorType): import("./collector.types.js").ProtectCollector | import("./collector.types.js").PollingCollector | InferAutoCollectorType; /** * @function returnObjectValueAutoCollector - Creates an ObjectValueAutoCollector object based on the provided field, index, and optional collector type. * @param {DaVinciField} field - The field object containing key, label, type, and links. * @param {number} idx - The index to be used in the id of the AutoCollector. * @param {ObjectValueAutoCollectorTypes} [collectorType] - Optional type of the AutoCollector. * @returns {AutoCollector} The constructed AutoCollector object. */ export declare function returnObjectValueAutoCollector(field: Field, idx: number, collectorType: CollectorType): import("./collector.types.js").FidoRegistrationCollector | import("./collector.types.js").FidoAuthenticationCollector; /** * @function returnPasswordCollector - Creates a PasswordCollector (no password policy). * @param {PasswordField} field - The PASSWORD / PASSWORD_VERIFY field; a `verify` flag is * propagated to the collector output if set. * @param {number} idx - The index to be used in the id of the PasswordCollector. * @returns {PasswordCollector} The constructed PasswordCollector object. */ export declare function returnPasswordCollector(field: PasswordField, idx: number): PasswordCollector; /** * @function returnValidatedPasswordCollector - Creates a ValidatedPasswordCollector for * fields that carry a `passwordPolicy`. The reducer routes both `PASSWORD` and * `PASSWORD_VERIFY` here when a policy is present. * @param {PasswordField} field - The PASSWORD or PASSWORD_VERIFY field carrying a passwordPolicy. * @param {number} idx - The index of the field in the form. * @returns {ValidatedPasswordCollector} The constructed ValidatedPasswordCollector. */ export declare function returnValidatedPasswordCollector(field: PasswordField, idx: number): ValidatedPasswordCollector; /** * @function returnTextCollector - Creates a TextCollector object based on the provided field and index. * @param {DaVinciField} field - The field object containing key, label, type, and links. * @param {number} idx - The index to be used in the id of the TextCollector. * @returns {TextCollector} The constructed TextCollector object. */ export declare function returnTextCollector(field: StandardField, idx: number, data: string): import("./collector.types.js").TextCollector | import("./collector.types.js").SingleSelectCollector | BooleanCollector | ValidatedBooleanCollector | ValidatedSingleValueCollectorWithValue<"TextCollector", string>; /** * @function returnSingleSelectCollector - Creates a SingleCollector object based on the provided field and index. * @param {DaVinciField} field - The field object containing key, label, type, and links. * @param {number} idx - The index to be used in the id of the SingleCollector. * @returns {SingleValueCollector} The constructed SingleCollector object. */ export declare function returnSingleSelectCollector(field: SingleSelectField, idx: number, data: string): import("./collector.types.js").SingleSelectCollector | BooleanCollector | ValidatedBooleanCollector | ValidatedSingleValueCollectorWithValue<"TextCollector", string>; /** * @function returnBooleanCollector - Creates a BooleanCollector (no validation). * @param {SingleCheckboxField} field - The field object containing key, label, type. * @param {number} idx - The index to be used in the id of the BooleanCollector. * @returns {BooleanCollector} The constructed BooleanCollector object. */ export declare function returnBooleanCollector(field: SingleCheckboxField, idx: number): BooleanCollector; /** * @function returnValidatedBooleanCollector - Creates a ValidatedBooleanCollector object based on the provided field and index. * @param {SingleCheckboxField} field - The field object containing key, label, type, required, and validation. * @param {number} idx - The index to be used in the id of the ValidatedBooleanCollector. * @returns {ValidatedBooleanCollector} The constructed ValidatedBooleanCollector object. */ export declare function returnValidatedBooleanCollector(field: SingleCheckboxField, idx: number): ValidatedBooleanCollector; /** * @function returnProtectCollector - Creates a ProtectCollector object based on the provided field and index. * @param {DaVinciField} field - The field object containing key, label, type, and links. * @param {number} idx - The index to be used in the id of the ProtectCollector. * @returns {ProtectCollector} The constructed ProtectCollector object. */ export declare function returnProtectCollector(field: ProtectField, idx: number): import("./collector.types.js").ProtectCollector | import("./collector.types.js").PollingCollector; /** * @function returnPollingCollector - Creates a PollingCollector object based on the provided field and index. * @param {DaVinciField} field - The field object containing key, label, type, and links. * @param {number} idx - The index to be used in the id of the PollingCollector. * @returns {PollingCollector} The constructed PollingCollector object. */ export declare function returnPollingCollector(field: PollingField, idx: number): import("./collector.types.js").ProtectCollector | import("./collector.types.js").PollingCollector; /** * @function returnFidoRegistrationCollector - Creates a FidoRegistrationCollector object based on the provided field and index. * @param {DaVinciField} field - The field object containing key, label, type, and links. * @param {number} idx - The index to be used in the id of the FidoRegistrationCollector. * @returns {FidoRegistrationCollector} The constructed FidoRegistrationCollector object. */ export declare function returnFidoRegistrationCollector(field: FidoRegistrationField, idx: number): import("./collector.types.js").FidoRegistrationCollector | import("./collector.types.js").FidoAuthenticationCollector; /** * @function returnFidoAuthenticationCollector - Creates a FidoAuthenticationCollector object based on the provided field and index. * @param {DaVinciField} field - The field object containing key, label, type, and links. * @param {number} idx - The index to be used in the id of the FidoAuthenticationCollector. * @returns {FidoAuthenticationCollector} The constructed FidoAuthenticationCollector object. */ export declare function returnFidoAuthenticationCollector(field: FidoAuthenticationField, idx: number): import("./collector.types.js").FidoRegistrationCollector | import("./collector.types.js").FidoAuthenticationCollector; /** * @function returnMultiValueCollector - Creates a MultiValueCollector object based on the provided field, index, and optional collector type. * @param {DaVinciField} field - The field object containing key, label, type, and links. * @param {number} idx - The index to be used in the id of the MultiValueCollector. * @param {MultiValueCollectorTypes} [collectorType] - Optional type of the MultiValueCollector. * @returns {MultiValueCollector} The constructed MultiValueCollector object. */ export declare function returnMultiValueCollector(field: Field, idx: number, collectorType: CollectorType, data?: string[]): InferMultiValueCollectorType; /** * @function returnMultiSelectCollector - Creates a DropDownCollector object based on the provided field and index. * @param {DaVinciField} field - The field object containing key, label, type, and links. * @param {number} idx - The index to be used in the id of the DropDownCollector. * @returns {SingleValueCollector} The constructed DropDownCollector object. */ export declare function returnMultiSelectCollector(field: MultiSelectField, idx: number, data: string[]): import("./collector.types.js").MultiValueCollectorWithValue<"MultiSelectCollector">; /** * @function returnObjectCollector - Creates a ObjectCollector object based on the provided field, index, and optional collector type. * @param {DaVinciField} field - The field object containing key, label, type, and links. * @param {number} idx - The index to be used in the id of the ObjectCollector. * @param {ObjectValueCollectorTypes} [collectorType] - Optional type of the ObjectCollector. * @returns {ObjectCollector} The constructed ObjectCollector object. */ export declare function returnObjectCollector(field: Field, idx: number, collectorType: CollectorType, prefillData?: PhoneNumberOutputValue | PhoneNumberExtensionOutputValue): InferValueObjectCollectorType; /** * @function returnObjectSelectCollector - Creates a DropDownCollector object based on the provided field and index. * @param {DaVinciField} field - The field object containing key, label, type, and links. * @param {number} idx - The index to be used in the id of the DropDownCollector. * @returns {SingleValueCollector} The constructed DropDownCollector object. */ export declare function returnObjectSelectCollector(field: DeviceAuthenticationField | DeviceRegistrationField, idx: number): import("./collector.types.js").DeviceAuthenticationCollector | import("./collector.types.js").DeviceRegistrationCollector; export declare function returnObjectValueCollector(field: PhoneNumberField | PhoneNumberExtensionField, idx: number, prefillData: PhoneNumberOutputValue | PhoneNumberExtensionOutputValue): import("./collector.types.js").PhoneNumberExtensionCollector | import("./collector.types.js").PhoneNumberCollector; /** * @function returnNoValueCollector - Creates a NoValueCollector object based on the provided field, index, and optional collector type. * @param {DaVinciField} field - The field object containing key, label, type, and links. * @param {number} idx - The index to be used in the id of the NoValueCollector. * @param {NoValueCollectorTypes} [collectorType] - Optional type of the NoValueCollector. * @returns {NoValueCollector} The constructed NoValueCollector object. */ export declare function returnNoValueCollector(field: Field, idx: number, collectorType: CollectorType): InferNoValueCollectorType; /** * @function returnReadOnlyCollector - Creates a `ReadOnlyCollector` (plain text) or * `RichTextCollector` (template + link replacements) depending on whether the field * carries a `richContent` payload. * * @param {ReadOnlyField} field - The LABEL field from the API response. * @param {number} idx - The index to be used in the id of the collector. * @returns {ReadOnlyCollector | RichTextCollector} The constructed collector. */ export declare function returnReadOnlyCollector(field: ReadOnlyField | AgreementField, idx: number): ReadOnlyCollector | RichTextCollector; /** * @function returnQrCodeCollector - Creates a QrCodeCollector object for displaying QR code images. * @param {QrCodeField} field - The field object containing key, content, type, and optional fallbackText. * @param {number} idx - The index to be used in the id of the QrCodeCollector. * @returns {QrCodeCollector} The constructed QrCodeCollector object. */ export declare function returnQrCodeCollector(field: QrCodeField, idx: number): QrCodeCollector; /** * @function returnImageCollector - Creates an ImageCollector object for displaying IMAGE fields. * * Composes on top of `returnNoValueCollector` for `category`, `id`, `name`, and base * `output.{key, type}`. Overrides `output.label` and `output.alt` with `field.description` * (IMAGE has no wire `label` property). * * @param {ImageField} field - The IMAGE field from the API response. * @param {number} idx - The index used in the collector `id`/`name`. * @returns {ImageCollector} The constructed ImageCollector object. */ export declare function returnImageCollector(field: ImageField, idx: number): ImageCollector; /** * @function returnValidator - Creates a validator function based on the provided collector * @param {ValidatedTextCollector | | ValidatedBooleanCollector | ObjectValueCollectors | MultiValueCollectors | AutoCollectors} collector - The collector to which the value will be validated * @returns {function} - A "validator" function that validates the input value */ export declare function returnValidator(collector: T): Validator; export declare function returnUnknownCollector(field: Record, idx: number): UnknownCollector; //# sourceMappingURL=collector.utils.d.ts.map