Skip to content

Commit

Permalink
chore(Types): include @discordjs/voice typings
Browse files Browse the repository at this point in the history
  • Loading branch information
amishshah committed Jun 28, 2021
1 parent e37ef3a commit cc34783
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 119 deletions.
109 changes: 0 additions & 109 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
"@commitlint/cli": "^12.1.4",
"@commitlint/config-angular": "^12.1.4",
"@discordjs/docgen": "^0.10.0",
"@discordjs/voice": "^0.3.0",
"@types/node": "^12.12.6",
"conventional-changelog-cli": "^2.1.1",
"cross-env": "^7.0.3",
Expand Down
11 changes: 2 additions & 9 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,8 @@
"pretty": false,
"module": "commonjs",
"target": "es2019",
"lib": [
"esnext",
"esnext.array",
"esnext.asynciterable",
"esnext.intl",
"esnext.symbol"
],
"lib": ["esnext", "esnext.array", "esnext.asynciterable", "esnext.intl", "esnext.symbol"],
"sourceMap": false,
"skipDefaultLibCheck": true,
"skipLibCheck": true
"skipDefaultLibCheck": true
}
}
19 changes: 19 additions & 0 deletions typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,25 @@ declare enum WebhookTypes {

type Awaited<T> = T | Promise<T>;

declare module '@discordjs/voice' {
import { GatewayVoiceServerUpdateDispatchData, GatewayVoiceStateUpdateDispatchData } from 'discord-api-types/v8';

export interface DiscordGatewayAdapterLibraryMethods {
onVoiceServerUpdate(data: GatewayVoiceServerUpdateDispatchData): void;
onVoiceStateUpdate(data: GatewayVoiceStateUpdateDispatchData): void;
destroy(): void;
}

export interface DiscordGatewayAdapterImplementerMethods {
sendPayload(payload: any): boolean;
destroy(): void;
}

export type DiscordGatewayAdapterCreator = (
methods: DiscordGatewayAdapterLibraryMethods,
) => DiscordGatewayAdapterImplementerMethods;
}

declare module 'discord.js' {
import BaseCollection from '@discordjs/collection';
import { ChildProcess } from 'child_process';
Expand Down

0 comments on commit cc34783

Please sign in to comment.