Skip to content

Commit 3fb1941

Browse files
committed
refactor: Rename interface to PascalCase
1 parent fe2cb05 commit 3fb1941

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

examples/server/webui/src/components/ChatScreen.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { classNames, cleanCurrentUrl, throttle } from '../utils/misc';
66
import CanvasPyInterpreter from './CanvasPyInterpreter';
77
import StorageUtils from '../utils/storage';
88
import { useVSCodeContext } from '../utils/llama-vscode';
9-
import { useChatTextarea, chatTextareaApi } from './useChatTextarea.ts';
9+
import { useChatTextarea, ChatTextareaApi } from './useChatTextarea.ts';
1010

1111
/**
1212
* A message display is a message node with additional information for rendering.
@@ -101,7 +101,7 @@ export default function ChatScreen() {
101101
replaceMessageAndGenerate,
102102
} = useAppContext();
103103

104-
const textarea: chatTextareaApi = useChatTextarea(prefilledMsg.content());
104+
const textarea: ChatTextareaApi = useChatTextarea(prefilledMsg.content());
105105

106106
const { extraContext, clearExtraContext } = useVSCodeContext(textarea);
107107
// TODO: improve this when we have "upload file" feature

examples/server/webui/src/components/useChatTextarea.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const adjustTextareaHeight = (textarea: HTMLTextAreaElement | null) => {
3232
};
3333

3434
// Interface describing the API returned by the hook
35-
export interface chatTextareaApi {
35+
export interface ChatTextareaApi {
3636
value: () => string;
3737
setValue: (value: string) => void;
3838
focus: () => void;
@@ -43,7 +43,7 @@ export interface chatTextareaApi {
4343
// This is a workaround to prevent the textarea from re-rendering when the inner content changes
4444
// See https://github.com/ggml-org/llama.cpp/pull/12299
4545
// combined now with auto-sizing logic.
46-
export function useChatTextarea(initValue: string): chatTextareaApi {
46+
export function useChatTextarea(initValue: string): ChatTextareaApi {
4747
const [savedInitValue, setSavedInitValue] = useState<string>(initValue);
4848
const textareaRef = useRef<HTMLTextAreaElement>(null);
4949

examples/server/webui/src/utils/llama-vscode.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useEffect, useState } from 'react';
22
import { MessageExtraContext } from './types';
3-
import { chatTextareaApi } from '../components/useChatTextarea.ts';
3+
import { ChatTextareaApi } from '../components/useChatTextarea.ts';
44

55
// Extra context when using llama.cpp WebUI from llama-vscode, inside an iframe
66
// Ref: https://github.com/ggml-org/llama.cpp/pull/11940
@@ -15,7 +15,7 @@ interface SetTextEvData {
1515
* window.postMessage({ command: 'setText', text: 'Spot the syntax error', context: 'def test()\n return 123' }, '*');
1616
*/
1717

18-
export const useVSCodeContext = (textarea: chatTextareaApi) => {
18+
export const useVSCodeContext = (textarea: ChatTextareaApi) => {
1919
const [extraContext, setExtraContext] = useState<MessageExtraContext | null>(
2020
null
2121
);

0 commit comments

Comments
 (0)