fix typescript errors, use wails models

This commit is contained in:
sawka 2024-05-21 11:46:54 -07:00
parent c203b6b376
commit 0eeacecc06
3 changed files with 2 additions and 17 deletions

View File

@ -5,7 +5,7 @@ import * as React from "react";
import * as jotai from "jotai"; import * as jotai from "jotai";
import { atoms, blockDataMap, useBlockAtom } from "@/store/global"; import { atoms, blockDataMap, useBlockAtom } from "@/store/global";
import { Markdown } from "@/element/markdown"; import { Markdown } from "@/element/markdown";
import { FileService } from "@/bindings/fileservice"; import { FileService, FileInfo, FullFile } from "@/bindings/fileservice";
import * as util from "@/util/util"; import * as util from "@/util/util";
import { CenteredDiv } from "../element/quickelems"; import { CenteredDiv } from "../element/quickelems";

View File

@ -49,7 +49,7 @@ function Widgets() {
async function createBlock(blockDef: BlockDef) { async function createBlock(blockDef: BlockDef) {
const rtOpts = { termsize: { rows: 25, cols: 80 } }; 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); const newBlockAtom = jotai.atom(rtnBlock);
blockDataMap.set(rtnBlock.blockid, newBlockAtom); blockDataMap.set(rtnBlock.blockid, newBlockAtom);
addBlockIdToTab(activeTabId, rtnBlock.blockid); addBlockIdToTab(activeTabId, rtnBlock.blockid);

View File

@ -33,21 +33,6 @@ declare global {
files?: FileDef[]; files?: FileDef[];
meta?: MetaDataType; 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 {}; export {};