@types/teen_process
Advanced tools
Comparing version 1.16.1 to 2.0.0
@@ -1,2 +0,2 @@ | ||
// Type definitions for teen_process 1.16 | ||
// Type definitions for teen_process 2.0 | ||
// Project: https://github.com/appium/node-teen_process | ||
@@ -14,3 +14,6 @@ // Definitions by: Tiger Oakes <https://github.com/NotWoods> | ||
export interface ExecOptions extends Pick<SpawnOptions, 'cwd' | 'env' | 'shell'> { | ||
/** | ||
* Options for {@link exec teen_process.exec}. | ||
*/ | ||
export interface TeenProcessExecOptions extends Pick<SpawnOptions, 'cwd' | 'env' | 'shell'> { | ||
cwd?: string | URL | undefined; | ||
@@ -58,4 +61,5 @@ env?: NodeJS.ProcessEnv | undefined; | ||
*/ | ||
logger?: { debug(chunk: string): void } | undefined; | ||
logger?: TeenProcessLogger | undefined; | ||
/** | ||
* Maximum size of `stdout` buffer | ||
* @default 100 * 1024 * 1024 // 100 MB | ||
@@ -65,2 +69,3 @@ */ | ||
/** | ||
* Maximum size of `stderr` buffer | ||
* @default 100 * 1024 * 1024 // 100 MB | ||
@@ -71,14 +76,32 @@ */ | ||
export interface ExecResult<T extends string | Buffer> { | ||
export interface TeenProcessLogger { | ||
debug(...args: any[]): void; | ||
} | ||
/** The value {@link exec teen_process.exec} resolves to */ | ||
export interface TeenProcessExecResult<T extends string | Buffer> { | ||
/** Stdout */ | ||
stdout: T; | ||
/** Stderr */ | ||
stderr: T; | ||
/** Exit code */ | ||
code: number; | ||
} | ||
/** | ||
* Spawns a process | ||
* @param cmd - Program to execute | ||
* @param args - Arguments to pass to the program | ||
* @param opts - Options | ||
*/ | ||
export function exec( | ||
cmd: string, | ||
args: ReadonlyArray<string> | undefined, | ||
opts: ExecOptions & { isBuffer: true }, | ||
): Promise<ExecResult<Buffer>>; | ||
export function exec(cmd: string, args?: ReadonlyArray<string>, opts?: ExecOptions): Promise<ExecResult<string>>; | ||
opts: TeenProcessExecOptions & { isBuffer: true }, | ||
): Promise<TeenProcessExecResult<Buffer>>; | ||
export function exec( | ||
cmd: string, | ||
args?: ReadonlyArray<string>, | ||
opts?: TeenProcessExecOptions, | ||
): Promise<TeenProcessExecResult<string>>; | ||
@@ -85,0 +108,0 @@ export interface SubProcessOptions extends SpawnOptions { |
{ | ||
"name": "@types/teen_process", | ||
"version": "1.16.1", | ||
"version": "2.0.0", | ||
"description": "TypeScript definitions for teen_process", | ||
@@ -25,4 +25,4 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/teen_process", | ||
}, | ||
"typesPublisherContentHash": "0ca5dfd7f69b04650f11339cab2b9b92a86104fdfd54e91d694a3047134f673d", | ||
"typeScriptVersion": "4.0" | ||
"typesPublisherContentHash": "82dbb8a5f26dc3b63745e248f20f6a93118b6b117d9d8c1f11c15b57555bd151", | ||
"typeScriptVersion": "4.1" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
### Additional Details | ||
* Last updated: Thu, 07 Jul 2022 19:32:20 GMT | ||
* Last updated: Sun, 30 Oct 2022 17:32:41 GMT | ||
* Dependencies: [@types/node](https://npmjs.com/package/@types/node) | ||
@@ -14,0 +14,0 @@ * Global values: none |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11553
215