diff --git a/types/gm/index.d.ts b/types/gm/index.d.ts index 5a5370e05b..15117e6cf9 100644 --- a/types/gm/index.d.ts +++ b/types/gm/index.d.ts @@ -316,8 +316,8 @@ declare namespace m { // Commands stream(callback?: WriteCallback): stream.PassThrough; stream(format: string, callback?: WriteCallback): stream.PassThrough; - toBuffer(callback: (err: Error, buffer: Buffer) => any): stream.PassThrough; - toBuffer(format: string, callback: (err: Error, buffer: Buffer) => any): stream.PassThrough; + toBuffer(callback: (err: Error|null, buffer: Buffer) => any): stream.PassThrough; + toBuffer(format: string, callback: (err: Error|null, buffer: Buffer) => any): stream.PassThrough; write(filename: string, callback: WriteCallback): void; } @@ -391,7 +391,7 @@ declare namespace m { | 'YPbPr' | 'YUV'; - type CompareCallback = (err: Error, isEqual: boolean, equality: number, raw: number) => any; + type CompareCallback = (err: Error|null, isEqual: boolean, equality: number, raw: number) => any; type ComposeOperator = 'Over' | 'In' @@ -465,7 +465,7 @@ declare namespace m { | 'Bessel' | 'Sinc'; - type GetterCallback = (err: Error, value: T) => any; + type GetterCallback = (err: Error|null, value: T) => any; type GravityDirection = 'NorthWest' | 'North' @@ -601,7 +601,7 @@ declare namespace m { | 'DirectColor' | 'default'; - type WriteCallback = (err: Error, stdout: string, stderr: string, cmd: string) => any; + type WriteCallback = (err: Error|null, stdout: stream.Readable, stderr: stream.Readable, cmd: string) => any; } export = m;