type 定义修改

This commit is contained in:
熊潇 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", "$schema": "https://json.schemastore.org/package",
"name": "@kevisual/router", "name": "@kevisual/router",
"version": "0.0.6-alpha-3", "version": "0.0.6-alpha-4",
"description": "", "description": "",
"main": "dist/index.js", "main": "dist/index.js",
"module": "dist/index.js", "module": "dist/index.js",

View File

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

View File

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