This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@punchly/proxy
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

DOM

生成各种 DOM 节点.

start

npm i @punchly/dom

api

DOM

DOM.PROPERTIES

Symbol('PROPERTIES')

DOM.$(...args)

{
    (str: string): HTMLCollection;
    (node: ParentNode, ...children: (string | Node)[]): readonly Node[] & {
        children: HTMLCollection;
    }; // Return[0] = node;
}

DOM.$[tagName](attrs, children)

{
    (attrs?: Attr, children?: ArrayLike<string | Node>) => HTMLElementTagNameMap[tagName];
}

type Attr = {
    [qualifiedName: string]: string;
} & {
    [PROPERTIES]: {...};
    class: string[];
    style: CSSStyleDeclaration;
};

Style

new Style(styleSheet, parentNode) / Style(...)

{
    new (styleSheet: StyleSheets, parentNode?: Node = document.head): {
        readonly node: HTMLStyleElement;
        insert(selector: string): {
            index: number;
            rule: CSSStyleRule;
        };
        insertRule(styleSheet: StyleSheets): HTMLStyleElement;
    }
    (styleSheet: StyleSheets, parentNode?: Node): ...;
}

type StyleSheets = {
    [selector: string]: CSSStyleDeclaration;
} & {
    [AT]: {
        [identifier: string]: string;
        [identifier: string]: [rule: string];
        [identifier: string]: [rule: string, cssBlock: {
            [selector: string]: CSSStyleDeclaration;
        }];
    };
};

Selector

Readme

Keywords

none

Package Sidebar

Install

npm i @punchly/proxy

Weekly Downloads

0

Version

1.0.5

License

WTFPL

Unpacked Size

9.15 kB

Total Files

26

Last publish

Collaborators

  • punchly