UNPKG

2.2 kBTypeScriptView Raw
1declare namespace cmdShim {
2 interface Options {
3 /**
4 * If a PowerShell script should be created.
5 *
6 * @default true
7 */
8 createPwshFile?: boolean;
9 /**
10 * If a Windows Command Prompt script should be created.
11 *
12 * @default false
13 */
14 createCmdFile?: boolean;
15 /**
16 * If symbolic links should be preserved.
17 *
18 * @default false
19 */
20 preserveSymlinks?: boolean;
21 /**
22 * The path to the executable file.
23 */
24 prog?: string;
25 /**
26 * The arguments to initialize the `node` process with.
27 */
28 args?: string;
29 /**
30 * The arguments to initialize the target process with, before the actual CLI arguments
31 */
32 progArgs?: string[];
33 /**
34 * The value of the $NODE_PATH environment variable.
35 *
36 * The single `string` format is only kept for legacy compatibility,
37 * and the array form should be preferred.
38 */
39 nodePath?: string | string[];
40 /**
41 * fs implementation to use. Must implement node's `fs` module interface.
42 */
43 fs?: typeof import('fs');
44 nodeExecPath?: string;
45 }
46}
47declare type Options = cmdShim.Options;
48export = cmdShim;
49/**
50 * Try to create shims.
51 *
52 * @param src Path to program (executable or script).
53 * @param to Path to shims.
54 * Don't add an extension if you will create multiple types of shims.
55 * @param opts Options.
56 * @throws If `src` is missing.
57 */
58declare function cmdShim(src: string, to: string, opts?: Options): Promise<void>;
59declare namespace cmdShim {
60 var ifExists: typeof cmdShimIfExists;
61}
62/**
63 * Try to create shims.
64 *
65 * Does nothing if `src` doesn't exist.
66 *
67 * @param src Path to program (executable or script).
68 * @param to Path to shims.
69 * Don't add an extension if you will create multiple types of shims.
70 * @param opts Options.
71 */
72declare function cmdShimIfExists(src: string, to: string, opts?: Options): Promise<void>;
73//# sourceMappingURL=index.d.ts.map
\No newline at end of file