export Focused type to make available externally

This commit is contained in:
Ole Frank Jensen 2018-08-17 19:25:45 +02:00
parent 8c84ef5285
commit cc046b2941

View File

@ -1,6 +1,6 @@
// Type definitions for react-credit-cards 0.7
// Project: https://github.com/amarofashion/react-credit-cards
// Definitions by: Vytautas Strimaitis <https://github.com/vstrimaitis>
// Definitions by: Vytautas Strimaitis <https://github.com/vstrimaitis>, Ole Frank <https://github.com/olefrank>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
@ -8,24 +8,28 @@ import * as React from "react";
export interface CallbackArgument {
isValid: boolean;
type: { issuer: string; maxLength: number; };
type: { issuer: string; maxLength: number };
}
export type Focused = "name" | "number" | "expiry" | "cvc";
export interface ReactCreditCardProps {
acceptedCards?: ReadonlyArray<string>;
callback?: (type: CallbackArgument, isValid: boolean) => void;
cvc: string | number;
expiry: string | number;
focused?: "name" | "number" | "expiry" | "cvc";
focused?: Focused;
issuer?: string;
locale?: { valid: string; };
locale?: { valid: string };
name: string;
number: string | number;
placeholders?: { name: string; };
placeholders?: { name: string };
preview?: boolean;
}
declare class ReactCreditCard extends React.Component<ReactCreditCardProps, never> {
}
declare class ReactCreditCard extends React.Component<
ReactCreditCardProps,
never
> {}
export default ReactCreditCard;