Skip to content

Commit

Permalink
Update httprouter.ts to use express types
Browse files Browse the repository at this point in the history
  • Loading branch information
DanPlayz0 committed Dec 22, 2023
1 parent 4b7b787 commit c224718
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ashmwtech/dapir",
"version": "1.0.9",
"version": "1.0.10",
"type": "module",
"description": "An api wrapper",
"source": "src/index.ts",
Expand Down
10 changes: 5 additions & 5 deletions src/types/httprouter.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Response, Request, NextFunction } from 'express';
import express from 'express';
import { Documentation } from './documentation';
import { HttpStatus } from '../utils/httpStatus';

Expand All @@ -17,17 +17,17 @@ export interface RouteConfig {

export interface HTTPContext {
// HTTP Context
req: Request;
res: Response;
next: NextFunction;
req: express.Request;
res: express.Response;
next: express.NextFunction;
errorResponse: (
status: HttpStatus,
opts?: {
message?: string;
data?: any;
code?: string;
},
) => Response<any, Record<string, any>>;
) => express.Response<any, Record<string, any>>;
}

// Converted to `export type RouteHandler = typeof api.routeHandler<HTTPContext>;`
Expand Down

0 comments on commit c224718

Please sign in to comment.