فهرست منبع

tmp structure

reiji-h 2 سال پیش
والد
کامیت
10360c1d06
1فایلهای تغییر یافته به همراه8 افزوده شده و 1 حذف شده
  1. 8 1
      packages/editor/src/stores/codemirror-editor.ts

+ 8 - 1
packages/editor/src/stores/codemirror-editor.ts

@@ -1,4 +1,4 @@
-import { useMemo } from 'react';
+import { useCallback, useMemo } from 'react';
 
 
 import { type Extension } from '@codemirror/state';
 import { type Extension } from '@codemirror/state';
 import { scrollPastEnd } from '@codemirror/view';
 import { scrollPastEnd } from '@codemirror/view';
@@ -15,6 +15,7 @@ const defaultExtensionsMain: Extension[] = [
 
 
 type MainEditorUtils = {
 type MainEditorUtils = {
   // impl something
   // impl something
+  setIndentSize: (indentSize?: number) => void,
 };
 };
 
 
 export const useCodeMirrorEditorMain = (container?: HTMLDivElement | null): SWRResponseWithUtils<MainEditorUtils, UseCodeMirrorEditorResponse> => {
 export const useCodeMirrorEditorMain = (container?: HTMLDivElement | null): SWRResponseWithUtils<MainEditorUtils, UseCodeMirrorEditorResponse> => {
@@ -30,7 +31,13 @@ export const useCodeMirrorEditorMain = (container?: HTMLDivElement | null): SWRR
 
 
   const swrResponse = useSWRStatic('codeMirrorEditorMain', container != null ? states : undefined);
   const swrResponse = useSWRStatic('codeMirrorEditorMain', container != null ? states : undefined);
 
 
+  // implement setIndentSize method
+  const setIndentSize = useCallback((indentSize?: number): void => {
+
+  }, []);
+
   return withUtils(swrResponse, {
   return withUtils(swrResponse, {
     // impl something
     // impl something
+    setIndentSize,
   });
   });
 };
 };