diff --git a/packages/functions/types/async.d.ts b/packages/functions/types/async.d.ts index ab95609..955bfc8 100644 --- a/packages/functions/types/async.d.ts +++ b/packages/functions/types/async.d.ts @@ -10,7 +10,21 @@ export function asyncHandler(fn: Function): (req: any, res: any, next: Function) */ export function tracedAsyncHandler(fn: Function): (req: any, res: any, next: Function) => Promise; +/** + * @description Same as the `tracedAsyncHandler` but the log upon failure is a warning log + * @param fn The function to be invoked asynchronously + */ +export function fallibleAsyncHandler(fn: Function): (req: any, res: any, next: Function) => Promise; + +/** + * @description A more stripped down version of asyncHandler without any logs + * @param fn The function to be invoked asynchronously + */ +export function plainAsyncHandler(fn: Function): (req: any, res: any, next: Function) => Promise; + export default { asyncHandler, - tracedAsyncHandler + tracedAsyncHandler, + fallibleAsyncHandler, + plainAsyncHandler };