From 91df887427a66617f41cb6f6f588dcb46b7f8cd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Budi=C5=A1a?= Date: Wed, 18 Dec 2019 18:41:11 +0100 Subject: [PATCH 1/3] Add env to options in index.d.ts Fixes #117 --- index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.d.ts b/index.d.ts index 52485c5..1d99892 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1 +1 @@ -export function exec(cmd: string, options: { name?: string, icns?: string }, callback: (error: string, stdout: string, stderr: string) => void): void; \ No newline at end of file +export function exec(cmd: string, options: { name?: string, icns?: string, env?: { [key: string]: string } }, callback: (error: string, stdout: string, stderr: string) => void): void; From 0ae7ed8ff4cccceb91566c6e6826beaa7275d724 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Budi=C5=A1a?= Date: Wed, 18 Dec 2019 19:11:38 +0100 Subject: [PATCH 2/3] index.d.ts: Allow 2 or 1 parameter exec() call. Fix callback parameter types --- index.d.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/index.d.ts b/index.d.ts index 1d99892..826c3be 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1 +1,4 @@ -export function exec(cmd: string, options: { name?: string, icns?: string, env?: { [key: string]: string } }, callback: (error: string, stdout: string, stderr: string) => void): void; +export function exec(cmd: string, + options?: ((error?: Error, stdout?: string | Buffer, stderr?: string | Buffer) => void) + | { name?: string, icns?: string, env?: { [key: string]: string } }, + callback?: (error: Error, stdout: string | Buffer, stderr: string | Buffer) => void): void; From c7ba4d91e89a864cc2f67b578514ec9bab6b120f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Budi=C5=A1a?= Date: Wed, 18 Dec 2019 19:16:05 +0100 Subject: [PATCH 3/3] index.d.ts: Fixed optional parameters for callback --- index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.d.ts b/index.d.ts index 826c3be..329c122 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,4 +1,4 @@ export function exec(cmd: string, options?: ((error?: Error, stdout?: string | Buffer, stderr?: string | Buffer) => void) | { name?: string, icns?: string, env?: { [key: string]: string } }, - callback?: (error: Error, stdout: string | Buffer, stderr: string | Buffer) => void): void; + callback?: (error?: Error, stdout?: string | Buffer, stderr?: string | Buffer) => void): void;