mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-15 07:34:42 -04:00
feat: add patch to add generic types to eventemitter2
EventEmitter2 has types, but they're very basic and not very type safe. I created this patch, because my improved types haven't been merged into the official package. Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
11c2f57e4b
commit
caa53e3556
16 changed files with 445 additions and 22 deletions
|
@ -3,6 +3,7 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { EventMap } from 'eventemitter2';
|
||||
|
||||
export const eventModuleConfig = {
|
||||
wildcard: false,
|
||||
|
@ -18,3 +19,7 @@ export enum NoteEvent {
|
|||
PERMISSION_CHANGE = 'note.permission_change' /** noteId: The id of the [@link Note], which permissions are changed. **/,
|
||||
DELETION = 'note.deletion' /** noteId: The id of the [@link Note], which is being deleted. **/,
|
||||
}
|
||||
|
||||
export interface NoteEventMap extends EventMap {
|
||||
[NoteEvent.PERMISSION_CHANGE]: (noteId: number) => void;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue