discord.js
discord.js copied to clipboard
types(collection): simplify ambient constructor declaration
collection.ts needs an ambient declaration for Collection.prototype.constructor
in order for the TypeScript compiler to understand this.constructor[Symbol.species]
references within class methods.
The existing implementation of this is a little clumsy. This refactor simplifies the declaration significantly, and also removes the risk of the constructor
property type becoming out-of-sync with Collection if changes are made to the constructor.
Removes the redundant CollectionConstructor
interface which, although exported, is marked @internal
and doesn't appear in the docs, therefore should probably be OK to count as a non-breaking change.
Status and versioning classification:
- Code changes have been tested against the Discord API, or there are no code changes
- I know how to update typings and have done so, or typings don't need updating