/** * ExitConfirmConfig — bottom sheet xác nhận thoát khi user nhấn back trong liveness. * Map 1-1 với native ExitConfirmConfig (sdkcore 1.5.2+). * * Mọi field đều optional — null/undefined = giữ giá trị mặc định của SDK. * Xem EXIT_CONFIRM_CONFIG.md để biết chi tiết và giá trị mặc định. */ /** Hướng gradient cho ViewStyle.backgroundGradient*. Map android.graphics.drawable.GradientDrawable.Orientation. */ export enum ExitConfirmGradientOrientation { LEFT_RIGHT = "LEFT_RIGHT", RIGHT_LEFT = "RIGHT_LEFT", TOP_BOTTOM = "TOP_BOTTOM", BOTTOM_TOP = "BOTTOM_TOP", TL_BR = "TL_BR", TR_BL = "TR_BL", BL_TR = "BL_TR", BR_TL = "BR_TL", } /** Text style cho title/content/button label. */ export interface ExitConfirmTextStyles { /** Hex màu chữ, vd "#1A1A1A" hoặc "#FF1A1A1A". */ textColor?: string; /** Cỡ chữ đơn vị sp. */ textSize?: number; /** Tên font resource trong res/font/, vd "inter_medium". */ textFont?: string; /** 0 Normal · 1 Bold · 2 Italic · 3 Bold+Italic. */ textStyle?: number; /** android.view.Gravity flag, vd Gravity.CENTER = 17. */ textAlign?: number; } /** View style cho background, kích thước, margin, padding, bo góc của container/button. */ export interface ExitConfirmViewStyle { /** Hex màu nền. Bị bỏ qua nếu set gradient. */ backgroundColor?: string; /** Tối thiểu 2 màu hex cho gradient. */ backgroundGradientColors?: string[]; /** * Vị trí [0.0–1.0] tương ứng từng màu (Android 10+). * null = phân bổ đều. Bắt buộc cùng size với backgroundGradientColors. */ backgroundGradientPositions?: number[]; /** Hướng gradient. Mặc định LEFT_RIGHT. */ backgroundGradientOrientation?: ExitConfirmGradientOrientation; /** dp — null = giữ constraint layout. */ width?: number; /** dp. */ height?: number; marginTop?: number; marginBottom?: number; marginStart?: number; marginEnd?: number; paddingTop?: number; paddingBottom?: number; paddingStart?: number; paddingEnd?: number; /** android.view.Gravity flag cho nội dung bên trong. */ gravity?: number; /** Bo góc dp. 100f = pill shape. */ cornerRadius?: number; } /** * Icon phía trên bottom sheet. * Native field `icon: Int?` là R.drawable resource ID — RN không truy cập trực tiếp được. * Truyền `iconResName` (vd "ic_warning") để native resolve qua getIdentifier(). * Bỏ qua / null = dùng icon mặc định SDK (ic_bell). */ export interface ExitConfirmIconProps { /** Tên drawable resource trong res/drawable/. null/omitted = icon mặc định SDK. */ iconResName?: string; iconViewStyle?: ExitConfirmViewStyle; } export interface ExitConfirmTitleProps { title?: string; titleStyles?: ExitConfirmTextStyles; } export interface ExitConfirmContentProps { content?: string; contentStyles?: ExitConfirmTextStyles; } export interface ExitConfirmButtonProps { buttonTitle?: string; buttonTextStyles?: ExitConfirmTextStyles; buttonStyles?: ExitConfirmViewStyle; } /** * Config bottom sheet xác nhận thoát. Truyền vào FinosEKYC.startEkycUI / startLiveness. * Mọi field optional — null = SDK default. * * @example * exitConfirmConfig: { * titleProps: { title: "Thông báo" }, * contentProps: { content: "Quý khách muốn thoát?" }, * confirmButtonProps: { * buttonTitle: "Có", * buttonStyles: { * backgroundGradientColors: ["#DA2128", "#F9A61C", "#FFDD00"], * cornerRadius: 100, * }, * }, * cancelButtonProps: { * buttonTitle: "Không", * buttonStyles: { backgroundColor: "#F3F4F6", cornerRadius: 100 }, * }, * } */ export interface ExitConfirmConfig { iconProps?: ExitConfirmIconProps; titleProps?: ExitConfirmTitleProps; contentProps?: ExitConfirmContentProps; /** Nút xác nhận thoát (vd "Có") — chỉ nút này mới trigger callback thoát SDK. */ confirmButtonProps?: ExitConfirmButtonProps; /** Nút huỷ (vd "Không") — đóng sheet, ở lại SDK. */ cancelButtonProps?: ExitConfirmButtonProps; }