import { components } from "@credify/api-docs" export type JsonObject = { [key: string]: any } | null export type Resolver = (isSuccess: boolean) => void export type EventCallback = ((resolve: Resolver) => void) | null export type OfferFlowPayload = { offer: Offer profile?: UserProfile } export type OfferPayload = { offerCode: string profile?: UserProfile } export type PromotionOffersFlowPayload = { offers: Offer[] profile?: UserProfile } export type PromotionOffersPayload = { offerCodes: string[] profile?: UserProfile } export type ShowPromotionOffers = PromotionOffersFlowPayload & { marketId: string } export type OfferFlowPayloadBnpl = { offers: Offer[] profile?: UserProfile orderId: string orderAmount?: components["FiatCurrency"] completeBnplProviders?: Provider[] marketId?: string tenor?: { value: number unit: UnitDuration } } export type OrderInfo = { orderId: string orderAmount: components["FiatCurrency"] } export type BnplPayload = { offerCodes?: string[] packageCode?: string profile?: UserProfile orderInfo: OrderInfo credifyId?: string productCode?: string, bnpl?: { itemCategory?: string itemCount?: number totalAmount?: components["FiatCurrency"] } } export interface PassportThemeConfig { color: ThemeColor font: ThemeFont inputFieldRadius: number modelRadius: number buttonRadius: number boxShadow: string } export interface ThemeFont { primaryFontFamily: string secondaryFontFamily: string bigTitleFontSize: number bigTitleFontLineHeight: number modelTitleFontSize: number modelTitleFontLineHeight: number sectionTitleFontSize: number sectionTitleFontLineHeight: number bigFontSize: number bigFontLineHeight: number normalFontSize: number normalFontLineHeight: number smallFontSize: number smallFontLineHeight: number boldFontSize: number boldFontLineHeight: number } export interface ThemeColor { primaryBrandyStart: string primaryBrandyEnd: string primaryText: string secondaryActive: string secondaryDisable: string secondaryText: string secondaryComponentBackground: string secondaryBackground: string primaryButtonTextColor: string primaryButtonBrandyStart: string primaryButtonBrandyEnd: string } export type PushClaimEventCallback = | ((externalId: string, resolve: Resolver) => void) | null export type BareEventCallback = (() => void) | null export type Offer = components["OfferData"] & { evaluationResult?: components["EvaluationResult"] } export type EvaluatedOffersList = components["EvaluatedOffersList"] & { credifyId?: string } export interface UserProfile { id?: string firstName?: string lastName?: string middleName?: string fullName?: string phoneNumber: string countryCode: string email?: string credifyId?: string entityId?: string } export interface UserInfo { id: string phone: { phoneNumber: string countryCode: string } name?: string email?: string credifyId?: string gender?: string } export type EventType = { type: string action: string payload: object } export interface GetListPayload { localId?: string phoneNumber?: string countryCode?: string credifyId?: string productTypes?: string[] } export type UserClaimPayload = { entityId: string claims: JsonObject[] } export enum Environment { Production = "production", Sandbox = "sandbox", UAT = "uat", SIT = "sit", Dev = "development", Local = "localhost", } export enum UnitDuration { Day = "DAY", Month = "MONTH", Year = "YEAR", } export interface Identifier { credifyId?: string entityId?: string phoneNumber?: string countryCode?: string } export interface Category { id: string name: string } export interface Provider { appUrl: string categories: Category[] description: string id: string logoUrl: string name: string scopes: string[] } export interface CompletedBnplProvidersResponse { data: { providers: Provider[] } success: boolean } export interface Consumer { id: string name: string description?: string logoUrl: string appUrl: string category?: string[] scopes: string[] } export interface BNPLInfo { isAvailable: boolean offers: Offer[] providers: Provider[] } export interface PublicEncryptionKey { id: string publicKey: string } export type Language = "vi" | "en" | "ja"