type fixed🐞 (#37699)

Convert error type `Error` to `Error|null`
Fixed WriteCallback's param
This commit is contained in:
Crindzebra Sjimo
2019-08-20 01:42:07 +08:00
committed by Sheetal Nandi
parent 7953464b17
commit c376b9fcd1

10
types/gm/index.d.ts vendored
View File

@@ -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<T> = (err: Error, value: T) => any;
type GetterCallback<T> = (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;