-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjsmake.d.ts
318 lines (318 loc) · 9.75 KB
/
jsmake.d.ts
1
2
3
4
5
6
7
8
9
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
/**
* Execute a shell command using an `argv` array.
* @param {string[]} argv
*/
export function shellRaw(argv: string[]): Promise<any>;
/**
* Execute a shell command.
* @param {string} cmd The command to execute.
* @param {boolean} [echo=true] Determine if the command itself should be printed to the screen.
* @returns
*/
export function shell(cmd: string, echo?: boolean): Promise<void>;
export namespace variables {
const CC: string;
const CXX: string;
const CC_FLAGS: string;
const CXX_FLAGS: string;
const GO: string;
const GO_FLAGS: string;
const NPM: string;
const IGNORE_ERRORS: boolean;
const SOURCE_INCLUDED: string[];
const NODE_INTERPRETER: string;
const GIT: string;
const LD: string;
const LD_FLAGS: string;
const CARGO: string;
const RUSTC: string;
const RUSTUP: string;
const JAVAC: string;
const JAVA: string;
const JAR: string;
}
/**
* Build C source files.
* @param {...string} c_sources The path to sources.
*/
export function buildC(...c_sources: string[]): Promise<void>;
/**
* Build C++ source files.
* @param {...string} cxx_sources The path to sources.
*/
export function buildCxx(...cxx_sources: string[]): Promise<void>;
/**
* Build C++ source files to a named executable.
* @param {string} name The name of the executable.
* @param {...string} cxx_sources The path to sources.
*/
export function buildExecutable(name: string, ...cxx_sources: string[]): Promise<void>;
/**
* Build go packages.
*/
export function buildGoPackages(): Promise<void>;
/**
* Define a build task.
* @param {string} taskName The task's name.
* @param {()=>void} task The task itself.
*/
export function task(taskName: string, task: () => void): void;
/**
* Start the build script.
*/
export function build(): Promise<void>;
/**
* Build a task with the name.
* @param {string} name The name of the task.
*/
export function buildTask(name: string): Promise<void>;
/**
* Execute the `npm` command.
* @param {...string} args Arguments to pass to `npm`.
*/
export function npm(...args: string[]): Promise<void>;
export namespace nodePack {
/**
* Set the version number of the npm.
* @param {string} v The new version.
*/
function version(v: string): Promise<void>;
/**
* Set the version number of the npm.
* @param {string} v The new version.
*/
function version(v: string): Promise<void>;
/**
* Publish a node package.
*/
function publish(): Promise<void>;
/**
* Publish a node package.
*/
function publish(): Promise<void>;
/**
* Install a node package.
* @param {string} pack_name Package's name.
*/
function install(pack_name: string): Promise<void>;
/**
* Install a node package.
* @param {string} pack_name Package's name.
*/
function install(pack_name: string): Promise<void>;
/**
* Patch the version number of the node package.
*/
function patch(): Promise<void>;
/**
* Patch the version number of the node package.
*/
function patch(): Promise<void>;
}
/**
* Call `callback` for every file under the directory.
* @param {string} dir Path to the directory.
* @param {(pthName: string)=>void} callback The callback.
*/
export function dir(dir: string, callback: (pthName: string) => void): Promise<void>;
/**
* Select a source.
* @param {string} src The name of the source.
*/
export function selectSource(src: string): void;
/**
* Include a source.
* @param {string} src The name of the source.
*/
export function includeSource(src: string): void;
/**
* Include all the sources in the working directory.
*/
export function includeAllInDir(): void;
/**
* Check if the source is included.
* @param {string} src The source to include.
* @returns {boolean} `true` if the source is included, `false` otherwise.
*/
export function isIncluded(src: string): boolean;
/**
* Include all the sources that are selected.
*/
export function includeAllSelected(): void;
/**
* Select all the sources that are included.
*/
export function selectAllIncluded(): void;
/**
* Compile all the selected sources as C and deselect them.
*/
export function compileAllSelectedAsC(): Promise<void>;
/**
* Compile all the selected sources as C++ and deselect them.
*/
export function compileAllSelectedAsCxx(): Promise<void>;
/**
* Check if a file exists.
* @param {string} path Path to the file.
* @returns {boolean} `true` if the file exists and `false` otherwise.
*/
export function exists(path: string): boolean;
/**
* Delete a file.
* @param {string} path Path to the file.
*/
export function rm(path: string): void;
export namespace git {
/**
* Check if the directory is a git repository.
* @returns {boolean} `true` if the directory is a git repository and `false` otherwise.
*/
function isGitted(): boolean;
/**
* Check if the directory is a git repository.
* @returns {boolean} `true` if the directory is a git repository and `false` otherwise.
*/
function isGitted(): boolean;
/**
* Initialize the directory as a git repository.
*/
function init(): Promise<void>;
/**
* Initialize the directory as a git repository.
*/
function init(): Promise<void>;
/**
* Add files to the repository.
* @param {...string} paths The path to files to add.
*/
function add(...paths: string[]): Promise<void>;
/**
* Add files to the repository.
* @param {...string} paths The path to files to add.
*/
function add(...paths: string[]): Promise<void>;
/**
* Push the repository.
*/
function push(): Promise<void>;
/**
* Push the repository.
*/
function push(): Promise<void>;
/**
* Push the repository with given options.
* @param {...string} options Options to pass.
*/
function pushWithOptions(...options: string[]): Promise<void>;
/**
* Push the repository with given options.
* @param {...string} options Options to pass.
*/
function pushWithOptions(...options: string[]): Promise<void>;
/**
* Execute `git branch` with given options.
* @param {...string} options Options to pass.
*/
function branch(...options: string[]): Promise<void>;
/**
* Execute `git branch` with given options.
* @param {...string} options Options to pass.
*/
function branch(...options: string[]): Promise<void>;
/**
* Execute `git remote add origin` with given options.
* @param {string} originName The name of the origin.
* @param {string} url The url of the origin.
*/
function remoteAddOrigin(originName: string, url: string): Promise<void>;
/**
* Execute `git remote add origin` with given options.
* @param {string} originName The name of the origin.
* @param {string} url The url of the origin.
*/
function remoteAddOrigin(originName: string, url: string): Promise<void>;
/**
* Execute `git remote add origin` with given options on the given branch.
* @param {string} branch The branch to set.
* @param {string} originName The name of the origin.
* @param {string} url The url of the origin.
*/
function remoteAddOriginForBranch(branch: string, originName: string, url: string): Promise<void>;
/**
* Execute `git remote add origin` with given options on the given branch.
* @param {string} branch The branch to set.
* @param {string} originName The name of the origin.
* @param {string} url The url of the origin.
*/
function remoteAddOriginForBranch(branch: string, originName: string, url: string): Promise<void>;
/**
*
* @param {...string} options Arguments.
*/
function invoke(...options: string[]): Promise<void>;
/**
*
* @param {...string} options Arguments.
*/
function invoke(...options: string[]): Promise<void>;
/**
* Commit the repository with the given message.
* @param {string} msg The message to display.
*/
function commit(msg: string): Promise<void>;
/**
* Commit the repository with the given message.
* @param {string} msg The message to display.
*/
function commit(msg: string): Promise<void>;
}
/**
*
* @param {string} patha The path to file A
* @param {string} pathb The path to file B
* @returns Whether file A is newer than file B.
*/
export function newer(patha: string, pathb: string): boolean;
/**
* Build the task from another build script.
* @param {string} path_to_script Path to the script.
* @param {string} taskName The task name.
*/
export function buildTaskFrom(path_to_script: string, taskName: string): Promise<void>;
/**
* Iterate the directoy and call the callback if and only if the `rule` callback returns true for that filename.
* @param {string} path The path.
* @param {(s:string)=>boolean} rule The rule.
* @param {(s:string)=>void} callback The callback.
*/
export function dirIf(path: string, rule: (s: string) => boolean, callback: (s: string) => void): Promise<void>;
/**
* Link the object files.
* @param {...string} object_files Path to object files.
*/
export function link(...object_files: string[]): Promise<void>;
/**
* Run the `cargo` command.
* @param {...string} args Arguments.
*/
export function cargo(...args: string[]): Promise<void>;
/**
* Run the `rustc` command.
* @param {...string} args Arguments.
*/
export function rustc(...args: string[]): Promise<void>;
/**
* Run the `rustup` command.
* @param {...string} args Arguments.
*/
export function rustup(...args: string[]): Promise<void>;
/**
* Run the `java` command.
* @param {...string} args Arguments.
*/
export function java(...args: string[]): Promise<void>;
/**
* Run the `javac` command.
* @param {...string} args Arguments.
*/
export function javac(...args: string[]): Promise<void>;