RockPaperScissors/node_modules/ytdl-core-discord/node_modules/@types/node/diagnostic_channel.d.ts
2021-12-02 17:15:29 +01:00

35 lines
842 B
TypeScript
Executable file

/**
* @experimental
*/
declare module 'diagnostic_channel' {
/**
* Returns wether a named channel has subscribers or not.
*/
function hasSubscribers(name: string): boolean;
/**
* Gets or create a diagnostic channel by name.
*/
function channel(name: string): Channel;
type ChannelListener = (name: string, message: unknown) => void;
/**
* Simple diagnostic channel that allows
*/
class Channel {
readonly name: string;
readonly hashSubscribers: boolean;
private constructor(name: string);
/**
* Add a listener to the message channel.
*/
subscribe(listener: ChannelListener): void;
/**
* Removes a previously registered listener.
*/
unsubscribe(listener: ChannelListener): void;
}
}