@kevisual/router 0.2.2 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app.js +112 -123
- package/dist/commander.d.ts +11 -14
- package/dist/commander.js +96 -90
- package/dist/opencode.d.ts +11 -14
- package/dist/opencode.js +84 -84
- package/dist/router-browser.d.ts +14 -14
- package/dist/router-browser.js +85 -85
- package/dist/router-define.d.ts +12 -12
- package/dist/router-simple.d.ts +2 -3
- package/dist/router-simple.js +1 -1
- package/dist/router.d.ts +16 -22
- package/dist/router.js +108 -119
- package/dist/ws.d.ts +11 -14
- package/dist/ws.js +23 -34
- package/package.json +3 -4
- package/src/commander.ts +6 -4
package/dist/opencode.d.ts
CHANGED
|
@@ -171,7 +171,7 @@ declare class Route<M extends SimpleObject = SimpleObject, U extends SimpleObjec
|
|
|
171
171
|
description?: string;
|
|
172
172
|
metadata?: M;
|
|
173
173
|
middleware?: RouteMiddleware[];
|
|
174
|
-
type?: string;
|
|
174
|
+
type?: string | undefined;
|
|
175
175
|
/**
|
|
176
176
|
* 是否开启debug,开启后会打印错误信息
|
|
177
177
|
*/
|
|
@@ -269,7 +269,7 @@ declare class QueryRouter<T extends SimpleObject = SimpleObject> implements thro
|
|
|
269
269
|
[key: string]: any;
|
|
270
270
|
}> | {
|
|
271
271
|
code: number;
|
|
272
|
-
body:
|
|
272
|
+
body: null;
|
|
273
273
|
message: string;
|
|
274
274
|
}>;
|
|
275
275
|
/**
|
|
@@ -287,9 +287,9 @@ declare class QueryRouter<T extends SimpleObject = SimpleObject> implements thro
|
|
|
287
287
|
}, ctx?: RouteContext & {
|
|
288
288
|
[key: string]: any;
|
|
289
289
|
}): Promise<{
|
|
290
|
-
code: number;
|
|
291
|
-
data:
|
|
292
|
-
message: string;
|
|
290
|
+
code: number | undefined;
|
|
291
|
+
data: string | number | Object | null | undefined;
|
|
292
|
+
message: string | undefined;
|
|
293
293
|
}>;
|
|
294
294
|
/**
|
|
295
295
|
* Router Run获取数据
|
|
@@ -305,9 +305,9 @@ declare class QueryRouter<T extends SimpleObject = SimpleObject> implements thro
|
|
|
305
305
|
}, ctx?: RouteContext<T> & {
|
|
306
306
|
[key: string]: any;
|
|
307
307
|
}): Promise<{
|
|
308
|
-
code: number;
|
|
309
|
-
data:
|
|
310
|
-
message: string;
|
|
308
|
+
code: number | undefined;
|
|
309
|
+
data: string | number | Object | null | undefined;
|
|
310
|
+
message: string | undefined;
|
|
311
311
|
}>;
|
|
312
312
|
/**
|
|
313
313
|
* 设置上下文
|
|
@@ -342,12 +342,12 @@ declare class QueryRouter<T extends SimpleObject = SimpleObject> implements thro
|
|
|
342
342
|
importRoutes(routes: Route[]): void;
|
|
343
343
|
importRouter(router: QueryRouter): void;
|
|
344
344
|
throw(...args: any[]): void;
|
|
345
|
-
hasRoute(path: string, key?: string): Route<SimpleObject, SimpleObject
|
|
345
|
+
hasRoute(path: string, key?: string): Route<SimpleObject, SimpleObject> | undefined;
|
|
346
346
|
findRoute(opts?: {
|
|
347
347
|
path?: string;
|
|
348
348
|
key?: string;
|
|
349
349
|
rid?: string;
|
|
350
|
-
}): Route<SimpleObject, SimpleObject
|
|
350
|
+
}): Route<SimpleObject, SimpleObject> | undefined;
|
|
351
351
|
createRouteList(opts?: {
|
|
352
352
|
force?: boolean;
|
|
353
353
|
filter?: (route: Route) => boolean;
|
|
@@ -791,10 +791,7 @@ declare class App<U = {}> extends QueryRouterServer<AppRouteContext<U>> {
|
|
|
791
791
|
listen(handle: any, backlog?: number, listeningListener?: () => void): void;
|
|
792
792
|
listen(handle: any, listeningListener?: () => void): void;
|
|
793
793
|
Route: typeof Route;
|
|
794
|
-
static handleRequest(req: IncomingMessage$1, res: ServerResponse$1): Promise<
|
|
795
|
-
cookies: Record<string, string>;
|
|
796
|
-
token: string;
|
|
797
|
-
}>;
|
|
794
|
+
static handleRequest(req: IncomingMessage$1, res: ServerResponse$1): Promise<any>;
|
|
798
795
|
onServerRequest(fn: (req: IncomingMessage$1, res: ServerResponse$1) => void): void;
|
|
799
796
|
}
|
|
800
797
|
|