alien-middleware 0.11.1 → 0.11.3
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.
|
@@ -41,19 +41,19 @@ type ReservedProperties = {
|
|
|
41
41
|
* - `env`: Add type-safe environment variables.
|
|
42
42
|
*/
|
|
43
43
|
type RequestPlugin = Record<string, unknown> & ReservedProperties;
|
|
44
|
-
type MiddlewareTypes = {
|
|
44
|
+
type MiddlewareTypes<TEnv extends object = object, TProperties extends object = object, TPlatform = unknown> = {
|
|
45
45
|
/** Values expected by the start of the chain. */
|
|
46
46
|
initial: {
|
|
47
|
-
env:
|
|
48
|
-
properties:
|
|
47
|
+
env: TEnv;
|
|
48
|
+
properties: TProperties;
|
|
49
49
|
};
|
|
50
50
|
/** Values provided by the end of the chain. */
|
|
51
51
|
current: {
|
|
52
|
-
env:
|
|
53
|
-
properties:
|
|
52
|
+
env: TEnv;
|
|
53
|
+
properties: TProperties;
|
|
54
54
|
};
|
|
55
55
|
/** Values from the host platform. */
|
|
56
|
-
platform:
|
|
56
|
+
platform: TPlatform;
|
|
57
57
|
};
|
|
58
58
|
type AnyMiddlewareTypes = {
|
|
59
59
|
initial: {
|
|
@@ -251,17 +251,7 @@ declare class MiddlewareChain<T extends MiddlewareTypes = any> {
|
|
|
251
251
|
*/
|
|
252
252
|
toHandler(): RequestHandler<T>;
|
|
253
253
|
}
|
|
254
|
-
declare function chain<TEnv extends object = {}, TProperties extends object = {}, TPlatform = unknown>(): MiddlewareChain<
|
|
255
|
-
initial: {
|
|
256
|
-
env: TEnv;
|
|
257
|
-
properties: TProperties;
|
|
258
|
-
};
|
|
259
|
-
current: {
|
|
260
|
-
env: TEnv;
|
|
261
|
-
properties: TProperties;
|
|
262
|
-
};
|
|
263
|
-
platform: TPlatform;
|
|
264
|
-
}>;
|
|
254
|
+
declare function chain<TEnv extends object = {}, TProperties extends object = {}, TPlatform = unknown>(): MiddlewareChain<MiddlewareTypes<TEnv, TProperties, TPlatform>>;
|
|
265
255
|
declare function chain<T extends AnyMiddleware>(middleware: T): T extends AnyMiddlewareChain ? T : RequestHandler<ApplyFirstMiddleware<T>>;
|
|
266
256
|
|
|
267
|
-
export { type
|
|
257
|
+
export { type AnyMiddleware as A, type EmptyMiddlewareChain as E, type HattipContext as H, type MiddlewareContext as M, type Router as R, MiddlewareChain as a, type RouteContext as b, type RouteHandler as c, chain as d, type AnyMiddlewareChain as e, filterPlatform as f, type ApplyMiddleware as g, type ApplyMiddlewares as h, type EnvAccessor as i, type ExtractMiddleware as j, type Middleware as k, type MiddlewareTypes as l, type RequestContext as m, type RequestHandler as n, type RequestMiddleware as o, type RequestPlugin as p, type ResponseCallback as q };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { A as
|
|
1
|
+
export { A as AnyMiddleware, e as AnyMiddlewareChain, g as ApplyMiddleware, h as ApplyMiddlewares, E as EmptyMiddlewareChain, i as EnvAccessor, j as ExtractMiddleware, H as HattipContext, k as Middleware, a as MiddlewareChain, M as MiddlewareContext, l as MiddlewareTypes, m as RequestContext, n as RequestHandler, o as RequestMiddleware, p as RequestPlugin, q as ResponseCallback, d as chain, f as filterPlatform } from './index-B2CcDlog.js';
|
|
2
2
|
import '@hattip/core';
|
|
3
3
|
import 'pathic';
|
package/dist/router.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as Router, M as MiddlewareContext, a as MiddlewareChain, E as EmptyMiddlewareChain } from './index-
|
|
2
|
-
export { b as RouteContext, c as RouteHandler } from './index-
|
|
1
|
+
import { R as Router, M as MiddlewareContext, a as MiddlewareChain, E as EmptyMiddlewareChain } from './index-B2CcDlog.js';
|
|
2
|
+
export { b as RouteContext, c as RouteHandler } from './index-B2CcDlog.js';
|
|
3
3
|
import '@hattip/core';
|
|
4
4
|
import 'pathic';
|
|
5
5
|
|