@pkerschbaum/code-oss-file-service
Version:
VS Code ([microsoft/vscode](https://github.com/microsoft/vscode)) includes a rich "`FileService`" and "`DiskFileSystemProvider`" abstraction built on top of Node.js core modules (`fs`, `path`) and Electron's `shell` module. This package allows to use that
60 lines • 3.31 kB
TypeScript
/// <reference types="node" />
import * as cp from 'child_process';
import * as Platform from '../../base/common/platform';
import { CommandOptions, Executable, ForkOptions, Source, SuccessData, TerminateResponse, TerminateResponseCode } from '../../base/common/processes';
export { CommandOptions, ForkOptions, SuccessData, Source, TerminateResponse, TerminateResponseCode };
export declare type ValueCallback<T> = (value: T | Promise<T>) => void;
export declare type ErrorCallback = (error?: any) => void;
export declare type ProgressCallback<T> = (progress: T) => void;
export interface LineData {
line: string;
source: Source;
}
/**
* Remove dangerous environment variables that have caused crashes
* in forked processes (i.e. in ELECTRON_RUN_AS_NODE processes)
*
* @param env The env object to change
*/
export declare function removeDangerousEnvVariables(env: NodeJS.ProcessEnv | undefined): void;
export declare function getWindowsShell(env?: Platform.IProcessEnvironment): string;
export declare abstract class AbstractProcess<TProgressData> {
private cmd;
private args;
private options;
protected shell: boolean;
private childProcess;
protected childProcessPromise: Promise<cp.ChildProcess> | null;
private pidResolve;
protected terminateRequested: boolean;
private static WellKnowCommands;
constructor(executable: Executable);
constructor(cmd: string, args: string[] | undefined, shell: boolean, options: CommandOptions | undefined);
getSanitizedCommand(): string;
start(pp: ProgressCallback<TProgressData>): Promise<SuccessData>;
protected abstract handleExec(cc: ValueCallback<SuccessData>, pp: ProgressCallback<TProgressData>, error: Error | null, stdout: Buffer, stderr: Buffer): void;
protected abstract handleSpawn(childProcess: cp.ChildProcess, cc: ValueCallback<SuccessData>, pp: ProgressCallback<TProgressData>, ee: ErrorCallback, sync: boolean): void;
protected handleClose(data: any, cc: ValueCallback<SuccessData>, pp: ProgressCallback<TProgressData>, ee: ErrorCallback): void;
private static readonly regexp;
private ensureQuotes;
get pid(): Promise<number>;
terminate(): Promise<TerminateResponse>;
private useExec;
}
export declare class LineProcess extends AbstractProcess<LineData> {
private stdoutLineDecoder;
private stderrLineDecoder;
constructor(executable: Executable);
constructor(cmd: string, args: string[], shell: boolean, options: CommandOptions);
protected handleExec(cc: ValueCallback<SuccessData>, pp: ProgressCallback<LineData>, error: Error, stdout: Buffer, stderr: Buffer): void;
protected handleSpawn(childProcess: cp.ChildProcess, cc: ValueCallback<SuccessData>, pp: ProgressCallback<LineData>, ee: ErrorCallback, sync: boolean): void;
protected handleClose(data: any, cc: ValueCallback<SuccessData>, pp: ProgressCallback<LineData>, ee: ErrorCallback): void;
}
export interface IQueuedSender {
send: (msg: any) => void;
}
export declare function createQueuedSender(childProcess: cp.ChildProcess): IQueuedSender;
export declare namespace win32 {
function findExecutable(command: string, cwd?: string, paths?: string[]): Promise<string>;
}
//# sourceMappingURL=processes.d.ts.map