import { IEngine } from './engine'; import { ICLIPJSON, IPluginPJSON } from './pjson'; export declare type PlatformTypes = 'darwin' | 'linux' | 'win32' | 'aix' | 'freebsd' | 'openbsd' | 'sunos'; export declare type ArchTypes = 'arm' | 'arm64' | 'mips' | 'mipsel' | 'ppc' | 'ppc64' | 's390' | 's390x' | 'x32' | 'x64' | 'x86'; export interface IConfigBase { root: string; arch: string; bin: string; cacheDir: string; commandsDir: string | undefined; configDir: string; dataDir: string; dirname: string; errlog: string; home: string; hooks: { [k: string]: string[]; }; name: string; pjson: IPluginPJSON | ICLIPJSON; platform: string; shell: string; tsconfig: TSConfig | undefined; userAgent: string; version: string; windows: boolean; debug: number; } export interface IPluginConfig extends IConfigBase { type: 'plugin'; pjson: IPluginPJSON; } export interface ICLIConfig extends IConfigBase { type: 'cli'; pjson: ICLIPJSON; engine: IEngine; npmRegistry: string; } export declare type IConfig = IPluginConfig | ICLIConfig; export interface TSConfig { compilerOptions: { rootDir?: string; outDir?: string; }; } export interface ConfigOptions { name?: string; root?: string; } export declare abstract class ConfigBase implements IConfigBase { static tsNode: any; /** * registers ts-node for reading typescript source (./src) instead of compiled js files (./lib) * there are likely issues doing this any the tsconfig.json files are not compatible with others */ static registerTSNode(): any; readonly _base: string; arch: string; bin: string; cacheDir: string; configDir: string; dataDir: string; dirname: string; errlog: string; home: string; name: string; pjson: any; platform: string; root: string; shell: string; version: string; windows: boolean; userAgent: string; commandsDir: string | undefined; tsconfig: TSConfig | undefined; debug: number; hooks: { [k: string]: string[]; }; constructor(); load({name, root}: { name?: string; root: string; }): Promise; scopedEnvVar(k: string): string | undefined; scopedEnvVarTrue(k: string): boolean; scopedEnvVarKey(k: string): string; private dir(category); private windowsHome(); private windowsHomedriveHome(); private windowsUserprofileHome(); private macosCacheDir(); private _tsConfig(); /** * convert a path from the compiled ./lib files to the ./src typescript source * this is for developing typescript plugins/CLIs * if there is a tsconfig and the original sources exist, it attempts to require ts- */ private _libToSrcPath(orig); private _hooks(); private _shell(); private _debug(); } export declare class PluginConfig extends ConfigBase implements IPluginConfig { static create({name, root}: ConfigOptions): Promise; readonly type: 'plugin'; pjson: IPluginPJSON; } export declare class CLIConfig extends ConfigBase implements ICLIConfig { static create({engine, name, root}: ConfigOptions & { engine: IEngine; }): Promise; readonly type: 'cli'; pjson: ICLIPJSON; engine: IEngine; npmRegistry: string; constructor(engine: IEngine); load({root, name}: { root: string; name?: string; }): Promise; } export declare type Config = PluginConfig | CLIConfig; export declare function isIConfig(o: any): o is IConfig;