Socket
Socket
Sign inDemoInstall

@types/webcomponents.js

Package Overview
Dependencies
0
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @types/webcomponents.js

TypeScript definitions for webcomponents.js


Version published
Weekly downloads
1.5K
decreased by-8.91%
Maintainers
1
Install size
5.61 kB
Created
Weekly downloads
 

Readme

Source

Installation

npm install --save @types/webcomponents.js

Summary

This package contains type definitions for webcomponents.js (https://github.com/webcomponents/webcomponentsjs).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/webcomponents.js.

index.d.ts

export interface CustomElementInit {
    prototype: HTMLElement;
    extends?: string | undefined;
}

export interface CustomElementConstructor {
    new(): HTMLElement;
}

export interface CustomElementsPolyfill {
    hasNative: boolean;
    flags: any;
    ready: boolean;
    useNative: boolean;
}

export interface HTMLImportsPolyfill {
    IMPORT_LINK_TYPE: string;
    isIE: boolean;
    flags: any;
    ready: boolean;
    rootDocument: Document;
    useNative: boolean;
    whenReady(callback: () => void): void;
}

export interface Polyfill {
    flags: any;
}

declare global {
    // This contains duplicates of some types in lib.dom.d.ts in order to support typescript 2.0
    interface ElementDefinitionOptions {
        extends?: string | undefined;
    }

    interface ShadowRoot extends DocumentFragment {
        innerHTML: string;
        readonly host: Element;
    }

    interface CustomElementRegistry {
        define(name: string, constructor: Function, options?: ElementDefinitionOptions): void;
        get(name: string): any;
        whenDefined(name: string): PromiseLike<void>;
    }

    interface Element {
        createShadowRoot(): ShadowRoot;
        readonly shadowRoot: ShadowRoot | null;
    }

    interface Document {
        registerElement(name: string, prototype: CustomElementInit): CustomElementConstructor;
    }

    interface Window {
        CustomElements: CustomElementsPolyfill;
        HTMLImports: HTMLImportsPolyfill;
        WebComponents: Polyfill;

        readonly customElements: CustomElementRegistry;
    }
}

Additional Details

  • Last updated: Tue, 07 Nov 2023 15:11:36 GMT
  • Dependencies: none

Credits

These definitions were written by Adi Dahiya.

FAQs

Last updated on 07 Nov 2023

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc