From 8d33985d5a8104e8090862972f1bca1669447ef5 Mon Sep 17 00:00:00 2001 From: Chris Wilkinson Date: Tue, 19 Nov 2019 19:36:58 +0000 Subject: [PATCH] [http-errors] Extract UnknownError type (#40487) * Extract UnknownError type * CS fix --- types/http-errors/index.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/types/http-errors/index.d.ts b/types/http-errors/index.d.ts index 90f8eeb13e..9969141091 100644 --- a/types/http-errors/index.d.ts +++ b/types/http-errors/index.d.ts @@ -20,9 +20,11 @@ declare namespace createHttpError { [key: string]: any; } + type UnknownError = Error | string | number | { [key: string]: any }; + type HttpErrorConstructor = new (msg?: string) => HttpError; - type CreateHttpError = (...args: Array) => HttpError; + type CreateHttpError = (...args: UnknownError[]) => HttpError; type NamedConstructors = { [code: string]: HttpErrorConstructor;