type 定义修改

This commit is contained in:
xion 2024-12-14 08:52:42 +08:00
parent dc2f282f4b
commit 50c87043c8
3 changed files with 8 additions and 8 deletions

View File

@ -1,7 +1,7 @@
{
"$schema": "https://json.schemastore.org/package",
"name": "@kevisual/router",
"version": "0.0.6-alpha-3",
"version": "0.0.6-alpha-4",
"description": "",
"main": "dist/index.js",
"module": "dist/index.js",

View File

@ -61,9 +61,9 @@ export class App<T = {}, U = AppReqRes> {
Route = Route;
route(opts: RouteOpts): Route<U>;
route(path: string, key?: string): Route;
route(path: string, opts?: RouteOpts): Route;
route(path: string, key?: string, opts?: RouteOpts): Route;
route(path: string, key?: string): Route<U>;
route(path: string, opts?: RouteOpts): Route<U>;
route(path: string, key?: string, opts?: RouteOpts): Route<U>;
route(...args: any[]) {
const [path, key, opts] = args;
if (typeof path === 'object') {

View File

@ -582,10 +582,10 @@ export class QueryRouterServer extends QueryRouter {
}
Route = Route;
route(opts: RouteOpts): Route;
route(path: string, key?: string): Route;
route(path: string, opts?: RouteOpts): Route;
route(path: string, key?: string, opts?: RouteOpts): Route;
route(opts: RouteOpts): Route<Required<RouteContext>>;
route(path: string, key?: string): Route<Required<RouteContext>>;
route(path: string, opts?: RouteOpts): Route<Required<RouteContext>>;
route(path: string, key?: string, opts?: RouteOpts): Route<Required<RouteContext>>;
route(...args: any[]) {
const [path, key, opts] = args;
if (typeof path === 'object') {