diff --git a/tsc/internal/bundled/libs/lib.decorators.d.ts b/tsc/internal/bundled/libs/lib.decorators.d.ts index 83d82bef2e557..1c044181d7efb 100644 --- a/tsc/internal/bundled/libs/lib.decorators.d.ts +++ b/tsc/internal/bundled/libs/lib.decorators.d.ts @@ -53,16 +53,19 @@ interface ClassDecoratorContext< * * @example * ```ts - * function customElement(name: string): ClassDecoratorFunction { - * return (target, context) => { + * function customElement(name: string) { + * return ( + * target: Class, + * context: ClassDecoratorContext, + * ) => { * context.addInitializer(function () { * customElements.define(name, this); * }); - * } + * }; * } * * @customElement("my-element") - * class MyElement {} + * class MyElement extends HTMLElement {} * ``` */ addInitializer(initializer: (this: Class) => void): void; @@ -114,10 +117,14 @@ interface ClassMethodDecoratorContext< * * @example * ```ts - * const bound: ClassMethodDecoratorFunction = (value, context) { + * function bound any>( + * value: Value, + * context: ClassMethodDecoratorContext, + * ) { * if (context.private) throw new TypeError("Not supported on private methods."); - * context.addInitializer(function () { - * this[context.name] = this[context.name].bind(this); + * context.addInitializer(function (this: This) { + * const self = this as Record; + * self[context.name] = self[context.name].bind(this); * }); * } *