summaryrefslogtreecommitdiff
path: root/node_modules/@malept/cross-spawn-promise/dist/src/index.d.ts
diff options
context:
space:
mode:
authorLinuxWizard42 <computerwizard@linuxmail.org>2022-10-12 22:54:37 +0300
committerLinuxWizard42 <computerwizard@linuxmail.org>2022-10-12 22:54:37 +0300
commit703e03aba33f234712206769f57717ba7d92d23d (patch)
tree0041f04ccb75bd5379c764e9fe42249fffe75fc3 /node_modules/@malept/cross-spawn-promise/dist/src/index.d.ts
parentab6e257e6e9d9a483d7e86f220d8b209a2cd7753 (diff)
downloadFlashRunner-703e03aba33f234712206769f57717ba7d92d23d.tar.gz
FlashRunner-703e03aba33f234712206769f57717ba7d92d23d.tar.zst
Added export_allowed file to make repository visible in cgit
Diffstat (limited to 'node_modules/@malept/cross-spawn-promise/dist/src/index.d.ts')
-rw-r--r--node_modules/@malept/cross-spawn-promise/dist/src/index.d.ts61
1 files changed, 61 insertions, 0 deletions
diff --git a/node_modules/@malept/cross-spawn-promise/dist/src/index.d.ts b/node_modules/@malept/cross-spawn-promise/dist/src/index.d.ts
new file mode 100644
index 0000000..68789ac
--- /dev/null
+++ b/node_modules/@malept/cross-spawn-promise/dist/src/index.d.ts
@@ -0,0 +1,61 @@
+/// <reference types="node" />
+import { SpawnOptions } from "child_process";
+export declare type LoggerFunction = (message: string) => void;
+/**
+ * List of string arguments.
+ */
+export declare type CrossSpawnArgs = ReadonlyArray<string> | undefined;
+export declare type CrossSpawnOptions = SpawnOptions & {
+ /**
+ * A `Function` such as `console.log` or `debug(name)` to log some information about the
+ * spawned process.
+ */
+ logger?: LoggerFunction;
+ /**
+ * A callback which mutates the error before it is rethrown. Most commonly, this is used to
+ * augment the error message of `ENOENT` errors to provide a more human-friendly message as to
+ * how to install the missing executable.
+ *
+ * @param error - The error thrown from the `spawn` function
+ * @param hasLogger - Whether `logger` was set
+ */
+ updateErrorCallback?: (error: Error, hasLogger: boolean) => void;
+};
+/**
+ * Wrapper error for when the spawn function itself emits an error.
+ */
+export declare class CrossSpawnError extends Error {
+ originalError: Error;
+ constructor(cmd: string, args: CrossSpawnArgs, originalError: Error, stderr: string);
+}
+/**
+ * Base error class for when a process does not exit with a status code of zero.
+ */
+export declare abstract class ExitError extends Error {
+ cmd: string;
+ args: CrossSpawnArgs;
+ stdout: string;
+ stderr: string;
+ constructor(cmd: string, args: CrossSpawnArgs, message: string, stdout: string, stderr: string);
+}
+/**
+ * The error thrown when a process emits a non-zero exit code.
+ */
+export declare class ExitCodeError extends ExitError {
+ code: number;
+ constructor(cmd: string, args: CrossSpawnArgs, code: number, stdout: string, stderr: string);
+}
+/**
+ * The error thrown when a process exits via a signal.
+ */
+export declare class ExitSignalError extends ExitError {
+ signal: string;
+ constructor(cmd: string, args: CrossSpawnArgs, signal: string, stdout: string, stderr: string);
+}
+/**
+ * A wrapper around `cross-spawn`'s `spawn` function which can optionally log the command executed
+ * and/or change the error object via a callback.
+ *
+ * @param cmd - The command to run
+ */
+export declare function spawn(cmd: string, args?: CrossSpawnArgs, options?: CrossSpawnOptions): Promise<string>;