fix lint: strict-export-declare-modifiers

This commit is contained in:
segayuu
2018-05-22 11:29:19 +09:00
parent 0e76900909
commit 39ae1c9015

View File

@@ -3,7 +3,7 @@
// Definitions by: segayuu <https://github.com/segayuu>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare type nodeCallback<T> = (err: Error | undefined, ...a: T[]) => any;
type nodeCallback<T> = (err: Error | undefined, ...a: T[]) => any;
// Delegates to `succ` on sucecss or to `fail` on error
// ex: Thing.load(123, iferr(cb, thing => ...))
@@ -12,18 +12,18 @@ declare function iferr<T>(fail: (err: Error | undefined) => void, succ: (...resu
declare namespace iferr {
// Delegates to `succ` on sucecss or to `fail` on error
// ex: Thing.load(123, iferr(cb, thing => ...))
export function iferr<T>(fail: (err: Error | undefined) => void, succ: (...result: T[]) => void): nodeCallback<T>;
function iferr<T>(fail: (err: Error | undefined) => void, succ: (...result: T[]) => void): nodeCallback<T>;
// Like iferr, but also catches errors thrown from `succ` and passes to `fail`
export function tiferr<T>(fail: (err: Error | undefined) => void, succ: (...result: T[]) => void): nodeCallback<T>;
function tiferr<T>(fail: (err: Error | undefined) => void, succ: (...result: T[]) => void): nodeCallback<T>;
// Delegate to the success function on success, throws the error otherwise
// ex: Thing.load(123, throwerr(thing => ...))
export function throwerr<T>(succ: (...result: T[]) => void): nodeCallback<T>;
function throwerr<T>(succ: (...result: T[]) => void): nodeCallback<T>;
// Prints errors when one is passed, or does nothing otherwise
// ex: Thing.load(123, printerr)
export function printerr(): nodeCallback<any>;
function printerr(): nodeCallback<any>;
}
export = iferr;