1 | import type {
|
2 | CommonOptions,
|
3 | Options,
|
4 | SyncOptions,
|
5 | StricterOptions,
|
6 | } from '../arguments/options.js';
|
7 | import type {SyncResult} from '../return/result.js';
|
8 | import type {ResultPromise} from '../subprocess/subprocess.js';
|
9 | import type {TemplateString} from './template.js';
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 |
|
52 |
|
53 | export const $: ExecaScriptMethod<{}>;
|
54 |
|
55 |
|
56 |
|
57 |
|
58 | export type ExecaScriptMethod<OptionsType extends CommonOptions = CommonOptions> =
|
59 | & ExecaScriptBind<OptionsType>
|
60 | & ExecaScriptTemplate<OptionsType>
|
61 | & ExecaScriptArrayLong<OptionsType>
|
62 | & ExecaScriptArrayShort<OptionsType>
|
63 | & {sync: ExecaScriptSyncMethod<OptionsType>}
|
64 | & {s: ExecaScriptSyncMethod<OptionsType>};
|
65 |
|
66 |
|
67 | type ExecaScriptBind<OptionsType extends CommonOptions> =
|
68 | <NewOptionsType extends CommonOptions = {}>(options: NewOptionsType)
|
69 | => ExecaScriptMethod<OptionsType & NewOptionsType>;
|
70 |
|
71 |
|
72 | type ExecaScriptTemplate<OptionsType extends CommonOptions> =
|
73 | (...templateString: TemplateString)
|
74 | => ResultPromise<StricterOptions<OptionsType, Options>>;
|
75 |
|
76 |
|
77 | type ExecaScriptArrayLong<OptionsType extends CommonOptions> =
|
78 | <NewOptionsType extends Options = {}>(file: string | URL, arguments?: readonly string[], options?: NewOptionsType)
|
79 | => ResultPromise<StricterOptions<OptionsType & NewOptionsType, Options>>;
|
80 |
|
81 |
|
82 | type ExecaScriptArrayShort<OptionsType extends CommonOptions> =
|
83 | <NewOptionsType extends Options = {}>(file: string | URL, options?: NewOptionsType)
|
84 | => ResultPromise<StricterOptions<OptionsType & NewOptionsType, Options>>;
|
85 |
|
86 |
|
87 |
|
88 |
|
89 |
|
90 |
|
91 | export type ExecaScriptSyncMethod<OptionsType extends CommonOptions = CommonOptions> =
|
92 | & ExecaScriptSyncBind<OptionsType>
|
93 | & ExecaScriptSyncTemplate<OptionsType>
|
94 | & ExecaScriptSyncArrayLong<OptionsType>
|
95 | & ExecaScriptSyncArrayShort<OptionsType>;
|
96 |
|
97 |
|
98 | type ExecaScriptSyncBind<OptionsType extends CommonOptions> =
|
99 | <NewOptionsType extends SyncOptions = {}>(options: NewOptionsType)
|
100 | => ExecaScriptSyncMethod<OptionsType & NewOptionsType>;
|
101 |
|
102 |
|
103 | type ExecaScriptSyncTemplate<OptionsType extends CommonOptions> =
|
104 | (...templateString: TemplateString)
|
105 | => SyncResult<StricterOptions<OptionsType, SyncOptions>>;
|
106 |
|
107 |
|
108 | type ExecaScriptSyncArrayLong<OptionsType extends CommonOptions> =
|
109 | <NewOptionsType extends SyncOptions = {}>(file: string | URL, arguments?: readonly string[], options?: NewOptionsType)
|
110 | => SyncResult<StricterOptions<OptionsType & NewOptionsType, SyncOptions>>;
|
111 |
|
112 |
|
113 | type ExecaScriptSyncArrayShort<OptionsType extends CommonOptions> =
|
114 | <NewOptionsType extends SyncOptions = {}>(file: string | URL, options?: NewOptionsType)
|
115 | => SyncResult<StricterOptions<OptionsType & NewOptionsType, SyncOptions>>;
|