Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The declaration file is missing the jsdoc comment #64

Closed
kong-lau opened this issue Jan 3, 2020 · 2 comments
Closed

The declaration file is missing the jsdoc comment #64

kong-lau opened this issue Jan 3, 2020 · 2 comments
Labels
Need More Information Further information is requested

Comments

@kong-lau
Copy link

kong-lau commented Jan 3, 2020

index.ts

export * from "./foo";

foo.ts

export class Foo {
    /**
     * m
     * @param {number} arg
     * @return {number} res
     */
    m(arg:number): number {
        return arg;
    }

    /**
     * static m1
     * @param {number} arg
     * @return {number} res
     */
    static m1(arg:number): number {
        return arg;
    }
}

declaration file

declare class Foo {
    m(arg: number): number;
    static m1(arg: number): number;
}
export { Foo };

Node: v8.10.0
OS: Windows 10 1909
TypeScript: 3.7.4
rollup-plugin-ts: 1.2.1

@wessberg
Copy link
Owner

wessberg commented Jan 5, 2020

Hey there. Yes, this is unfortunate. It is related to microsoft/TypeScript#17146. When merging and generating the declarations, nodes are cloned, and currently TypeScript's compiler APIs doesn't offer APIs for transforming JSDoc comments. I've tried my best at working around it, but for the time being we'll need to await movement on the related issue.

@wessberg wessberg added the Need More Information Further information is requested label Jan 5, 2020
@wessberg
Copy link
Owner

Hey there. I've come up with a workaround that effectively resolves the issue. It has been released as part of v1.2.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Need More Information Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants