Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrei Bents committed Nov 6, 2024
1 parent 3bd2427 commit 84392f9
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ export type CountryCode =
| 'QA'
| 'MZ'

export type Locale = typeof LOCALES[number]
export type Locale = (typeof LOCALES)[number]

Check failure on line 257 in src/types.ts

View workflow job for this annotation

GitHub Actions / build (16.x)

Replace `(typeof·LOCALES)` with `typeof·LOCALES`

export type ValidationErrorType =
| 'validation.card.number.incomplete'
Expand Down Expand Up @@ -428,7 +428,10 @@ export interface CommonOptions {
/** Callback will be called when the payment is completed successfully */
onSuccess?: (payload: { orderId: string }) => void
/** Callback if transaction is failed to complete, the reason should be available in the message parameter */
onError?: (error: RevolutCheckoutError, payload: { orderId: OrderToken | undefined }) => void
onError?: (
error: RevolutCheckoutError,
payload: { orderId: OrderToken | undefined }
) => void
/** Callback if an user did not complete the transaction and canceled the authorisation or closed the checkout window */
onCancel?: () => void
/** Indicates in which case this saved payment method can be used for payments */
Expand Down Expand Up @@ -639,16 +642,19 @@ export type RevolutPayEvents =
orderId: string
}
| { type: 'error'; error: RevolutCheckoutError; orderId: string }
| { type: 'cancel'; dropOffState: RevolutPayDropOffState; orderId?: string }
| {
type: 'cancel'
dropOffState: RevolutPayDropOffState
orderId?: string
}
}
| {
type: 'click'
payload: null
}

export type RevolutPayEventPayload<
T extends RevolutPayEvents['type']
> = Extract<RevolutPayEvents, { type: T }>['payload']
export type RevolutPayEventPayload<T extends RevolutPayEvents['type']> =

Check failure on line 656 in src/types.ts

View workflow job for this annotation

GitHub Actions / build (16.x)

Replace `T·extends·RevolutPayEvents['type']>·=⏎·` with `⏎··T·extends·RevolutPayEvents['type']⏎>·=`
Extract<RevolutPayEvents, { type: T }>['payload']

export interface PaymentsModuleRevolutPayInstance {
mount: (
Expand Down Expand Up @@ -871,3 +877,4 @@ export interface RevolutCheckout {
) => RevolutPaymentsModuleInstance
upsell: (option: RevolutUpsellModuleOptions) => RevolutUpsellModuleInstance
}

Check failure on line 880 in src/types.ts

View workflow job for this annotation

GitHub Actions / build (16.x)

Delete `⏎`

0 comments on commit 84392f9

Please sign in to comment.