You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 regels
1.3 KiB

  1. import type { GitCommandOptions } from '../git/commandOptions';
  2. // eslint-disable-next-line @typescript-eslint/no-unused-vars
  3. export class RequestType<Request, Response> {
  4. constructor(public readonly name: string) {}
  5. }
  6. export interface GitCommandRequest {
  7. options: GitCommandOptions;
  8. args: any[];
  9. }
  10. export interface GitCommandResponse {
  11. data: string;
  12. isBuffer?: boolean;
  13. }
  14. export const GitCommandRequestType = new RequestType<GitCommandRequest, GitCommandResponse>('git');
  15. export interface GitLogStreamToCommandRequest {
  16. repoPath: string;
  17. sha: string;
  18. limit: number;
  19. options?: { configs?: readonly string[]; stdin?: string };
  20. args: string[];
  21. }
  22. export interface GitLogStreamToCommandResponse {
  23. data: string[];
  24. count: number;
  25. }
  26. export const GitLogStreamToCommandRequestType = new RequestType<
  27. GitLogStreamToCommandRequest,
  28. GitLogStreamToCommandResponse
  29. >('git/logStreamTo');
  30. export interface RepositoryProxy {
  31. folderUri: string;
  32. /** @deprecated */
  33. path?: string;
  34. root: boolean;
  35. closed: boolean;
  36. }
  37. export interface GetRepositoriesForUriRequest {
  38. folderUri: string;
  39. }
  40. export interface GetRepositoriesForUriResponse {
  41. repositories: RepositoryProxy[];
  42. }
  43. export const GetRepositoriesForUriRequestType = new RequestType<
  44. GetRepositoriesForUriRequest,
  45. GetRepositoriesForUriResponse
  46. >('repositories/inFolder');