@adyen/kyc-components
Version:
`adyen-kyc-components` provides the required pieces to build an onboarding flow based on a legal entity. To onboard and verify users, you need to create a user interface (UI) to collect user data. To speed up building your integration, Adyen offers onboar
71 lines (70 loc) • 2.89 kB
TypeScript
import type { BaseInnerFormProps } from '../../core/hooks/useForm/types';
import type { CompanyDatasetResponse } from '../../core/models/api/company-search';
import type { CountryCode } from '../../core/models/country-code';
import type { TranslationKey } from '../../language/types';
import type { RecordWithDefault } from '../../utils/recordWithDefault';
import type { ValidationRuleResult, ValidatorMode } from '../../utils/validation/types';
import type { DropinAPIHandlers } from '../Dropins/types';
export type AddressType = 'registrationAddress' | 'operationalAddress';
export interface AddressSchema {
address?: string;
otherAddressInformation?: string;
postalCode?: string;
city?: string;
stateOrProvince?: string;
country?: CountryCode;
searchAddress?: string;
poBox?: boolean;
}
export interface AddressProps extends BaseInnerFormProps<AddressSchema> {
countryCode?: CountryCode;
hideCountry?: boolean;
onCountryChange?(country: CountryCode): void;
addressType?: AddressType;
handleAddressSearch: DropinAPIHandlers['handleAddressSearch'];
handleFindAddress: DropinAPIHandlers['handleFindAddress'];
legalEntityId?: string;
verifiedBusiness?: CompanyDatasetResponse | undefined;
verifiedAddress?: AddressSchema;
condensed?: boolean;
}
export interface FieldContainerProps {
legalEntityId?: string;
classNameModifiers?: string[];
schema?: Array<keyof AddressSchema>;
data: AddressSchema;
fieldName: keyof AddressSchema;
valid?: Record<keyof AddressSchema, boolean>;
errors?: Record<keyof AddressSchema, ValidationRuleResult | null>;
fieldProblems?: Record<keyof AddressSchema, boolean>;
readOnly?: boolean;
optional?: boolean;
maxlength?: number;
hideField?: boolean;
trimOnBlur?: boolean;
handleChangeFor: (key: keyof AddressSchema, mode?: ValidatorMode) => (e: any) => void;
handleAddressSearch?: DropinAPIHandlers['handleAddressSearch'];
handleFindAddress?: DropinAPIHandlers['handleFindAddress'];
}
export interface ReadOnlyAddressProps {
data: AddressSchema;
label: TranslationKey;
}
export type AddressSchemas = RecordWithDefault<CountryCode, Array<keyof AddressSchema>>;
export type AddressLabels = {
[label: string]: RecordWithDefault<CountryCode, TranslationKey>;
};
export type AddressSchemaLabels = {
[field in keyof AddressSchema]?: TranslationKey;
};
export interface SearchAddressProps {
handleAddressSearch: DropinAPIHandlers['handleAddressSearch'];
handleFindAddress: DropinAPIHandlers['handleFindAddress'];
handleChangeFor: (key: keyof AddressSchema, mode?: ValidatorMode) => (e: any) => void;
data: AddressSchema;
legalEntityId?: string;
autocompleteAddressForm: (address: AddressSchema) => void;
addressType?: AddressType;
kompanyAddress?: string;
kompanyPrefilled?: boolean;
}