mirror of
https://github.com/jaandrle/deka-dom-el
synced 2025-07-29 07:00:16 +02:00
🚧 mainly wc/ce
This commit is contained in:
28
dist/esm.d.ts
vendored
28
dist/esm.d.ts
vendored
@@ -166,6 +166,34 @@ export const scope: {
|
||||
pop(): ReturnType<Array<Scope>["pop"]>,
|
||||
};
|
||||
|
||||
/*
|
||||
* TODO TypeScript HACK (better way?)
|
||||
* this doesnt works
|
||||
* ```ts
|
||||
* interface element<el> extends Node{
|
||||
* prototype: el;
|
||||
* append(...els: (SupportedElement | DocumentFragment | string | element<SupportedElement | DocumentFragment>)[]): el
|
||||
* }
|
||||
*
|
||||
export function el<T>(
|
||||
* tag_name?: "<>",
|
||||
* ): element<DocumentFragment>
|
||||
* ```
|
||||
* …as its complains here
|
||||
* ```
|
||||
ts
|
||||
*
|
||||
const d= el("div");
|
||||
*
|
||||
const f= (a: HTMLDivElement)=> a;
|
||||
* f(d);
|
||||
//←
|
||||
* document.head.append( //←
|
||||
* el("script", { src: "https://flems.io/flems.html", type: "text/javascript", charset: "utf-8" }),
|
||||
* );
|
||||
* ```
|
||||
* TODO for SVG
|
||||
* */
|
||||
type ddeAppend<el>= (...nodes: (Node | string)[])=> el;
|
||||
declare global{
|
||||
interface HTMLAnchorElement{
|
||||
|
Reference in New Issue
Block a user