1 | import { ExecaError, ExecaReturnValue } from 'execa';
|
2 | import { Arguments, Argv, Command, MapOptionConfig, MapParamConfig, OptionConfigMap, ParserOptions, PrimitiveType } from '@boost/args';
|
3 | import { Path, PortablePath } from '@boost/common';
|
4 | import { PluginsSetting } from '@boost/config';
|
5 | import { Pluggable } from '@boost/plugin';
|
6 | import type { Context } from './contexts/Context';
|
7 | import type { ScriptContext } from './contexts/ScriptContext';
|
8 | import type { Tool } from './Tool';
|
9 | export type { Arguments, Argv, ParserOptions };
|
10 | export declare type BeemoTool = Tool;
|
11 | export interface BeemoProcess<C extends Context = Context> {
|
12 | context: C;
|
13 | tool: BeemoTool;
|
14 | }
|
15 | export declare type UnknownSettings = Record<string, unknown>;
|
16 | export interface BootstrapFile {
|
17 | (tool: BeemoTool): Promise<void> | void;
|
18 | bootstrap?: (tool: BeemoTool) => Promise<void> | void;
|
19 | default?: (tool: BeemoTool) => Promise<void> | void;
|
20 | }
|
21 | export declare type Execution = ExecaReturnValue;
|
22 | export declare type ExecutionError = ExecaError;
|
23 | export declare type DriverConfigStrategy = 'copy' | 'create' | 'native' | 'none' | 'reference' | 'template';
|
24 | export declare type DriverOutputStrategy = 'buffer' | 'none' | 'pipe' | 'stream';
|
25 | export interface DriverOptions {
|
26 | args?: string[];
|
27 | configStrategy?: DriverConfigStrategy;
|
28 | dependencies?: string[];
|
29 | env?: Record<string, string>;
|
30 | expandGlobs?: boolean;
|
31 | outputStrategy?: DriverOutputStrategy;
|
32 | template?: string;
|
33 | }
|
34 | export interface DriverMetadata {
|
35 | bin: string;
|
36 | commandOptions: OptionConfigMap;
|
37 | configName: string;
|
38 | configOption: string;
|
39 | configStrategy: 'copy' | 'create' | 'reference' | 'template';
|
40 | dependencies: string[];
|
41 | description: string;
|
42 | filterOptions: boolean;
|
43 | helpOption: string;
|
44 | title: string;
|
45 | useConfigOption: boolean;
|
46 | versionOption: string;
|
47 | watchOptions: string[];
|
48 | workspaceStrategy: 'copy' | 'reference';
|
49 | }
|
50 | export interface DriverOutput {
|
51 | stderr: string;
|
52 | stdout: string;
|
53 | }
|
54 | export interface Driverable extends Pluggable<BeemoTool> {
|
55 | metadata: DriverMetadata;
|
56 | }
|
57 | export interface DriverCommandConfig<O extends object, P extends PrimitiveType[]> extends Omit<Command, 'category'> {
|
58 | allowUnknownOptions?: boolean;
|
59 | allowVariadicParams?: boolean | string;
|
60 | options?: MapOptionConfig<O>;
|
61 | params?: MapParamConfig<P>;
|
62 | }
|
63 | export declare type DriverCommandRunner<O extends object, P extends PrimitiveType[]> = (tool: Tool, options: O, params: P, rest: string[]) => Promise<string | undefined | void> | string | undefined | void;
|
64 | export interface DriverCommandRegistration<O extends object, P extends PrimitiveType[]> {
|
65 | path: string;
|
66 | config: DriverCommandConfig<O, P>;
|
67 | runner: DriverCommandRunner<O, P>;
|
68 | }
|
69 | export interface Scriptable<O extends object> extends Pluggable<BeemoTool> {
|
70 | parse: () => ParserOptions<O>;
|
71 | execute: (context: ScriptContext, args: Arguments<O>) => Promise<unknown>;
|
72 | }
|
73 | export interface RoutineOptions {
|
74 | tool: BeemoTool;
|
75 | }
|
76 | export declare type ConfigExecuteStrategy = DriverOutputStrategy | '';
|
77 | export interface ConfigFile<T extends object = UnknownSettings> {
|
78 | configure: {
|
79 | cleanup: boolean;
|
80 | parallel: boolean;
|
81 | };
|
82 | debug: boolean;
|
83 | drivers: PluginsSetting;
|
84 | execute: {
|
85 | concurrency: number;
|
86 | graph: boolean;
|
87 | output: ConfigExecuteStrategy;
|
88 | };
|
89 | module: string;
|
90 | scripts: PluginsSetting;
|
91 | settings: T;
|
92 | }
|
93 | export interface BeemoConfig<T extends object = UnknownSettings> {
|
94 | configure?: {
|
95 | cleanup?: boolean;
|
96 | parallel?: boolean;
|
97 | };
|
98 | debug?: boolean;
|
99 | drivers?: PluginsSetting;
|
100 | execute?: {
|
101 | concurrency?: number;
|
102 | graph?: boolean;
|
103 | output?: ConfigExecuteStrategy;
|
104 | };
|
105 | module?: string;
|
106 | scripts?: PluginsSetting;
|
107 | settings?: T;
|
108 | }
|
109 | export declare type ConfigObject = Record<string, unknown>;
|
110 | export interface ConfigTemplateOptions {
|
111 | configModule: string;
|
112 | consumerConfigPath: Path | null;
|
113 | context: Context;
|
114 | driver: Driverable;
|
115 | driverConfigPath: Path;
|
116 | driverName: string;
|
117 | providerConfigPath: Path | null;
|
118 | templatePath: Path;
|
119 | tool: BeemoTool;
|
120 | }
|
121 | export interface ConfigTemplateResult {
|
122 | config: ConfigObject | string;
|
123 | path?: PortablePath;
|
124 | }
|
125 | export declare type ConfigTemplate = (configs: ConfigObject[], options: ConfigTemplateOptions) => ConfigTemplateResult;
|
126 | declare global {
|
127 | namespace NodeJS {
|
128 | interface Process {
|
129 | beemo: BeemoProcess;
|
130 | }
|
131 | }
|
132 | }
|
133 |
|
\ | No newline at end of file |