@adyen/kyc-components
Version:
This guide assumes that you have already an account with Adyen. A legalEntity needs to be created, and you need to have a `legalEntityId` to instatiate a Component.
14 lines (13 loc) • 1.29 kB
TypeScript
import type { MaskSettings } from '../hooks/useForm/types';
import type { Namespace, NsTranslatable, NsTranslationKey } from '../../types';
import type { PerCountry } from './perCountry';
import type { ValidatorRule } from './validation/types';
export interface FieldMetadata<FormSchema, FieldName extends keyof FormSchema, Ns extends Namespace = 'common'> {
label?: NsTranslationKey<'common'>;
guidanceText?: NsTranslatable<Ns>;
mask?: MaskSettings;
validators?: ValidatorRule<FormSchema[FieldName], FormSchema> | ValidatorRule<FormSchema[FieldName], FormSchema>[];
}
export type PerCountryFieldConfig<FormSchema, FieldName extends keyof FormSchema, Params extends object, Ns extends Namespace = 'common'> = PerCountry<FieldMetadata<FormSchema, FieldName, Ns> | ((params: Params) => FieldMetadata<FormSchema, FieldName, Ns>)>;
export type NoParams = Record<string, never>;
export declare const resolveFieldMetadata: <FormSchema, FieldName extends keyof FormSchema, Params extends object, Ns extends Namespace = "common">(countryEntry: FieldMetadata<FormSchema, FieldName, Ns> | ((params: Params) => FieldMetadata<FormSchema, FieldName, Ns>) | undefined, params: Params, defaultMetadata: FieldMetadata<FormSchema, FieldName, Ns>) => FieldMetadata<FormSchema, FieldName, Ns>;