|
|
@@ -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();
|
|
|
|