From 2110d861290eb3199dd4c242d220fc966b7917f2 Mon Sep 17 00:00:00 2001 From: RaviAnand Mohabir Date: Fri, 25 Apr 2025 16:09:31 +0200 Subject: [PATCH] fix: :label: move types to global.d.ts to include in global function --- src/FileOrganizer.tsx | 8 +------- src/global.d.ts | 32 +++++++++++++++++++++++++++++++- src/types.ts | 31 ------------------------------- 3 files changed, 32 insertions(+), 39 deletions(-) delete mode 100644 src/types.ts diff --git a/src/FileOrganizer.tsx b/src/FileOrganizer.tsx index 1576603..dcb6238 100644 --- a/src/FileOrganizer.tsx +++ b/src/FileOrganizer.tsx @@ -3,31 +3,25 @@ import { Button, Flex, Group, - Indicator, Pagination, - Progress, - Select, Stack, Text, TextInput, Title, - Tooltip, } from "@mantine/core"; import { Document, Page } from "react-pdf"; import { Form, isNotEmpty, useForm } from "@mantine/form"; import { createArchiveAndDownload, fileCategories, - getFileDataUrl, systemMessage, } from "./utils"; import { useCallback, useState } from "react"; import { ChatCompletionMessageParam } from "@mlc-ai/web-llm"; -import { CreateArchiveInput } from "./types"; +import type { CreateArchiveInput } from "./global.d"; import Dropzone from "./Dropzone"; import { FileWithPath } from "@mantine/dropzone"; -import { IconRobotFace } from "@tabler/icons-react"; import LLMPicker from "./LLMPicker"; import { useMLEngine } from "./MLEngineContext"; diff --git a/src/global.d.ts b/src/global.d.ts index 504636a..adfbf9f 100644 --- a/src/global.d.ts +++ b/src/global.d.ts @@ -1,3 +1,33 @@ -import { CreateArchiveInput } from "./types"; +export interface Customer { + firstName: string; + lastName: string; +} + +export interface Document { + id: string; + file: File; +} + +export interface CustomerFile { + id: string; + documents: CustomerDocument[]; + suffix: string; +} + +export interface CustomerDocument { + id: string; + selectedPages: string[]; +} + +export interface CreateArchiveInput { + customer: Customer; + documents: Document[]; + files: CustomerFile[]; +} + +export interface CreateArchiveResult { + resultArchive?: string; + error?: string; +} declare function createArchive(payload: CreateArchiveInput): Promise; diff --git a/src/types.ts b/src/types.ts deleted file mode 100644 index 1c9ca0a..0000000 --- a/src/types.ts +++ /dev/null @@ -1,31 +0,0 @@ -export interface Customer { - firstName: string; - lastName: string; -} - -export interface Document { - id: string; - file: File; -} - -export interface CustomerFile { - id: string; - documents: CustomerDocument[]; - suffix: string; -} - -export interface CustomerDocument { - id: string; - selectedPages: string[]; -} - -export interface CreateArchiveInput { - customer: Customer; - documents: Document[]; - files: CustomerFile[]; -} - -export interface CreateArchiveResult { - resultArchive?: string; - error?: string; -}