diff --git a/packages/collection/src/collection.ts b/packages/collection/src/collection.ts index 5fa11cb1ebb9..8f842ef68ad6 100644 --- a/packages/collection/src/collection.ts +++ b/packages/collection/src/collection.ts @@ -1,14 +1,4 @@ /* eslint-disable no-param-reassign */ -/** - * @internal - */ -export interface CollectionConstructor { - new (): Collection; - new (entries?: readonly (readonly [Key, Value])[] | null): Collection; - new (iterable: Iterable): Collection; - readonly prototype: Collection; - readonly [Symbol.species]: CollectionConstructor; -} /** * Represents an immutable version of a collection @@ -19,13 +9,13 @@ export type ReadonlyCollection = Omit< > & ReadonlyMap; -/** - * Separate interface for the constructor so that emitted js does not have a constructor that overwrites itself - * - * @internal - */ -export interface Collection extends Map { - constructor: CollectionConstructor; +export interface Collection { + /** + * Ambient declaration to allow `this.constructor[@@species]` in class methods. + * + * @internal + */ + constructor: typeof Collection & { readonly [Symbol.species]: typeof Collection }; } /**