UNPKG

2.53 kBTypeScriptView Raw
1/// <reference types="node" />
2import { ChildProcess, ExecOptions } from 'child_process';
3import { PagerOptions } from './api';
4/**
5 * The development dependencies of this package.
6 * @ignore
7 */
8export declare const devDependencies: {
9 [key: string]: string;
10};
11/**
12 * The version of this package. Used for synchronizing Diez versions.
13 * @ignore
14 */
15export declare const diezVersion: string;
16/**
17 * A Promise-wrapped `child_process.exec`.
18 * @param command - The command to run, with space-separated arguments.
19 * @param options - The child_process.exec options.
20 */
21export declare const execAsync: (command: string, options?: ExecOptions | undefined) => Promise<string>;
22/**
23 * Returns true iff we are on the macOS platform.
24 * @ignore
25 */
26export declare const isMacOS: () => boolean;
27/**
28 * Returns true iff we are on the Windows platform.
29 * @ignore
30 */
31export declare const isWindows: () => boolean;
32/**
33 * Loops through all dependencies to locate Diez plugins, and returns a map of module names to [[DiezConfiguration]]s.
34 */
35export declare const findPlugins: (rootPackageName?: string, bootstrapRoot?: string | undefined) => Promise<Map<string, Partial<import("./api").FullDiezConfiguration>>>;
36/**
37 * Wrapped require to support CLI plugin infrastructure.
38 * @ignore
39 */
40export declare const cliRequire: <T>(plugin: string, path: string) => T;
41/**
42 * Provides an async check for whether we can run a command from the command line.
43 *
44 * Resolves `true` iff the command both runs and produces output.
45 */
46export declare const canRunCommand: (command: string) => Promise<boolean>;
47/**
48 * Locate a binary on macOS.
49 */
50export declare const locateBinaryMacOS: (bundleId: string) => Promise<string | undefined>;
51/**
52 * Exit trap for shutting down handles and preventing process leaks in Node.
53 */
54export declare const exitTrap: (cleanup: () => void) => void;
55/**
56 * Checks if an argument is a ChildProcess
57 */
58export declare const isChildProcess: (proc: void | Buffer | ChildProcess) => proc is ChildProcess;
59/**
60 * Encodes a package name to be safely transmitted via HTTP requests.
61 */
62export declare const encodePackageName: (name: string) => string;
63/**
64 * Decodes a package name transmitted via HTTP requests.
65 */
66export declare const decodePackageName: (name: string) => string;
67/**
68 * Page an input source using sensible pager applications per-platform.
69 */
70export declare const pager: (options: PagerOptions) => Promise<{
71 code: number | null;
72 signal: string | null;
73}>;
74//# sourceMappingURL=utils.d.ts.map
\No newline at end of file