mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 02:23:31 +01:00
feat(docgen): proper event parsing for typescript
This commit is contained in:
@@ -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.
|
||||
*/
|
||||
|
||||
@@ -1,25 +1,9 @@
|
||||
import { TypedEmitter } from 'tiny-typed-emitter';
|
||||
import type { Awaited } from '../util/util';
|
||||
|
||||
/**
|
||||
* The events that a SpeakingMap can emit.
|
||||
*/
|
||||
export interface SpeakingMapEvents {
|
||||
/**
|
||||
* Emitted when a user starts speaking.
|
||||
*/
|
||||
start: (userId: string) => Awaited<void>;
|
||||
|
||||
/**
|
||||
* Emitted when a user stops speaking.
|
||||
*/
|
||||
end: (userId: string) => Awaited<void>;
|
||||
}
|
||||
import { EventEmitter } from 'node:events';
|
||||
|
||||
/**
|
||||
* Tracks the speaking states of users in a voice channel.
|
||||
*/
|
||||
export class SpeakingMap extends TypedEmitter<SpeakingMapEvents> {
|
||||
export class SpeakingMap extends EventEmitter {
|
||||
/**
|
||||
* The delay after a packet is received from a user until they're marked as not speaking anymore.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user