mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* Use discriminated union for WebhookNotifications Change the WebhookNotification types to know their own values for the `kind` property, so that the compiler can automatically infer types from it. This also requires changing the notification types to be interfaces instead of classes, and changing `WebhookNotification` to be a union type instead of an abstract class. Ref: https://www.typescriptlang.org/docs/handbook/advanced-types.html#discriminated-unions The result of all this is that a guard on the returned `notification.kind` will have the effect of narrowing the type of `notification` itself, so that explicit casts aren’t always necessary. * Update test * Revert kind to still be WebhookNotificationKind * Group types for WebhookNotificationKind * fix: missing semicolon |
||
|---|---|---|
| .. | ||
| braintree-tests.ts | ||
| index.d.ts | ||
| tsconfig.json | ||
| tslint.json | ||