1 | import { CancellablePromise } from '@theintern/common';
|
2 | import { Config } from './config';
|
3 | import { Executor } from '../executors/Executor';
|
4 | import { InternError } from '../types';
|
5 | export interface EvaluatedProperty {
|
6 | name: keyof Config;
|
7 | addToExisting: boolean;
|
8 | }
|
9 | export interface TextLoader {
|
10 | (path: string): CancellablePromise<string>;
|
11 | }
|
12 | export declare type TypeName = 'string' | 'boolean' | 'number' | 'regexp' | 'object' | 'string[]' | 'object[]';
|
13 | export declare type Parser<T = any> = (value: any) => T;
|
14 | export declare function evalProperty<C>(key: keyof C): EvaluatedProperty;
|
15 | export declare function getBasePath(configFile: string, basePath: string, isAbsolute: (path: string) => boolean, pathSep?: string): string;
|
16 | export declare function getConfigDescription(config: any, prefix?: string): string;
|
17 | export declare function loadConfig(configPath: string, loadText: TextLoader, args?: {
|
18 | [key: string]: any;
|
19 | }, childConfig?: string | string[]): CancellablePromise<any>;
|
20 | export declare function parseArgs(rawArgs: string[]): {
|
21 | [key: string]: any;
|
22 | };
|
23 | export declare function parseJson(json: string): any;
|
24 | export declare function parseValue(name: string, value: any, parser: TypeName | Parser, requiredProperty?: string): any;
|
25 | export declare function prefix(message: string, prefix: string): string;
|
26 | export declare function processOption<C extends Config>(key: keyof C, value: any, config: C, executor?: Executor): void;
|
27 | export declare function pullFromArray<T>(haystack: T[], needle: T): T[];
|
28 | export declare function setOption(config: Config, name: keyof Config, value: any, addToExisting?: boolean): void;
|
29 | export declare function splitConfigPath(path: string, separator?: string): {
|
30 | configFile: string;
|
31 | childConfig?: string;
|
32 | };
|
33 | export declare function stringify(object: Object, indent?: string): string;
|
34 | export declare function errorToJSON(error?: InternError): InternError | undefined;
|