BugDomain: lib.d.tsHelp Wanted
Métriques du dépôt
- Stars
- (48 455 stars)
- Métriques de merge PR
- (Merge moyen 6j 17h) (9 PRs mergées en 30 j)
Description
lib Update Request
Configuration Check
My compilation target is ES2015 and my lib is the default.
Missing / Incorrect Definition
Array and other interfaces for built-ins do not declare their own constructor methods
Sample Code
[].constructor[Symbol.species];
Element implicitly has an 'any' type because expression of type 'unique symbol' can't be used to index type 'Function'.
Property '[SymbolConstructor.species]' does not exist on type 'Function'.
The code compiles fine when defining the appropriate constructor method:
declare global {
interface Array<T> {
constructor: ArrayConstructor;
}
}
Documentation Link
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/constructor