mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-02 06:29:40 +08:00
fix lint: strict-export-declare-modifiers
This commit is contained in:
10
types/iferr/index.d.ts
vendored
10
types/iferr/index.d.ts
vendored
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user