Browse Source

refactor: improve types

e22m4u 3 weeks ago
parent
commit
59bcc3efb8
3 changed files with 4 additions and 4 deletions
  1. 1 1
      src/parsers/query-parser.d.ts
  2. 2 2
      src/request-context.d.ts
  3. 1 1
      src/route.d.ts

+ 1 - 1
src/parsers/query-parser.d.ts

@@ -5,7 +5,7 @@ import {DebuggableService} from '../debuggable-service.js';
  * Parsed query.
  * Parsed query.
  */
  */
 export type ParsedQuery = {
 export type ParsedQuery = {
-  [key: string]: any;
+  [key: string]: string | undefined;
 };
 };
 
 
 /**
 /**

+ 2 - 2
src/request-context.d.ts

@@ -10,7 +10,7 @@ import {ServiceContainer} from '@e22m4u/js-service';
  * Parsed params.
  * Parsed params.
  */
  */
 export type ParsedParams = {
 export type ParsedParams = {
-  [key: string]: any;
+  [key: string]: string | undefined;
 };
 };
 
 
 /**
 /**
@@ -55,7 +55,7 @@ export declare class RequestContext {
   /**
   /**
    * Body.
    * Body.
    */
    */
-  body: any;
+  body: unknown;
 
 
   /**
   /**
    * Route meta.
    * Route meta.

+ 1 - 1
src/route.d.ts

@@ -40,7 +40,7 @@ export type RoutePostHandler<T = unknown, U = unknown> = (
  * Route meta.
  * Route meta.
  */
  */
 export type RouteMeta = {
 export type RouteMeta = {
-  [key: string]: any;
+  [key: string]: unknown;
 };
 };
 
 
 /**
 /**