-
Notifications
You must be signed in to change notification settings - Fork 653
Open
Description
Summary
When API-extractor creates a namespace in the API rollup file to represent an exported module namespace object, any @module comment in the source file should be applied to the namespace.
Repro steps
index.ts
export * as Text from './Text';Text.ts
/**
* @module
* Functions for manipulating text.
*/
/**
* Convert line endings to `\n`
*/
export function convertToLf(input: text): string {
return text.replace(/\r\n/g, '\n');
}
/**
* Convert line endings to `\r\n`
*/
export function convertToCrLf(input: text): string {
return text.replace(/\r?\n/g, '\r\n');
}Will generate
/**
* Convert line endings to `\n`
*/
declare function convertToLf(input: text): string;
/**
* Convert line endings to `\r\n`
*/
declare function convertToCrLf(input: text): string;
declare namespace Text {
export {
convertToLf,
convertToCrLf
}
}
export { Text }Details
However, it should generate:
/**
* Convert line endings to `\n`
*/
declare function convertToLf(input: text): string;
/**
* Convert line endings to `\r\n`
*/
declare function convertToCrLf(input: text): string;
/**
* Functions for manipulating text.
*/
declare namespace Text {
export {
convertToLf,
convertToCrLf
}
}
## Standard questions
Please answer these questions to help us investigate your issue more quickly:
| Question | Answer |
| -------- | -------- |
| `@microsoft/api-extractor` version? | 7.54.0 |
| Operating system? | Linux |
| API Extractor scenario? | rollups (.d.ts) |
| Would you consider contributing a PR? | No |
| TypeScript compiler version? | 5.8.2 |
| Node.js version (`node -v`)? | 22.16.0 |Copilot
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Needs triage