From ef1201f753b2af50dc7de4c36395ee0ad7853735 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Sat, 14 Mar 2026 00:13:36 +0100 Subject: [PATCH] Add types for AI action request and related components --- src/App.tsx | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/App.tsx b/src/App.tsx index fa6227d..b79db5e 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -134,8 +134,29 @@ type AiPromptTemplate = { openPreviewOnSuccess?: boolean; }; +type AiEditScope = "document" | "selection"; + +type AiSelection = { + from: number; + to: number; + text: string; +}; + type AiActionRequest = { template: AiPromptTemplate; + scope?: AiEditScope; + selection?: AiSelection | null; +}; + +type PendingAiScopeChoice = { + template: AiPromptTemplate | null; + selection: AiSelection; + isCustomPrompt: boolean; +}; + +type CustomPromptState = { + scope: AiEditScope; + selection: AiSelection | null; }; const DEFAULT_TITLE = "Untitled Text";