Mercurial
comparison benchmark/bun-http-framework-benchmark/dev/adonis/contracts/events.ts @ 185:dfdd66825396
Merged in keep alive changes and mrjunejune changes.
| author | MrJuneJune <me@mrjunejune.com> |
|---|---|
| date | Fri, 23 Jan 2026 22:22:30 -0800 |
| parents | a8976a008a9d |
| children |
comparison
equal
deleted
inserted
replaced
| 182:d6ab5921fedc | 185:dfdd66825396 |
|---|---|
| 1 /** | |
| 2 * Contract source: https://git.io/JfefG | |
| 3 * | |
| 4 * Feel free to let us know via PR, if you find something broken in this contract | |
| 5 * file. | |
| 6 */ | |
| 7 | |
| 8 declare module '@ioc:Adonis/Core/Event' { | |
| 9 /* | |
| 10 |-------------------------------------------------------------------------- | |
| 11 | Define typed events | |
| 12 |-------------------------------------------------------------------------- | |
| 13 | | |
| 14 | You can define types for events inside the following interface and | |
| 15 | AdonisJS will make sure that all listeners and emit calls adheres | |
| 16 | to the defined types. | |
| 17 | | |
| 18 | For example: | |
| 19 | | |
| 20 | interface EventsList { | |
| 21 | 'new:user': UserModel | |
| 22 | } | |
| 23 | | |
| 24 | Now calling `Event.emit('new:user')` will statically ensure that passed value is | |
| 25 | an instance of the the UserModel only. | |
| 26 | | |
| 27 */ | |
| 28 interface EventsList { | |
| 29 // | |
| 30 } | |
| 31 } |