@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
64 lines (63 loc) • 2.82 kB
TypeScript
import type { ComponentChildren } from 'preact';
import type { CountryCode } from '../../core/models/country-code';
/**
* Settings are features that can be switched on or off by external users.
* This list is defined in the BE.
*/
export declare enum SettingNames {
AcceptedCountries = "acceptedCountries",
AllowBankAccountFormatSelection = "allowBankAccountFormatSelection",
AllowDebugUi = "allowDebugUi",
AllowIntraRegionCrossBorderPayout = "allowIntraRegionCrossBorderPayout",
AllowLegalEntityTypeChange = "changeLegalEntityType",
AllowPrefilledCountryEdit = "editPrefilledCountry",
RequirePciSignEcommerce = "requirePciSignEcommerce",
RequirePciSignPos = "requirePciSignPos",
RequirePciSignEcomMoto = "requirePciSignEcomMoto",
RequirePciSignPosMoto = "requirePciSignPosMoto",
HideOnboardingIntroductionIndividual = "hideOnboardingIntroductionIndividual",
HideOnboardingIntroductionOrganization = "hideOnboardingIntroductionOrganization",
HideOnboardingIntroductionTrust = "hideOnboardingIntroductionTrust",
HideOnboardingIntroductionSoleProprietor = "hideOnboardingIntroductionSoleProprietor",
TransferInstrumentLimit = "transferInstrumentLimit",
ViewOnboardingGuidance = "viewOnboardingGuidance",
InstantBankVerification = "instantBankVerification",
ShowServiceAgreementsFirst = "showServiceAgreementsFirst",
ShowBusinessFinancingFirst = "showBusinessFinancingFirst",
EnforceLegalAge = "enforceLegalAge"
}
export type SettingName = `${SettingNames}`;
export interface Settings {
acceptedCountries: CountryCode[] | undefined;
allowBankAccountFormatSelection: boolean;
allowDebugUi: boolean;
allowIntraRegionCrossBorderPayout: boolean;
changeLegalEntityType: boolean;
editPrefilledCountry: boolean;
requirePciSignEcommerce: boolean;
requirePciSignPos: boolean;
requirePciSignEcomMoto: boolean;
requirePciSignPosMoto: boolean;
hideOnboardingIntroductionIndividual: boolean;
hideOnboardingIntroductionOrganization: boolean;
hideOnboardingIntroductionTrust: boolean;
hideOnboardingIntroductionSoleProprietor: boolean;
viewOnboardingGuidance: boolean;
transferInstrumentLimit: number;
instantBankVerification: boolean;
showServiceAgreementsFirst: boolean;
showBusinessFinancingFirst: boolean;
enforceLegalAge: boolean;
}
export type ProvidedSettings = Partial<Settings>;
export type BooleanSettingName = {
[S in keyof Settings]: Settings[S] extends boolean ? S : never;
}[keyof Settings];
export interface SettingsProps {
children?: ComponentChildren;
settings: ProvidedSettings;
}
export interface SettingsContextValue {
isSettingEnabled(key: BooleanSettingName): boolean;
getSetting<S extends SettingName>(settingName: S): Settings[S];
}