|
| 1 | +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. |
| 2 | + |
| 3 | +import { APIResource } from '../core/resource'; |
| 4 | +import { APIPromise } from '../core/api-promise'; |
| 5 | +import { RequestOptions } from '../internal/request-options'; |
| 6 | + |
| 7 | +export class Find extends APIResource { |
| 8 | + /** |
| 9 | + * Find files |
| 10 | + */ |
| 11 | + files(query: FindFilesParams, options?: RequestOptions): APIPromise<FindFilesResponse> { |
| 12 | + return this._client.get('/find/file', { query, ...options }); |
| 13 | + } |
| 14 | + |
| 15 | + /** |
| 16 | + * Find workspace symbols |
| 17 | + */ |
| 18 | + symbols(query: FindSymbolsParams, options?: RequestOptions): APIPromise<FindSymbolsResponse> { |
| 19 | + return this._client.get('/find/symbol', { query, ...options }); |
| 20 | + } |
| 21 | + |
| 22 | + /** |
| 23 | + * Find text in files |
| 24 | + */ |
| 25 | + text(query: FindTextParams, options?: RequestOptions): APIPromise<FindTextResponse> { |
| 26 | + return this._client.get('/find', { query, ...options }); |
| 27 | + } |
| 28 | +} |
| 29 | + |
| 30 | +export type FindFilesResponse = Array<string>; |
| 31 | + |
| 32 | +export type FindSymbolsResponse = Array<unknown>; |
| 33 | + |
| 34 | +export type FindTextResponse = Array<FindTextResponse.FindTextResponseItem>; |
| 35 | + |
| 36 | +export namespace FindTextResponse { |
| 37 | + export interface FindTextResponseItem { |
| 38 | + absolute_offset: number; |
| 39 | + |
| 40 | + line_number: number; |
| 41 | + |
| 42 | + lines: FindTextResponseItem.Lines; |
| 43 | + |
| 44 | + path: FindTextResponseItem.Path; |
| 45 | + |
| 46 | + submatches: Array<FindTextResponseItem.Submatch>; |
| 47 | + } |
| 48 | + |
| 49 | + export namespace FindTextResponseItem { |
| 50 | + export interface Lines { |
| 51 | + text: string; |
| 52 | + } |
| 53 | + |
| 54 | + export interface Path { |
| 55 | + text: string; |
| 56 | + } |
| 57 | + |
| 58 | + export interface Submatch { |
| 59 | + end: number; |
| 60 | + |
| 61 | + match: Submatch.Match; |
| 62 | + |
| 63 | + start: number; |
| 64 | + } |
| 65 | + |
| 66 | + export namespace Submatch { |
| 67 | + export interface Match { |
| 68 | + text: string; |
| 69 | + } |
| 70 | + } |
| 71 | + } |
| 72 | +} |
| 73 | + |
| 74 | +export interface FindFilesParams { |
| 75 | + query: string; |
| 76 | +} |
| 77 | + |
| 78 | +export interface FindSymbolsParams { |
| 79 | + query: string; |
| 80 | +} |
| 81 | + |
| 82 | +export interface FindTextParams { |
| 83 | + pattern: string; |
| 84 | +} |
| 85 | + |
| 86 | +export declare namespace Find { |
| 87 | + export { |
| 88 | + type FindFilesResponse as FindFilesResponse, |
| 89 | + type FindSymbolsResponse as FindSymbolsResponse, |
| 90 | + type FindTextResponse as FindTextResponse, |
| 91 | + type FindFilesParams as FindFilesParams, |
| 92 | + type FindSymbolsParams as FindSymbolsParams, |
| 93 | + type FindTextParams as FindTextParams, |
| 94 | + }; |
| 95 | +} |
0 commit comments