Skip to content

Commit

Permalink
Merge branch 'main' into fix-connect-timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] authored Sep 25, 2022
2 parents db2e56b + d79aa2d commit 9ab51b0
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 23 deletions.
42 changes: 21 additions & 21 deletions packages/collection/src/collection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,13 +230,13 @@ export class Collection<K, V> extends Map<K, V> {
* ```
*/
public find<V2 extends V>(fn: (value: V, key: K, collection: this) => value is V2): V2 | undefined;
public find(fn: (value: V, key: K, collection: this) => boolean): V | undefined;
public find(fn: (value: V, key: K, collection: this) => unknown): V | undefined;
public find<This, V2 extends V>(
fn: (this: This, value: V, key: K, collection: this) => value is V2,
thisArg: This,
): V2 | undefined;
public find<This>(fn: (this: This, value: V, key: K, collection: this) => boolean, thisArg: This): V | undefined;
public find(fn: (value: V, key: K, collection: this) => boolean, thisArg?: unknown): V | undefined {
public find<This>(fn: (this: This, value: V, key: K, collection: this) => unknown, thisArg: This): V | undefined;
public find(fn: (value: V, key: K, collection: this) => unknown, thisArg?: unknown): V | undefined {
if (typeof fn !== 'function') throw new TypeError(`${fn} is not a function`);
if (typeof thisArg !== 'undefined') fn = fn.bind(thisArg);
for (const [key, val] of this) {
Expand All @@ -259,13 +259,13 @@ export class Collection<K, V> extends Map<K, V> {
* ```
*/
public findKey<K2 extends K>(fn: (value: V, key: K, collection: this) => key is K2): K2 | undefined;
public findKey(fn: (value: V, key: K, collection: this) => boolean): K | undefined;
public findKey(fn: (value: V, key: K, collection: this) => unknown): K | undefined;
public findKey<This, K2 extends K>(
fn: (this: This, value: V, key: K, collection: this) => key is K2,
thisArg: This,
): K2 | undefined;
public findKey<This>(fn: (this: This, value: V, key: K, collection: this) => boolean, thisArg: This): K | undefined;
public findKey(fn: (value: V, key: K, collection: this) => boolean, thisArg?: unknown): K | undefined {
public findKey<This>(fn: (this: This, value: V, key: K, collection: this) => unknown, thisArg: This): K | undefined;
public findKey(fn: (value: V, key: K, collection: this) => unknown, thisArg?: unknown): K | undefined {
if (typeof fn !== 'function') throw new TypeError(`${fn} is not a function`);
if (typeof thisArg !== 'undefined') fn = fn.bind(thisArg);
for (const [key, val] of this) {
Expand All @@ -282,9 +282,9 @@ export class Collection<K, V> extends Map<K, V> {
* @param thisArg - Value to use as `this` when executing function
* @returns The number of removed entries
*/
public sweep(fn: (value: V, key: K, collection: this) => boolean): number;
public sweep<T>(fn: (this: T, value: V, key: K, collection: this) => boolean, thisArg: T): number;
public sweep(fn: (value: V, key: K, collection: this) => boolean, thisArg?: unknown): number {
public sweep(fn: (value: V, key: K, collection: this) => unknown): number;
public sweep<T>(fn: (this: T, value: V, key: K, collection: this) => unknown, thisArg: T): number;
public sweep(fn: (value: V, key: K, collection: this) => unknown, thisArg?: unknown): number {
if (typeof fn !== 'function') throw new TypeError(`${fn} is not a function`);
if (typeof thisArg !== 'undefined') fn = fn.bind(thisArg);
const previousSize = this.size;
Expand All @@ -309,7 +309,7 @@ export class Collection<K, V> extends Map<K, V> {
*/
public filter<K2 extends K>(fn: (value: V, key: K, collection: this) => key is K2): Collection<K2, V>;
public filter<V2 extends V>(fn: (value: V, key: K, collection: this) => value is V2): Collection<K, V2>;
public filter(fn: (value: V, key: K, collection: this) => boolean): Collection<K, V>;
public filter(fn: (value: V, key: K, collection: this) => unknown): Collection<K, V>;
public filter<This, K2 extends K>(
fn: (this: This, value: V, key: K, collection: this) => key is K2,
thisArg: This,
Expand All @@ -318,8 +318,8 @@ export class Collection<K, V> extends Map<K, V> {
fn: (this: This, value: V, key: K, collection: this) => value is V2,
thisArg: This,
): Collection<K, V2>;
public filter<This>(fn: (this: This, value: V, key: K, collection: this) => boolean, thisArg: This): Collection<K, V>;
public filter(fn: (value: V, key: K, collection: this) => boolean, thisArg?: unknown): Collection<K, V> {
public filter<This>(fn: (this: This, value: V, key: K, collection: this) => unknown, thisArg: This): Collection<K, V>;
public filter(fn: (value: V, key: K, collection: this) => unknown, thisArg?: unknown): Collection<K, V> {
if (typeof fn !== 'function') throw new TypeError(`${fn} is not a function`);
if (typeof thisArg !== 'undefined') fn = fn.bind(thisArg);
const results = new this.constructor[Symbol.species]<K, V>();
Expand Down Expand Up @@ -347,7 +347,7 @@ export class Collection<K, V> extends Map<K, V> {
public partition<V2 extends V>(
fn: (value: V, key: K, collection: this) => value is V2,
): [Collection<K, V2>, Collection<K, Exclude<V, V2>>];
public partition(fn: (value: V, key: K, collection: this) => boolean): [Collection<K, V>, Collection<K, V>];
public partition(fn: (value: V, key: K, collection: this) => unknown): [Collection<K, V>, Collection<K, V>];
public partition<This, K2 extends K>(
fn: (this: This, value: V, key: K, collection: this) => key is K2,
thisArg: This,
Expand All @@ -357,11 +357,11 @@ export class Collection<K, V> extends Map<K, V> {
thisArg: This,
): [Collection<K, V2>, Collection<K, Exclude<V, V2>>];
public partition<This>(
fn: (this: This, value: V, key: K, collection: this) => boolean,
fn: (this: This, value: V, key: K, collection: this) => unknown,
thisArg: This,
): [Collection<K, V>, Collection<K, V>];
public partition(
fn: (value: V, key: K, collection: this) => boolean,
fn: (value: V, key: K, collection: this) => unknown,
thisArg?: unknown,
): [Collection<K, V>, Collection<K, V>] {
if (typeof fn !== 'function') throw new TypeError(`${fn} is not a function`);
Expand Down Expand Up @@ -458,9 +458,9 @@ export class Collection<K, V> extends Map<K, V> {
* collection.some(user => user.discriminator === '0000');
* ```
*/
public some(fn: (value: V, key: K, collection: this) => boolean): boolean;
public some<T>(fn: (this: T, value: V, key: K, collection: this) => boolean, thisArg: T): boolean;
public some(fn: (value: V, key: K, collection: this) => boolean, thisArg?: unknown): boolean {
public some(fn: (value: V, key: K, collection: this) => unknown): boolean;
public some<T>(fn: (this: T, value: V, key: K, collection: this) => unknown, thisArg: T): boolean;
public some(fn: (value: V, key: K, collection: this) => unknown, thisArg?: unknown): boolean {
if (typeof fn !== 'function') throw new TypeError(`${fn} is not a function`);
if (typeof thisArg !== 'undefined') fn = fn.bind(thisArg);
for (const [key, val] of this) {
Expand All @@ -483,7 +483,7 @@ export class Collection<K, V> extends Map<K, V> {
*/
public every<K2 extends K>(fn: (value: V, key: K, collection: this) => key is K2): this is Collection<K2, V>;
public every<V2 extends V>(fn: (value: V, key: K, collection: this) => value is V2): this is Collection<K, V2>;
public every(fn: (value: V, key: K, collection: this) => boolean): boolean;
public every(fn: (value: V, key: K, collection: this) => unknown): boolean;
public every<This, K2 extends K>(
fn: (this: This, value: V, key: K, collection: this) => key is K2,
thisArg: This,
Expand All @@ -492,8 +492,8 @@ export class Collection<K, V> extends Map<K, V> {
fn: (this: This, value: V, key: K, collection: this) => value is V2,
thisArg: This,
): this is Collection<K, V2>;
public every<This>(fn: (this: This, value: V, key: K, collection: this) => boolean, thisArg: This): boolean;
public every(fn: (value: V, key: K, collection: this) => boolean, thisArg?: unknown): boolean {
public every<This>(fn: (this: This, value: V, key: K, collection: this) => unknown, thisArg: This): boolean;
public every(fn: (value: V, key: K, collection: this) => unknown, thisArg?: unknown): boolean {
if (typeof fn !== 'function') throw new TypeError(`${fn} is not a function`);
if (typeof thisArg !== 'undefined') fn = fn.bind(thisArg);
for (const [key, val] of this) {
Expand Down
4 changes: 2 additions & 2 deletions packages/discord.js/src/managers/GuildForumThreadManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ class GuildForumThreadManager extends ThreadManager {
*/

/**
* @typedef {BaseMessageOptions} GuildForumThreadCreateOptions
* @typedef {BaseMessageOptions} GuildForumThreadMessageCreateOptions
* @property {stickers} [stickers] The stickers to send with the message
* @property {BitFieldResolvable} [flags] The flags to send with the message
*/

/**
* Options for creating a thread.
* @typedef {StartThreadOptions} GuildForumThreadCreateOptions
* @property {GuildForumThreadCreateOptions|MessagePayload} message The message associated with the thread post
* @property {GuildForumThreadMessageCreateOptions|MessagePayload} message The message associated with the thread post
* @property {Snowflake[]} [appliedTags] The tags to apply to the thread
*/

Expand Down
1 change: 1 addition & 0 deletions packages/discord.js/src/structures/ForumChannel.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const { transformAPIGuildForumTag, transformAPIGuildDefaultReaction } = require(
/**
* Represents a channel that only contains threads
* @extends {GuildChannel}
* @implements {TextBasedChannel}
*/
class ForumChannel extends GuildChannel {
constructor(guild, data, client) {
Expand Down

0 comments on commit 9ab51b0

Please sign in to comment.