-
Notifications
You must be signed in to change notification settings - Fork 259
Expand file tree
/
Copy pathtypes.ts
More file actions
41 lines (34 loc) · 1.64 KB
/
types.ts
File metadata and controls
41 lines (34 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// @NOTE : Please keep this file in sync with @sourcebot/web/src/features/search/types.ts
// At some point, we should move these to a shared package...
import {
fileSourceResponseSchema,
listReposQueryParamsSchema,
locationSchema,
searchRequestSchema,
searchResponseSchema,
rangeSchema,
fileSourceRequestSchema,
symbolSchema,
serviceErrorSchema,
listCommitsQueryParamsSchema,
listCommitsResponseSchema,
askCodebaseRequestSchema,
askCodebaseResponseSchema,
} from "./schemas.js";
import { z } from "zod";
export type SearchRequest = z.infer<typeof searchRequestSchema>;
export type SearchResponse = z.infer<typeof searchResponseSchema>;
export type SearchResultRange = z.infer<typeof rangeSchema>;
export type SearchResultLocation = z.infer<typeof locationSchema>;
export type SearchResultFile = SearchResponse["files"][number];
export type SearchResultChunk = SearchResultFile["chunks"][number];
export type SearchSymbol = z.infer<typeof symbolSchema>;
export type ListReposQueryParams = z.input<typeof listReposQueryParamsSchema>;
export type FileSourceRequest = z.infer<typeof fileSourceRequestSchema>;
export type FileSourceResponse = z.infer<typeof fileSourceResponseSchema>;
export type TextContent = { type: "text", text: string };
export type ServiceError = z.infer<typeof serviceErrorSchema>;
export type ListCommitsQueryParamsSchema = z.infer<typeof listCommitsQueryParamsSchema>;
export type ListCommitsResponse = z.infer<typeof listCommitsResponseSchema>;
export type AskCodebaseRequest = z.infer<typeof askCodebaseRequestSchema>;
export type AskCodebaseResponse = z.infer<typeof askCodebaseResponseSchema>;