From a4736c6224002e805cd04c69142d1098b5325d9c Mon Sep 17 00:00:00 2001 From: Vury Leo Date: Wed, 25 Apr 2018 15:16:47 +0800 Subject: [PATCH 1/3] remove return type requirement of pbjs callback The callback function of pbjs main should not enforce a return value. --- cli/pbjs.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/pbjs.d.ts b/cli/pbjs.d.ts index 5fbe06a73..ead1f3c5d 100644 --- a/cli/pbjs.d.ts +++ b/cli/pbjs.d.ts @@ -1,4 +1,4 @@ -type pbjsCallback = (err: Error|null, output?: string) => {}; +type pbjsCallback = (err: Error|null, output?: string) => void; /** * Runs pbjs programmatically. From b6105c0d2ea44569912c3cfebe994073dd88de65 Mon Sep 17 00:00:00 2001 From: Vury Leo Date: Wed, 2 May 2018 13:32:55 +0800 Subject: [PATCH 2/3] update pbjs callback type to the right one https://github.com/dcodeIO/protobuf.js/blob/master/cli/pbjs.js#L20 --- cli/pbjs.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/pbjs.d.ts b/cli/pbjs.d.ts index ead1f3c5d..dc95cccf4 100644 --- a/cli/pbjs.d.ts +++ b/cli/pbjs.d.ts @@ -1,4 +1,4 @@ -type pbjsCallback = (err: Error|null, output?: string) => void; +type pbjsCallback = (err: Error|null, output?: string) => number|undefined; /** * Runs pbjs programmatically. From cdbd2decf680dede3eb4c462e831ac81cd106ef2 Mon Sep 17 00:00:00 2001 From: Vury Leo Date: Wed, 2 May 2018 13:40:40 +0800 Subject: [PATCH 3/3] revert b6105c0d2ea44569912c3cfebe994073dd88de65 The type is not for the callback function, --- cli/pbjs.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/pbjs.d.ts b/cli/pbjs.d.ts index dc95cccf4..ead1f3c5d 100644 --- a/cli/pbjs.d.ts +++ b/cli/pbjs.d.ts @@ -1,4 +1,4 @@ -type pbjsCallback = (err: Error|null, output?: string) => number|undefined; +type pbjsCallback = (err: Error|null, output?: string) => void; /** * Runs pbjs programmatically.