From ee537a781bdad5500ec56b67b58fb6b02b1e56d0 Mon Sep 17 00:00:00 2001 From: Seth Trowbridge Date: Sun, 19 Oct 2025 16:22:47 -0400 Subject: [PATCH] init --- deno.json | 8 ++++++++ main.ts | 34 ++++++++++++++++++++++++++++++++++ main_test.ts | 10 ++++++++++ 3 files changed, 52 insertions(+) create mode 100644 deno.json create mode 100644 main.ts create mode 100644 main_test.ts diff --git a/deno.json b/deno.json new file mode 100644 index 0000000..5b320c2 --- /dev/null +++ b/deno.json @@ -0,0 +1,8 @@ +{ + "tasks": { + "dev": "deno run --watch main.ts" + }, + "imports": { + "@std/assert": "jsr:@std/assert@1" + } +} diff --git a/main.ts b/main.ts new file mode 100644 index 0000000..eaccc1a --- /dev/null +++ b/main.ts @@ -0,0 +1,34 @@ +type EnumDefinition = Record; +type EnumBlock = Record; + +function Block(options:Fields):{[F in keyof Fields]:{[E in keyof Fields[F]]:Fields}} +{ + const list = []; + let fieldLookup = {}; + + const proxyOuter = new Proxy({}, {get(_target, propName){ + fieldLookup = options[propName]; + list.push(fieldLookup._); + return proxyInner + }}); + + const proxyInner = new Proxy({}, {get(_target, valName){ + list.push(`:${fieldLookup[valName]};`); + console.log(list); + return proxyOuter; + }}); + + return proxyOuter; +} + +const styles = Block({ + Pos:{_:"position", Abs:"absolute", Rel:"relative"}, + Display:{_:"display", Flex:"flex", Grid:"grid", None:"none", Block:"block", InlineBlock:"inline-block"} +}); + +export default styles + +function Sheet>(userClasses:UserClasses):{[Class in keyof UserClasses]:string} +{ + return new Proxy({}, {get(_target, className){}}); +} diff --git a/main_test.ts b/main_test.ts new file mode 100644 index 0000000..2a2c038 --- /dev/null +++ b/main_test.ts @@ -0,0 +1,10 @@ +import * as Test from "@std/assert"; + +Deno.test(function() + { + + Test.assertEquals(); + } +); + +