🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

cem-plugin-type-descriptions-markdown

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cem-plugin-type-descriptions-markdown

Append markdown descriptions to types

latest
Source
npmnpm
Version
0.0.4
Version published
Weekly downloads
54
58.82%
Maintainers
1
Weekly downloads
 
Created
Source

cem-plugin-type-descriptions-markdown

Appends Markdown documents to function parameter and return types and class field types.

Options

OptionTypeRequiredDescription
typeTablesDirstringyesAbsolute path to the directory holding the type docs.
quietboolnoSuppress logs

Example

custom-elements-manifest.config.js

import { fileURLToPath } from 'url';
import { typeDescriptionsMarkdownPlugin } from 'cem-plugin-type-descriptions-markdown';

export default {
  plugins: [
    typeDescriptionsMarkdownPlugin({
      typeTablesDir: fileURLToPath(new URL('../../docs/type-tables/', import.meta.url)),
    }),
  ]
}

docs/type-tables/BigBagOfProperties.md

| Option     | Type   | Description |
| ---------- | ------ | ----------- |
| name       | string | The name of the thing |
| shoeSize   | number | Act your age |

src/shoe-sizer.ts

interface BigBagOfProperties {
  name?: string;
  shoeSize?: number;
}

/** @element shoe-sizer */
export class ShoeSizer {
  /** @summary Shoe Size options */
  declare options: BigBagOfProperties;
}

Output

{
  "schemaVersion": "1.0.0",
  "readme": "",
  "modules": [
    {
      "kind": "javascript-module",
      "path": "src/shoe-sizer.js",
      "declarations": [
        {
          "kind": "class",
          "name": "ShoeSizer",
          "description": "",
          "members": [
            {
              "kind": "field",
              "name": "options",
              "summary": "Shoe Size options",
              "description": "| Option     | Type   | Description |\n| ---------- | ------ | ----------- |\n| name       | string | The name of the thing |\n| shoeSize   | number | Act your age |",
              "type": {
                "text": "BigBagOfProperties"
              }
            }
          ],
          "tagName": "shoe-sizer",
          "customElement": true
        }
      ],
      "exports": [
        {
          "kind": "js",
          "name": "ShoeSizer",
          "declaration": {
            "name": "ShoeSizer",
            "module": "src/shoe-sizer.js"
          }
        }
      ]
    }
  ]
}

Keywords

custom-elements-manifest

FAQs

Package last updated on 23 Mar 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts