Skip to content

Commit

Permalink
Merge pull request #337 from Jordan-T/fix/type-update
Browse files Browse the repository at this point in the history
update and fix some types
  • Loading branch information
s-yagues authored Apr 15, 2024
2 parents 6717bfe + 8c7b93d commit 19bc3b2
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ declare interface KR {
* Form valid event listener.
* @param callback - Callback
*/
onFormValid: (callback: () => void) => Promise<{ KR: KR }>
onFormValid: (callback: (FormValidCallBackProps) => void) => Promise<{ KR: KR }>
/**
* Form submitted event listener.
* @param callback - Callback
Expand Down Expand Up @@ -203,6 +203,7 @@ declare interface KR {
* Payment button.
*/
button: KRButton
smartForm: KRSmartForm
wallet: KRWallet
}

Expand All @@ -213,6 +214,7 @@ declare interface KRButton {
/**
* Payment button click event listener.
* @param callback - Callback
* @deprecated Use KR.smartForm.onClick
*/
onClick: (
callback: () => void | boolean | Promise<boolean>
Expand Down Expand Up @@ -243,6 +245,19 @@ declare interface KRButton {
enable: () => Promise<{ KR: KR }>
}

/**
* Smart form
*/
declare interface KRSmartForm {
/**
* Payment button click event listener.
* @param callback - Callback
*/
onClick: (
callback: () => void | boolean | Promise<boolean>
) => Promise<{ KR: KR }>
}

/**
* Form wallet
*/
Expand Down Expand Up @@ -538,9 +553,17 @@ declare enum FormType {
All = 'all'
}

declare interface FormValidCallBackProps {
KR: KR
cardInfo: {
bin: string
brand: string
}
}

declare interface BrandChangeCallBackProps {
KR: KR
card: {
cardInfo: {
bin: string
brand: string
}
Expand Down

0 comments on commit 19bc3b2

Please sign in to comment.