feat(docgen): proper event parsing for typescript

This commit is contained in:
iCrawl
2022-06-10 16:22:11 +02:00
parent 0415300243
commit d4b41dd081
15 changed files with 113 additions and 140 deletions

View File

@@ -1,5 +1,4 @@
import { TypedEmitter } from 'tiny-typed-emitter';
import type { Awaited } from '../util/util';
import { EventEmitter } from 'node:events';
/**
* The known data for a user in a Discord voice connection.
@@ -22,19 +21,10 @@ export interface VoiceUserData {
userId: string;
}
/**
* The events that an SSRCMap may emit.
*/
export interface SSRCMapEvents {
create: (newData: VoiceUserData) => Awaited<void>;
update: (oldData: VoiceUserData | undefined, newData: VoiceUserData) => Awaited<void>;
delete: (deletedData: VoiceUserData) => Awaited<void>;
}
/**
* Maps audio SSRCs to data of users in voice connections.
*/
export class SSRCMap extends TypedEmitter<SSRCMapEvents> {
export class SSRCMap extends EventEmitter {
/**
* The underlying map.
*/