Skip to content

[api-extractor] Empty declaration in API report for unexported element #2808

@hiranya911

Description

@hiranya911

Summary

We have an unexported interface declaration in one of our namespaces:

export namespace foo {
  interface Bar {
    name: string;
  }

  export interface BarEx extends Bar {
    score: number;
  }
}

This results in the following API report:

// @public (undocumented)
export namespace foo {
    // (undocumented)
    export interface Bar {
        // (undocumented)
        name: string;
    }
    // (undocumented)
    export interface BarEx extends Bar {
        // (undocumented)
        score: number;
    }
        {};
}

Notice the empty {}; line at the end. Exporting the interface Bar makes it go away.

Repro steps

See above.

Standard questions

Please answer these questions to help us investigate your issue more quickly:

Question Answer
@microsoft/api-extractor version? v7.18.x
Operating system? Mac / Linux
API Extractor scenario? reporting (.api.md)
TypeScript compiler version? 3.9.6
Node.js version (node -v)? v10 and up

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    AE/AD

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions