Browse Source

imprv hook type

Shun Miyazawa 1 year ago
parent
commit
fa6b626481

+ 8 - 1
apps/app/src/features/openai/client/services/editor-assistant.ts

@@ -40,7 +40,14 @@ type DetectedDiff = Array<{
   id: string,
   id: string,
 }>
 }>
 
 
-export const useEditorAssistant = (): {postMessage: PostMessage, processMessage: ProcessMessage, accept: () => void, reject: () => void } => {
+type UseEditorAssistant = () => {
+  postMessage: PostMessage,
+  processMessage: ProcessMessage,
+  accept: () => void,
+  reject: () => void,
+}
+
+export const useEditorAssistant: UseEditorAssistant = () => {
   const positionRef = useRef<number>(0);
   const positionRef = useRef<number>(0);
 
 
   const [detectedDiff, setDetectedDiff] = useState<DetectedDiff>();
   const [detectedDiff, setDetectedDiff] = useState<DetectedDiff>();