payload-live-preview 2.0.6 → 2.1.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.
Files changed (116) hide show
  1. package/README.md +141 -38
  2. package/dist/adapters/astro/FragmentBridge.astro +25 -0
  3. package/dist/adapters/astro/PreviewBoundary.astro +2 -4
  4. package/dist/adapters/astro/RichText.astro +26 -5
  5. package/dist/adapters/astro/index.d.ts +41 -9
  6. package/dist/adapters/astro/index.js +1 -1
  7. package/dist/adapters/astro/index.js.map +1 -1
  8. package/dist/adapters/astro/middleware-entry.d.ts +3 -3
  9. package/dist/adapters/astro/middleware-entry.js +1 -1
  10. package/dist/adapters/astro/middleware-entry.js.map +1 -1
  11. package/dist/adapters/nextjs/index.d.ts +17 -12
  12. package/dist/adapters/nextjs/index.js +1 -1
  13. package/dist/adapters/nextjs/index.js.map +1 -1
  14. package/dist/adapters/nuxt/index.d.ts +11 -6
  15. package/dist/adapters/nuxt/index.js +1 -1
  16. package/dist/adapters/nuxt/index.js.map +1 -1
  17. package/dist/adapters/nuxt/module.d.ts +64 -13
  18. package/dist/adapters/nuxt/module.js +1 -1
  19. package/dist/adapters/nuxt/module.js.map +1 -1
  20. package/dist/adapters/react/index.d.ts +11 -7
  21. package/dist/adapters/react/index.js +1 -1
  22. package/dist/adapters/react/index.js.map +1 -1
  23. package/dist/adapters/sveltekit/index.d.ts +10 -5
  24. package/dist/adapters/sveltekit/index.js +1 -1
  25. package/dist/adapters/sveltekit/index.js.map +1 -1
  26. package/dist/adapters/vue/index.d.ts +10 -7
  27. package/dist/adapters/vue/index.js +1 -1
  28. package/dist/adapters/vue/index.js.map +1 -1
  29. package/dist/annotate.d.ts +15 -2
  30. package/dist/annotate.js.map +1 -1
  31. package/dist/client.cjs +1 -1
  32. package/dist/client.cjs.map +1 -1
  33. package/dist/client.d.cts +367 -266
  34. package/dist/client.d.ts +367 -266
  35. package/dist/client.js +1 -1
  36. package/dist/client.js.map +1 -1
  37. package/dist/codegen-cli.js.map +1 -1
  38. package/dist/codegen.cjs.map +1 -1
  39. package/dist/codegen.d.cts +7 -1
  40. package/dist/codegen.d.ts +7 -1
  41. package/dist/codegen.js.map +1 -1
  42. package/dist/core.cjs +1 -1
  43. package/dist/core.cjs.map +1 -1
  44. package/dist/core.d.cts +544 -392
  45. package/dist/core.d.ts +544 -392
  46. package/dist/core.js +1 -1
  47. package/dist/core.js.map +1 -1
  48. package/dist/doctor-cli.d.ts +1 -1
  49. package/dist/doctor-cli.js +1 -1
  50. package/dist/doctor-cli.js.map +1 -1
  51. package/dist/doctor.d.ts +2 -2
  52. package/dist/doctor.js +1 -1
  53. package/dist/doctor.js.map +1 -1
  54. package/dist/{document-session-BfBfLVpg.d.ts → document-session-DWi9H3Qk.d.ts} +7 -0
  55. package/dist/{fragment-endpoint-DATKU183.d.ts → fragment-endpoint-B2qcRw5T.d.ts} +22 -7
  56. package/dist/fragment.cjs +1 -1
  57. package/dist/fragment.cjs.map +1 -1
  58. package/dist/fragment.d.cts +37 -16
  59. package/dist/fragment.d.ts +37 -16
  60. package/dist/fragment.js +1 -1
  61. package/dist/fragment.js.map +1 -1
  62. package/dist/index.cjs +1 -1
  63. package/dist/index.cjs.map +1 -1
  64. package/dist/index.d.cts +598 -400
  65. package/dist/index.d.ts +598 -400
  66. package/dist/index.js +1 -1
  67. package/dist/index.js.map +1 -1
  68. package/dist/lean.cjs +1 -1
  69. package/dist/lean.cjs.map +1 -1
  70. package/dist/lean.d.cts +5 -2
  71. package/dist/lean.d.ts +5 -2
  72. package/dist/lean.js +1 -1
  73. package/dist/lean.js.map +1 -1
  74. package/dist/lexical.cjs +1 -1
  75. package/dist/lexical.cjs.map +1 -1
  76. package/dist/lexical.d.cts +32 -11
  77. package/dist/lexical.d.ts +32 -11
  78. package/dist/lexical.js +1 -1
  79. package/dist/lexical.js.map +1 -1
  80. package/dist/{locals-CNUGYbA_.d.ts → locals-B1mF3aTb.d.ts} +1 -1
  81. package/dist/{middleware-CWObDO37.d.ts → middleware-BGobLN9P.d.ts} +11 -5
  82. package/dist/migrate.js +1 -1
  83. package/dist/migrate.js.map +1 -1
  84. package/dist/{options-uHKrDM2U.d.ts → options-Cm8fC7dj.d.ts} +31 -1
  85. package/dist/payload.cjs +1 -1
  86. package/dist/payload.cjs.map +1 -1
  87. package/dist/payload.d.cts +18 -2
  88. package/dist/payload.d.ts +18 -2
  89. package/dist/payload.js +1 -1
  90. package/dist/payload.js.map +1 -1
  91. package/dist/plugin.cjs +2 -0
  92. package/dist/plugin.cjs.map +1 -0
  93. package/dist/plugin.d.cts +30 -0
  94. package/dist/plugin.d.ts +30 -0
  95. package/dist/plugin.js +2 -0
  96. package/dist/plugin.js.map +1 -0
  97. package/dist/plugins.cjs +1 -1
  98. package/dist/plugins.cjs.map +1 -1
  99. package/dist/plugins.d.cts +102 -29
  100. package/dist/plugins.d.ts +102 -29
  101. package/dist/plugins.js +1 -1
  102. package/dist/plugins.js.map +1 -1
  103. package/dist/{probe-Bzm4fYFL.d.ts → probe-DGPDsnbj.d.ts} +6 -2
  104. package/dist/server.cjs +1 -1
  105. package/dist/server.cjs.map +1 -1
  106. package/dist/server.d.cts +43 -4
  107. package/dist/server.d.ts +43 -4
  108. package/dist/server.js +1 -1
  109. package/dist/server.js.map +1 -1
  110. package/dist/structural.cjs +2 -2
  111. package/dist/structural.cjs.map +1 -1
  112. package/dist/structural.d.cts +61 -13
  113. package/dist/structural.d.ts +61 -13
  114. package/dist/structural.js +2 -2
  115. package/dist/structural.js.map +1 -1
  116. package/package.json +33 -4
package/dist/index.d.cts CHANGED
@@ -2,280 +2,6 @@
2
2
  /** @internal */
3
3
  declare const VERSION: string;
4
4
 
5
- /** Connection status and the heartbeat that decides a disconnect. */
6
- type ConnectionStatus = 'disconnected' | 'connecting' | 'connected';
7
-
8
- /**
9
- * Shape of the `inspect()` snapshot. It only re-reads what the page already
10
- * shows — origins from the injected script, field names from the DOM,
11
- * counters derived from both — so it stays available in production, where a
12
- * misbehaving preview is exactly the case worth diagnosing. Reading one
13
- * performs no I/O and transmits nothing.
14
- */
15
-
16
- /** Origin trust as the runtime currently sees it. */
17
- interface InspectionOrigins {
18
- /** Configured origins; empty means the referrer and localhost heuristics decide instead. */
19
- readonly trusted: readonly string[];
20
- /** The origin locked onto by the first accepted update; every other is then refused. */
21
- readonly locked: string | undefined;
22
- }
23
- /** Protocol versions and the capabilities they enable. */
24
- interface InspectionProtocol {
25
- /** This library's protocol version. */
26
- readonly ours: number;
27
- /** The remote party's version, or `undefined` if it never announced one. */
28
- readonly theirs: number | undefined;
29
- /** `min(ours, theirs ?? 1)` — what both sides actually share. */
30
- readonly negotiated: number;
31
- /** Capability flags enabled at the negotiated version. */
32
- readonly capabilities: readonly string[];
33
- /** The subset of `capabilities` seen on the wire rather than granted by version. */
34
- readonly observed: readonly string[];
35
- /** The Payload profile the observed capabilities imply: `unknown`, `payload-2` or `payload-3`. */
36
- readonly profile: string;
37
- }
38
- /** Revision accounting for the update pipeline. */
39
- interface InspectionRevisions {
40
- /** Updates accepted since the runtime started. */
41
- readonly accepted: number;
42
- /**
43
- * Updates that were still in flight when a newer one arrived and were
44
- * therefore abandoned. A number that tracks `accepted` closely means the
45
- * editor is out-typing the pipeline, which is normal; it is only a problem
46
- * when the last update is among the abandoned ones.
47
- */
48
- readonly superseded: number;
49
- /**
50
- * Updates whose scheduled writes reached the DOM. What is neither
51
- * superseded nor completed is in flight or was cancelled; a `superseded`
52
- * that tracks `accepted` while `completed` stays low is the editor
53
- * out-typing the pipeline.
54
- */
55
- readonly completed: number;
56
- /**
57
- * Bindings not scheduled because their value was identical to the one last
58
- * applied. Cumulative since start; always `0` unless `skipUnchanged` is on.
59
- * A large number beside a small `accepted` is the optimisation working.
60
- */
61
- readonly skippedUnchanged: number;
62
- /** Revision currently in flight, or `undefined` when the pipeline is idle. */
63
- readonly active: number | undefined;
64
- }
65
- /** What the DOM offers the runtime to write into. */
66
- interface InspectionBindings {
67
- /** Elements carrying a binding. */
68
- readonly elements: number;
69
- /** Distinct field names across those elements. */
70
- readonly fields: number;
71
- /** Those field names, sorted. */
72
- readonly fieldNames: readonly string[];
73
- /**
74
- * Bound fields some update carried no value for, so the binding kept its old
75
- * text — why a binding can stay stale while its siblings update. Cumulative.
76
- */
77
- readonly absentFields: readonly string[];
78
- /**
79
- * Field names that arrived but matched no binding — a markup problem.
80
- * A name in neither this list nor `fieldNames` was never sent. Cumulative.
81
- */
82
- readonly orphanFields: readonly string[];
83
- /** Whether `scopeBindingsByOwner` is active. */
84
- readonly ownerScoped: boolean;
85
- /** Distinct document owners currently on the page, sorted. */
86
- readonly owners: readonly string[];
87
- /**
88
- * Bindings the runtime found by value on the connection's first message
89
- * (`autoBind: 'unique'`, ADR 0014), sorted by field, each with the value it
90
- * matched on and the attribute it matched in — `undefined` for a text match.
91
- * These are the elements that change without a `data-payload-field` in the
92
- * template; every one of them carries `data-payload-guessed` in the DOM.
93
- */
94
- readonly guessed: readonly {
95
- readonly field: string;
96
- readonly matched: string;
97
- readonly attribute: string | undefined;
98
- }[];
99
- /** `autoBind` as configured, and what the one search cost; `searchMs` is `undefined` until it ran. */
100
- readonly autoBind: {
101
- readonly mode: 'off' | 'unique';
102
- readonly searchMs: number | undefined;
103
- };
104
- }
105
- /** Scheduler work in progress. */
106
- interface InspectionScheduler {
107
- /** Writes buffered for the next flush. */
108
- readonly pending: number;
109
- /** Writes held back offscreen above `visibilityGateThreshold`; applied when scrolled into view. */
110
- readonly deferred: number;
111
- /** The binding count above which the visibility gate starts deferring. */
112
- readonly visibilityGateThreshold: number;
113
- /** Whether the binding count is above that threshold right now. */
114
- readonly visibilityGateActive: boolean;
115
- /** Stats of the most recent flush, or `undefined` if none has run. */
116
- readonly lastFlush: {
117
- readonly applied: number;
118
- /** Which fields the flush wrote; a count alone cannot say a binding was skipped. */
119
- readonly appliedFields: readonly string[];
120
- readonly deferred: number;
121
- readonly durationMs: number;
122
- } | undefined;
123
- }
124
- /** A point-in-time read; plain values only, with no references into runtime internals. */
125
- interface LivePreviewInspection {
126
- /** Package version that produced this snapshot. */
127
- readonly version: string;
128
- /** Whether the runtime is started, and whether it has been destroyed. */
129
- readonly started: boolean;
130
- /** Connection status as reported to the `connect`/`disconnect` events. */
131
- readonly status: ConnectionStatus;
132
- readonly origins: InspectionOrigins;
133
- readonly protocol: InspectionProtocol;
134
- readonly revisions: InspectionRevisions;
135
- readonly bindings: InspectionBindings;
136
- readonly scheduler: InspectionScheduler;
137
- /** Field types with a registered renderer, sorted. */
138
- readonly renderers: readonly string[];
139
- /** Registered plugins and their live registrations; empty on a bare runtime. */
140
- readonly plugins: readonly PluginInspection[];
141
- /** Server-rendered fragment boundaries: whether a handler exists and what happened to renders. */
142
- readonly fragments: InspectionFragments;
143
- /** Route refreshes: whether a strategy exists, how many ran, failed, were paced, or were stopped by the loop guard. */
144
- readonly route: InspectionRoute;
145
- /** Patches the runtime knew could not match the server's render, and what became of them. */
146
- readonly fidelity: InspectionFidelity;
147
- /**
148
- * Whether the page declared a framework that hydrates it, and how far the
149
- * wait for its first commit — React's, or Vue's mount — got (ADR 0015).
150
- * `waiting` is why a preview on a Next or Nuxt page is not connected yet;
151
- * `timed-out` is LP0607.
152
- */
153
- readonly hydration: {
154
- readonly mode: 'off' | 'react' | 'vue';
155
- readonly state: 'idle' | 'waiting' | 'committed' | 'timed-out';
156
- };
157
- }
158
- /**
159
- * The fidelity verdicts as `inspect()` reports them (LP0411). A positive
160
- * `unfaithful` beside `escalated: 0` is a page that keeps a degraded patch —
161
- * because `mode` says so, or because `canEscalate` is false: neither
162
- * `fragments.handler` nor `route.handler` is there to escalate to, which the
163
- * runtime also says once as LP0808 when `mode` is `'escalate'`.
164
- */
165
- interface InspectionFidelity {
166
- /** `onUnfaithfulPatch` as resolved from both of its names. */
167
- readonly mode: 'ignore' | 'warn' | 'escalate';
168
- /** Whether a fragment or route strategy exists for `'escalate'` to hand a patch to. */
169
- readonly canEscalate: boolean;
170
- /** Bindings reported unfaithful since start — once per element, like LP0411, and under every mode. */
171
- readonly unfaithful: number;
172
- /** Of those, how many were handed to the fragment or route strategy. */
173
- readonly escalated: number;
174
- /** The field names behind `unfaithful`, sorted. Cumulative. */
175
- readonly fields: readonly string[];
176
- }
177
- /** The route strategy as `inspect()` reports it. */
178
- interface InspectionRoute {
179
- readonly handler: boolean;
180
- readonly refreshes: number;
181
- /** Refreshes that broke: the request, the answer, or the morph. */
182
- readonly failed: number;
183
- /**
184
- * Refreshes the strategy's own minimum interval held back (LP0805). Each is
185
- * run once the window closes unless a newer revision takes its place, so this
186
- * counts pacing and not loss — and it is deliberately not `failed`.
187
- */
188
- readonly refused: number;
189
- /** Second refresh requests for one revision, refused with LP0805. */
190
- readonly loopStopped: number;
191
- }
192
- /** The fragment strategy as `inspect()` reports it. */
193
- interface InspectionFragments {
194
- /** Whether a fragment handler is configured; without one, boundaries are patched. */
195
- readonly handler: boolean;
196
- readonly inFlight: number;
197
- readonly rendered: number;
198
- readonly failed: number;
199
- readonly superseded: number;
200
- }
201
- /** One plugin as `inspect().plugins` reports it. */
202
- interface PluginInspection {
203
- readonly name: string;
204
- readonly version: string | undefined;
205
- /** `initializing` while `init` runs, `active` afterwards, `tearing-down` while `destroy` runs. */
206
- readonly state: 'initializing' | 'active' | 'tearing-down';
207
- /** Live registrations owned by the plugin's scope, by kind. */
208
- readonly registrations: {
209
- readonly transforms: number;
210
- readonly renderers: number;
211
- readonly subscriptions: number;
212
- readonly cleanups: number;
213
- };
214
- }
215
-
216
- /**
217
- * Payload's live-preview `postMessage` protocol as the shipped admin sends it:
218
- * raw form values on every edit, no schema. `previewToken` and
219
- * `protocolVersion` are extensions of this library for custom senders.
220
- */
221
- interface PayloadLivePreviewMessage {
222
- readonly type: 'payload-live-preview';
223
- readonly data?: Record<string, unknown>;
224
- /** Sent by Payload 2.x and custom senders only. */
225
- readonly fieldSchemaJSON?: readonly PayloadFieldSchema[];
226
- readonly globalSlug?: string;
227
- readonly collectionSlug?: string;
228
- readonly locale?: string;
229
- readonly ready?: boolean;
230
- /** Payload 3.x: the most recent relationship-document event (a drawer save), or `null`. */
231
- readonly externallyUpdatedRelationship?: PayloadDocumentEventDetail | null;
232
- /** Library extension: the token `validateToken` checks. Stock Payload never sends one. */
233
- readonly previewToken?: string;
234
- /** Library extension: the highest protocol version the sender supports; absent means v1. */
235
- readonly protocolVersion?: number;
236
- }
237
- /** Payload's `DocumentEvent` shape (admin `providers/DocumentEvents`). */
238
- interface PayloadDocumentEventDetail {
239
- readonly entitySlug: string;
240
- readonly operation?: 'create' | 'update';
241
- readonly id?: string | number;
242
- readonly updatedAt?: string;
243
- readonly [extra: string]: unknown;
244
- }
245
- /** A validated update as events expose it. */
246
- interface PayloadLivePreviewData {
247
- readonly fields: Record<string, unknown>;
248
- readonly schema?: readonly PayloadFieldSchema[];
249
- readonly globalSlug?: string;
250
- readonly collectionSlug?: string;
251
- readonly locale?: string;
252
- }
253
- /** The subset of Payload's field schema the runtime reads; extra properties are kept opaquely. */
254
- interface PayloadFieldSchema {
255
- readonly name: string;
256
- readonly type: PayloadFieldType;
257
- readonly label?: string;
258
- readonly required?: boolean;
259
- readonly localized?: boolean;
260
- readonly fields?: readonly PayloadFieldSchema[];
261
- readonly blocks?: readonly PayloadBlockSchema[];
262
- readonly relationTo?: string | readonly string[];
263
- readonly hasMany?: boolean;
264
- readonly admin?: {
265
- readonly condition?: PayloadFieldCondition;
266
- };
267
- readonly [extra: string]: unknown;
268
- }
269
- interface PayloadBlockSchema {
270
- readonly slug: string;
271
- readonly fields: readonly PayloadFieldSchema[];
272
- readonly [extra: string]: unknown;
273
- }
274
- /** Payload's core field types. `tabs` is a structural container; `group` flattens. */
275
- type PayloadFieldType = 'text' | 'textarea' | 'richText' | 'email' | 'number' | 'checkbox' | 'date' | 'select' | 'radio' | 'array' | 'blocks' | 'group' | 'tabs' | 'row' | 'collapsible' | 'relationship' | 'upload' | 'point' | 'json' | 'code' | 'ui';
276
- /** `admin.condition` is a function in source and cannot cross `postMessage`; modelled, not consumed. */
277
- type PayloadFieldCondition = (data: unknown, siblingData: unknown) => boolean;
278
-
279
5
  /**
280
6
  * Every diagnostic code the runtime and tools emit, so a consumer can branch
281
7
  * on `e.code` instead of matching message text. A code is never reused for a
@@ -355,13 +81,13 @@ declare const DIAGNOSTIC_CODES: Readonly<{
355
81
  readonly StartupFailed: "LP0605";
356
82
  /** Sending the ready handshake failed. */
357
83
  readonly ReadyFailed: "LP0606";
358
- /** The page declared hydration, but no React commit or Vue mount came within the cap; the runtime started without waiting. */
84
+ /** The page declared hydration, but no React commit, Vue mount or SvelteKit mount came within the cap; the runtime started without waiting. */
359
85
  readonly HydrationWaitTimedOut: "LP0607";
360
86
  /** The audit found no runtime in a response that carried preview intent. */
361
87
  readonly AuditRuntimeMissing: "LP0701";
362
88
  /** The preview response declares no `frame-ancestors`. */
363
89
  readonly AuditNoFrameAncestors: "LP0702";
364
- /** `X-Frame-Options` forbids framing, which no CSP can undo; `SAMEORIGIN` forbids it from another origin only. */
90
+ /** `X-Frame-Options` forbids framing on a response that declares no `frame-ancestors`; `SAMEORIGIN` forbids it from another origin only. */
365
91
  readonly AuditFrameOptionsBlocks: "LP0703";
366
92
  /** Binding attributes are served to anonymous visitors. */
367
93
  readonly AuditBindingsExposed: "LP0704";
@@ -389,6 +115,10 @@ declare const DIAGNOSTIC_CODES: Readonly<{
389
115
  readonly UnboundChangeRefresh: "LP0807";
390
116
  /** `onUnfaithfulPatch: 'escalate'` found no route or fragment strategy to hand an unfaithful patch to; the page keeps it. */
391
117
  readonly EscalationUnavailable: "LP0808";
118
+ /** A fragment inserted an Astro island the page cannot start: it never loaded the island element or that client directive. */
119
+ readonly IslandStartUnavailable: "LP0809";
120
+ /** The host's route refresh returned no promise, so the revision was re-applied before the host committed. */
121
+ readonly RouteRefreshUnconfirmed: "LP0810";
392
122
  /** A readiness row is not yet at its 2.0 value; `pll doctor --v2` reports it. */
393
123
  readonly V2ReadinessGap: "LP0709";
394
124
  /** The preview runtime is served to anonymous visitors, not only inside the admin frame. */
@@ -397,6 +127,69 @@ declare const DIAGNOSTIC_CODES: Readonly<{
397
127
  /** A diagnostic code, as it appears in log output and on the `error` event. */
398
128
  type DiagnosticCode = (typeof DIAGNOSTIC_CODES)[keyof typeof DIAGNOSTIC_CODES];
399
129
 
130
+ /**
131
+ * Payload's live-preview `postMessage` protocol as the shipped admin sends it:
132
+ * raw form values on every edit, no schema. `previewToken` and
133
+ * `protocolVersion` are extensions of this library for custom senders.
134
+ */
135
+ interface PayloadLivePreviewMessage {
136
+ readonly type: 'payload-live-preview';
137
+ readonly data?: Record<string, unknown>;
138
+ /** Sent by Payload 2.x and custom senders only. */
139
+ readonly fieldSchemaJSON?: readonly PayloadFieldSchema[];
140
+ readonly globalSlug?: string;
141
+ readonly collectionSlug?: string;
142
+ readonly locale?: string;
143
+ readonly ready?: boolean;
144
+ /** Payload 3.x: the most recent relationship-document event (a drawer save), or `null`. */
145
+ readonly externallyUpdatedRelationship?: PayloadDocumentEventDetail | null;
146
+ /** Library extension: the token `validateToken` checks. Stock Payload never sends one. */
147
+ readonly previewToken?: string;
148
+ /** Library extension: the highest protocol version the sender supports; absent means v1. */
149
+ readonly protocolVersion?: number;
150
+ }
151
+ /** Payload's `DocumentEvent` shape (admin `providers/DocumentEvents`). */
152
+ interface PayloadDocumentEventDetail {
153
+ readonly entitySlug: string;
154
+ readonly operation?: 'create' | 'update';
155
+ readonly id?: string | number;
156
+ readonly updatedAt?: string;
157
+ readonly [extra: string]: unknown;
158
+ }
159
+ /** A validated update as events expose it. */
160
+ interface PayloadLivePreviewData {
161
+ readonly fields: Record<string, unknown>;
162
+ readonly schema?: readonly PayloadFieldSchema[];
163
+ readonly globalSlug?: string;
164
+ readonly collectionSlug?: string;
165
+ readonly locale?: string;
166
+ }
167
+ /** The subset of Payload's field schema the runtime reads; extra properties are kept opaquely. */
168
+ interface PayloadFieldSchema {
169
+ readonly name: string;
170
+ readonly type: PayloadFieldType;
171
+ readonly label?: string;
172
+ readonly required?: boolean;
173
+ readonly localized?: boolean;
174
+ readonly fields?: readonly PayloadFieldSchema[];
175
+ readonly blocks?: readonly PayloadBlockSchema[];
176
+ readonly relationTo?: string | readonly string[];
177
+ readonly hasMany?: boolean;
178
+ readonly admin?: {
179
+ readonly condition?: PayloadFieldCondition;
180
+ };
181
+ readonly [extra: string]: unknown;
182
+ }
183
+ interface PayloadBlockSchema {
184
+ readonly slug: string;
185
+ readonly fields: readonly PayloadFieldSchema[];
186
+ readonly [extra: string]: unknown;
187
+ }
188
+ /** Payload's core field types. `tabs` is a structural container; `group` flattens. */
189
+ type PayloadFieldType = 'text' | 'textarea' | 'richText' | 'email' | 'number' | 'checkbox' | 'date' | 'select' | 'radio' | 'array' | 'blocks' | 'group' | 'tabs' | 'row' | 'collapsible' | 'relationship' | 'upload' | 'point' | 'json' | 'code' | 'ui';
190
+ /** `admin.condition` is a function in source and cannot cross `postMessage`; modelled, not consumed. */
191
+ type PayloadFieldCondition = (data: unknown, siblingData: unknown) => boolean;
192
+
400
193
  /**
401
194
  * How a bound region is brought up to date: the runtime patches it, a server
402
195
  * renders a `data-payload-fragment` boundary from the unsaved form state, or
@@ -420,9 +213,9 @@ interface FragmentContext {
420
213
  readonly signal: AbortSignal;
421
214
  /** Whether this revision is still the current one. */
422
215
  readonly isCurrent: () => boolean;
423
- /** Morph server-rendered HTML into a boundary (Trusted Types and the keyed morph apply). */
216
+ /** Morph server-rendered HTML into a boundary; no-op after supersession (Trusted Types and the keyed morph apply). */
424
217
  readonly morph: (boundary: Element, html: string) => void;
425
- /** Patch the boundary's own bindings from this revision — the deterministic fallback. */
218
+ /** Patch the boundary's owned bindings from this revision; no-op after supersession. */
426
219
  readonly patch: (boundary: Element) => void;
427
220
  /** Debug log through the runtime's logger, with the diagnostic code. */
428
221
  readonly log: (code: DiagnosticCode, detail: string) => void;
@@ -447,8 +240,13 @@ interface FragmentStrategy {
447
240
  interface RouteContext {
448
241
  readonly revision: number;
449
242
  readonly receivedAt: number;
450
- /** Aborted when a newer revision arrives or the runtime stops. */
243
+ /** Aborted when a newer revision asks for a refresh of its own, a navigation commits, or the runtime stops. */
451
244
  readonly signal: AbortSignal;
245
+ /**
246
+ * Whether the refresh may still land. A newer revision that asks for no
247
+ * refresh of its own does not end it: the route is the server's, so the
248
+ * refresh lands for that revision, which the runtime then re-applies.
249
+ */
452
250
  readonly isCurrent: () => boolean;
453
251
  readonly log: (code: DiagnosticCode, detail: string) => void;
454
252
  /**
@@ -461,18 +259,30 @@ interface RouteContext {
461
259
  readonly retryAfter?: (delayMs: number) => void;
462
260
  }
463
261
  /**
464
- * What one refresh did. `refused` is the strategy's own brake and not a
465
- * failure — it is counted separately, because a number that mixes a planned
466
- * pause with a broken request cannot be read.
262
+ * What one refresh did. `refreshed` asserts that the strategy rendered the
263
+ * current unsaved revision. `partial` completed a render whose data source was
264
+ * not proven current; the runtime still reapplies every binding it can reach.
265
+ * `refused` is the strategy's own brake and not a failure.
467
266
  */
468
- type RouteOutcome = 'refreshed' | 'failed' | 'refused' | 'superseded';
267
+ type RouteOutcome = 'refreshed' | 'partial' | 'failed' | 'refused' | 'superseded';
268
+ /** What the runtime tells a route planner about the update it plans for. */
269
+ interface RoutePlanContext {
270
+ /**
271
+ * Whether an element belongs to the update: always `true` without
272
+ * `scopeBindingsByOwner`, otherwise only inside the document the update
273
+ * names. A marker outside it asks for nothing.
274
+ */
275
+ readonly inScope: (element: Element) => boolean;
276
+ }
469
277
  /**
470
278
  * Whether a revision needs the whole route re-rendered, and how. After a
471
- * refresh the runtime rescans and re-applies the revision, so the unsaved
472
- * state lands on the fresh markup.
279
+ * refresh the runtime rescans and re-applies the revision, so reachable
280
+ * unsaved bindings land on the fresh markup. The runtime always passes
281
+ * `context`; a planner written before it existed still works, but plans for
282
+ * markers of every document.
473
283
  */
474
284
  interface RouteStrategy {
475
- readonly plan: (root: ParentNode, changedFields: ReadonlySet<string>) => boolean;
285
+ readonly plan: (root: ParentNode, changedFields: ReadonlySet<string>, context?: RoutePlanContext) => boolean;
476
286
  readonly refresh: (context: RouteContext) => Promise<RouteOutcome>;
477
287
  }
478
288
  interface StrategyHandlers {
@@ -542,6 +352,12 @@ interface LivePreviewEventMap {
542
352
  readonly revision: number;
543
353
  readonly receivedAt: number;
544
354
  };
355
+ /**
356
+ * A revision left `pending`: it is current, partial (with the shortfalls
357
+ * that kept it from being current), unconfirmed by an island, or superseded.
358
+ * Fires again when an unconfirmed revision is confirmed (ADR 0023).
359
+ */
360
+ readonly revisionDisplay: RevisionDisplay;
545
361
  /** A `payload-document-event` message arrived (document save). */
546
362
  readonly documentSave: {
547
363
  readonly timestamp: number;
@@ -630,6 +446,12 @@ interface SanitizeOptions {
630
446
  * never add a binding.
631
447
  */
632
448
  readonly templateMode?: boolean;
449
+ /**
450
+ * The DOM to parse with, for this call: an SSR document such as linkedom's
451
+ * or jsdom's. Wins over `setSanitizerDocument()` and over the global
452
+ * `document`, and two callers with two documents never share one.
453
+ */
454
+ readonly document?: SanitizerDocument;
633
455
  }
634
456
  /**
635
457
  * The default for calls without an explicit `policy`, per package entry. A
@@ -643,10 +465,19 @@ interface SanitizerDocument {
643
465
  readonly content: ParentNode;
644
466
  };
645
467
  }
646
- /** Supply a `Document` for SSR, e.g. linkedom's `parseHTML(...).document`; `null` clears it, for every entry. */
468
+ /**
469
+ * Supply a `Document` for SSR, e.g. linkedom's `parseHTML(...).document`;
470
+ * `null` clears it, for every entry. The fallback for a call that names no
471
+ * document of its own.
472
+ *
473
+ * @deprecated Since 2.1 a call names its document: `sanitizeHtml(html, { document })`,
474
+ * `lexicalToHtml(content, { document })`. The process-wide slot stays until 3.0
475
+ * (ADR 0007 ledger).
476
+ */
647
477
  declare function setSanitizerDocument(doc: SanitizerDocument | null): void;
648
478
  /**
649
- * Sanitize `html`; malformed input is recovered by the parser first.
479
+ * Sanitize `html`; malformed input is recovered by the parser first. The
480
+ * result is a fixed point: sanitising it again changes nothing.
650
481
  *
651
482
  * @throws {SanitizerEnvironmentError} when no DOM is available.
652
483
  */
@@ -712,41 +543,381 @@ interface CachedElement {
712
543
  * binding the runtime found by value rather than one the template declared.
713
544
  * Absent for a declared binding.
714
545
  */
715
- readonly guessed?: string;
546
+ readonly guessed?: string;
547
+ }
548
+ /** What a renderer is given; `allFields` lets it resolve a sibling field. */
549
+ interface RenderContext {
550
+ /** Full field map for the current update — used for sibling lookups. */
551
+ readonly allFields: Record<string, unknown>;
552
+ /** Active locale, or `undefined` when none is established. */
553
+ readonly locale: string | undefined;
554
+ /** Optional schema descriptor for the field, when available. */
555
+ readonly schema: PayloadFieldSchema | undefined;
556
+ /** The project's rich-text renderer, when the client was configured with one. */
557
+ readonly renderRichText?: RichTextRenderer;
558
+ /**
559
+ * The Payload server the runtime reads populated documents from (`serverURL`),
560
+ * absent without one. A renderer that writes a URL out of a media document
561
+ * resolves a path against it, as Payload's admin does; the built-in `upload`
562
+ * and `image` renderers do.
563
+ */
564
+ readonly serverURL?: string;
565
+ /**
566
+ * This instance's sanitizer policy, for every HTML write the renderer makes.
567
+ * Absent, the process default set by `setSanitizerPolicy()` applies.
568
+ */
569
+ readonly sanitizerPolicy?: SanitizerPolicyMode;
570
+ /**
571
+ * Say that this write cannot reproduce what the server drew, so
572
+ * `onUnfaithfulPatch` can have a strategy render the region instead of
573
+ * leaving a degraded patch on the page. The built-in rich-text renderer
574
+ * calls it for a Lexical block whose markup it had to drop; a project
575
+ * renderer may call it for any value it can only approximate. `reason`
576
+ * completes the sentence 'field "x" …' in LP0411.
577
+ */
578
+ readonly reportUnfaithful?: (target: CachedElement, reason: string) => void;
579
+ }
580
+ /**
581
+ * A renderer writes one value into its element. It must not throw: one bad
582
+ * field may not stop an update. The result stays `void` — the internal
583
+ * no-write sentinel is not part of the contract.
584
+ */
585
+ interface FieldRenderer {
586
+ readonly name: RendererKey;
587
+ render(target: CachedElement, value: unknown, context: RenderContext): void;
588
+ }
589
+
590
+ /**
591
+ * Protocol negotiation. A capability is granted either by the version a peer
592
+ * announces or by observation, since the stock Payload admin announces none:
593
+ * what it can do is read off the messages it sends. See ADR 0010.
594
+ */
595
+ /** Bumped only when this library's understanding of the wire format changes. @internal */
596
+ declare const LIBRARY_PROTOCOL_VERSION = 4;
597
+ /** How a capability becomes active. @internal */
598
+ type CapabilitySource = 'version' | 'observed';
599
+ /** @internal */
600
+ interface CapabilityDeclaration {
601
+ /** Enabled once the negotiated version reaches this (for announced peers). */
602
+ readonly since: number;
603
+ /** The wire signal that grants this capability to a peer announcing no version. */
604
+ readonly observed?: 'schema' | 'locale' | 'preview-token' | 'document-event' | 'relationship-event';
605
+ }
606
+ /** What activates each capability; the prose lives in `CAPABILITY_DOCUMENTATION`. */
607
+ declare const CAPABILITY_DECLARATIONS: {
608
+ readonly basic: {
609
+ readonly since: 1;
610
+ };
611
+ readonly 'schema-json': {
612
+ readonly since: 2;
613
+ readonly observed: "schema";
614
+ };
615
+ readonly locale: {
616
+ readonly since: 2;
617
+ readonly observed: "locale";
618
+ };
619
+ readonly 'preview-token': {
620
+ readonly since: 3;
621
+ readonly observed: "preview-token";
622
+ };
623
+ readonly 'nested-arrays': {
624
+ readonly since: 4;
625
+ };
626
+ readonly 'recursive-diffs': {
627
+ readonly since: 4;
628
+ };
629
+ readonly 'document-events': {
630
+ readonly since: 4;
631
+ readonly observed: "document-event";
632
+ };
633
+ readonly 'relationship-events': {
634
+ readonly since: 4;
635
+ readonly observed: "relationship-event";
636
+ };
637
+ };
638
+ type ProtocolCapability = keyof typeof CAPABILITY_DECLARATIONS;
639
+ /** Every declared capability, in declaration order. @internal */
640
+ declare const PROTOCOL_CAPABILITIES: readonly ProtocolCapability[];
641
+ interface ProtocolNegotiation {
642
+ /** This library's protocol version. */
643
+ readonly ours: number;
644
+ /** The remote party's version, when it announced one. */
645
+ readonly theirs: number | undefined;
646
+ /** `min(ours, theirs ?? 1)` — the version both sides actually share. */
647
+ readonly negotiated: number;
648
+ /** Capabilities active at the negotiated version or seen on the wire. */
649
+ readonly capabilities: ReadonlySet<ProtocolCapability>;
650
+ /** The subset that was observed on the wire rather than granted by version. */
651
+ readonly observed: ReadonlySet<ProtocolCapability>;
652
+ }
653
+ /** Deterministic; the runtime re-runs it whenever either input changes. */
654
+ declare function negotiateProtocol(theirs: number | undefined, observed?: Iterable<ProtocolCapability>): ProtocolNegotiation;
655
+ /** @internal */
656
+ declare function hasCapability(negotiation: ProtocolNegotiation, capability: ProtocolCapability): boolean;
657
+
658
+ /** Connection status and the heartbeat that decides a disconnect. */
659
+ type ConnectionStatus = 'disconnected' | 'connecting' | 'connected';
660
+
661
+ /**
662
+ * How completely the page shows one revision (ADR 0023). The session counters
663
+ * say what happened over a session; this says, for the revision in flight,
664
+ * whether work is outstanding and which step fell short, so a host does not
665
+ * have to attribute route outcomes and fragment fallbacks itself.
666
+ */
667
+
668
+ /** Where a revision stands: work left, shown, shown with shortfalls, awaiting an island, or replaced (ADR 0023). */
669
+ type RevisionDisplayState = 'pending' | 'current' | 'partial' | 'unconfirmed' | 'superseded';
670
+ /** One step that kept a settled revision from being current. */
671
+ type RevisionShortfall = {
672
+ readonly kind: 'fragment';
673
+ readonly id: string;
674
+ readonly key: string | undefined;
675
+ readonly code: DiagnosticCode;
676
+ } | {
677
+ readonly kind: 'route-saved';
678
+ } | {
679
+ readonly kind: 'route-failed';
680
+ readonly outcome: RouteOutcome;
681
+ } | {
682
+ readonly kind: 'unfaithful' | 'unbound';
683
+ readonly field: string;
684
+ } | {
685
+ readonly kind: 'write';
686
+ readonly field: string;
687
+ readonly code: DiagnosticCode;
688
+ } | {
689
+ readonly kind: 'merge';
690
+ };
691
+ /** How completely the page shows one accepted revision (ADR 0023). */
692
+ interface RevisionDisplay {
693
+ /** The message revision this record is about. */
694
+ readonly revision: number;
695
+ /** `pending` while work is left; the other states once it settled. */
696
+ readonly state: RevisionDisplayState;
697
+ /** What kept a settled revision from being current; empty unless `state` is `partial`. */
698
+ readonly shortfalls: readonly RevisionShortfall[];
699
+ /** Writes the visibility gate holds until their element is seen; they count as landed. */
700
+ readonly deferred: number;
701
+ /** Islands the revision was handed to that have not called `displayed()`. */
702
+ readonly awaitingIslands: number;
703
+ }
704
+
705
+ /**
706
+ * Shape of the `inspect()` snapshot. It only re-reads what the page already
707
+ * shows — origins from the injected script, field names from the DOM,
708
+ * counters derived from both — so it stays available in production, where a
709
+ * misbehaving preview is exactly the case worth diagnosing. Reading one
710
+ * performs no I/O and transmits nothing.
711
+ */
712
+
713
+ /** Origin trust as the runtime currently sees it. */
714
+ interface InspectionOrigins {
715
+ /** Configured origins; empty means the referrer and localhost heuristics decide instead. */
716
+ readonly trusted: readonly string[];
717
+ /** The origin locked onto by the first accepted update; every other is then refused. */
718
+ readonly locked: string | undefined;
719
+ }
720
+ /** Protocol versions and the capabilities they enable. */
721
+ interface InspectionProtocol {
722
+ /** This library's protocol version. */
723
+ readonly ours: number;
724
+ /** The remote party's version, or `undefined` if it never announced one. */
725
+ readonly theirs: number | undefined;
726
+ /** `min(ours, theirs ?? 1)` — what both sides actually share. */
727
+ readonly negotiated: number;
728
+ /** Capability flags enabled at the negotiated version. */
729
+ readonly capabilities: readonly string[];
730
+ /** The subset of `capabilities` seen on the wire rather than granted by version. */
731
+ readonly observed: readonly string[];
732
+ /** The Payload profile the observed capabilities imply: `unknown`, `payload-2` or `payload-3`. */
733
+ readonly profile: string;
734
+ }
735
+ /** Revision accounting for the update pipeline. */
736
+ interface InspectionRevisions {
737
+ /** Updates accepted since the runtime started. */
738
+ readonly accepted: number;
739
+ /**
740
+ * Updates that were still in flight when a newer one arrived and were
741
+ * therefore abandoned. A number that tracks `accepted` closely means the
742
+ * editor is out-typing the pipeline, which is normal; it is only a problem
743
+ * when the last update is among the abandoned ones.
744
+ */
745
+ readonly superseded: number;
746
+ /**
747
+ * Updates whose scheduled writes reached the DOM. What is neither
748
+ * superseded nor completed is in flight or was cancelled; a `superseded`
749
+ * that tracks `accepted` while `completed` stays low is the editor
750
+ * out-typing the pipeline.
751
+ */
752
+ readonly completed: number;
753
+ /**
754
+ * Bindings not scheduled because their value was identical to the one last
755
+ * applied. Cumulative since start; always `0` unless `skipUnchanged` is on.
756
+ * A large number beside a small `accepted` is the optimisation working.
757
+ */
758
+ readonly skippedUnchanged: number;
759
+ /** Revision currently in flight, or `undefined` when the pipeline is idle. */
760
+ readonly active: number | undefined;
761
+ /**
762
+ * How completely the page shows the latest accepted revision (ADR 0023):
763
+ * `pending`, `current`, `partial` with its shortfalls, or `unconfirmed` while
764
+ * an island it was handed has not called `displayed()`. `undefined` before
765
+ * the first message.
766
+ */
767
+ readonly display: RevisionDisplay | undefined;
716
768
  }
717
- /** What a renderer is given; `allFields` lets it resolve a sibling field. */
718
- interface RenderContext {
719
- /** Full field map for the current update — used for sibling lookups. */
720
- readonly allFields: Record<string, unknown>;
721
- /** Active locale, or `undefined` when none is established. */
722
- readonly locale: string | undefined;
723
- /** Optional schema descriptor for the field, when available. */
724
- readonly schema: PayloadFieldSchema | undefined;
725
- /** The project's rich-text renderer, when the client was configured with one. */
726
- readonly renderRichText?: RichTextRenderer;
769
+ /** What the DOM offers the runtime to write into. */
770
+ interface InspectionBindings {
771
+ /** Elements carrying a binding. */
772
+ readonly elements: number;
773
+ /** Distinct field names across those elements. */
774
+ readonly fields: number;
775
+ /** Those field names, sorted. */
776
+ readonly fieldNames: readonly string[];
727
777
  /**
728
- * This instance's sanitizer policy, for every HTML write the renderer makes.
729
- * Absent, the process default set by `setSanitizerPolicy()` applies.
778
+ * Bound fields some update carried no value for, so the binding kept its old
779
+ * text — why a binding can stay stale while its siblings update. Cumulative.
730
780
  */
731
- readonly sanitizerPolicy?: SanitizerPolicyMode;
781
+ readonly absentFields: readonly string[];
732
782
  /**
733
- * Say that this write cannot reproduce what the server drew, so
734
- * `onUnfaithfulPatch` can have a strategy render the region instead of
735
- * leaving a degraded patch on the page. The built-in rich-text renderer
736
- * calls it for a Lexical block whose markup it had to drop; a project
737
- * renderer may call it for any value it can only approximate. `reason`
738
- * completes the sentence 'field "x" …' in LP0411.
783
+ * Scalar fields (and one group level) that arrived but matched no binding.
784
+ * Arrays, relationships, rich text, `null` and the fields Payload sends with
785
+ * every update are never listed. Cumulative.
739
786
  */
740
- readonly reportUnfaithful?: (target: CachedElement, reason: string) => void;
787
+ readonly orphanFields: readonly string[];
788
+ /** Whether `scopeBindingsByOwner` is active. */
789
+ readonly ownerScoped: boolean;
790
+ /** Distinct document owners currently on the page, sorted. */
791
+ readonly owners: readonly string[];
792
+ /**
793
+ * Bindings the runtime found by value on the connection's first message
794
+ * (`autoBind: 'unique'`, ADR 0014), sorted by field, each with the value it
795
+ * matched on and the attribute it matched in — `undefined` for a text match.
796
+ * These are the elements that change without a `data-payload-field` in the
797
+ * template; every one of them carries `data-payload-guessed` in the DOM.
798
+ */
799
+ readonly guessed: readonly {
800
+ readonly field: string;
801
+ readonly matched: string;
802
+ readonly attribute: string | undefined;
803
+ }[];
804
+ /** `autoBind` as configured, and what the one search cost; `searchMs` is `undefined` until it ran. */
805
+ readonly autoBind: {
806
+ readonly mode: 'off' | 'unique';
807
+ readonly searchMs: number | undefined;
808
+ };
809
+ }
810
+ /** Scheduler work in progress. */
811
+ interface InspectionScheduler {
812
+ /** Writes buffered for the next flush. */
813
+ readonly pending: number;
814
+ /** Writes held back offscreen above `visibilityGateThreshold`; applied when scrolled into view. */
815
+ readonly deferred: number;
816
+ /** The binding count above which the visibility gate starts deferring. */
817
+ readonly visibilityGateThreshold: number;
818
+ /** Whether the binding count is above that threshold right now. */
819
+ readonly visibilityGateActive: boolean;
820
+ /** Stats of the most recent flush, or `undefined` if none has run. */
821
+ readonly lastFlush: {
822
+ readonly applied: number;
823
+ /** Which fields the flush wrote; a count alone cannot say a binding was skipped. */
824
+ readonly appliedFields: readonly string[];
825
+ readonly deferred: number;
826
+ readonly durationMs: number;
827
+ } | undefined;
828
+ }
829
+ /** A point-in-time read; plain values only, with no references into runtime internals. */
830
+ interface LivePreviewInspection {
831
+ /** Package version that produced this snapshot. */
832
+ readonly version: string;
833
+ /** Whether the runtime is started, and whether it has been destroyed. */
834
+ readonly started: boolean;
835
+ /** Connection status as reported to the `connect`/`disconnect` events. */
836
+ readonly status: ConnectionStatus;
837
+ readonly origins: InspectionOrigins;
838
+ readonly protocol: InspectionProtocol;
839
+ readonly revisions: InspectionRevisions;
840
+ readonly bindings: InspectionBindings;
841
+ readonly scheduler: InspectionScheduler;
842
+ /** Field types with a registered renderer, sorted. */
843
+ readonly renderers: readonly string[];
844
+ /** Registered plugins and their live registrations; empty on a bare runtime. */
845
+ readonly plugins: readonly PluginInspection[];
846
+ /** Server-rendered fragment boundaries: whether a handler exists and what happened to renders. */
847
+ readonly fragments: InspectionFragments;
848
+ /** Route refreshes: whether a strategy exists, how many ran, failed, were paced, or were stopped by the loop guard. */
849
+ readonly route: InspectionRoute;
850
+ /** Patches the runtime knew could not match the server's render, and what became of them. */
851
+ readonly fidelity: InspectionFidelity;
852
+ /**
853
+ * Whether the page declared a framework that hydrates it, and how far the
854
+ * wait for its first commit — React's, Vue's mount, or SvelteKit's root
855
+ * mounting — got (ADR 0015). `waiting` is why a preview on a Next, Nuxt or
856
+ * SvelteKit page is not connected yet; `timed-out` is LP0607.
857
+ */
858
+ readonly hydration: {
859
+ readonly mode: 'off' | 'react' | 'vue' | 'sveltekit';
860
+ readonly state: 'idle' | 'waiting' | 'committed' | 'timed-out';
861
+ };
741
862
  }
742
863
  /**
743
- * A renderer writes one value into its element. It must not throw: one bad
744
- * field may not stop an update. The result stays `void` — the internal
745
- * no-write sentinel is not part of the contract.
864
+ * The fidelity verdicts as `inspect()` reports them (LP0411). A positive
865
+ * `unfaithful` beside `escalated: 0` is a page that keeps a degraded patch —
866
+ * because `mode` says so, or because `canEscalate` is false: neither
867
+ * `fragments.handler` nor `route.handler` is there to escalate to, which the
868
+ * runtime also says once as LP0808 when `mode` is `'escalate'`.
746
869
  */
747
- interface FieldRenderer {
748
- readonly name: RendererKey;
749
- render(target: CachedElement, value: unknown, context: RenderContext): void;
870
+ interface InspectionFidelity {
871
+ /** `onUnfaithfulPatch` as resolved from both of its names. */
872
+ readonly mode: 'ignore' | 'warn' | 'escalate';
873
+ /** Whether a fragment or route strategy exists for `'escalate'` to hand a patch to. */
874
+ readonly canEscalate: boolean;
875
+ /** Bindings reported unfaithful since start — once per element, like LP0411, and under every mode. */
876
+ readonly unfaithful: number;
877
+ /** Of those, how many were handed to the fragment or route strategy. */
878
+ readonly escalated: number;
879
+ /** The field names behind `unfaithful`, sorted. Cumulative. */
880
+ readonly fields: readonly string[];
881
+ }
882
+ /** The route strategy as `inspect()` reports it. */
883
+ interface InspectionRoute {
884
+ readonly handler: boolean;
885
+ readonly refreshes: number;
886
+ /** Successful refreshes whose server render was not proven to contain the current unsaved revision. */
887
+ readonly partial: number;
888
+ /** Refreshes that broke: the request, the answer, or the morph. */
889
+ readonly failed: number;
890
+ /**
891
+ * Refreshes the strategy's own minimum interval held back (LP0805). Each is
892
+ * run once the window closes unless a newer revision takes its place, so this
893
+ * counts pacing and not loss — and it is deliberately not `failed`.
894
+ */
895
+ readonly refused: number;
896
+ /** Second refresh requests for one revision, refused with LP0805. */
897
+ readonly loopStopped: number;
898
+ }
899
+ /** The fragment strategy as `inspect()` reports it. */
900
+ interface InspectionFragments {
901
+ /** Whether a fragment handler is configured; without one, boundaries are patched. */
902
+ readonly handler: boolean;
903
+ readonly inFlight: number;
904
+ readonly rendered: number;
905
+ readonly failed: number;
906
+ readonly superseded: number;
907
+ }
908
+ /** One plugin as `inspect().plugins` reports it. */
909
+ interface PluginInspection {
910
+ readonly name: string;
911
+ readonly version: string | undefined;
912
+ /** `initializing` while `init` runs, `active` afterwards, `tearing-down` while `destroy` runs. */
913
+ readonly state: 'initializing' | 'active' | 'tearing-down';
914
+ /** Live registrations owned by the plugin's scope, by kind. */
915
+ readonly registrations: {
916
+ readonly transforms: number;
917
+ readonly renderers: number;
918
+ readonly subscriptions: number;
919
+ readonly cleanups: number;
920
+ };
750
921
  }
751
922
 
752
923
  /**
@@ -861,6 +1032,13 @@ interface LivePreviewClientConfig {
861
1032
  * and listed in `inspect().bindings.guessed`. Default `'off'`.
862
1033
  */
863
1034
  readonly autoBind?: 'off' | 'unique';
1035
+ /**
1036
+ * How a group counts as covered (ADR 0022). `'descendant'` (default): one
1037
+ * bound path inside it covers all of it. `'declared'`: each changed path
1038
+ * inside such a group needs its own binding or a `data-payload-covers`
1039
+ * declaration; an uncovered one is an unbound change.
1040
+ */
1041
+ readonly subfieldCoverage?: 'descendant' | 'declared';
864
1042
  /** Fields whose change re-applies other bindings regardless of their own value: `{ price: ['priceLabel'] }`. Used with `skipUnchanged`. */
865
1043
  readonly dependencies?: Readonly<Record<string, readonly string[]>>;
866
1044
  /** Strategy handlers beyond patching; `createFragmentStrategy()` from `payload-live-preview/fragment` builds one. */
@@ -926,7 +1104,10 @@ declare class LivePreviewClient {
926
1104
  use(plugin: LivePreviewPlugin): Promise<void>;
927
1105
  /** Unregister a plugin and release everything its registration owned. Still allowed from a destroy hook during teardown. */
928
1106
  unuse(name: string): Promise<void>;
1107
+ /** Re-scan bindings after replacing markup without crossing a navigation boundary. */
929
1108
  refreshCache(): void;
1109
+ /** Re-scan bindings and locally replay the last accepted document after a router commit. */
1110
+ refreshAfterNavigation(): void;
930
1111
  get events(): EventEmitter;
931
1112
  /** Names of the registered plugins. */
932
1113
  get plugins(): readonly string[];
@@ -972,7 +1153,10 @@ declare function createPreviewFocusReporter(resolveTarget: () => FocusReportTarg
972
1153
  interface NavigationLifecycleTarget {
973
1154
  suspend(): boolean;
974
1155
  resume(): boolean;
1156
+ /** Re-scan bindings after replacing markup without crossing a navigation boundary. */
975
1157
  refreshCache(): void;
1158
+ /** Re-scan and replay the last accepted document after a committed router navigation. */
1159
+ refreshAfterNavigation?(): void;
976
1160
  }
977
1161
  interface NavigationLifecycleOptions {
978
1162
  /** Where `pagehide`/`pageshow` fire; they exist only on the window. Defaults to `window`. */
@@ -980,8 +1164,9 @@ interface NavigationLifecycleOptions {
980
1164
  /** Event target for soft-navigation events. Defaults to `document`. */
981
1165
  readonly documentTarget?: EventTarget;
982
1166
  /**
983
- * Events after which the DOM was replaced and the cache must be rebuilt, e.g.
984
- * `astro:page-load`. Empty by default: only the host knows which its router fires.
1167
+ * Events after which the DOM was replaced and the current editor state must
1168
+ * be replayed, e.g. `astro:page-load`. Empty by default: only the host knows
1169
+ * which its router fires.
985
1170
  */
986
1171
  readonly softNavigationEvents?: readonly string[];
987
1172
  }
@@ -1011,6 +1196,9 @@ declare function bindNavigationLifecycle(target: NavigationLifecycleTarget, opti
1011
1196
  * A host's own route refresh. It must settle once the fresh markup is
1012
1197
  * committed: the runtime re-applies the revision on top of it, and doing that
1013
1198
  * against the markup being replaced would write into nodes about to be dropped.
1199
+ * A function that returns nothing is taken as already committed; the route
1200
+ * strategy says once that it could not wait (LP0810), and 3.0 requires the
1201
+ * promise (ADR 0028).
1014
1202
  */
1015
1203
  type RouteRefresh = () => void | Promise<void>;
1016
1204
  /**
@@ -1105,21 +1293,40 @@ interface InlineScriptConfig {
1105
1293
  * throws `Hydration failed` and regenerates the tree, and the write is gone.
1106
1294
  * Under `'vue'` it holds the write until Vue has mounted the app around them
1107
1295
  * — otherwise Vue's hydration repairs the write back to the server's value,
1108
- * quietly. The Next.js and Nuxt adapters set it on every script they emit; a
1109
- * page built by hand with `generateInlineScript()` may. Omitted: the runtime
1110
- * starts on `DOMContentLoaded`, as on a static page.
1296
+ * quietly. Under `'sveltekit'` it holds the write until SvelteKit's root has
1297
+ * mounted, on a page SvelteKit's client runs on — otherwise Svelte's
1298
+ * hydration sets its own text back over it, as quietly. The Next.js, Nuxt
1299
+ * and SvelteKit adapters set it on every script they emit; a page built by
1300
+ * hand with `generateInlineScript()` may. Omitted: the runtime starts on
1301
+ * `DOMContentLoaded`, as on a static page.
1111
1302
  */
1112
- readonly hydration?: 'react' | 'vue';
1303
+ readonly hydration?: 'react' | 'vue' | 'sveltekit';
1113
1304
  /**
1114
1305
  * Which defaults the omitted options fall back to, resolved by the generator
1115
1306
  * rather than the runtime, whose own fallbacks are the 2.0 rows: `'v1'`
1116
1307
  * writes its four runtime rows into their slots (an explicit option still
1117
1308
  * wins) and relaxes the `mergeDepth` check. The resolved value always
1118
- * travels, in the last slot, so a reader of the served page knows what an
1309
+ * travels in slot 24, so a reader of the served page knows what an
1119
1310
  * empty slot means instead of guessing it — `pll doctor --v2` reads it. The
1120
- * runtime does not: every row the profile decides is already in its slot.
1311
+ * runtime does not use that value: every row the profile decides is already
1312
+ * in its slot. Slot 24 stays fixed as later options are appended.
1121
1313
  */
1122
1314
  readonly defaults?: DefaultsProfile;
1315
+ /**
1316
+ * Document events fired after a client router committed new markup. Each
1317
+ * rebuilds the binding cache and locally reapplies the last accepted state.
1318
+ * Adapter integrations set this from their framework lifecycle. It is a
1319
+ * low-level generator fact, not a `PreviewAdapterOptions` field. Empty by
1320
+ * default.
1321
+ */
1322
+ readonly softNavigationEvents?: readonly string[];
1323
+ /**
1324
+ * How a group counts as covered (ADR 0022). `'descendant'`, the 2.x default:
1325
+ * one bound path inside it covers all of it. `'declared'`: each changed path
1326
+ * inside such a group needs its own binding or a `data-payload-covers`
1327
+ * declaration; an uncovered one is an unbound change.
1328
+ */
1329
+ readonly subfieldCoverage?: 'descendant' | 'declared';
1123
1330
  /**
1124
1331
  * A runtime artifact to embed instead of the full one — today only
1125
1332
  * `LEAN_RUNTIME` from `payload-live-preview/lean`, which leaves out the
@@ -1249,6 +1456,25 @@ declare function mergeCspHeader(existing: string, additions: Readonly<Record<str
1249
1456
  */
1250
1457
  declare const AUTHORIZED_PREVIEW_BRAND_KEY = "payload-live-preview.authorized-preview-context";
1251
1458
  type PreviewAuthorizationStrategyName = 'payload-session' | 'signed-token' | 'verifier';
1459
+ /** One server-authorized Payload document, not a query selected by the browser. */
1460
+ type AuthorizedPreviewDocument = {
1461
+ readonly kind: 'collection';
1462
+ readonly slug: string;
1463
+ readonly id: string | number;
1464
+ } | {
1465
+ readonly kind: 'global';
1466
+ readonly slug: string;
1467
+ };
1468
+ /** Opt-in data capability, enforced by the fragment endpoint and `definePreview`. */
1469
+ interface AuthorizedPreviewPayloadScope {
1470
+ /** Payload base URL, distinct from the preview site's audience. */
1471
+ readonly serverURL: string;
1472
+ /** REST prefix, default `/api`. */
1473
+ readonly apiRoute?: string;
1474
+ readonly document: AuthorizedPreviewDocument;
1475
+ /** Maximum requested population depth, not a field-level ACL. */
1476
+ readonly maxDepth: number;
1477
+ }
1252
1478
  /** What a context is bound to; every field is optional because every strategy binds differently. */
1253
1479
  interface AuthorizedPreviewScope {
1254
1480
  /** The site origin the credential was issued for. */
@@ -1256,6 +1482,8 @@ interface AuthorizedPreviewScope {
1256
1482
  /** The request pathname the credential is valid for. */
1257
1483
  readonly path?: string;
1258
1484
  readonly locale?: string;
1485
+ /** Requires a finite context expiry. Unscoped contexts keep their existing behavior. */
1486
+ readonly payload?: AuthorizedPreviewPayloadScope;
1259
1487
  }
1260
1488
  /** The verdict of a successful `authorizePreviewRequest()`: frozen, branded, produced only there. Carry it, do not rebuild it. */
1261
1489
  interface AuthorizedPreviewContext {
@@ -1298,11 +1526,15 @@ interface PreviewAuthorizationRequest {
1298
1526
  readonly headers: {
1299
1527
  get(name: string): string | null;
1300
1528
  };
1529
+ /** Request lifetime, when supplied by the caller. Session fetches follow it. */
1530
+ readonly signal?: AbortSignal;
1301
1531
  }
1302
1532
 
1303
1533
  /**
1304
1534
  * The `payload-session` strategy: forward exactly one named cookie to
1305
1535
  * `GET <serverURL>/api/<usersSlug>/me` and authorize when a user comes back.
1536
+ * A cookie-only request preserves working Payload 2 sessions. When `/me`
1537
+ * reports no user, one retry adds an `Origin` for Payload 3's CSRF check.
1306
1538
  */
1307
1539
 
1308
1540
  /** A `fetch`-compatible function, injectable for tests. */
@@ -1322,6 +1554,12 @@ interface PayloadSessionStrategy {
1322
1554
  readonly usersSlug?: string;
1323
1555
  /** Cookie name; Payload's default is `payload-token`. */
1324
1556
  readonly cookieName?: string;
1557
+ /**
1558
+ * Send this listed origin with the cookie from the first request. Without
1559
+ * it, try the existing cookie-only request, then the origin of `serverURL`
1560
+ * once when `/me` reports a null user. Draft reads keep the accepted headers.
1561
+ */
1562
+ readonly origin?: string;
1325
1563
  /** Upper bound for the `/me` round trip. Below 250 ms is raised to 250 ms; default 3000. */
1326
1564
  readonly timeoutMs?: number;
1327
1565
  /** Longest cookie value accepted; longer ones are refused as `missing-credential`. Default 4096. */
@@ -1371,7 +1609,7 @@ interface PreviewTokenReplayStore {
1371
1609
  consume(id: string, expiresAt: number): Promise<boolean> | boolean;
1372
1610
  }
1373
1611
  /**
1374
- * @deprecated The 1.x store shape, removed in 3.0. Its two calls cannot be one
1612
+ * @deprecated The store shape of the 2.0 beta, removed in 3.0. Its two calls cannot be one
1375
1613
  * step, so two requests with the same token that arrive together both pass
1376
1614
  * `isUsed` before either reaches `markUsed`. Implement
1377
1615
  * {@link PreviewTokenReplayStore.consume} instead.
@@ -1535,6 +1773,19 @@ interface LexicalRoot {
1535
1773
  interface LexicalRenderOptions {
1536
1774
  /** Pass the result through `sanitizeHtml()` (default `true`). */
1537
1775
  readonly sanitize?: boolean;
1776
+ /**
1777
+ * The DOM the sanitizer parses with, for this call: an SSR document such as
1778
+ * linkedom's or jsdom's. Without it the document `setSanitizerDocument()`
1779
+ * supplied is used, then the global one; with neither the result is
1780
+ * unsanitised and warns once.
1781
+ */
1782
+ readonly document?: SanitizerDocument;
1783
+ /**
1784
+ * Throw instead of returning unsanitised HTML when no document is available:
1785
+ * the `SanitizerEnvironmentError` `sanitizeHtml()` throws (ADR 0025). Off in
1786
+ * 2.x, where the call warns once and returns the markup; the default in 3.0.
1787
+ */
1788
+ readonly requireDocument?: boolean;
1538
1789
  /**
1539
1790
  * Called for every `block` or `inlineBlock` the registry has no renderer
1540
1791
  * for, with the block's slug as Payload sent it and the class its empty
@@ -1546,7 +1797,7 @@ interface LexicalRenderOptions {
1546
1797
  }
1547
1798
  /** @internal */
1548
1799
  declare function isLexicalContent(value: unknown): value is LexicalRoot;
1549
- /** Render a Lexical document to HTML; without `setSanitizerDocument()` the result is unsanitised and warns once. */
1800
+ /** Render a Lexical document to HTML; without a document the result is unsanitised and warns once, or throws under `requireDocument`. */
1550
1801
  declare function lexicalToHtml(content: LexicalRoot, options?: LexicalRenderOptions): string;
1551
1802
  /** Plain text of a document, paragraphs separated by `\n`. */
1552
1803
  declare function lexicalToPlainText(content: LexicalRoot): string;
@@ -1570,7 +1821,7 @@ declare function registerBlockRenderer(blockType: string, renderer: BlockRendere
1570
1821
 
1571
1822
  declare const highlightPlugin: LivePreviewPlugin;
1572
1823
 
1573
- /** `debug` plugin: logs every lifecycle event through the plugin context. */
1824
+ /** `debug` plugin: logs init, connect, disconnect, cacheRefresh, beforeUpdate, afterUpdate and error through the plugin context. */
1574
1825
 
1575
1826
  declare const debugPlugin: LivePreviewPlugin;
1576
1827
 
@@ -1714,74 +1965,6 @@ interface PayloadRelationship<TSlug extends string = string> {
1714
1965
  /** One renderer map per client; the stateful text and structural renderers are created fresh each call. @internal */
1715
1966
  declare function buildBuiltinRenderers(): Readonly<Record<string, FieldRenderer>>;
1716
1967
 
1717
- /**
1718
- * Protocol negotiation. A capability is granted either by the version a peer
1719
- * announces or by observation, since the stock Payload admin announces none:
1720
- * what it can do is read off the messages it sends. See ADR 0010.
1721
- */
1722
- /** Bumped only when this library's understanding of the wire format changes. @internal */
1723
- declare const LIBRARY_PROTOCOL_VERSION = 4;
1724
- /** How a capability becomes active. @internal */
1725
- type CapabilitySource = 'version' | 'observed';
1726
- /** @internal */
1727
- interface CapabilityDeclaration {
1728
- /** Enabled once the negotiated version reaches this (for announced peers). */
1729
- readonly since: number;
1730
- /** The wire signal that grants this capability to a peer announcing no version. */
1731
- readonly observed?: 'schema' | 'locale' | 'preview-token' | 'document-event' | 'relationship-event';
1732
- }
1733
- /** What activates each capability; the prose lives in `CAPABILITY_DOCUMENTATION`. */
1734
- declare const CAPABILITY_DECLARATIONS: {
1735
- readonly basic: {
1736
- readonly since: 1;
1737
- };
1738
- readonly 'schema-json': {
1739
- readonly since: 2;
1740
- readonly observed: "schema";
1741
- };
1742
- readonly locale: {
1743
- readonly since: 2;
1744
- readonly observed: "locale";
1745
- };
1746
- readonly 'preview-token': {
1747
- readonly since: 3;
1748
- readonly observed: "preview-token";
1749
- };
1750
- readonly 'nested-arrays': {
1751
- readonly since: 4;
1752
- };
1753
- readonly 'recursive-diffs': {
1754
- readonly since: 4;
1755
- };
1756
- readonly 'document-events': {
1757
- readonly since: 4;
1758
- readonly observed: "document-event";
1759
- };
1760
- readonly 'relationship-events': {
1761
- readonly since: 4;
1762
- readonly observed: "relationship-event";
1763
- };
1764
- };
1765
- type ProtocolCapability = keyof typeof CAPABILITY_DECLARATIONS;
1766
- /** Every declared capability, in declaration order. @internal */
1767
- declare const PROTOCOL_CAPABILITIES: readonly ProtocolCapability[];
1768
- interface ProtocolNegotiation {
1769
- /** This library's protocol version. */
1770
- readonly ours: number;
1771
- /** The remote party's version, when it announced one. */
1772
- readonly theirs: number | undefined;
1773
- /** `min(ours, theirs ?? 1)` — the version both sides actually share. */
1774
- readonly negotiated: number;
1775
- /** Capabilities active at the negotiated version or seen on the wire. */
1776
- readonly capabilities: ReadonlySet<ProtocolCapability>;
1777
- /** The subset that was observed on the wire rather than granted by version. */
1778
- readonly observed: ReadonlySet<ProtocolCapability>;
1779
- }
1780
- /** Deterministic; the runtime re-runs it whenever either input changes. */
1781
- declare function negotiateProtocol(theirs: number | undefined, observed?: Iterable<ProtocolCapability>): ProtocolNegotiation;
1782
- /** @internal */
1783
- declare function hasCapability(negotiation: ProtocolNegotiation, capability: ProtocolCapability): boolean;
1784
-
1785
1968
  /**
1786
1969
  * What each capability tells the runtime, for `inspect()` and consumer
1787
1970
  * diagnostics. Kept out of the runtime module so the inline bundle ships the
@@ -1808,9 +1991,10 @@ interface ProtocolProfile {
1808
1991
  /** Where field types come from. */
1809
1992
  readonly fieldTyping: 'schema' | 'heuristic';
1810
1993
  /**
1811
- * Who populates relationships. Payload 2.x's admin posts populated data
1812
- * (it merges client-side with `fieldSchemaJSON`); Payload 3.x posts raw
1813
- * form values and the runtime asks the REST API when `serverURL` is set.
1994
+ * Legacy transport label, retained for 2.x compatibility. `admin` identifies
1995
+ * Payload 2's schema-based path; observed messages can contain raw relation IDs,
1996
+ * which the shared merger populates with collection GETs. `server` identifies
1997
+ * the Payload 3 merge path. This label alone does not describe population state.
1814
1998
  */
1815
1999
  readonly populatesRelationships: 'admin' | 'server';
1816
2000
  /** Whether the peer reports document saves and relationship edits. */
@@ -1858,7 +2042,7 @@ interface BindOptions {
1858
2042
  readonly attribute?: string;
1859
2043
  /** Explicit field type, bypassing schema detection. */
1860
2044
  readonly type?: string;
1861
- /** Mark the binding as Lexical rich text; needed only when the initial render is empty. */
2045
+ /** Mark the binding as Lexical rich text; needed for an element that can hold uploads or relationships, or when the initial render is empty. */
1862
2046
  readonly richtext?: boolean;
1863
2047
  /** Render the value as sanitised HTML rather than text. */
1864
2048
  readonly html?: boolean;
@@ -1920,6 +2104,12 @@ interface PreviewBindings {
1920
2104
  * The registry behind `id` is the endpoint's (docs/hybrid.md).
1921
2105
  */
1922
2106
  boundary: (id: string, options?: FragmentBoundaryOptions) => FragmentBoundaryAttributes | SuppressedBinding;
2107
+ /**
2108
+ * Field paths the page accounts for without binding them, and everything
2109
+ * below them (`data-payload-covers`, ADR 0022), or nothing while
2110
+ * unauthorized.
2111
+ */
2112
+ covers: (...paths: readonly string[]) => Readonly<Record<'data-payload-covers', string>> | SuppressedBinding;
1923
2113
  }
1924
2114
  /** Request-scoped `bind`, `bindByPath` and `owner`, all suppressed unless `authorization` is a real context. */
1925
2115
  declare function createPreviewBindings(options: PreviewBindingsOptions): PreviewBindings;
@@ -1949,7 +2139,8 @@ declare function previewBindingsFromLocals(locals: unknown, options?: {
1949
2139
  * Instead every flush that carried a change dispatches `payload-live-preview:update`
1950
2140
  * on each island root with the update in `detail`, whether or not a binding
1951
2141
  * outside the islands was written. `data-payload-island="patch"` opts back in.
1952
- * @internal
2142
+ * Server HTML reaches an Astro island only through Astro's own props handoff
2143
+ * (ADR 0021). @internal
1953
2144
  */
1954
2145
  declare const ISLAND_EVENT = "payload-live-preview:update";
1955
2146
  interface IslandUpdateDetail {
@@ -1957,8 +2148,15 @@ interface IslandUpdateDetail {
1957
2148
  readonly revision: number;
1958
2149
  readonly receivedAt: number;
1959
2150
  readonly locale: string | undefined;
2151
+ /**
2152
+ * Call once the island has rendered this revision, for instance from an
2153
+ * effect after its framework committed. Until every island handed the
2154
+ * revision has called it, `inspect().revisions.display` says `unconfirmed`
2155
+ * (ADR 0023). Repeated, late or superseded calls do nothing.
2156
+ */
2157
+ readonly displayed: () => void;
1960
2158
  }
1961
2159
  /** Whether `element` (or an ancestor) is an island that did not opt into patching. @internal */
1962
2160
  declare function isInsideIsland(element: Element): boolean;
1963
2161
 
1964
- export { AUTHORIZED_PREVIEW_BRAND_KEY, type AnalyticsSnapshot, type AuthorizedPreviewContext, type AuthorizedPreviewScope, type BindOptions, type BlockRenderContext, type BlockRenderer, CAPABILITY_DECLARATIONS, CAPABILITY_DOCUMENTATION, type CachedElement, type CapabilityDeclaration, type CapabilityDocumentation, type CapabilitySource, type ConnectionStatus, type CspDirectiveMerge, type CustomRendererKey, DIAGNOSTIC_CODES, type DefaultsProfile, type DiagnosticCode, type DocumentSaveHandler, type DocumentSavePluginOptions, type DocumentSaveStrategy, EventEmitter, type EventHandler, type EventSourcePolicy, type FetchLike, type FieldBindingAttributes, type FieldName, type FieldPath, type FieldRenderer, type FieldTransform, type FieldType, type FocusReportTarget, type FragmentBoundaryAttributes, type FragmentBoundaryOptions, type FragmentContext, type FragmentReport, type FragmentStrategy, type FrameAncestorsOptions, ISLAND_EVENT, type InlineScriptConfig, type InspectionBindings, type InspectionFidelity, type InspectionFragments, type InspectionOrigins, type InspectionProtocol, type InspectionRevisions, type InspectionRoute, type InspectionScheduler, type IslandUpdateDetail, type IssuePreviewTokenOptions, LIBRARY_PROTOCOL_VERSION, type LexicalNode, type LexicalRoot, LivePreviewClient, type LivePreviewClientConfig, type LivePreviewEventMap, type LivePreviewInspection, type LivePreviewPlugin, type NavigationLifecycleOptions, type NavigationLifecycleTarget, OriginDetector, type OwnerBindingAttributes, PROTOCOL_CAPABILITIES, type PayloadDocumentEventDetail, type PayloadFieldCondition, type PayloadFieldSchema, type PayloadFieldType, type PayloadLivePreviewData, type PayloadLivePreviewMessage, type PayloadMedia, type PayloadRelationship, type PayloadSessionStrategy, type PluginCompatibility, type PluginContext, type PluginDisposer, type PluginEvents, type PluginInspection, type PreviewAuthorization, type PreviewAuthorizationOutcome, type PreviewAuthorizationRequest, type PreviewAuthorizationStrategy, type PreviewAuthorizationStrategyName, type PreviewBindings, type PreviewBindingsOptions, type PreviewFocusMessage, type PreviewRequestLike, type PreviewRequestOptions, type PreviewTokenClaims, type PreviewTokenReplayChecks, type PreviewTokenReplayStore, type PreviewTokenTransport, type PreviewVerifierClaims, type ProtocolCapability, type ProtocolNegotiation, type ProtocolProfile, type ProtocolProfileName, type RenderContext, type RendererKey, type RichTextRenderer, type RouteContext, type RouteOutcome, type RouteRefresh, type RouteStrategy, type RuntimeArtifact, type SanitizerDocument, type SanitizerPolicyMode, type SignedTokenStrategy, type StrategyHandlers, type SubtleCryptoLike, type SuppressedBinding, TRUSTED_TYPES_POLICY_NAME, type TrustedHtmlPolicyLike, type Unsubscribe, type UpdateSource, VERSION, type ValueAt, type VerifierStrategy, authorizePreviewRequest, bind, bindByPath, bindNavigationLifecycle, buildBuiltinRenderers, buildFrameAncestors, buildScriptSrcWithNonce, createAnalyticsPlugin, createPreviewBindings, createPreviewFocusReporter, debugPlugin, detectInitialLocale, detectProtocolProfile, documentSavePlugin, escapeHtml, escapeHtmlAttribute, generateCspNonce, generateInlineScript, hasCapability, hasPreviewIntent, highlightPlugin, initLivePreview, isAuthorizedPreviewContext, isDevMode, isExternalHttpUrl, isInIframe, isInPopup, isInPreviewContext, isInsideIsland, isLexicalContent, isPreviewRequest, isSafeUrl, issuePreviewToken, lexicalToHtml, lexicalToPlainText, mergeCspHeader, negotiateProtocol, previewBindingsFromLocals, registerBlockRenderer, registerBuiltinRenderer, registerRouteRefresh, reportPreviewFocus, runtimeBuildInfo, sanitizeHtml, setCspCrypto, setSanitizerDocument, setSanitizerPolicy, setTrustedTypesPolicy, trustedHtml, wrapWithScriptTag };
2162
+ export { AUTHORIZED_PREVIEW_BRAND_KEY, type AnalyticsSnapshot, type AuthorizedPreviewContext, type AuthorizedPreviewDocument, type AuthorizedPreviewPayloadScope, type AuthorizedPreviewScope, type BindOptions, type BlockRenderContext, type BlockRenderer, CAPABILITY_DECLARATIONS, CAPABILITY_DOCUMENTATION, type CachedElement, type CapabilityDeclaration, type CapabilityDocumentation, type CapabilitySource, type ConnectionStatus, type CspDirectiveMerge, type CustomRendererKey, DIAGNOSTIC_CODES, type DefaultsProfile, type DiagnosticCode, type DocumentSaveHandler, type DocumentSavePluginOptions, type DocumentSaveStrategy, EventEmitter, type EventHandler, type EventSourcePolicy, type FetchLike, type FieldBindingAttributes, type FieldName, type FieldPath, type FieldRenderer, type FieldTransform, type FieldType, type FocusReportTarget, type FragmentBoundaryAttributes, type FragmentBoundaryOptions, type FragmentContext, type FragmentReport, type FragmentStrategy, type FrameAncestorsOptions, ISLAND_EVENT, type InlineScriptConfig, type InspectionBindings, type InspectionFidelity, type InspectionFragments, type InspectionOrigins, type InspectionProtocol, type InspectionRevisions, type InspectionRoute, type InspectionScheduler, type IslandUpdateDetail, type IssuePreviewTokenOptions, LIBRARY_PROTOCOL_VERSION, type LexicalNode, type LexicalRoot, LivePreviewClient, type LivePreviewClientConfig, type LivePreviewEventMap, type LivePreviewInspection, type LivePreviewPlugin, type NavigationLifecycleOptions, type NavigationLifecycleTarget, OriginDetector, type OwnerBindingAttributes, PROTOCOL_CAPABILITIES, type PayloadDocumentEventDetail, type PayloadFieldCondition, type PayloadFieldSchema, type PayloadFieldType, type PayloadLivePreviewData, type PayloadLivePreviewMessage, type PayloadMedia, type PayloadRelationship, type PayloadSessionStrategy, type PluginCompatibility, type PluginContext, type PluginDisposer, type PluginEvents, type PluginInspection, type PreviewAuthorization, type PreviewAuthorizationOutcome, type PreviewAuthorizationRequest, type PreviewAuthorizationStrategy, type PreviewAuthorizationStrategyName, type PreviewBindings, type PreviewBindingsOptions, type PreviewFocusMessage, type PreviewRequestLike, type PreviewRequestOptions, type PreviewTokenClaims, type PreviewTokenReplayChecks, type PreviewTokenReplayStore, type PreviewTokenTransport, type PreviewVerifierClaims, type ProtocolCapability, type ProtocolNegotiation, type ProtocolProfile, type ProtocolProfileName, type RenderContext, type RendererKey, type RevisionDisplay, type RevisionDisplayState, type RevisionShortfall, type RichTextRenderer, type RouteContext, type RouteOutcome, type RoutePlanContext, type RouteRefresh, type RouteStrategy, type RuntimeArtifact, type SanitizerDocument, type SanitizerPolicyMode, type SignedTokenStrategy, type StrategyHandlers, type SubtleCryptoLike, type SuppressedBinding, TRUSTED_TYPES_POLICY_NAME, type TrustedHtmlPolicyLike, type Unsubscribe, type UpdateSource, VERSION, type ValueAt, type VerifierStrategy, authorizePreviewRequest, bind, bindByPath, bindNavigationLifecycle, buildBuiltinRenderers, buildFrameAncestors, buildScriptSrcWithNonce, createAnalyticsPlugin, createPreviewBindings, createPreviewFocusReporter, debugPlugin, detectInitialLocale, detectProtocolProfile, documentSavePlugin, escapeHtml, escapeHtmlAttribute, generateCspNonce, generateInlineScript, hasCapability, hasPreviewIntent, highlightPlugin, initLivePreview, isAuthorizedPreviewContext, isDevMode, isExternalHttpUrl, isInIframe, isInPopup, isInPreviewContext, isInsideIsland, isLexicalContent, isPreviewRequest, isSafeUrl, issuePreviewToken, lexicalToHtml, lexicalToPlainText, mergeCspHeader, negotiateProtocol, previewBindingsFromLocals, registerBlockRenderer, registerBuiltinRenderer, registerRouteRefresh, reportPreviewFocus, runtimeBuildInfo, sanitizeHtml, setCspCrypto, setSanitizerDocument, setSanitizerPolicy, setTrustedTypesPolicy, trustedHtml, wrapWithScriptTag };