1
0
mirror of https://github.com/jaandrle/deka-dom-el synced 2026-01-11 16:26:28 +01:00

💥 WIP custom elements docs and types and utils

This commit is contained in:
2024-01-09 21:18:43 +01:00
parent 91f8c96eac
commit 13c75fede1
14 changed files with 141 additions and 8 deletions

12
index.d.ts vendored
View File

@@ -175,6 +175,18 @@ export const scope: {
pop(): ReturnType<Array<Scope>["pop"]>,
};
export function customElementRender<
EL extends HTMLElement,
P extends any = Record<string, any>
>(
custom_element: EL,
render: (props: P)=> SupportedElement,
props?: P | ((...args: any[])=> P)
): EL
export function customElementWithDDE<EL extends HTMLElement>(custom_element: EL): EL
export function lifecycleToEvents<EL extends HTMLElement>(custom_element: EL): EL
export function observedAttributes(custom_element: HTMLElement): Record<string, string>
/* TypeScript MEH // TODO for SVG */
type ddeAppend<el>= (...nodes: (Node | string)[])=> el;
declare global{