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

贡献者指南