This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import type { Stripe } from 'stripe' | |
export type StripeWebhookEventTypes = | |
Stripe.WebhookEndpointCreateParams.EnabledEvent | |
export type StripeWebhookEvent< | |
EventType extends StripeWebhookEventTypes, | |
Payload | |
> = { | |
eventType: EventType |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// when T is any|unknown, Y is returned, otherwise N | |
type IsAnyUnknown<T, Y, N> = unknown extends T ? Y : N; | |
// when T is never, Y is returned, otherwise N | |
type IsNever<T, Y = true, N = false> = [T] extends [never] ? Y : N; | |
// when T is a tuple, Y is returned, otherwise N | |
// valid tuples = [string], [string, boolean], | |
// invalid tuples = [], string[], (string | number)[] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface ZendeskWidget { | |
( | |
type: 'webWidget:on' | 'webWidget' | 'webWidget:get', | |
command: string, | |
payload?: any, | |
): void; | |
( | |
type: 'webWidget', | |
command: 'updateSettings', | |
payload: ZendeskSettings, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
at, /^ATU[A-Z0-9]{9,9}$/, | |
be, /^BE[0-9]{10,10}$/, | |
bg, /^BG[0-9]{9,10}$/, | |
cy, /^CY[A-Z0-9]{9,9}$/, | |
cz, /^CZ[0-9]{8,10}$/, | |
de, /^DE[0-9]{9,9}$/, | |
dk, /^DK[0-9]{8,8}$/, | |
ee, /^EE[0-9]{9,9}$/, | |
el, /^EL[0-9]{9,9}$/, | |
es, /^ES[A-Z0-9]{9,9}$/, |