mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-23 18:19:12 +01:00
git: cleaner exports
This commit is contained in:
72
extensions/git/src/api/git.d.ts
vendored
72
extensions/git/src/api/git.d.ts
vendored
@@ -6,41 +6,43 @@
|
||||
import { Uri, SourceControlInputBox, Event, CancellationToken } from 'vscode';
|
||||
import * as cp from 'child_process';
|
||||
|
||||
declare module GitExtension {
|
||||
|
||||
export interface IExecResult<T extends string | Buffer> {
|
||||
readonly exitCode: number;
|
||||
readonly stdout: T;
|
||||
readonly stderr: string;
|
||||
}
|
||||
|
||||
export interface SpawnOptions extends cp.SpawnOptions {
|
||||
readonly input?: string;
|
||||
readonly encoding?: string;
|
||||
readonly log?: boolean;
|
||||
readonly cancellationToken?: CancellationToken;
|
||||
}
|
||||
|
||||
export interface API {
|
||||
readonly gitPath: string;
|
||||
readonly repositories: Repository[];
|
||||
readonly onDidOpenRepository: Event<Repository>;
|
||||
readonly onDidCloseRepository: Event<Repository>;
|
||||
|
||||
exec(cwd: string, args: string[], options?: SpawnOptions): Promise<IExecResult<string>>;
|
||||
spawn(cwd: string, args: string[], options?: SpawnOptions): cp.ChildProcess;
|
||||
}
|
||||
|
||||
export interface InputBox {
|
||||
value: string;
|
||||
}
|
||||
|
||||
export interface Repository {
|
||||
readonly rootUri: Uri;
|
||||
readonly inputBox: InputBox;
|
||||
}
|
||||
export interface ExecResult<T extends string | Buffer> {
|
||||
readonly exitCode: number;
|
||||
readonly stdout: T;
|
||||
readonly stderr: string;
|
||||
}
|
||||
|
||||
export interface SpawnOptions extends cp.SpawnOptions {
|
||||
readonly input?: string;
|
||||
readonly encoding?: string;
|
||||
readonly log?: boolean;
|
||||
readonly cancellationToken?: CancellationToken;
|
||||
}
|
||||
|
||||
export interface Git {
|
||||
readonly path: string;
|
||||
exec(cwd: string, args: string[], options?: SpawnOptions): Promise<ExecResult<string>>;
|
||||
spawn(cwd: string, args: string[], options?: SpawnOptions): cp.ChildProcess;
|
||||
}
|
||||
|
||||
export interface API {
|
||||
readonly git: Git;
|
||||
readonly repositories: Repository[];
|
||||
readonly onDidOpenRepository: Event<Repository>;
|
||||
readonly onDidCloseRepository: Event<Repository>;
|
||||
}
|
||||
|
||||
export interface InputBox {
|
||||
value: string;
|
||||
}
|
||||
|
||||
export interface Repository {
|
||||
readonly rootUri: Uri;
|
||||
readonly inputBox: InputBox;
|
||||
}
|
||||
|
||||
declare module GitExtension { }
|
||||
|
||||
export interface GitExtension {
|
||||
|
||||
/**
|
||||
@@ -50,14 +52,14 @@ export interface GitExtension {
|
||||
* @param range Semver version range for API compatibility.
|
||||
* @returns API instance
|
||||
*/
|
||||
getAPI(range: string): GitExtension.API;
|
||||
getAPI(range: string): API;
|
||||
|
||||
/**
|
||||
* Returns the collection of active repositories.
|
||||
*
|
||||
* @deprecated Use `API.repositories` instead.
|
||||
*/
|
||||
getRepositories(): Promise<GitExtension.Repository[]>;
|
||||
getRepositories(): Promise<Repository[]>;
|
||||
|
||||
/**
|
||||
* Returns the path to the current git executable.
|
||||
|
||||
Reference in New Issue
Block a user