-
Notifications
You must be signed in to change notification settings - Fork 12.8k
JSDoc export type support #48104
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
Comments
Use case: class Foo {
/**
* @typedef {object} FooOptions
* @prop {boolean} [verbose]
*/
/**
* @param {FooOptions} opts
*/
constructor(opts = {}) {
/** @type {Required<FooOptions>} */
this.opts = {
verbose: false,
...opts,
};
}
} In the project containing Next, I'd like to subclass |
A suggestion for an approach that might work, different from the one suggested in the original issue might be:
For the example above, instead of generating this: export class Foo {
constructor(opts?: {
verbose?: boolean | undefined;
});
opts: Required<{
verbose?: boolean | undefined;
}>;
} You would get this: export interface FooOptions {
verbose?: boolean | undefined;
}
export class Foo {
constructor(opts?: FooOptions);
opts: Required<FooOptions>;
} |
Now that typescript 5.5 have brought the also it does not seem possible to use use case exemple
example corresponding typescript syntax
|
Suggestion
π Search Terms
JSDoc
β Viability Checklist
My suggestion meets these guidelines:
β Suggestion
π Motivating Example
Can we export AjaxStatus to other files?
such as
π» Use Cases
Used for JavaScript development using the TypeScript language service.
The text was updated successfully, but these errors were encountered: