From 0eeacecc06038f066353fac3afcc660ec8b36b01 Mon Sep 17 00:00:00 2001 From: sawka Date: Tue, 21 May 2024 11:46:54 -0700 Subject: [PATCH] fix typescript errors, use wails models --- frontend/app/view/preview.tsx | 2 +- frontend/app/workspace/workspace.tsx | 2 +- frontend/types/custom.d.ts | 15 --------------- 3 files changed, 2 insertions(+), 17 deletions(-) diff --git a/frontend/app/view/preview.tsx b/frontend/app/view/preview.tsx index 894055d69..97b738f10 100644 --- a/frontend/app/view/preview.tsx +++ b/frontend/app/view/preview.tsx @@ -5,7 +5,7 @@ import * as React from "react"; import * as jotai from "jotai"; import { atoms, blockDataMap, useBlockAtom } from "@/store/global"; import { Markdown } from "@/element/markdown"; -import { FileService } from "@/bindings/fileservice"; +import { FileService, FileInfo, FullFile } from "@/bindings/fileservice"; import * as util from "@/util/util"; import { CenteredDiv } from "../element/quickelems"; diff --git a/frontend/app/workspace/workspace.tsx b/frontend/app/workspace/workspace.tsx index e14a984a9..9322f3a3e 100644 --- a/frontend/app/workspace/workspace.tsx +++ b/frontend/app/workspace/workspace.tsx @@ -49,7 +49,7 @@ function Widgets() { async function createBlock(blockDef: BlockDef) { const rtOpts = { termsize: { rows: 25, cols: 80 } }; - const rtnBlock: BlockData = await BlockService.CreateBlock(blockDef, rtOpts); + const rtnBlock: BlockData = (await BlockService.CreateBlock(blockDef, rtOpts)) as BlockData; const newBlockAtom = jotai.atom(rtnBlock); blockDataMap.set(rtnBlock.blockid, newBlockAtom); addBlockIdToTab(activeTabId, rtnBlock.blockid); diff --git a/frontend/types/custom.d.ts b/frontend/types/custom.d.ts index a67689421..f3f95c4c4 100644 --- a/frontend/types/custom.d.ts +++ b/frontend/types/custom.d.ts @@ -33,21 +33,6 @@ declare global { files?: FileDef[]; meta?: MetaDataType; }; - - type FileInfo = { - path: string; - notfound: boolean; - size: number; - mode: number; - modtime: number; - isdir: boolean; - mimetype: string; - }; - - type FullFile = { - info: FileInfo; - data64: string; - }; } export {};