runem / web-component-analyzer

CLI that analyzes web components and emits documentation
https://runem.github.io/web-component-analyzer
MIT License
501 stars 63 forks source link

Methods should be a ComponentMember, attributes should be separate. #154

Open justinfagnani opened 4 years ago

justinfagnani commented 4 years ago

Properties and methods are actual members of the component class. Attributes are not represented in the JavaScript object model. The current organization of properties and attributes being collected into members and methods being separate doesn't match this.

I would suggest the following reorganization:

export type ComponentMemberKind = "property" | "method";

export type ComponentMember = ComponentMemberProperty | ComponentMemberMethod;

export interface ComponentFeatures {
  members: ComponentMember[];
  attributes: ComponentAttribute[];
  events: ComponentEvent[];
  slots: ComponentSlot[];
  cssProperties: ComponentCssProperty[];
  cssParts: ComponentCssPart[];
}