@wooksjs/event-http 0.7.1 → 0.7.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.
- package/dist/index.cjs +493 -499
- package/dist/index.d.ts +10 -10
- package/dist/index.mjs +494 -500
- package/package.json +5 -5
- package/skills/wooksjs-event-http/request.md +7 -7
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _wooksjs_event_core from '@wooksjs/event-core';
|
|
2
|
-
import { EventContext, Logger, EventContextOptions } from '@wooksjs/event-core';
|
|
2
|
+
import { EventContext, Logger, EventContextOptions, EventKindSeeds } from '@wooksjs/event-core';
|
|
3
3
|
export { EventContext, EventContextOptions, useLogger, useRouteParams } from '@wooksjs/event-core';
|
|
4
4
|
import * as http from 'http';
|
|
5
5
|
import { IncomingHttpHeaders, IncomingMessage, ServerResponse, Server } from 'http';
|
|
@@ -469,8 +469,15 @@ declare const useUrlParams: (ctx?: EventContext) => {
|
|
|
469
469
|
toJson: () => unknown;
|
|
470
470
|
};
|
|
471
471
|
|
|
472
|
-
/**
|
|
473
|
-
declare
|
|
472
|
+
/** Event kind definition for HTTP requests. Provides typed context slots for `req`, `response`, and `requestLimits`. */
|
|
473
|
+
declare const httpKind: _wooksjs_event_core.EventKind<{
|
|
474
|
+
req: _wooksjs_event_core.SlotMarker<IncomingMessage>;
|
|
475
|
+
response: _wooksjs_event_core.SlotMarker<HttpResponse | undefined>;
|
|
476
|
+
requestLimits: _wooksjs_event_core.SlotMarker<TRequestLimits | undefined>;
|
|
477
|
+
}>;
|
|
478
|
+
|
|
479
|
+
/** Creates an HTTP event context and runs `fn` inside it. */
|
|
480
|
+
declare function createHttpContext<R>(options: EventContextOptions, seeds: EventKindSeeds<typeof httpKind>, fn: () => R): R;
|
|
474
481
|
/** Returns the current HTTP event context. */
|
|
475
482
|
declare function useHttpContext(ctx?: EventContext): EventContext;
|
|
476
483
|
|
|
@@ -600,13 +607,6 @@ declare class WooksHttp extends WooksAdapterBase {
|
|
|
600
607
|
*/
|
|
601
608
|
declare function createHttpApp(opts?: TWooksHttpOptions, wooks?: Wooks | WooksAdapterBase): WooksHttp;
|
|
602
609
|
|
|
603
|
-
/** Event kind definition for HTTP requests. Provides typed context slots for `req`, `response`, and `requestLimits`. */
|
|
604
|
-
declare const httpKind: _wooksjs_event_core.EventKind<{
|
|
605
|
-
req: _wooksjs_event_core.SlotMarker<IncomingMessage>;
|
|
606
|
-
response: _wooksjs_event_core.SlotMarker<HttpResponse>;
|
|
607
|
-
requestLimits: _wooksjs_event_core.SlotMarker<TRequestLimits | undefined>;
|
|
608
|
-
}>;
|
|
609
|
-
|
|
610
610
|
/**
|
|
611
611
|
* Configuration for `securityHeaders()`. Each option accepts a `string` (override value),
|
|
612
612
|
* `false` (disable), or `undefined` (use default). `strictTransportSecurity` has no default (opt-in only).
|