1.1.3 • Published 1 year ago

@punchly/dom v1.1.3

Weekly downloads
-
License
WTFPL
Repository
github
Last release
1 year ago

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

1.1.3

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.0

1 year ago