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

declare module vs @module different output #2401

Closed
lal12 opened this issue Sep 18, 2023 · 4 comments
Closed

declare module vs @module different output #2401

lal12 opened this issue Sep 18, 2023 · 4 comments
Labels
bug Functionality does not match expectation

Comments

@lal12
Copy link

lal12 commented Sep 18, 2023

Search terms

module, declare module,

Question

Before I a .d.ts file was only as a way to document a library/environment.

So each file looked like this:

/**
* @module foo:bar
* This module can be imported to do something
*/
export function doSomething(a: any): void;

This resulted in the comment above being included and the page being called foo:bar.
However know I want to use those .d.ts also as reference in Typescript, so I need to wrap the whole file into a declare module:

/**
* @module foo:bar
* This module can be imported to do something
*/
declare module 'foo:bar'{
export function doSomething(a: any): void;
}

now however the page is title as (Module +) filename and the comment isn't included either.

How can I handle this?

@lal12 lal12 added the question Question about functionality label Sep 18, 2023
@Gerrit0 Gerrit0 added bug Functionality does not match expectation and removed question Question about functionality labels Sep 23, 2023
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Sep 23, 2023

The @module tag currently doesn't work on declare module, though it really ought to

@saghul
Copy link

saghul commented Oct 6, 2023

Thanks for fixing this!

@saghul
Copy link

saghul commented Oct 6, 2023

Follow up question: will the module comments also be preserved?

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Oct 6, 2023

When a file only contains declare module "foo", the comment on that will be used as the module comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Functionality does not match expectation
Projects
None yet
Development

No branches or pull requests

3 participants