Microsoft/TypeScript

Unknown interface "ClassMethodDecoratorFunction" in documentation for 5.0.4 lib.decorators.d.ts

Open

#54.099 geöffnet am 2. Mai 2023

Auf GitHub ansehen
 (3 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)TypeScript (6.726 Forks)batch import
BugDomain: DecoratorsHelp Wanted

Repository-Metriken

Stars
 (48.455 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 6T 17h) (9 gemergte PRs in 30 T)

Beschreibung

lib Update Request

Configuration Check

My compilation target is ES2021 and my lib is ["es2017", "dom"].

Missing / Incorrect Definition

The mentioned example:

const bound: ClassMethodDecoratorFunction = (value, context) {
  if (context.private) throw new TypeError("Not supported on private methods.");
  context.addInitializer(function () {
    this[context.name] = this[context.name].bind(this);
  });
}

Uses an Interface ClassMethodDecoratorFunction which isn't implemented - as far as I can tell this should be ClassMethodDecoratorContext instead

Documentation Link

v5.0.4/src/lib/decorators.d.ts

Contributor Guide