Microsoft/TypeScript

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

Open

#54,099 建立於 2023年5月2日

在 GitHub 查看
 (3 留言) (0 反應) (0 負責人)TypeScript (6,726 fork)batch import
BugDomain: DecoratorsHelp Wanted

倉庫指標

Star
 (48,455 star)
PR 合併指標
 (平均合併 6天 17小時) (30 天內合併 9 個 PR)

描述

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

貢獻者指南