Shun Miyazawa 1 سال پیش
والد
کامیت
5f78c87797
1فایلهای تغییر یافته به همراه3 افزوده شده و 2 حذف شده
  1. 3 2
      apps/app/src/features/openai/client/services/editor-assistant.ts

+ 3 - 2
apps/app/src/features/openai/client/services/editor-assistant.ts

@@ -6,6 +6,7 @@ import { GlobalCodeMirrorEditorKey } from '@growi/editor';
 import { acceptChange, rejectChange } from '@growi/editor/dist/client/services/unified-merge-view';
 import { useCodeMirrorEditorIsolated } from '@growi/editor/dist/client/stores/codemirror-editor';
 import { useSecondaryYdocs } from '@growi/editor/dist/client/stores/use-secondary-ydocs';
+import { type Text as YText } from 'yjs';
 
 import {
   SseMessageSchema,
@@ -40,7 +41,7 @@ type DetectedDiff = Array<{
   id: string,
 }>
 
-const insertTextAtLine = (ytext, lineNumber: number, textToInsert: string): void => {
+const insertTextAtLine = (ytext: YText, lineNumber: number, textToInsert: string): void => {
   // Get the entire text content
   const content = ytext.toString();
 
@@ -60,7 +61,7 @@ const insertTextAtLine = (ytext, lineNumber: number, textToInsert: string): void
 };
 
 
-const getLineInfo = (ytext, lineNumber: number): { text: string, startIndex: number, endIndex: number } | null => {
+const getLineInfo = (ytext: YText, lineNumber: number): { text: string, startIndex: number, endIndex: number } | null => {
   // Get the entire text content
   const content = ytext.toString();