Skip to content

bajtos/bug-api-extractor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Consider code that defines both a class and an interface with the same name. This approach is the recommended - if not the only - way how to describe events emitted by subclasses of Node.js EventEmitter, as explained on StackOverflow.

export class MyWidget extends EventEmitter {
  // class implementation goes here
}

export interface MyWidget {
  // `on()` and `once()` declarations for MyWidget events
}

The package api-extractor recognizes both artifact types and emits a class and an interface entry in the .api.json file.

{
  // ...
  "members": [
    {
      "kind": "Class",
      "name": "MyWidget"
      // ...
    },
    {
      "kind": "Interface",
      "name": "MyWidget"
      // ...
    }
  ]
}

When rendered using api-documenter, the index file shows two entries:

index page

Both entries point to the same page mywidget.md. This page describes only interface members, ignoring the members implemented by the class.

widget docs

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published