diff --git a/app.js b/app.js index e2d3cff..c5a91ce 100644 --- a/app.js +++ b/app.js @@ -12,4 +12,8 @@ const sheet = Styles({ Outline:{border:"2px solid orange"} }); -const el = sheet.dom.div.Button.Outline(); \ No newline at end of file +const el = sheet.dom.a.Button.Outline({onclick(){console.log("clicked!")}}, "Click!"); +console.log(el); + + +van.add(document.body, el, sheet.dom.p.Outline("paragraph!")); \ No newline at end of file diff --git a/deno.json b/deno.json index 64c4916..bee32bd 100644 --- a/deno.json +++ b/deno.json @@ -5,6 +5,6 @@ "deno.window", "DOM" ], - "types": ["./drill.d.ts"] + "types": ["./drill.d.ts", "./types.d.ts"] } } \ No newline at end of file diff --git a/drill.d.ts b/drill.d.ts index d42b16a..eb905e5 100644 --- a/drill.d.ts +++ b/drill.d.ts @@ -3,10 +3,9 @@ export {} declare global { namespace Gale { - type Invoker =()=>HTMLElement - type Elemental = {[K in keyof HTMLElementTagNameMap]: Circular} - type Circular = { - [K in Keys]: Circular&Invoker; + type Elemental = {[K in keyof HTMLElementTagNameMap]: Circular} + type Circular = { + [K in Keys]: Circular&Van.TagFunc; }; } } \ No newline at end of file diff --git a/index.html b/index.html index 6c1c4d7..0b78f94 100644 --- a/index.html +++ b/index.html @@ -5,6 +5,7 @@ Document + \ No newline at end of file diff --git a/styles.dev.js b/styles.dev.js index f934bf7..a26253d 100644 --- a/styles.dev.js +++ b/styles.dev.js @@ -57,7 +57,12 @@ function MakeElemental(ref) let pending = false; let classes = []; - const collector = new Proxy(()=>{console.log("original func invoked!", pending, classes)}, + const collector = new Proxy((...args)=>{ + console.log("original func invoked!", pending, classes); + const element = van.tags[pending](...args); + element.className = classes.join(" "); + return element + }, { get(target, prop, rec) {