mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-20 01:04:22 +01:00
fix: better file/content return
This commit is contained in:
@@ -1117,10 +1117,30 @@ export type Symbol = {
|
||||
export type FileNode = {
|
||||
name: string
|
||||
path: string
|
||||
absolute: string
|
||||
type: "file" | "directory"
|
||||
ignored: boolean
|
||||
}
|
||||
|
||||
export type FileContent = {
|
||||
content: string
|
||||
diff?: string
|
||||
patch?: {
|
||||
oldFileName: string
|
||||
newFileName: string
|
||||
oldHeader?: string
|
||||
newHeader?: string
|
||||
hunks: Array<{
|
||||
oldStart: number
|
||||
oldLines: number
|
||||
newStart: number
|
||||
newLines: number
|
||||
lines: Array<string>
|
||||
}>
|
||||
index?: string
|
||||
}
|
||||
}
|
||||
|
||||
export type File = {
|
||||
path: string
|
||||
added: number
|
||||
@@ -1893,10 +1913,7 @@ export type FileReadResponses = {
|
||||
/**
|
||||
* File content
|
||||
*/
|
||||
200: {
|
||||
type: "raw" | "patch"
|
||||
content: string
|
||||
}
|
||||
200: FileContent
|
||||
}
|
||||
|
||||
export type FileReadResponse = FileReadResponses[keyof FileReadResponses]
|
||||
|
||||
Reference in New Issue
Block a user