-
-
Notifications
You must be signed in to change notification settings - Fork 32
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 static tag #62
Comments
Hey there. I can't reproduce this problem, but I do see a few things. First, your code is not valid TypeScript and will result in a TypeScript error: However, the other thing is that the output you got from Which TypeScript and Node versions are you running, and which OS and version are you using? I've tried to reproduce this issue on Node 13 on Mac OS 10.15.3 with TypeScript v3.7.4. Here's what I got: The following code: class PoolImpl<T extends { dispose?(): void, onAlloc?(): void, onRelease?(): void }> {
constructor(cls: new() => T) {}
/* @internal */ public alloc(): T {}
/* @internal */ public release(item: T): void {}
/* @internal */ public resize(time: number): void {}
/* @internal */ public dispose(): void {}
}
export class Pool {
public static alloc<T>(cls: new () => T): T {}
public static release(item: any): null {}
public static releaseList(list: any[]): void {}
} Will produce the following declaration file with v1.2.0 of declare class Pool {
static alloc<T>(cls: new () => T): T;
static release(item: any): null;
static releaseList(list: any[]): void;
}
export {Pool}; |
Hi, I post the sample at here. |
Node v8.10.0 |
I'm seeing the same. It appears a class has to be re-exported for it to occur. I.e. an
Which I assume is caused by dropping the static flag when copying the declaration around somewhere. |
Related to this issue I just opened at the TypeScript repo. Will implement a workaround. |
This has been fixed in v1.2.1 |
Hi,
The dts file emit with plugin is missing the static tag
The text was updated successfully, but these errors were encountered: