open-wc / api-viewer-element

API documentation and live playground for Web Components. Based on Custom Elements Manifest format
https://api-viewer.open-wc.org
MIT License
270 stars 26 forks source link

Distinguish between static properties and instance properties #151

Open bennypowers opened 2 years ago

bennypowers commented 2 years ago

given

{
  "schemaVersion": "1.0.0",
  "readme": "",
  "modules": [
    {
      "kind": "javascript-module",
      "path": "rh-jazz-hands.js",
      "declarations": [
        {
          "kind": "class",
          "description": "Jazz Hands",
          "name": "RhJazzHands",
          "slots": [
            {
              "description": "Place element content here",
              "name": ""
            }
          ],
          "members": [
            {
              "kind": "field",
              "name": "version",
              "type": {
                "text": "string"
              },
              "static": true,
              "default": "1.0.0",
              "readonly": true
            },
            {
              "kind": "field",
              "name": "type",
              "type": {
                "text": "string"
              }
            }
          ],
          "superclass": {
            "name": "LitElement",
            "package": "lit"
          },
          "tagName": "rh-jazz-hands",
          "customElement": true
        }
      ],
      "exports": [
        {
          "kind": "js",
          "name": "RhJazzHands",
          "declaration": {
            "name": "RhJazzHands",
            "module": "rh-jazz-hands.js"
          }
        },
        {
          "kind": "custom-element-definition",
          "name": "rh-jazz-hands",
          "declaration": {
            "name": "RhJazzHands",
            "module": "rh-jazz-hands.js"
          }
        }
      ]
    }
  ]
}

Expected: in docs view, under 'Properties', version is listed as static

Actual: in docs view, under 'Properties', version is listed just like type

bendera commented 3 weeks ago

I think this can be closed now. :)