simple-git
Version:
Simple GIT interface for node.js
52 lines • 1.77 kB
TypeScript
import type { ChildProcess, SpawnOptions } from 'child_process';
import type { GitExecutorResult } from '../types';
export type SimpleGitTaskPluginContext = {
readonly method: string;
readonly commands: string[];
/** Environment variables supplied through `.env()` on the executor - not the ambient environment. */
readonly env: NodeJS.ProcessEnv;
/** Content to write to stdIn for just this task, can be overridden with the `input` plugin. */
readonly input: string | Buffer | undefined;
};
export interface SimpleGitPluginTypes {
'spawn.args': {
data: string[];
context: SimpleGitTaskPluginContext & {
env: Record<string, string | undefined>;
};
};
'spawn.binary': {
data: string;
context: SimpleGitTaskPluginContext & {};
};
'spawn.options': {
data: Partial<SpawnOptions>;
context: SimpleGitTaskPluginContext & {};
};
'spawn.before': {
data: void;
context: SimpleGitTaskPluginContext & {
kill(reason: Error): void;
};
};
'spawn.after': {
data: void;
context: SimpleGitTaskPluginContext & {
spawned: ChildProcess;
close(exitCode: number, reason?: Error): void;
kill(reason: Error): void;
};
};
'task.error': {
data: {
error?: Error;
};
context: SimpleGitTaskPluginContext & GitExecutorResult;
};
}
export type SimpleGitPluginType = keyof SimpleGitPluginTypes;
export interface SimpleGitPlugin<T extends SimpleGitPluginType> {
action(data: SimpleGitPluginTypes[T]['data'], context: SimpleGitPluginTypes[T]['context']): typeof data;
type: T;
}
//# sourceMappingURL=simple-git-plugin.d.ts.map