-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Awesome but would love typescript types ;)_ #32
Comments
This is untested, but it should suffice: declare module "react-credit-card-input" {
export default class SVG extends React.Component<
{
cardNumberInputProps: {
value: string
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void
style?: object
onBlur?: (e: React.FormEvent<HTMLInputElement>) => void
onFocus?: (e: React.FormEvent<HTMLInputElement>) => void
onClick?(event: React.MouseEvent<HTMLElement>): void
onMouseDown?(event: React.MouseEvent<HTMLElement>): void
onMouseUp?(event: React.MouseEvent<HTMLElement>): void
onMouseOver?(event: React.MouseEvent<HTMLElement>): void
onMouseEnter?(event: React.MouseEvent<HTMLElement>): void
onMouseLeave?(event: React.MouseEvent<HTMLElement>): void
onMouseOut?(event: React.MouseEvent<HTMLElement>): void
onKeyDown?(event: React.KeyboardEvent<HTMLElement>): void
onKeyUp?(event: React.KeyboardEvent<HTMLElement>): void
onKeyPress?(event: React.KeyboardEvent<HTMLElement>): void
}
cardExpiryInputProps: {
value: string
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void
style?: object
onBlur?: (e: React.FormEvent<HTMLInputElement>) => void
onFocus?: (e: React.FormEvent<HTMLInputElement>) => void
onClick?(event: React.MouseEvent<HTMLElement>): void
onMouseDown?(event: React.MouseEvent<HTMLElement>): void
onMouseUp?(event: React.MouseEvent<HTMLElement>): void
onMouseOver?(event: React.MouseEvent<HTMLElement>): void
onMouseEnter?(event: React.MouseEvent<HTMLElement>): void
onMouseLeave?(event: React.MouseEvent<HTMLElement>): void
onMouseOut?(event: React.MouseEvent<HTMLElement>): void
onKeyDown?(event: React.KeyboardEvent<HTMLElement>): void
onKeyUp?(event: React.KeyboardEvent<HTMLElement>): void
onKeyPress?(event: React.KeyboardEvent<HTMLElement>): void
}
cardCVCInputProps: {
value: string
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void
style?: object
onBlur?: (e: React.FormEvent<HTMLInputElement>) => void
onFocus?: (e: React.FormEvent<HTMLInputElement>) => void
onClick?(event: React.MouseEvent<HTMLElement>): void
onMouseDown?(event: React.MouseEvent<HTMLElement>): void
onMouseUp?(event: React.MouseEvent<HTMLElement>): void
onMouseOver?(event: React.MouseEvent<HTMLElement>): void
onMouseEnter?(event: React.MouseEvent<HTMLElement>): void
onMouseLeave?(event: React.MouseEvent<HTMLElement>): void
onMouseOut?(event: React.MouseEvent<HTMLElement>): void
onKeyDown?(event: React.KeyboardEvent<HTMLElement>): void
onKeyUp?(event: React.KeyboardEvent<HTMLElement>): void
onKeyPress?(event: React.KeyboardEvent<HTMLElement>): void
}
cardNumberInputRenderer?: (value: string) => React.ReactNode
cardExpiryInputRenderer?: (value: string) => React.ReactNode
cardCVCInputRenderer?: (value: string) => React.ReactNode
onError?: (errorMessage: string) => void
cardImageClassName?: string
cardImageStyle?: object
containerClassName?: string
containerStyle?: object
dangerTextClassName?: string
dangerTextStyle?: object
fieldClassName?: string
fieldStyle?: object
inputClassName?: string
inputStyle?: object
invalidClassName?: string
invalidStyle?: object
inputComponent?: string | React.ComponentType
customTextLabels?: {
invalidCardNumber?: string
expiryError?: {
invalidExpiryDate?: string
monthOutOfRange?: string
yearOutOfRange?: string
dateOutOfRange?: string
}
invalidCvc?: string
invalidZipCode?: string
cardNumberPlaceholder?: string
expiryPlaceholder?: string
cvcPlaceholder?: string
zipPlaceholder?: string
}
},
any
> {}
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No description provided.
The text was updated successfully, but these errors were encountered: