From a658e571ef245a200884ea96198c54188ae650da Mon Sep 17 00:00:00 2001 From: Josh Kingsley Date: Sat, 25 Oct 2025 16:24:53 +0300 Subject: feat(web): setup components --- web/index.ts | 38 +++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) (limited to 'web/index.ts') diff --git a/web/index.ts b/web/index.ts index a34c8b4..1524b04 100644 --- a/web/index.ts +++ b/web/index.ts @@ -1,5 +1,37 @@ -console.log("OK"); +interface Cell { + value: string; +} + +interface Row { + cells: Cell[]; +} + +interface Part { + rows: Row[]; +} + +interface Grid { + parts: Part[]; +} -function foo() { - return "foo"; +interface Doc { + grids: Grid[]; } + +function defaultDoc(): Doc { + const defaultCells = Array(16).map(() => ({ value: "1" })); + + return { + grids: [ + { parts: [{ rows: Array(4).map(() => ({ cells: [...defaultCells] })) }] }, + ], + }; +} + +export default class Notive { + doc: Doc = defaultDoc(); +} + +window.notive = new Notive(); + +window.dispatchEvent(new CustomEvent("ntv:initialized")); -- cgit v1.2.3