New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

cem-plugin-define

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cem-plugin-define

Enhance custom-element-definition exports

canary
latest
Source
npmnpm
Version
0.1.1
Version published
Weekly downloads
2
-50%
Maintainers
0
Weekly downloads
 
Created
Source

cem-plugin-define

Enhance custom-element-definition exports.

cem config

import { jsDocDefine, moduleDeclarationDefine } from "cem-plugin-define";

export default {
  plugins: [
    jsDocDefine(
      /* Specify the doc tag. */
      "define",
    ),
    moduleDeclarationDefine(),
  ],
};

JSDoc comments and module declarations can be placed anywhere.

Tag name and element identifier need to be provided together.

class MyElement extends HTMLElement {}

/**
 * Using jsDocDefine:
 *
 * Specify the element name and identifier through a JSDoc.
 *
 * @define my-element {@link MyElement}
 */

/**
 * Using moduleDeclarationDefine:
 *
 * Globally Declare the element name and type in HTMLElementTagNameMap.
 */
declare global {
  interface HTMLElementTagNameMap {
    "my-element": MyElement;
  }
}

Computed property

Only string literal accepted.

declare global {
  interface HTMLElementTagNameMap {
    ["my-element"]: MyElement;
  }
}

Keywords

custom-elements-manifest

FAQs

Package last updated on 07 Nov 2024

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