import type { CardEmbedType, EmbedType } from "./embed-configuration"; import type { Styles } from "./styles"; export declare const EMBED_VIEW_TYPES: { readonly pan: "PAN"; readonly cvv: "CVV"; readonly exp_month: "EXP_MONTH"; readonly exp_year: "EXP_YEAR"; readonly pin_setting: "PIN_SETTING"; }; export type EmbedViewType = (typeof EMBED_VIEW_TYPES)[EmbedType]; export type CardDetailsEmbedViewType = (typeof EMBED_VIEW_TYPES)[CardEmbedType]; export declare const EmbedMessageType: { readonly EmbedSubmitPin: "Embed:SubmitPin"; readonly EmbedFetchCardDetails: "Embed:FetchCardDetails"; readonly EmbedToggleCardDetails: "Embed:ToggleCardDetails"; readonly EmbedUpdateStyles: "Embed:UpdateStyles"; readonly EmbedRendered: "Embed:Rendered"; readonly EmbedPinSubmissionStatusChanged: "Embed:PinSubmissionStatusChanged"; readonly EmbedCardDetailsRevealStatusChanged: "Embed:CardDetailsRevealStatusChanged"; readonly EmbedCopied: "Embed:Copied"; }; export declare const EmbedActionStatus: { readonly Started: "STARTED"; readonly Succeeded: "SUCCEEDED"; readonly Failed: "FAILED"; }; export declare const EmbedErrorCode: { readonly PinSubmitFailed: "PIN_SUBMIT_FAILED"; readonly RevealFailed: "REVEAL_FAILED"; readonly SessionMissing: "SESSION_MISSING"; readonly CopyFailed: "COPY_FAILED"; }; export type EmbedMessageType = (typeof EmbedMessageType)[keyof typeof EmbedMessageType]; export type EmbedActionStatus = (typeof EmbedActionStatus)[keyof typeof EmbedActionStatus]; export type EmbedErrorCode = (typeof EmbedErrorCode)[keyof typeof EmbedErrorCode]; export type CardDetailsRequestErrorCode = typeof EmbedErrorCode.RevealFailed | typeof EmbedErrorCode.SessionMissing; export type PinSubmissionErrorCode = typeof EmbedErrorCode.PinSubmitFailed | typeof EmbedErrorCode.SessionMissing; type CopyErrorCode = typeof EmbedErrorCode.CopyFailed; export type EmbedMessageError = { code: TCode; message?: string; requestId?: string; }; type EmbedMessage = { messageType: TMessageType; embedType: TEmbedType; }; type StartedStatus = { status: typeof EmbedActionStatus.Started; }; type SucceededStatus = { status: typeof EmbedActionStatus.Succeeded; }; type FailedStatus = { status: typeof EmbedActionStatus.Failed; error: EmbedMessageError; }; type NetworkActionStatus = StartedStatus | SucceededStatus | FailedStatus; type TerminalActionStatus = SucceededStatus | FailedStatus; export type EmbedRenderedPayload = EmbedMessage; export type EmbedCopiedPayload = EmbedMessage & TerminalActionStatus; export type EmbedCardDetailsRevealStatusChangedPayload = EmbedMessage & NetworkActionStatus; export type EmbedPinSubmissionStatusChangedPayload = EmbedMessage & NetworkActionStatus; export type EmbedUpdateStylesPayload = EmbedMessage & { styles: Styles; }; export type EmbedCallbackMessagePayload = EmbedRenderedPayload | EmbedCopiedPayload | EmbedCardDetailsRevealStatusChangedPayload | EmbedPinSubmissionStatusChangedPayload; export type EmbedCallbackMessageType = EmbedCallbackMessagePayload["messageType"]; export type EmbedCallbackPayloadByMessageType = { [MessageType in EmbedCallbackMessageType]: Extract; }; export {};