summaryrefslogtreecommitdiff
path: root/web/html.ts
diff options
context:
space:
mode:
authorJosh Kingsley <josh@joshkingsley.me>2025-10-25 20:46:35 +0300
committerJosh Kingsley <josh@joshkingsley.me>2025-10-25 22:09:48 +0300
commit5404a95c15e176d25728bf1a319ddb9828b23625 (patch)
tree639d175e15170618d36c0b22b3c8ad7764925175 /web/html.ts
parent2a4d7a7fc3b968ed8cdfd958a5e65fbe140042da (diff)
refactor(web): re-organize files
Diffstat (limited to 'web/html.ts')
-rw-r--r--web/html.ts26
1 files changed, 0 insertions, 26 deletions
diff --git a/web/html.ts b/web/html.ts
deleted file mode 100644
index 5bfff21..0000000
--- a/web/html.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-export type CreateElement<T extends HTMLElement> = {
- (...children: (Node | string)[]): T;
- (attrs: Partial<T>, ...children: (Node | string)[]): T;
-};
-
-type ElementCreator = {
- [K in keyof HTMLElementTagNameMap]: CreateElement<HTMLElementTagNameMap[K]>;
-};
-
-const h = new Proxy({} as ElementCreator, {
- get:
- (_, tag: string) =>
- (...args: any[]) => {
- const el = document.createElement(tag);
-
- if (typeof args[0] === "object") {
- Object.assign(el, args.shift());
- }
-
- el.append(...args.flat());
-
- return el;
- },
-});
-
-export default h;