🎉 initial commit
This commit is contained in:
36
src/renderer/types/editor.ts
Normal file
36
src/renderer/types/editor.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
export interface FileNode {
|
||||
name: string
|
||||
path: string
|
||||
type: 'file' | 'directory'
|
||||
children?: FileNode[]
|
||||
}
|
||||
|
||||
export interface ChatMessage {
|
||||
id: string
|
||||
role: 'user' | 'assistant'
|
||||
content: string
|
||||
}
|
||||
|
||||
export type AnnotationType = 'passive_voice' | 'consistency' | 'style'
|
||||
|
||||
export interface TextAnnotation {
|
||||
id: string
|
||||
type: AnnotationType
|
||||
from: number
|
||||
to: number
|
||||
matchedText: string
|
||||
message: string
|
||||
suggestion?: string
|
||||
}
|
||||
|
||||
export type AnalysisMode = 'none' | 'passive_voice' | 'consistency' | 'style'
|
||||
|
||||
export type AIMode = 'chat' | 'passive_voice' | 'consistency' | 'style'
|
||||
|
||||
export interface AIPayload {
|
||||
mode: AIMode
|
||||
documentContent: string
|
||||
documentPath: string
|
||||
conversationHistory: Array<{ role: 'user' | 'assistant'; content: string }>
|
||||
userMessage: string
|
||||
}
|
||||
16
src/renderer/types/global.d.ts
vendored
Normal file
16
src/renderer/types/global.d.ts
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
import type { FileNode, AIPayload } from './editor'
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
api: {
|
||||
listFiles: () => Promise<FileNode[]>
|
||||
readFile: (filePath: string) => Promise<string>
|
||||
writeFile: (filePath: string, content: string) => Promise<void>
|
||||
streamAIMessage: (
|
||||
payload: AIPayload,
|
||||
onChunk: (chunk: string) => void
|
||||
) => Promise<void>
|
||||
removeAIListener: () => void
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user