Skip to content

Commit

Permalink
chore: exclude EventEmitter methods
Browse files Browse the repository at this point in the history
  • Loading branch information
almeidx committed Dec 10, 2023
1 parent 4c879fb commit ce71c13
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/discord.js/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@
"no-restricted-syntax": [
2,
{
"selector": "MethodDefinition > TSEmptyBodyFunctionExpression > Identifier :not(TSTypeOperator[operator=readonly]) > TSArrayType",
"selector": "MethodDefinition[key.name!=on][key.name!=once][key.name!=off] > TSEmptyBodyFunctionExpression > Identifier :not(TSTypeOperator[operator=readonly]) > TSArrayType",
"message": "Array parameters on methods must be readonly"
},
{
Expand Down
14 changes: 7 additions & 7 deletions packages/discord.js/typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1016,7 +1016,7 @@ export class Client<Ready extends boolean = boolean> extends BaseClient {
): this;
public on<Event extends string | symbol>(
event: Exclude<Event, keyof ClientEvents>,
listener: (...args: readonly any[]) => Awaitable<void>,
listener: (...args: any[]) => Awaitable<void>,
): this;

public once<Event extends keyof ClientEvents>(
Expand All @@ -1025,7 +1025,7 @@ export class Client<Ready extends boolean = boolean> extends BaseClient {
): this;
public once<Event extends string | symbol>(
event: Exclude<Event, keyof ClientEvents>,
listener: (...args: readonly any[]) => Awaitable<void>,
listener: (...args: any[]) => Awaitable<void>,
): this;

public emit<Event extends keyof ClientEvents>(event: Event, ...args: ClientEvents[Event]): boolean;
Expand All @@ -1037,7 +1037,7 @@ export class Client<Ready extends boolean = boolean> extends BaseClient {
): this;
public off<Event extends string | symbol>(
event: Exclude<Event, keyof ClientEvents>,
listener: (...args: readonly any[]) => Awaitable<void>,
listener: (...args: any[]) => Awaitable<void>,
): this;

public removeAllListeners<Event extends keyof ClientEvents>(event?: Event): this;
Expand Down Expand Up @@ -1897,14 +1897,14 @@ export class InteractionCollector<Interaction extends CollectedInteraction> exte
event: 'end',
listener: (collected: ReadonlyCollection<Snowflake, Interaction>, reason: string) => Awaitable<void>,
): this;
public on(event: string, listener: (...args: readonly any[]) => Awaitable<void>): this;
public on(event: string, listener: (...args: any[]) => Awaitable<void>): this;

public once(event: 'collect' | 'dispose' | 'ignore', listener: (interaction: Interaction) => Awaitable<void>): this;
public once(
event: 'end',
listener: (collected: ReadonlyCollection<Snowflake, Interaction>, reason: string) => Awaitable<void>,
): this;
public once(event: string, listener: (...args: readonly any[]) => Awaitable<void>): this;
public once(event: string, listener: (...args: any[]) => Awaitable<void>): this;
}

export class InteractionWebhook extends PartialWebhookMixin() {
Expand Down Expand Up @@ -2563,7 +2563,7 @@ export class ReactionCollector extends Collector<Snowflake | string, MessageReac
event: 'end',
listener: (collected: ReadonlyCollection<Snowflake, MessageReaction>, reason: string) => void,
): this;
public on(event: string, listener: (...args: readonly any[]) => void): this;
public on(event: string, listener: (...args: any[]) => void): this;

public once(
event: 'collect' | 'dispose' | 'remove' | 'ignore',
Expand All @@ -2573,7 +2573,7 @@ export class ReactionCollector extends Collector<Snowflake | string, MessageReac
event: 'end',
listener: (collected: ReadonlyCollection<Snowflake, MessageReaction>, reason: string) => void,
): this;
public once(event: string, listener: (...args: readonly any[]) => void): this;
public once(event: string, listener: (...args: any[]) => void): this;
}

export class ReactionEmoji extends Emoji {
Expand Down

0 comments on commit ce71c13

Please sign in to comment.