sourcebot/src/lib/types.ts
2024-08-27 21:00:59 -07:00

42 lines
No EOL
759 B
TypeScript

export const pathQueryParamName = "path";
export const repoQueryParamName = "repo";
export type GetSourceResponse = {
content: string;
}
export interface ZoektMatch {
URL: string,
FileName: string,
LineNum: number,
Fragments: {
Pre: string,
Match: string,
Post: string
}[]
}
export interface ZoektFileMatch {
FileName: string,
Repo: string,
Language: string,
Matches: ZoektMatch[],
URL: string,
}
export interface ZoektResult {
QueryStr: string,
FileMatches: ZoektFileMatch[] | null,
Stats: {
// Duration in nanoseconds
Duration: number,
}
}
export interface ZoektSearchResponse {
result: ZoektResult,
}
export type KeymapType = "default" | "vim";