import { ICustomer, ICustomerInput } from '../customer.types'; import { EnumValues } from '../types'; import { BaseZenskarElementInstance, ZenskarElementProps } from './base.types'; /** * Billing Information Element Props * Extends base element props with billing-specific functionality */ export type ManageBillingInformationElementProps = { /** * Triggered when data exposed by this Element is changed. * @future - Will emit form state changes including validation status */ /** * Triggered when the Element is fully rendered and ready for interaction. */ onReady?: () => void; /** * Triggered when an error occurs during element initialization or operation. * @future - Will handle element-level errors like API failures, validation errors */ /** * Triggered when the escape key is pressed within the Element. * @future - Will handle escape key events for better UX */ /** * Element configuration options. * Allow customization of fields, validation mode, etc. */ options?: ManageBillingInformationElementOptions; } & ZenskarElementProps; /** * Event data emitted when the billing information form changes * @future - Will be used with onChange callback */ export type ManageBillingInformationChangeEvent = { /** Type of element that emitted the event */ elementType: 'manage-billing-information'; /** Whether the form is complete and valid */ complete: boolean; /** Whether the form is empty */ empty: boolean; /** Current form data (only available when complete is true) */ data?: ICustomerInput; /** Error information if validation fails */ error?: { type: 'validation_error' | 'required_field_missing'; code: string; message: string; field?: string; }; }; export declare const MANAGE_BILLING_INFORMATION_ELEMENT_FIELDS: { readonly email: "email"; readonly address: "address"; readonly ship_to_address: "ship_to_address"; readonly tax_info: "tax_info"; }; export type ManageBillingInformationElementFields = EnumValues; /** * Configuration options for billing information element * @future - Will allow customization of element behavior */ export type ManageBillingInformationElementOptions = { /** * Fields to show in the form * Will allow selective field display * @default - ['email', 'address', 'ship_to_address', 'tax_info'] */ fields?: ManageBillingInformationElementFields[]; /** * Validation mode for the form * @default - 'onChange' */ validationMode?: 'onChange' | 'onBlur' | 'onSubmit'; /** * Default values to pre-populate the form with * @default - undefined */ defaultValues?: ICustomer; }; /** * Element instance type for internal registry * This is what gets registered with the ZenskarProvider */ export type ManageBillingInformationElementInstance = { /** Element type identifier */ type: 'manage-billing-information'; /** Get the current form data from the element */ getValue: () => ICustomerInput; /** * Trigger validation on the element and show field errors * Returns validation result with isValid flag and error details */ validate: () => Promise; } & BaseZenskarElementInstance;