-
Notifications
You must be signed in to change notification settings - Fork 430
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Export Type declarations for
turbo:
events (#452)
Various `turbo:`-prefixed events are dispatched as [CustomEvent][] instances with data encoded into the [detail][] property. In TypeScript, that property is encoded as `any`, but the `CustomEvent` type is generic (i.e. `CustomEvent<T>`) where the generic Type argument describes the structure of the `detail` key. This commit introduces types that extend from `CustomEvent` for each event, and exports them from `/core/index.ts`, which is exported from `/index.ts` in-turn. In practice, there are no changes to the implementation. However, TypeScript consumers of the package can import the types. At the same time, the internal implementation can depend on the types to ensure consistency throughout. [CustomEvent]: https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent [detail]: https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/detail
- Loading branch information
1 parent
706e614
commit 2d5cdda
Showing
9 changed files
with
73 additions
and
25 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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