Skip to content

Overriden properties in jsdoc annotation are not picked up in declaration fileΒ #44693

Closed
@simonseyock

Description

@simonseyock

Bug Report

πŸ”Ž Search Terms

typescript jsdoc declaration override method property signature

πŸ•— Version & Regression Information

  • This changed between versions 3.8.3 and 3.9.7.

⏯ Playground Link

Example JavaScript with JSDoc

πŸ’» Code

/**
 * @typedef A
 * @property {string} a
 */

/**
 * @typedef B
 * @property {number} b
 */

class Base {
    /**
     * @type {A}
     */
    value;
}

class Test extends Base {
    /**
     * @type {A & B}
     */
    value;
}

πŸ™ Actual behavior

The declaration file does not contain a typing for the narrower type for value in class Test.

declare class Test extends Base {
}

πŸ™‚ Expected behavior

The declaration file should contain the narrower type for value.

declare class Test extends Base {
    /**
     * @type {A & B}
     */
    value: A & B;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: Declaration EmitThe issue relates to the emission of d.ts filesHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions