DefinitelyTyped/types/shipit-cli/index.d.ts
Nathan Shively-Sanders 20c09018e0 Fix build
2019-02-13 16:29:07 -08:00

61 lines
2.4 KiB
TypeScript

// Type definitions for shipit-cli 1.5
// Project: https://github.com/shipitjs/shipit
// Definitions by: Cyril Schumacher <https://github.com/cyrilschumacher>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
import * as fs from "fs";
import * as child_process from "child_process";
import * as shipit from "./index"; // Used for `typeof shipit`
export type LocalOrRemoteCommand = (command: string, options?: child_process.ExecOptions, callback?: (error: Error, stdout: string, stderr: string) => void) => PromiseLike<ShipitLocal>;
export type EmptyCallback = () => void;
export type TaskExecution = (name: string, depsOrFn: string[] | EmptyCallback, fn: () => void) => any;
export interface Options {
environment: string;
stderr: fs.WriteStream;
stdout: fs.WriteStream;
}
export interface ShipitLocal {
child: child_process.ChildProcess;
stderr: fs.WriteStream;
stdout: fs.WriteStream;
}
export interface Tasks {
[name: string]: Task;
}
export interface Task {
blocking: boolean;
dep: string[];
fn(): void;
name: string;
}
export function blTask(name: string, depsOrFn: string[] | EmptyCallback, fn?: () => void): any;
export function emit(name: string): any;
export function initConfig(config: {}): typeof shipit;
export function local(command: string, options?: child_process.ExecOptions, callback?: (error: Error, stdout: string, stderr: string) => void): PromiseLike<ShipitLocal>;
export function log(log: any): void;
export function log(...log: any[]): void;
export function on(name: string, callback: (e: any) => void): any;
export function remote(command: string, options?: child_process.ExecOptions, callback?: (error: Error, stdout: string, stderr: string) => void): PromiseLike<ShipitLocal>;
export function remoteCopy(src: string, dest: string, options?: child_process.ExecOptions, callback?: (error: Error, stdout: string, stderr: string) => void): PromiseLike<ShipitLocal>;
export function start(tasks: string | string[]): typeof shipit;
export function start(...tasks: string[]): typeof shipit;
export function task(name: string, depsOrFn: string[] | EmptyCallback, fn?: () => void): typeof shipit;
export const config: {};
export const domain: any;
export const doneCallback: any;
export const environment: string;
export const seq: any[];
export const tasks: Tasks;
export const isRunning: boolean;
export as namespace shipit;