brumate 0.8.0 → 0.9.0
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/{boot-BkUdiYOF.d.ts → boot-ej-9NRT3.d.ts} +20 -2
- package/dist/cli.js +88 -82
- package/dist/cli.js.map +1 -1
- package/dist/{client-B0FXW5Kw.js → client-B-ww-PQ7.js} +402 -63
- package/dist/client-B-ww-PQ7.js.map +1 -0
- package/dist/{client-Cq6aTiDs.d.ts → client-Do6IBIhI.d.ts} +58 -14
- package/dist/{defer-BMIMP4Hq.js → defer-JD2FK9mV.js} +5 -3
- package/dist/defer-JD2FK9mV.js.map +1 -0
- package/dist/{devtools-calls-DGW6nLZ2.js → devtools-calls-DCjuSkim.js} +3 -3
- package/dist/{devtools-calls-DGW6nLZ2.js.map → devtools-calls-DCjuSkim.js.map} +1 -1
- package/dist/{devtools-panel-B1nF1KB7.js → devtools-panel-DLeWTPhU.js} +4 -4
- package/dist/{devtools-panel-B1nF1KB7.js.map → devtools-panel-DLeWTPhU.js.map} +1 -1
- package/dist/{devtools-B4prrxht.js → devtools-tuq7ATGN.js} +10 -7
- package/dist/devtools-tuq7ATGN.js.map +1 -0
- package/dist/{error-catalog-DakxjSgj.js → error-catalog-BBWB7w-E.js} +11 -4
- package/dist/error-catalog-BBWB7w-E.js.map +1 -0
- package/dist/{error-catalog-VxLbz-6p.js → error-catalog-CbmQqfat.js} +1 -1
- package/dist/{events-LgLdp1R7.js → events-BDVITj3P.js} +3 -5
- package/dist/events-BDVITj3P.js.map +1 -0
- package/dist/{features-DwMYKBIC.js → features-Cte5aj20.js} +8 -2
- package/dist/features-Cte5aj20.js.map +1 -0
- package/dist/{files-D5GtxwEQ.js → files-Bz0lAQzD.js} +2 -2
- package/dist/{files-D5GtxwEQ.js.map → files-Bz0lAQzD.js.map} +1 -1
- package/dist/{html-Cf5uKhLs.js → html-BYuHDvxy.js} +10 -3
- package/dist/html-BYuHDvxy.js.map +1 -0
- package/dist/index.d.ts +71 -19
- package/dist/index.js +3 -3
- package/dist/{inspect-CGl5Y8q6.js → inspect-fpaBJ5pm.js} +1305 -75
- package/dist/inspect-fpaBJ5pm.js.map +1 -0
- package/dist/{loader-BsaSuIoG.js → loader-DMxuZ6He.js} +14 -6
- package/dist/loader-DMxuZ6He.js.map +1 -0
- package/dist/{navigate-BlowKvhB.js → navigate-C5PjwYMh.js} +108 -20
- package/dist/navigate-C5PjwYMh.js.map +1 -0
- package/dist/{produce-CLABZ8k2.d.ts → produce-BDkCsGH7.d.ts} +3 -3
- package/dist/{rpc-C1jYVNAe.js → rpc-DOdrekhP.js} +23 -13
- package/dist/rpc-DOdrekhP.js.map +1 -0
- package/dist/runtime/bundles.d.ts +3 -2
- package/dist/runtime/bundles.js +20 -5
- package/dist/runtime/bundles.js.map +1 -1
- package/dist/runtime/client.d.ts +4 -3
- package/dist/runtime/client.js +5 -5
- package/dist/runtime/devtools.d.ts +3 -1
- package/dist/runtime/devtools.js +1 -1
- package/dist/runtime/events.js +1 -1
- package/dist/runtime/hot.d.ts +1 -1
- package/dist/runtime/html.js +1 -1
- package/dist/runtime/loader.d.ts +2 -2
- package/dist/runtime/loader.js +2 -2
- package/dist/runtime/otel.d.ts +18 -0
- package/dist/runtime/otel.js +127 -0
- package/dist/runtime/otel.js.map +1 -0
- package/dist/runtime/server.d.ts +4 -3
- package/dist/runtime/server.js +5 -5
- package/dist/runtime/signals.d.ts +2 -2
- package/dist/runtime/signals.js +4 -1
- package/dist/runtime/signals.js.map +1 -1
- package/dist/runtime/static-loader.d.ts +2 -2
- package/dist/runtime/static-loader.js +1 -1
- package/dist/runtime/store.d.ts +2 -2
- package/dist/runtime/store.js +1 -1
- package/dist/runtime/testing.d.ts +2 -2
- package/dist/runtime/testing.js +2 -2
- package/dist/search-params-qGERTLi3.js +382 -0
- package/dist/search-params-qGERTLi3.js.map +1 -0
- package/dist/{serial-ribg9NAj.js → serial-B2AJ9VGx.js} +1 -1
- package/dist/{serial-ioa17MuY.js → serial-Cj6pDGOq.js} +6 -6
- package/dist/{serial-ioa17MuY.js.map → serial-Cj6pDGOq.js.map} +1 -1
- package/dist/{server-DesBZv5g.d.ts → server-2-LS_KFo.d.ts} +125 -9
- package/dist/{server-BUuf7XPZ.js → server-CRGZMWnK.js} +545 -236
- package/dist/server-CRGZMWnK.js.map +1 -0
- package/dist/{shared-CX_YacDm.js → shared-CUBWrbiM.js} +4 -4
- package/dist/{shared-CX_YacDm.js.map → shared-CUBWrbiM.js.map} +1 -1
- package/dist/sheets-B9Zr50mf.js +105 -0
- package/dist/sheets-B9Zr50mf.js.map +1 -0
- package/dist/{signals-7VVD9C_H.d.ts → signals-BgsJK-uT.d.ts} +16 -6
- package/dist/{static-loader-C_en-4v8.js → static-loader-BDBtWsdg.js} +107 -19
- package/dist/static-loader-BDBtWsdg.js.map +1 -0
- package/dist/{static-loader-UKnK11Em.d.ts → static-loader-CAFn6p0l.d.ts} +2 -2
- package/dist/{store-9_oa0HG1.d.ts → store-BwWg-Iei.d.ts} +79 -2
- package/dist/store-DNr24Z8L.js +950 -0
- package/dist/store-DNr24Z8L.js.map +1 -0
- package/dist/{stream-read-BTsYstJY.js → stream-read-CiLDH60b.js} +2 -2
- package/dist/{stream-read-BTsYstJY.js.map → stream-read-CiLDH60b.js.map} +1 -1
- package/dist/{stream-read-Dek3HnqO.js → stream-read-DVoregpA.js} +1 -1
- package/dist/trace-DT7RGRAV.d.ts +52 -0
- package/dist/trace-browser-C7MFMove.js +170 -0
- package/dist/trace-browser-C7MFMove.js.map +1 -0
- package/dist/trace-flag-Dy267snx.js +7 -0
- package/dist/trace-flag-Dy267snx.js.map +1 -0
- package/dist/{trusted-g_zUJbh2.js → trusted-Bmwg4_hf.js} +12 -5
- package/dist/trusted-Bmwg4_hf.js.map +1 -0
- package/dist/view-transitions-BpnVwtS4.js +141 -0
- package/dist/view-transitions-BpnVwtS4.js.map +1 -0
- package/dist/vite.d.ts +8 -1
- package/dist/vite.js +356 -46
- package/dist/vite.js.map +1 -1
- package/elements.d.ts +8 -0
- package/package.json +13 -1
- package/skills/brumate/SKILL.md +9 -5
- package/skills/brumate/references/errors.md +95 -14
- package/skills/brumate/references/events.md +27 -1
- package/skills/brumate/references/signals.md +4 -4
- package/skills/brumate/references/state.md +79 -4
- package/skills/brumate/references/syntax.md +58 -9
- package/dist/client-B0FXW5Kw.js.map +0 -1
- package/dist/defer-BMIMP4Hq.js.map +0 -1
- package/dist/devtools-B4prrxht.js.map +0 -1
- package/dist/error-catalog-DakxjSgj.js.map +0 -1
- package/dist/events-LgLdp1R7.js.map +0 -1
- package/dist/features-DwMYKBIC.js.map +0 -1
- package/dist/html-Cf5uKhLs.js.map +0 -1
- package/dist/inspect-CGl5Y8q6.js.map +0 -1
- package/dist/loader-BsaSuIoG.js.map +0 -1
- package/dist/navigate-BlowKvhB.js.map +0 -1
- package/dist/rpc-C1jYVNAe.js.map +0 -1
- package/dist/search-params-Wg-0FsMj.js +0 -148
- package/dist/search-params-Wg-0FsMj.js.map +0 -1
- package/dist/server-BUuf7XPZ.js.map +0 -1
- package/dist/static-loader-C_en-4v8.js.map +0 -1
- package/dist/store-Cy4EEyZ7.js +0 -439
- package/dist/store-Cy4EEyZ7.js.map +0 -1
- package/dist/trusted-g_zUJbh2.js.map +0 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { t as Context$1 } from "./context-BNgBXVUQ.js";
|
|
2
2
|
import { a as PageState, c as ScopeId, i as PackedState, l as ScopeState, m as Raw, n as ElementReference, o as PropSink, t as Binding } from "./shared-CuJdWifz.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { d as Store } from "./store-BwWg-Iei.js";
|
|
4
|
+
import { a as Tracer, n as TraceHandler, t as EndSpan } from "./trace-DT7RGRAV.js";
|
|
5
|
+
import { N as SearchParamOptions } from "./signals-BgsJK-uT.js";
|
|
5
6
|
import { t as StandardSchemaV1 } from "./standard-schema-BNY82yX3.js";
|
|
6
7
|
import { f as Intent, v as SubmissionResult } from "./forms-j1xPAR14.js";
|
|
7
8
|
//#region src/runtime/cookies.d.ts
|
|
@@ -112,6 +113,8 @@ interface RequestEventOptions {
|
|
|
112
113
|
prerender?: boolean;
|
|
113
114
|
/** The `onError` of the app, which gets the errors of this request. */
|
|
114
115
|
onError?: ServerErrorHandler;
|
|
116
|
+
/** The `onTrace` of the app, which gets the spans of this request. */
|
|
117
|
+
onTrace?: TraceHandler;
|
|
115
118
|
}
|
|
116
119
|
/** Where the server met an error: `'stream'` is a `#loading` body or a route after the response started. */
|
|
117
120
|
type ServerErrorKind = RequestKind | "stream";
|
|
@@ -186,8 +189,13 @@ declare class RequestEvent {
|
|
|
186
189
|
trace?: TraceEntry[];
|
|
187
190
|
/** When the trace started, by `performance.now()`. */
|
|
188
191
|
traceStart: number;
|
|
189
|
-
/**
|
|
190
|
-
|
|
192
|
+
/** Makes the spans for `onTrace`, when the app has one. */
|
|
193
|
+
readonly tracer: Tracer | undefined;
|
|
194
|
+
/**
|
|
195
|
+
* Starts an entry of the trace, for the devtools in development and for
|
|
196
|
+
* `onTrace`, and returns what ends it. Without either it makes nothing.
|
|
197
|
+
*/
|
|
198
|
+
traced(kind: TraceEntry["kind"], label: string): EndSpan;
|
|
191
199
|
/**
|
|
192
200
|
* The tags of the `cached` functions that the request called, with the
|
|
193
201
|
* version that each had then, so `revalidate` drops the page that it renders.
|
|
@@ -897,6 +905,12 @@ declare class Context {
|
|
|
897
905
|
private inTarget;
|
|
898
906
|
private readonly boundaries;
|
|
899
907
|
private readonly styles;
|
|
908
|
+
/** The `<link>` elements of the stylesheets that components asked for, in render order. */
|
|
909
|
+
private readonly sheets;
|
|
910
|
+
/** The URLs of the stylesheets that the page links already. */
|
|
911
|
+
linked: Set<string>;
|
|
912
|
+
/** The bundles of the client build, for the stylesheet of each component. */
|
|
913
|
+
bundles: ClientBundles | undefined;
|
|
900
914
|
/** Markup of `#portal` blocks, written at the end of the page. */
|
|
901
915
|
readonly portals: string[];
|
|
902
916
|
/** Markup of `#head` blocks. */
|
|
@@ -934,6 +948,8 @@ declare class Context {
|
|
|
934
948
|
event: RequestEvent | undefined;
|
|
935
949
|
/** The sink of the event, or of the `onError` option of a render without a request. */
|
|
936
950
|
errors: ErrorSink | undefined;
|
|
951
|
+
/** The spans of a render without a request, when the app has an `onTrace`. */
|
|
952
|
+
tracer: Tracer | undefined;
|
|
937
953
|
/** Results of server function calls in this render, so the same call runs once. */
|
|
938
954
|
readonly calls: Map<string, unknown>;
|
|
939
955
|
/** The event of the request, or undefined when the render has none. */
|
|
@@ -943,7 +959,7 @@ declare class Context {
|
|
|
943
959
|
/** The event of the page, for `getEvent()` in a component, which the compiler rewrites to this. */
|
|
944
960
|
getEvent(): RequestEvent;
|
|
945
961
|
/** Starts an entry of the trace of the request, in development. */
|
|
946
|
-
traced(kind: TraceEntry["kind"], label: string):
|
|
962
|
+
traced(kind: TraceEntry["kind"], label: string): EndSpan | undefined;
|
|
947
963
|
/** Marks the request of the page as one that depends on the user, so the page is not cached for everyone. */
|
|
948
964
|
personal(): void;
|
|
949
965
|
/** Runs code of the render with its event and its call results, such as a memo's compute. */
|
|
@@ -1122,8 +1138,17 @@ declare class Context {
|
|
|
1122
1138
|
* `$handler` marks gets a copy for its arguments.
|
|
1123
1139
|
*/
|
|
1124
1140
|
fn<T>(value: T, ref: string, scope: ScopeId, args?: unknown[]): T;
|
|
1125
|
-
/**
|
|
1126
|
-
|
|
1141
|
+
/**
|
|
1142
|
+
* Returns a component's stylesheet the first time the page renders the component. A build
|
|
1143
|
+
* passes no `css`: the page gets the CSS of the component from the bundles, as an inline
|
|
1144
|
+
* `<style>` in its head, or in place when the head has gone out. A component the bundles have
|
|
1145
|
+
* no CSS for gets a link to its stylesheet asset.
|
|
1146
|
+
*/
|
|
1147
|
+
style(id: string, css?: string): string;
|
|
1148
|
+
/** The IDs of the components that the page wrote the CSS of. */
|
|
1149
|
+
styledIds(): ReadonlySet<string>;
|
|
1150
|
+
/** The `<link>` elements of the stylesheets that the components of the page asked for. */
|
|
1151
|
+
sheetHTML(): string;
|
|
1127
1152
|
/** Adds the markup of a `#head` block. */
|
|
1128
1153
|
head(html: string): void;
|
|
1129
1154
|
/**
|
|
@@ -1357,6 +1382,10 @@ interface RenderResult {
|
|
|
1357
1382
|
next: () => number;
|
|
1358
1383
|
/** Markup for the document's head: the `$title` and the `#head` blocks. */
|
|
1359
1384
|
head: string;
|
|
1385
|
+
/** The `<link>` elements of the stylesheets of the components, which a build links. */
|
|
1386
|
+
sheets: string;
|
|
1387
|
+
/** The IDs of the components whose CSS the first render wrote, for the stylesheets of the bundles. */
|
|
1388
|
+
styled: ReadonlySet<string>;
|
|
1360
1389
|
/**
|
|
1361
1390
|
* The event of the request. Its `signal` aborts when the reader of the
|
|
1362
1391
|
* response goes away, which `streamParts` and `renderToStream` report.
|
|
@@ -1369,9 +1398,13 @@ interface RenderResult {
|
|
|
1369
1398
|
*/
|
|
1370
1399
|
defer?: "found" | "moved" | "missing";
|
|
1371
1400
|
}
|
|
1401
|
+
/** The `pending` of a render that has nothing left to send. */
|
|
1402
|
+
declare const NOTHING_PENDING: AsyncIterable<string>;
|
|
1372
1403
|
interface RenderOptions {
|
|
1373
1404
|
/** The `onError` of the app, which gets the errors of a render without a request event. */
|
|
1374
1405
|
onError?: ServerErrorHandler;
|
|
1406
|
+
/** The `onTrace` of the app, which gets the spans of a render. */
|
|
1407
|
+
onTrace?: TraceHandler;
|
|
1375
1408
|
/** The URL prefix of server function calls, for forms that post to one. Defaults to `/_brumate`. */
|
|
1376
1409
|
rpc?: string;
|
|
1377
1410
|
/** In development: the swaps of `#loading` bodies keep their fallbacks, for the devtools. */
|
|
@@ -1446,7 +1479,11 @@ interface RenderOptions {
|
|
|
1446
1479
|
* `setClientBundles`), so only a render that wants others passes them.
|
|
1447
1480
|
*/
|
|
1448
1481
|
bundles?: ClientBundles;
|
|
1482
|
+
/** The URLs of the stylesheets that the page links already, so a component does not link them again. */
|
|
1483
|
+
linked?: Iterable<string>;
|
|
1449
1484
|
}
|
|
1485
|
+
/** The bundles of the client build, for a render whose options name none. */
|
|
1486
|
+
declare let clientBundles: ClientBundles | undefined;
|
|
1450
1487
|
/**
|
|
1451
1488
|
* Sets the bundles that a render names when its options name none. The Vite plugin calls it in
|
|
1452
1489
|
* a server build with those of the client build, so a server that calls `render()` itself gets
|
|
@@ -1459,6 +1496,12 @@ interface ClientBundles {
|
|
|
1459
1496
|
chunks: Record<string, string>;
|
|
1460
1497
|
/** The URLs of the stylesheets that the modules of each bundle import. */
|
|
1461
1498
|
styles?: Record<string, string[]>;
|
|
1499
|
+
/** The URLs of the stylesheet that holds the CSS of each component, by component ID. */
|
|
1500
|
+
components?: Record<string, string[]>;
|
|
1501
|
+
/** The sheets of components only, by URL, and the components of each with global rules. */
|
|
1502
|
+
deferred?: Record<string, string[]>;
|
|
1503
|
+
/** The CSS of each component with CSS, which a page writes inline for the components it renders. */
|
|
1504
|
+
css?: Record<string, string>;
|
|
1462
1505
|
/** The IDs of the components whose code each bundle holds. */
|
|
1463
1506
|
members: Record<string, string[]>;
|
|
1464
1507
|
/** The roots whose bundles the browser has, such as those of a page that asks for a `#defer` body. */
|
|
@@ -1505,6 +1548,20 @@ type StreamOptions = DocumentOptions;
|
|
|
1505
1548
|
declare function renderToStream<P>(Root: Component<P>, props: P, options?: DocumentOptions): ReadableStream<string>;
|
|
1506
1549
|
/** Streams the parts of a page from `render`: the first render whole, then what resolves later. */
|
|
1507
1550
|
declare function streamParts(parts: RenderResult, options?: DocumentOptions): ReadableStream<string>;
|
|
1551
|
+
/**
|
|
1552
|
+
* The message and status that answer an error. A `ServerError` sends its
|
|
1553
|
+
* own. Any other error is logged, and sends `fallback` with status 500.
|
|
1554
|
+
*/
|
|
1555
|
+
declare function errorAnswer(error: unknown, fallback: string, kind: ServerErrorKind, event: RequestEvent | undefined): {
|
|
1556
|
+
message: string;
|
|
1557
|
+
status: number;
|
|
1558
|
+
};
|
|
1559
|
+
/**
|
|
1560
|
+
* Logs an error of the server, or gives it to `onError` when the app has one, which then logs
|
|
1561
|
+
* what it wants. A `ServerError` is an answer, so the handler does not get it. A handler that
|
|
1562
|
+
* fails has its error logged with the first one.
|
|
1563
|
+
*/
|
|
1564
|
+
declare function logError(error: unknown, kind: ServerErrorKind, sink: ErrorSink | undefined, event: RequestEvent | undefined): void;
|
|
1508
1565
|
/**
|
|
1509
1566
|
* The error that a `#catch` body gets on the server, which the page state carries to the
|
|
1510
1567
|
* browser. In development it is the error itself, for debugging. In production it is a plain
|
|
@@ -1513,6 +1570,14 @@ declare function streamParts(parts: RenderResult, options?: DocumentOptions): Re
|
|
|
1513
1570
|
* HTML cannot print what the state does not carry.
|
|
1514
1571
|
*/
|
|
1515
1572
|
declare function caught(error: unknown, ctx: Context, kind?: ServerErrorKind): unknown;
|
|
1573
|
+
/**
|
|
1574
|
+
* A response with `init`. A DOM environment such as happy-dom drops
|
|
1575
|
+
* `set-cookie` from the headers that a response is made with, but keeps the
|
|
1576
|
+
* ones added after, so a page in `brumate/testing` keeps its cookies.
|
|
1577
|
+
*/
|
|
1578
|
+
declare function respond(body: BodyInit | null, init: ResponseInit & {
|
|
1579
|
+
headers: Headers;
|
|
1580
|
+
}): Response;
|
|
1516
1581
|
interface RequestOptions {
|
|
1517
1582
|
/**
|
|
1518
1583
|
* Other origins that may call server functions and post forms to them,
|
|
@@ -1531,6 +1596,11 @@ interface RequestOptions {
|
|
|
1531
1596
|
* a `ServerError`, in place of `console.error`. The Vite plugin passes it.
|
|
1532
1597
|
*/
|
|
1533
1598
|
onError?: ServerErrorHandler;
|
|
1599
|
+
/**
|
|
1600
|
+
* The `onTrace` export of `src/middleware.ts`, which gets each span of the work of the server:
|
|
1601
|
+
* requests, renders, memos, calls and `#loading` and `#defer` bodies. The Vite plugin passes it.
|
|
1602
|
+
*/
|
|
1603
|
+
onTrace?: TraceHandler;
|
|
1534
1604
|
/**
|
|
1535
1605
|
* The middleware of each `'use server'` file, by the ID of each of its
|
|
1536
1606
|
* functions. It runs before the function, after the middleware of the
|
|
@@ -1568,6 +1638,15 @@ declare function isCrossSite(request: Request, options?: RequestOptions): boolea
|
|
|
1568
1638
|
* another site answers 403. See `isCrossSite`.
|
|
1569
1639
|
*/
|
|
1570
1640
|
declare function handleRequest(functions: Record<string, (...args: any[]) => unknown>, request: Request, prefix?: string, options?: RequestOptions): Promise<Response | undefined>;
|
|
1641
|
+
interface ResolvedView {
|
|
1642
|
+
key: string;
|
|
1643
|
+
component: Component;
|
|
1644
|
+
slots: Record<string, ResolvedView>;
|
|
1645
|
+
/** `_loading.brm`: the view streams in, and this shows until then. */
|
|
1646
|
+
loading?: Component;
|
|
1647
|
+
/** The `cache` export of the module script of the file. */
|
|
1648
|
+
cache?: PageCache;
|
|
1649
|
+
}
|
|
1571
1650
|
/**
|
|
1572
1651
|
* How long a page can be cached for everyone, as a route exports it from
|
|
1573
1652
|
* its module script: `export const cache = { maxAge: 60 }`. A layout's
|
|
@@ -1579,6 +1658,14 @@ interface PageCache {
|
|
|
1579
1658
|
/** Seconds after `maxAge` that a cache can serve the old page while it gets a new one. */
|
|
1580
1659
|
staleWhileRevalidate?: number;
|
|
1581
1660
|
}
|
|
1661
|
+
/** The key of a page in the store: its URL, and the base of a client navigation, by build. */
|
|
1662
|
+
declare function pageKey(url: URL, request: Request, build: string | undefined): string;
|
|
1663
|
+
/** The page that the store keeps for a key, when it is still fresh. */
|
|
1664
|
+
declare function keptPage(key: string): Promise<Response | undefined>;
|
|
1665
|
+
/** Keeps a public page in the store until its `max-age` ends. */
|
|
1666
|
+
declare function keepPage(key: string, response: Response, event: RequestEvent): Promise<void>;
|
|
1667
|
+
/** Imports every module of a matched route before it renders. */
|
|
1668
|
+
declare function resolveView(view: RouteView): Promise<ResolvedView>;
|
|
1582
1669
|
interface RouteOptions extends DocumentOptions, RequestOptions {
|
|
1583
1670
|
/**
|
|
1584
1671
|
* The HTML that the build prerendered for the path, for a server that has
|
|
@@ -1624,6 +1711,35 @@ interface RouteOptions extends DocumentOptions, RequestOptions {
|
|
|
1624
1711
|
*/
|
|
1625
1712
|
earlyHints?: (links: string[]) => void;
|
|
1626
1713
|
}
|
|
1714
|
+
/**
|
|
1715
|
+
* Runs the server function that a form without scripts posted to a page, as
|
|
1716
|
+
* `?__action=<id>`. Returns its result for `$action`, or the response that
|
|
1717
|
+
* answers the post instead of the page: a redirect, or an error.
|
|
1718
|
+
* `handleRoute` adds the cookies of the event to that response, and no other
|
|
1719
|
+
* headers of the event.
|
|
1720
|
+
*/
|
|
1721
|
+
declare function runAction(fn: (...args: any[]) => unknown, event: RequestEvent): Promise<{
|
|
1722
|
+
actions: Map<unknown, unknown>;
|
|
1723
|
+
} | {
|
|
1724
|
+
answer: Response;
|
|
1725
|
+
}>;
|
|
1726
|
+
/**
|
|
1727
|
+
* The `#defer` block that a request asks for, from `x-brumate-defer:
|
|
1728
|
+
* <boundary> <scope>:<anchor>`, which the browser sends when the block's
|
|
1729
|
+
* trigger fires.
|
|
1730
|
+
*/
|
|
1731
|
+
declare function deferTarget(request: Request): {
|
|
1732
|
+
boundary: ScopeId;
|
|
1733
|
+
at: string;
|
|
1734
|
+
} | undefined;
|
|
1735
|
+
/**
|
|
1736
|
+
* Renders the first `_error.brm` that renders, from the innermost. Its
|
|
1737
|
+
* component gets `error`, with the message and the status.
|
|
1738
|
+
*/
|
|
1739
|
+
declare function renderError(views: RouteView[], error: {
|
|
1740
|
+
message: string;
|
|
1741
|
+
status: number;
|
|
1742
|
+
}, params: Record<string, string>, request: Request, options: RouteOptions): Promise<Response | undefined>;
|
|
1627
1743
|
/**
|
|
1628
1744
|
* Answers a request with the route that matches its path, streamed:
|
|
1629
1745
|
*
|
|
@@ -1648,5 +1764,5 @@ declare function handleRoute(tree: RouteNode, request: Request, options?: RouteO
|
|
|
1648
1764
|
*/
|
|
1649
1765
|
declare function spread(attributes: Record<string, unknown>, on?: string[], names?: boolean): string | Promise<string>;
|
|
1650
1766
|
//#endregion
|
|
1651
|
-
export {
|
|
1652
|
-
//# sourceMappingURL=server-
|
|
1767
|
+
export { runAction as $, searchParam as $t, component as A, FailedSubmission as At, keptPage as B, fieldErrors as Bt, action as C, toNodeHeaders as Cn, RateLimitMiddleware as Ct, caught as D, clientAddress as Dt, binding as E, Window as Et, handleRoute as F, SuccessfulSubmission as Ft, pageKey as G, Handler as Gt, logError as H, parseForm as Ht, inlineBodies as I, parseSubmission as It, render as J, MiddlewareLoader as Jt, read as K, Loader as Kt, insert as L, ParseResult as Lt, dynamic as M, ReplyOptions as Mt, errorAnswer as N, Submission as Nt, children as O, configureRateLimit as Ot, handleRequest as P, SubmissionOptions as Pt, respond as Q, matchRoute as Qt, isCrossSite as R, ValidationError as Rt, StreamOptions as S, serializeCookie as Sn, RateLimitError as St, attribute as T, RateLimitStore as Tt, memo as U, safeParse as Ut, lazy as V, parse as Vt, packState as W, EndpointLoader as Wt, renderToStream as X, RouteNode as Xt, renderError as Y, RouteMatch as Yt, resolveView as Z, RouteView as Zt, RevealOrder as _, CookieOptions as _n, revalidate as _t, DocumentOptions as a, RequestEventOptions as an, stateScript as at, StateAttributes as b, createSession as bn, RateLimit as bt, Mark as c, ServerErrorHandler as cn, streamState as ct, NotReady as d, dedupe as dn, IdempotentOptions as dt, EntryMiddleware as en, setClientBundles as et, PageCache as f, defineMiddleware as fn, idempotent as ft, ResolvedView as g, withEvent as gn, memoryStore as gt, RequestOptions as h, redirect as hn, cached as ht, DeferTarget as i, RequestEvent as in, start as it, deferTarget as j, IntentSubmission as jt, clientBundles as k, rateLimit as kt, Memo as l, ServerErrorInfo as ln, wait as lt, RenderResult as m, isRedirect as mn, CachedOptions as mt, Component as n, Redirect as nn, spacerTag as nt, ItemSource as o, RequestKind as on, stateValue as ot, RenderOptions as p, getEvent as pn, CacheStore as pt, ready as q, Middleware as qt, Context as r, RequestCall as rn, spread as rt, Lazy as s, ServerError as sn, streamParts as st, ClientBundles as t, Locals as tn, settled as tt, NOTHING_PENDING as u, ServerErrorKind as un, waitAll as ut, RouteOptions as v, Session as vn, setCacheStore as vt, actionResult as w, RateLimitOptions as wt, StateMap as x, parseCookies as xn, RateLimitConfig as xt, ScopeEntry as y, SessionOptions as yn, storageStore as yt, keepPage as z, ValidationIssue as zt };
|
|
1768
|
+
//# sourceMappingURL=server-2-LS_KFo.d.ts.map
|