UNPKG

@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

33 lines (32 loc) 1.16 kB
import type { Mask, MaskToken } from './maskTypes'; interface CorrectResult { outcome: 'partialCorrect' | 'correct' | 'obscureCorrect'; displayValue: string; potentialForMoreOptionalInput?: boolean; } export interface MismatchResult { outcome: 'mismatch'; badChar: string; mismatchAtChar: number; mismatchedToken: MaskToken | 'inputTooLong'; partialDisplayValue: string; } export type MaskResult = CorrectResult | MismatchResult; export type MatchedToken = MaskToken & { char: string; }; /** * Takes some pure value e.g. `NL123456` and a {@link Mask}, and returns a `partialCorrect`, * `correct` or `mismatch` {@link MaskResult} accordingly. * * This is the inverse of {@link displayValueToPureValue}. * * @returns the result of matching the given value against the mask * @param pureValue the pure, unformatted input value * @param mask the mask to match against * @param acceptObscuredValue whether to accept * * @see displayValueToPureValue */ export declare const matchAgainstMask: (pureValue: string, mask: Mask, acceptObscuredValue?: boolean, stripNonAllowedInputs?: boolean) => MaskResult; export {};