// Copyright © 2022 Olo Inc. All rights reserved.
// This software is made available under the Olo Pay SDK License (See LICENSE.md file)
import type { NativeSyntheticEvent, ViewProps } from 'react-native';
import type {
  CardDetails,
  CardField,
  CustomErrorMessages,
  FontWeight,
  PaymentCardDetailsPlaceholders,
} from '../../definitions';

export interface FocusFieldDetails {
  field: CardField;
}

export interface PaymentCardDetailsNativeViewStyles {
  backgroundColor?: string;
  borderColor?: string;
  borderWidth?: number;
  cornerRadius?: number;
  cursorColor?: string;
  fontFamily?: string;
  fontSize?: number;
  placeholderColor?: string;
  textColor?: string;
  errorTextColor?: string;
  textPaddingLeft?: number;
  textPaddingRight?: number;
  fontWeight?: FontWeight;
  italic?: boolean;
}

export interface CardDetailsNativeProps extends ViewProps {
  cardStyles?: PaymentCardDetailsNativeViewStyles;
  customErrorMessages?: CustomErrorMessages;
  isEnabled?: boolean;
  placeholders?: PaymentCardDetailsPlaceholders;
  postalCodeEnabled?: boolean;
  onBlurEvent(event: NativeSyntheticEvent<void>): void;
  onCardChangeEvent(event: NativeSyntheticEvent<CardDetails>): void;
  onFocusEvent(event: NativeSyntheticEvent<void>): void;
  onFocusFieldEvent(event: NativeSyntheticEvent<FocusFieldDetails>): void;
}
