feat: Video receiver (2/n)

- Only VP8 supported
- With example JSDoc
- Tested but bad quality
This commit is contained in:
Elysia
2024-07-25 21:09:52 +07:00
parent 24e151805d
commit 74f49ba92d
6 changed files with 197 additions and 23 deletions

9
typings/index.d.ts vendored
View File

@@ -1076,6 +1076,8 @@ export class StreamConnection extends VoiceConnection {
export class VoiceReceiver extends EventEmitter {
constructor(connection: VoiceConnection);
public createStream(user: UserResolvable, options?: { mode?: 'opus' | 'pcm'; end?: 'silence' | 'manual' }): Readable;
/** @deprecated Only recorded VP8 stream */
public createVideoStream(user: UserResolvable): IvfJoinner;
public on(event: 'debug', listener: (error: Error | string) => void): this;
public on(event: string, listener: (...args: any[]) => void): this;
@@ -1084,6 +1086,13 @@ export class VoiceReceiver extends EventEmitter {
public once(event: string, listener: (...args: any[]) => void): this;
}
export class IvfJoinner {
constructor(codec: 'VP8');
public stream: Readable;
public stop(): void;
public createFinalFile(read: Readable, write: Writable): void;
}
export { Collection } from '@discordjs/collection';
export interface CollectorEventTypes<K, V, F extends unknown[] = []> {