Skip to content

Need a way to document module namespace objects #447

@dmichon-msft

Description

@dmichon-msft

Problem

API-Extractor and TSDoc support adding a documentation comment to the entry point module, but not to individual re-exported modules. Modern bundlers and other tooling vastly prefer module namespace objects over static classes because they can be fully statically analyzed and tree-shaken. However, the current model does not provide a way to apply a documentation comment to an individual module that gets applied to the module namespace object (the result of import * as ... or export * as ... expressions).

functions/foo.ts

export function foo();

functions/index.ts

export { foo } from './foo';

Functions.ts

import * as Functions from './functions/index';
// How do I put a comment on this export?
export { Functions };

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions