@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
70 lines • 2.74 kB
TypeScript
import { CancellationToken } from '../../../../base/common/cancellation';
import { Event } from '../../../../base/common/event';
import { IDisposable } from '../../../../base/common/lifecycle';
import { ChannelServer as IPCServer, IChannel, IChannelClient } from '../../../../base/parts/ipc/common/ipc';
/**
* This implementation doesn't perform well since it uses base64 encoding for buffers.
* We should move all implementations to use named ipc.net, so we stop depending on cp.fork.
*/
export declare class Server<TContext extends string> extends IPCServer<TContext> {
constructor(ctx: TContext);
}
export interface IIPCOptions {
/**
* A descriptive name for the server this connection is to. Used in logging.
*/
serverName: string;
/**
* Time in millies before killing the ipc process. The next request after killing will start it again.
*/
timeout?: number;
/**
* Arguments to the module to execute.
*/
args?: string[];
/**
* Environment key-value pairs to be passed to the process that gets spawned for the ipc.
*/
env?: any;
/**
* Allows to assign a debug port for debugging the application executed.
*/
debug?: number;
/**
* Allows to assign a debug port for debugging the application and breaking it on the first line.
*/
debugBrk?: number;
/**
* If set, starts the fork with empty execArgv. If not set, execArgv from the parent process are inherited,
* except --inspect= and --inspect-brk= which are filtered as they would result in a port conflict.
*/
freshExecArgv?: boolean;
/**
* Enables our createQueuedSender helper for this Client. Uses a queue when the internal Node.js queue is
* full of messages - see notes on that method.
*/
useQueue?: boolean;
}
export declare class Client implements IChannelClient, IDisposable {
private modulePath;
private options;
private disposeDelayer;
private activeRequests;
private child;
private _client;
private channels;
private readonly _onDidProcessExit;
readonly onDidProcessExit: Event<{
code: number;
signal: string;
}>;
constructor(modulePath: string, options: IIPCOptions);
getChannel<T extends IChannel>(channelName: string): T;
protected requestPromise<T>(channelName: string, name: string, arg?: any, cancellationToken?: CancellationToken): Promise<T>;
protected requestEvent<T>(channelName: string, name: string, arg?: any): Event<T>;
private get client();
private getCachedChannel;
private disposeClient;
dispose(): void;
}
//# sourceMappingURL=ipc.cp.d.ts.map