From 9cc75bf6080dfe633dd1a823affc61f627f05bfe Mon Sep 17 00:00:00 2001 From: Daniel Hensby Date: Thu, 25 Jul 2024 09:54:37 +0100 Subject: [PATCH] refactor: prefer Record built-in over object maps --- index.d.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/index.d.ts b/index.d.ts index b06235d..bb1396c 100644 --- a/index.d.ts +++ b/index.d.ts @@ -51,15 +51,15 @@ declare namespace OAuth2Server { */ class Request { body?: any; - headers?: { [key: string]: string; }; + headers?: Record; method?: string; - query?: { [key: string]: string; }; + query?: Record; /** * Instantiates Request using the supplied options. * */ - constructor(options?: { [key: string]: any } | http.IncomingMessage); + constructor(options?: Record | http.IncomingMessage); /** * Returns the specified HTTP header field. The match is case-insensitive. @@ -79,14 +79,14 @@ declare namespace OAuth2Server { */ class Response { body?: any; - headers?: { [key: string]: string; }; + headers?: Record; status?: number; /** * Instantiates Response using the supplied options. * */ - constructor(options?: { [key: string]: any; } | http.ServerResponse); + constructor(options?: Record | http.ServerResponse); /** * Returns the specified HTTP header field. The match is case-insensitive. @@ -232,7 +232,7 @@ declare namespace OAuth2Server { /** * Additional supported grant types. */ - extendedGrantTypes?: { [key: string]: typeof AbstractGrantType }; + extendedGrantTypes?: Record; } /**