UNPKG

2.99 kBTypeScriptView Raw
1import { CrossbowConfiguration } from "./config";
2import { CommandTrigger } from "./command.run";
3import { ExternalFileInput, ExternalFile } from "./file.utils";
4import { Task } from "./task.resolve";
5import { CrossbowInput } from "./index";
6export declare enum InputErrorTypes {
7 InputFileNotFound,
8 NoTasksAvailable,
9 NoWatchersAvailable,
10 FileNotFound,
11 NotAFile,
12 InvalidYaml,
13 InvalidInput,
14 InvalidJson,
15}
16export interface InputFileNotFoundError extends InputError {
17}
18export interface NoTasksAvailableError extends InputError {
19}
20export interface NoWatchersAvailableError extends InputError {
21}
22export interface InputError {
23 type: InputErrorTypes;
24}
25export interface InputFiles {
26 all: ExternalFileInput[];
27 valid: ExternalFileInput[];
28 invalid: ExternalFileInput[];
29}
30export declare function locateModule(config: CrossbowConfiguration, taskName: string): ExternalFile[];
31export declare function getChildTaskNames(task: Task): string[];
32/**
33 * Convert a JS object into ENV vars
34 * eg:
35 * var obj = {
36 * options: {
37 * docker: {
38 * port: 8000
39 * }
40 * }
41 * }
42 * ->
43 * envifyObject(obj, 'CB', 'OPTIONS')
44 * ->
45 * CB_OPTIONS_DOCKER_PORT=8000
46 */
47export declare function envifyObject(object: any, prefix: string, objectKeyName: string): any;
48export declare function excludeKeys(input: any, blacklist: string[]): any;
49export declare function getCBEnv(trigger: CommandTrigger): {};
50export declare function getFunctionName(fn: any): string;
51export declare const removeNewlines: (x: string) => string;
52export declare const escapeNewLines: (x: string) => string;
53export declare const removeTrailingNewlines: (x: string) => string;
54export declare function stringifyObj(incoming: any, max?: number): string;
55export declare function isPlainObject(val: any): boolean;
56export declare function isString(val: any): boolean;
57export declare function isFunction(val: any): boolean;
58export declare function isReport(report: any): boolean;
59export declare function isPrivateTask(taskName: string): boolean;
60export declare function isPublicTask(taskName: string): boolean;
61export declare function isParentGroupName(name: string): RegExpMatchArray;
62export declare function isParentRef(name: string, names: string[]): boolean;
63export declare function getChildItems(name: string, input: any): any;
64export declare function getPossibleTaskNames(input: CrossbowInput): any[];
65export declare function getChildName(name: any): any;
66export declare function isInternal(incoming: string): boolean;
67export declare function isSupportedFileType(incoming: any): boolean;
68export declare function _e(x: any): any;
69export declare function __e(x: any): any;
70export declare function longestString(col: string[]): number;
71export declare function getLongestTaskName(tasks: Task[]): number;
72export declare function padLine(incoming: any, max?: any): any;
73export declare function concatProps(tasks: any, initial: string[], propname: string): string[];