-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.d.ts
44 lines (44 loc) · 1.17 KB
/
index.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
#! /usr/bin/env node
/**
* A Module that exports a method named `run`.
*/
export type RunnableModule = NodeModule & {
run: Function;
};
/**
* Available CLI options for runex.
*
* Usage information: `npx runex -h|--help`
*/
export type Options = {
require: string[];
};
export function collectDistinct(value: string, prev: string[]): string[];
export namespace ExitCode {
export const MissingArgument: number;
export const ModuleNotFound: number;
export const InvalidModuleExport: number;
export const ExportThrows: number;
}
export function exitWithUsage(commander: any, code: number): () => never;
export function parseArguments(argv: string[]): {
args: string[];
moduleNameOrPath: string;
opts: {
require: string[];
};
};
export function requireRunnable(possiblePaths: string[], opts: {
require: string[];
}, _require?: NodeRequire | undefined): NodeModule & {
run: Function;
};
export function resolveRelativeAndRequirePaths(moduleNameOrPath: string): string[];
export function run(runnable: NodeModule & {
run: Function;
}, { args }?: {
args: any[];
opts: {
require: string[];
};
} | undefined): Promise<any>;