@ogygia/core 0.11.3 → 0.11.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/hooks.d.ts +2 -1
- package/dist/kit-handle.d.ts +20 -0
- package/dist/kit-handle.js +0 -0
- package/dist/plugin/index.d.ts +3 -4
- package/dist/plugin/server.d.ts +3 -2
- package/package.json +1 -1
package/dist/hooks.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { Handle } from "./kit-handle.js";
|
|
1
2
|
import { TransformKind } from "./server/reversible.js";
|
|
2
3
|
import { ogygiaTransport } from "./transport.js";
|
|
3
4
|
import { DocumentOptions, document } from "./document.js";
|
|
4
5
|
import { LiftResult, LiftedRegion, RegionKind, RegionSpan, liftRegions, restoreRegions, scanRegions } from "./server/split-regions.js";
|
|
5
|
-
import {
|
|
6
|
+
import { RequestEvent } from "@sveltejs/kit";
|
|
6
7
|
/**
|
|
7
8
|
* Options for {@link handle}.
|
|
8
9
|
*/
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { RequestEvent } from "@sveltejs/kit";
|
|
2
|
+
type MaybePromise<T> = T | Promise<T>;
|
|
3
|
+
/** Kit's `resolve()` options. */
|
|
4
|
+
export interface ResolveOptions {
|
|
5
|
+
transformPageChunk?(input: {
|
|
6
|
+
html: string;
|
|
7
|
+
done: boolean;
|
|
8
|
+
}): MaybePromise<string | undefined>;
|
|
9
|
+
filterSerializedResponseHeaders?(name: string, value: string): boolean;
|
|
10
|
+
preload?(input: {
|
|
11
|
+
type: "font" | "css" | "js" | "asset";
|
|
12
|
+
path: string;
|
|
13
|
+
}): boolean;
|
|
14
|
+
}
|
|
15
|
+
/** Kit's `Handle` hook. */
|
|
16
|
+
export type Handle = (input: {
|
|
17
|
+
event: RequestEvent;
|
|
18
|
+
resolve: (event: RequestEvent, opts?: ResolveOptions) => MaybePromise<Response>;
|
|
19
|
+
}) => MaybePromise<Response>;
|
|
20
|
+
export {};
|
|
File without changes
|
package/dist/plugin/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Handle, ResolveOptions } from "../kit-handle.js";
|
|
1
2
|
import { RequestFacts } from "./facts.js";
|
|
2
3
|
import { Ask, Notify, ServerHooks } from "./hooks.js";
|
|
3
4
|
import { DevtoolsEventInput } from "../events/schema.js";
|
|
@@ -5,7 +6,7 @@ import { DeferredRegion, og_html_region, region } from "../region.js";
|
|
|
5
6
|
import { RouteConfig, RouteConfigMatcher, register_route_config } from "./routes.js";
|
|
6
7
|
import { LateRegion, open_late_scope, take_late_regions } from "../late-region-registry.js";
|
|
7
8
|
import { LATE_BOOT_SCRIPT, late_chunk, late_slot } from "../server/late-wire.js";
|
|
8
|
-
import {
|
|
9
|
+
import { RequestEvent } from "@sveltejs/kit";
|
|
9
10
|
/** The server process, as one plugin sees it (handed to `setup`, and on every `ctx.app`). */
|
|
10
11
|
export interface ServerApp<Options = undefined> {
|
|
11
12
|
/** The plugin's name (its package name). */
|
|
@@ -81,8 +82,6 @@ export interface RequestContext<Options = undefined, State = undefined> {
|
|
|
81
82
|
perVisitor(reason: string): void;
|
|
82
83
|
}
|
|
83
84
|
type MaybePromise<T> = T | Promise<T>;
|
|
84
|
-
/** Kit's `resolve()` options (a `transformPageChunk`, `filterSerializedResponseHeaders`, …). */
|
|
85
|
-
export type ResolveOptions = NonNullable<Parameters<Parameters<Handle>[0]["resolve"]>[1]>;
|
|
86
85
|
/** A request as an AROUND hook sees it: before anything is decided about it. */
|
|
87
86
|
export interface HandleContext<Options = undefined> {
|
|
88
87
|
/** Kit's own event, untouched. */
|
|
@@ -124,4 +123,4 @@ export declare const STORED_DOCUMENT_META = "<meta name=\"ogygia-stored\" conten
|
|
|
124
123
|
/** A deferred region value whose HTML the browser fetches from `url` (a capability the plugin minted,
|
|
125
124
|
* `''` for an inert one). HTML only: whatever islands the answer carries wake themselves. */
|
|
126
125
|
export declare function deferredRegion(id: string, url: string): DeferredRegion;
|
|
127
|
-
export { type DevtoolsEventInput, LATE_BOOT_SCRIPT, type LateRegion, type RequestFacts, type RouteConfig, type RouteConfigMatcher, type ServerHooks, og_html_region as htmlRegion, late_chunk as lateChunk, late_slot as lateSlot, open_late_scope as openLateScope, region, register_route_config as registerRouteConfig, take_late_regions as takeLateRegions };
|
|
126
|
+
export { type DevtoolsEventInput, type Handle, LATE_BOOT_SCRIPT, type LateRegion, type RequestFacts, type ResolveOptions, type RouteConfig, type RouteConfigMatcher, type ServerHooks, og_html_region as htmlRegion, late_chunk as lateChunk, late_slot as lateSlot, open_late_scope as openLateScope, region, register_route_config as registerRouteConfig, take_late_regions as takeLateRegions };
|
package/dist/plugin/server.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Handle, ResolveOptions } from "../kit-handle.js";
|
|
2
|
+
import { RequestContext, ServerApp, ServerPlugin } from "./index.js";
|
|
2
3
|
import { RequestFacts } from "./facts.js";
|
|
3
4
|
import { CapabilitySigner } from "./capability.js";
|
|
4
|
-
import {
|
|
5
|
+
import { RequestEvent } from "@sveltejs/kit";
|
|
5
6
|
/** One plugin's server half as the build lists it (`virtual:ogygia/server-plugins`). */
|
|
6
7
|
export interface ServerPluginEntry {
|
|
7
8
|
name: string;
|