mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-24 18:56:32 -05:00
caa53e3556
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>
25 lines
721 B
TypeScript
25 lines
721 B
TypeScript
/*
|
|
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
|
*
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
import { EventMap } from 'eventemitter2';
|
|
|
|
export const eventModuleConfig = {
|
|
wildcard: false,
|
|
delimiter: '.',
|
|
newListener: false,
|
|
removeListener: false,
|
|
maxListeners: 10,
|
|
verboseMemoryLeak: true,
|
|
ignoreErrors: false,
|
|
};
|
|
|
|
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;
|
|
}
|