@vscode/component-explorer 0.2.1-17 → 0.2.1-170

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 (85) hide show
  1. package/README.md +198 -27
  2. package/dist/browserDaemonClient-AB8d4x2O.js +3465 -0
  3. package/dist/browserDaemonClient-AB8d4x2O.js.map +1 -0
  4. package/dist/components/BottomDebugPanel.d.ts +8 -0
  5. package/dist/components/BottomDebugPanel.d.ts.map +1 -0
  6. package/dist/components/DebugPanelPlacement.d.ts +3 -0
  7. package/dist/components/DebugPanelPlacement.d.ts.map +1 -0
  8. package/dist/components/DebugWorkbench.d.ts +42 -0
  9. package/dist/components/DebugWorkbench.d.ts.map +1 -0
  10. package/dist/components/DebugWorkbenchLayout.d.ts +30 -0
  11. package/dist/components/DebugWorkbenchLayout.d.ts.map +1 -0
  12. package/dist/components/DebugWorkbenchState.d.ts +31 -0
  13. package/dist/components/DebugWorkbenchState.d.ts.map +1 -0
  14. package/dist/components/ExplorerModel.d.ts +28 -5
  15. package/dist/components/ExplorerModel.d.ts.map +1 -1
  16. package/dist/components/FixtureDebugStore.d.ts +20 -0
  17. package/dist/components/FixtureDebugStore.d.ts.map +1 -0
  18. package/dist/components/FixturePreviewItem.d.ts +11 -0
  19. package/dist/components/FixturePreviewItem.d.ts.map +1 -1
  20. package/dist/components/LeftSidebar.d.ts.map +1 -1
  21. package/dist/components/PageViewportState.d.ts +34 -0
  22. package/dist/components/PageViewportState.d.ts.map +1 -0
  23. package/dist/components/PreviewArea.d.ts.map +1 -1
  24. package/dist/components/RightSidebar.d.ts +8 -2
  25. package/dist/components/RightSidebar.d.ts.map +1 -1
  26. package/dist/components/TitleBar.d.ts.map +1 -1
  27. package/dist/components/TreeView.d.ts +3 -1
  28. package/dist/components/TreeView.d.ts.map +1 -1
  29. package/dist/components/favoriteFixtures.d.ts +4 -0
  30. package/dist/components/favoriteFixtures.d.ts.map +1 -0
  31. package/dist/components/icons.d.ts +12 -8
  32. package/dist/components/icons.d.ts.map +1 -1
  33. package/dist/components/types.d.ts +2 -0
  34. package/dist/components/types.d.ts.map +1 -1
  35. package/dist/core/ComponentRenderer.d.ts +26 -3
  36. package/dist/core/ComponentRenderer.d.ts.map +1 -1
  37. package/dist/core/ErrorInfo.d.ts +21 -1
  38. package/dist/core/ErrorInfo.d.ts.map +1 -1
  39. package/dist/core/FixtureInputStore.d.ts +32 -0
  40. package/dist/core/FixtureInputStore.d.ts.map +1 -0
  41. package/dist/core/FixtureInteractionRuntime.d.ts +30 -0
  42. package/dist/core/FixtureInteractionRuntime.d.ts.map +1 -0
  43. package/dist/core/FixtureNode.d.ts.map +1 -1
  44. package/dist/core/FixtureRegistry.d.ts +2 -0
  45. package/dist/core/FixtureRegistry.d.ts.map +1 -1
  46. package/dist/core/RenderTimeout.d.ts +39 -0
  47. package/dist/core/RenderTimeout.d.ts.map +1 -0
  48. package/dist/core/fixtureApi.d.ts +234 -32
  49. package/dist/core/fixtureApi.d.ts.map +1 -1
  50. package/dist/core/fixtureApiConsumer.d.ts +22 -2
  51. package/dist/core/fixtureApiConsumer.d.ts.map +1 -1
  52. package/dist/core/index.d.ts +7 -3
  53. package/dist/core/index.d.ts.map +1 -1
  54. package/dist/core/inputAggregation.d.ts +31 -0
  55. package/dist/core/inputAggregation.d.ts.map +1 -0
  56. package/dist/daemon/DaemonConfig.d.ts +0 -2
  57. package/dist/daemon/DaemonConfig.d.ts.map +1 -1
  58. package/dist/daemon/DaemonModel.d.ts +12 -6
  59. package/dist/daemon/DaemonModel.d.ts.map +1 -1
  60. package/dist/daemon/browserDaemonClient.d.ts +3 -0
  61. package/dist/daemon/browserDaemonClient.d.ts.map +1 -0
  62. package/dist/fixtureApi.d-DjVuiRlO.d.ts +533 -0
  63. package/dist/index.d.ts +53 -10
  64. package/dist/index.d.ts.map +1 -1
  65. package/dist/index.js +11 -9
  66. package/dist/lib/explorerQueryParams.d.ts +2 -2
  67. package/dist/lib/explorerQueryParams.d.ts.map +1 -1
  68. package/dist/lib/fixtureSizeCache.d.ts +2 -0
  69. package/dist/lib/fixtureSizeCache.d.ts.map +1 -1
  70. package/dist/modes/EmbeddedMode.d.ts +7 -0
  71. package/dist/modes/EmbeddedMode.d.ts.map +1 -1
  72. package/dist/modes/ExplorerUIMode.d.ts +1 -1
  73. package/dist/modes/ExplorerUIMode.d.ts.map +1 -1
  74. package/dist/modes/HeadlessMode.d.ts +12 -3
  75. package/dist/modes/HeadlessMode.d.ts.map +1 -1
  76. package/dist/{runtimeVersion-DMb19DDZ.js → runtimeVersion-rZ2g9LqC.js} +80 -39
  77. package/dist/runtimeVersion-rZ2g9LqC.js.map +1 -0
  78. package/dist/viewer.d.ts +2900 -24
  79. package/dist/viewer.d.ts.map +1 -1
  80. package/dist/viewer.js +5596 -2332
  81. package/dist/viewer.js.map +1 -1
  82. package/package.json +10 -6
  83. package/dist/core/PropertySchema.d.ts +0 -40
  84. package/dist/core/PropertySchema.d.ts.map +0 -1
  85. package/dist/runtimeVersion-DMb19DDZ.js.map +0 -1
package/dist/viewer.d.ts CHANGED
@@ -1,34 +1,2910 @@
1
- import { FixtureModules, ExplorerRuntime } from './core/index.js';
2
- import { DaemonConfig } from './daemon/DaemonConfig.js';
3
- /**
4
- * Viewer entry point
5
- *
6
- * This module exports everything needed by the Component Explorer viewer.
7
- * Projects should NOT import from this module - use '@vscode/component-explorer' instead.
8
- */
9
- export * from './core/index.js';
10
- export type { FixtureExport, SingleFixtureExport, FixtureGroupExport, FixtureVariantsExport, } from './core/fixtureApi.js';
11
- export type { ExplorerMode, ExplorerQueryParams } from './lib/explorerQueryParams.js';
12
- export { Explorer, ExplorerModel } from './components/index.js';
13
- export type { ExplorerTreeNode } from './components/index.js';
14
- export { toExplorerTree } from './components/index.js';
15
- export { TitleBar, TitleBarButton, LeftSidebar, RightSidebar, TreeView, TreeItem, } from './components/index.js';
16
- export * from './components/icons.js';
17
- export { styles, mergeStyles } from './components/index.js';
18
- export { DaemonModel } from './daemon/index.js';
19
- export type { DaemonScreenshotResult, DaemonCompareResult, DaemonFixtureInfo } from './daemon/DaemonModel.js';
20
- export { ReportModel } from './report/index.js';
21
- export type { ScreenshotReport, ReportFixtureEntry, ReportSummary, FixtureStatus } from './report/index.js';
22
- export interface ExplorerAppOptions {
1
+ import { k as DisplayMode, x as StyleDefinition, s as IJsonSchema, p as FixtureInputControlOptions, b as DebugPanelDefinition, R as RenderContext, w as RenderReturn, S as SingleFixtureExport, n as FixtureGroupExport, q as FixtureVariantsExport, l as FixtureExport, P as PageMode, I as IDisposable$2, u as RenderHost, v as RenderResult, g as DebugPanelViewStateOptions, f as DebugPanelViewState } from './fixtureApi.d-DjVuiRlO.js';
2
+ export { C as ComponentMode, D as DebugPanelActivation, a as DebugPanelChannel, c as DebugPanelPlacement, d as DebugPanelViewContext, e as DebugPanelViewInstance, h as DefineComponentOptions, i as DefineDebugPanelOptions, j as DefineFixtureOptions, F as FixtureDebugApi, m as FixtureGroupEntry, o as FixtureGroupInput, r as FixtureVariantsInput, t as InteractiveOutput, V as ViewportPreset, y as ViewportPresetName, L as asyncRender, z as defineDebugPanel, A as defineFixture, B as defineFixtureGroup, E as defineFixtureVariants, G as fixtureGroupBrand, H as fixtureVariantsBrand, J as interactiveOutput, M as isInteractiveOutput, K as singleFixtureBrand, N as syncRender } from './fixtureApi.d-DjVuiRlO.js';
3
+ import * as React from 'react';
4
+ import { Context } from 'react';
5
+ import * as zod_v4_core from 'zod/v4/core';
6
+ import { $ZodType, output } from 'zod/v4/core';
7
+ import * as zod_mini from 'zod/mini';
8
+ import 'zod';
9
+
10
+ /**
11
+ * Type guard for SingleFixtureExport.
12
+ * Uses the global symbol brand for cross-version compatibility.
13
+ */
14
+ declare function isSingleFixture(value: unknown): value is SingleFixtureExport;
15
+ /**
16
+ * Type guard for FixtureGroupExport.
17
+ * Uses the global symbol brand for cross-version compatibility.
18
+ */
19
+ declare function isFixtureGroup(value: unknown): value is FixtureGroupExport;
20
+ /**
21
+ * Type guard for FixtureVariantsExport.
22
+ * Uses the global symbol brand for cross-version compatibility.
23
+ */
24
+ declare function isFixtureVariants(value: unknown): value is FixtureVariantsExport;
25
+ type ParseResult<T> = {
26
+ success: true;
27
+ data: T;
28
+ } | {
29
+ success: false;
30
+ error: string;
31
+ };
32
+ /**
33
+ * Parses and validates a potential fixture export.
34
+ * Returns a ParseResult with either the validated data or an error message.
35
+ */
36
+ declare function parseFixtureExport(value: unknown): ParseResult<FixtureExport>;
37
+ /**
38
+ * Parses and validates a single fixture export.
39
+ */
40
+ declare function parseSingleFixture(value: unknown): ParseResult<SingleFixtureExport>;
41
+ /**
42
+ * Parses and validates a fixture group export.
43
+ */
44
+ declare function parseFixtureGroup(value: unknown): ParseResult<FixtureGroupExport>;
45
+ /**
46
+ * Parses and validates a fixture variants export.
47
+ */
48
+ declare function parseFixtureVariants(value: unknown): ParseResult<FixtureVariantsExport>;
49
+ /**
50
+ * Definition of a component fixture (internal representation).
51
+ */
52
+ interface ComponentDefinition {
53
+ /** Unique identifier within the fixture file */
54
+ readonly id: string;
55
+ /** Display name shown in the tree */
56
+ readonly name: string;
57
+ /** Optional description for documentation */
58
+ readonly description?: string;
59
+ /** How to isolate this component from other components */
60
+ readonly isolation: 'none' | 'shadow-dom' | 'iframe';
61
+ /** How to display: page (device viewport) or component (natural size) */
62
+ readonly displayMode: DisplayMode;
63
+ /** Stylesheets to inject (into document head, shadow root, or iframe head depending on isolation mode) */
64
+ readonly styles?: readonly StyleDefinition[];
65
+ /** Background pattern for the preview canvas: 'light' (default) or 'dark' for dark transparent pattern */
66
+ readonly background: 'light' | 'dark';
67
+ /** Labels for categorization and filtering */
68
+ readonly labels: readonly string[];
69
+ /** Accumulated expected visual descriptions (from self + parent groups/variants) */
70
+ readonly expectedVisualDescriptions: readonly string[];
71
+ /** JSON Schema describing the expected shape of `RenderContext.input` (always an object). */
72
+ readonly inputSchema?: IJsonSchema;
73
+ /** Explorer presentation metadata for input properties. */
74
+ readonly inputControls?: Readonly<Record<string, FixtureInputControlOptions>>;
75
+ /** Statically declared custom debug panels. */
76
+ readonly debugPanels: readonly DebugPanelDefinition<unknown, unknown>[];
77
+ /** Source file path this fixture was defined in */
78
+ readonly sourceFile: string;
79
+ /**
80
+ * Render the component into the container.
81
+ * Returns an optional RenderResult or Promise for cleanup and async readiness.
82
+ */
83
+ render(container: HTMLElement, context: RenderContext): RenderReturn;
84
+ }
85
+ /**
86
+ * Creates the component definition from a validated SingleFixtureExport.
87
+ *
88
+ * @param inheritedInputSchema - JSON Schema accumulated from enclosing groups/variants; merged
89
+ * with the fixture's own schema (the fixture's properties win on conflict).
90
+ */
91
+ declare function createComponentDefinition(fixture: SingleFixtureExport, id: string, name: string, sourceFile: string, inheritedVisualDescriptions?: readonly string[], inheritedInputSchema?: IJsonSchema | undefined): ComponentDefinition;
92
+ /**
93
+ * Merges two object JSON Schemas. `child` properties win over `parent` on key conflicts;
94
+ * `required` is the de-duplicated union. Returns whichever side is defined when only one is.
95
+ */
96
+ declare function mergeInputSchemas(parent: IJsonSchema | undefined, child: IJsonSchema | undefined): IJsonSchema | undefined;
97
+ /**
98
+ * Builds the effective `input` object passed to a fixture: the schema's top-level property
99
+ * defaults, overlaid with any caller-provided overrides. Returns the override unchanged when
100
+ * there is no schema (so schemaless fixtures keep their original `undefined`/passthrough input).
101
+ */
102
+ declare function applyInputDefaults(schema: IJsonSchema | undefined, input: unknown): unknown;
103
+ /**
104
+ * Type guard for checking if a value is a ComponentDefinition.
105
+ * @deprecated Use isSingleFixture or isFixtureGroup instead
106
+ */
107
+ declare function isComponentDefinition(value: unknown): value is ComponentDefinition;
108
+
109
+ interface IDisposable$1 {
110
+ dispose(): void;
111
+ }
112
+ declare class DisposableStore$1 implements IDisposable$1 {
113
+ private disposables;
114
+ private _isDisposed;
115
+ get isDisposed(): boolean;
116
+ dispose(): void;
117
+ add<T extends IDisposable$1 | undefined>(disposable: T): T;
118
+ remove<T extends IDisposable$1 | undefined>(disposable: T): T;
119
+ clear(): void;
120
+ leakItems(): void;
121
+ }
122
+
123
+ /**
124
+ * Represents an observable value.
125
+ *
126
+ * @template T The type of the values the observable can hold.
127
+ */
128
+ interface IObservable$1<T> extends IObservableWithChange$1<T, unknown> {
129
+ }
130
+ /**
131
+ * Represents an observable value.
132
+ *
133
+ * @template T The type of the values the observable can hold.
134
+ * @template TChange The type used to describe value changes
135
+ * (usually `void` and only used in advanced scenarios).
136
+ * While observers can miss temporary values of an observable,
137
+ * they will receive all change values (as long as they are subscribed)!
138
+ */
139
+ interface IObservableWithChange$1<T, TChange = unknown> {
140
+ /**
141
+ * Returns the current value.
142
+ *
143
+ * Calls {@link IObserver.handleChange} if the observable notices that the value changed.
144
+ * Must not be called from {@link IObserver.handleChange}!
145
+ */
146
+ get(): T;
147
+ /**
148
+ * Forces the observable to check for changes and report them.
149
+ *
150
+ * Has the same effect as calling {@link IObservable.get}, but does not force the observable
151
+ * to actually construct the value, e.g. if change deltas are used.
152
+ * Calls {@link IObserver.handleChange} if the observable notices that the value changed.
153
+ * Must not be called from {@link IObserver.handleChange}!
154
+ */
155
+ reportChanges(): void;
156
+ /**
157
+ * Adds the observer to the set of subscribed observers.
158
+ * This method is idempotent.
159
+ */
160
+ addObserver(observer: IObserver$1): void;
161
+ /**
162
+ * Removes the observer from the set of subscribed observers.
163
+ * This method is idempotent.
164
+ */
165
+ removeObserver(observer: IObserver$1): void;
166
+ /**
167
+ * Reads the current value and subscribes the reader to this observable.
168
+ *
169
+ * Calls {@link IReader.readObservable} if a reader is given, otherwise {@link IObservable.get}
170
+ * (see {@link ConvenientObservable.read} for the implementation).
171
+ */
172
+ read(reader: IReader$1 | undefined): T;
173
+ /**
174
+ * Makes sure this value is computed eagerly.
175
+ */
176
+ recomputeInitiallyAndOnChange(store: DisposableStore$1, handleValue?: (value: T) => void): IObservable$1<T>;
177
+ /**
178
+ * Makes sure this value is cached.
179
+ */
180
+ keepObserved(store: DisposableStore$1): IObservable$1<T>;
181
+ /**
182
+ * Creates a derived observable that depends on this observable.
183
+ * Use the reader to read other observables
184
+ * (see {@link ConvenientObservable.map} for the implementation).
185
+ */
186
+ map<TNew>(fn: (value: T, reader: IReader$1) => TNew): IObservable$1<TNew>;
187
+ map<TNew>(owner: object, fn: (value: T, reader: IReader$1) => TNew): IObservable$1<TNew>;
188
+ flatten<TNew>(this: IObservable$1<IObservable$1<TNew>>): IObservable$1<TNew>;
189
+ /**
190
+ * ONLY FOR DEBUGGING!
191
+ * Logs computations of this derived.
192
+ */
193
+ log(): IObservableWithChange$1<T, TChange>;
194
+ /**
195
+ * A human-readable name for debugging purposes.
196
+ */
197
+ readonly debugName: string;
198
+ /**
199
+ * ONLY FOR DEBUGGING!
200
+ */
201
+ debugGetDependencyGraph(): string;
202
+ /**
203
+ * This property captures the type of the change object. Do not use it at runtime!
204
+ */
205
+ readonly TChange: TChange;
206
+ }
207
+ /**
208
+ * Represents an observer that can be subscribed to an observable.
209
+ *
210
+ * If an observer is subscribed to an observable and that observable didn't signal
211
+ * a change through one of the observer methods, the observer can assume that the
212
+ * observable didn't change.
213
+ * If an observable reported a possible change, {@link IObservable.reportChanges} forces
214
+ * the observable to report an actual change if there was one.
215
+ */
216
+ interface IObserver$1 {
217
+ /**
218
+ * Signals that the given observable might have changed and a transaction potentially modifying that observable started.
219
+ * Before the given observable can call this method again, is must call {@link IObserver.endUpdate}.
220
+ *
221
+ * Implementations must not get/read the value of other observables, as they might not have received this event yet!
222
+ * The method {@link IObservable.reportChanges} can be used to force the observable to report the changes.
223
+ */
224
+ beginUpdate<T>(observable: IObservable$1<T>): void;
225
+ /**
226
+ * Signals that the transaction that potentially modified the given observable ended.
227
+ * This is a good place to react to (potential) changes.
228
+ */
229
+ endUpdate<T>(observable: IObservable$1<T>): void;
230
+ /**
231
+ * Signals that the given observable might have changed.
232
+ * The method {@link IObservable.reportChanges} can be used to force the observable to report the changes.
233
+ *
234
+ * Implementations must not get/read the value of other observables, as they might not have received this event yet!
235
+ * The change should be processed lazily or in {@link IObserver.endUpdate}.
236
+ */
237
+ handlePossibleChange<T>(observable: IObservable$1<T>): void;
238
+ /**
239
+ * Signals that the given {@link observable} changed.
240
+ *
241
+ * Implementations must not get/read the value of other observables, as they might not have received this event yet!
242
+ * The change should be processed lazily or in {@link IObserver.endUpdate}.
243
+ *
244
+ * @param change Indicates how or why the value changed.
245
+ */
246
+ handleChange<T, TChange>(observable: IObservableWithChange$1<T, TChange>, change: TChange): void;
247
+ }
248
+ interface IReader$1 {
249
+ /**
250
+ * Reads the value of an observable and subscribes to it.
251
+ */
252
+ readObservable<T>(observable: IObservableWithChange$1<T, any>): T;
253
+ }
254
+ interface ISettable<T, TChange = void> {
255
+ /**
256
+ * Sets the value of the observable.
257
+ * Use a transaction to batch multiple changes (with a transaction, observers only react at the end of the transaction).
258
+ *
259
+ * @param transaction When given, value changes are handled on demand or when the transaction ends.
260
+ * @param change Describes how or why the value changed.
261
+ */
262
+ set(value: T, transaction: ITransaction | undefined, change: TChange): void;
263
+ }
264
+ interface ITransaction {
265
+ /**
266
+ * Calls {@link Observer.beginUpdate} immediately
267
+ * and {@link Observer.endUpdate} when the transaction ends.
268
+ */
269
+ updateObserver(observer: IObserver$1, observable: IObservableWithChange$1<any, any>): void;
270
+ }
271
+ /**
272
+ * A settable observable.
273
+ */
274
+ interface ISettableObservable<T, TChange = void> extends IObservableWithChange$1<T, TChange>, ISettable<T, TChange> {
275
+ }
276
+
277
+ /** A fixture's input override object (only the keys the user explicitly changed). */
278
+ type FixtureInputOverride = Record<string, unknown>;
279
+ /**
280
+ * Central store of `input` overrides for the explorer UI.
281
+ *
282
+ * Values are keyed by **property identity** (name + structural schema), not by fixture, so a
283
+ * value chosen on one fixture is automatically reused by every other fixture that declares the
284
+ * same input — navigating between fixtures keeps the shared value instead of resetting it.
285
+ * The whole map is persisted to `localStorage` so choices survive reloads. Schema defaults are
286
+ * applied at render time (see `applyInputDefaults`); only explicit overrides are stored here.
287
+ */
288
+ declare class FixtureInputStore {
289
+ /** Shared values keyed by `inputPropertyKey(name, schema)`. */
290
+ private readonly _values;
291
+ /** Cache of derived per-fixture override observables. */
292
+ private readonly _byFixture;
293
+ constructor();
294
+ /**
295
+ * Returns a derived observable of `fixtureId`'s input overrides, mapped from the shared
296
+ * per-property store. Only properties the user explicitly set (across any fixture) appear.
297
+ */
298
+ getInput(fixtureId: string, schema: IJsonSchema | undefined): IObservable$1<FixtureInputOverride>;
299
+ /** The currently effective value of a shared property: explicit override, else schema default. */
300
+ readValue(reader: IReader$1, name: string, schema: IJsonSchema): unknown;
301
+ /** Sets a shared input property (applies to every fixture that declares it) and persists. */
302
+ setValue(name: string, schema: IJsonSchema, value: unknown): void;
303
+ private _load;
304
+ private _persist;
305
+ }
306
+
307
+ /**
308
+ * A single input property shared by one or more of the currently rendered fixtures.
309
+ * Properties are grouped by name **and** structural schema equality, so a control can edit
310
+ * every fixture that declares the same property at once.
311
+ */
312
+ interface AggregatedInputProperty {
313
+ readonly name: string;
314
+ readonly schema: IJsonSchema;
315
+ /** Ids of the fixtures that declare this exact property (same name + schema). */
316
+ readonly fixtureIds: readonly string[];
317
+ }
318
+ /** Minimal shape needed to aggregate: a fixture id and its (merged) input schema. */
319
+ interface ComponentInputInfo {
320
+ readonly id: string;
321
+ readonly inputSchema?: IJsonSchema;
322
+ }
323
+ /**
324
+ * Collects the input properties declared across the given fixtures, grouping identical
325
+ * (name + schema) properties so they can be edited together. Order follows first appearance.
326
+ */
327
+ declare function aggregateInputProperties(components: readonly ComponentInputInfo[]): AggregatedInputProperty[];
328
+ /** The value currently in effect for a property: explicit override, else schema default. */
329
+ declare function effectiveInputValue(override: Record<string, unknown> | undefined, name: string, schema: IJsonSchema): unknown;
330
+
331
+ interface ExceptionError {
332
+ readonly message: string;
333
+ readonly stack?: string;
334
+ }
335
+ type RenderEventType = 'console.error' | 'console.warn' | 'console.log' | 'window.error' | 'window.unhandledrejection';
336
+ interface RenderEvent {
337
+ readonly type: RenderEventType;
338
+ readonly message: string;
339
+ readonly stack?: string;
340
+ }
341
+ /**
342
+ * Errors and events captured while disposing a fixture (the implicit dispose
343
+ * that runs before a new render, or the explicit one triggered by
344
+ * `disposeAfter` / `disposeCurrentFixture()`).
345
+ */
346
+ interface DisposeReport {
347
+ readonly hasError: boolean;
348
+ /** Errors thrown by `dispose()` calls (RenderResult.dispose, addDisposable disposables). */
349
+ readonly errors: readonly ExceptionError[];
350
+ /** Console / window error events fired during the dispose call. */
351
+ readonly events: readonly RenderEvent[];
352
+ }
353
+ interface RenderReport {
354
+ readonly hasError: boolean;
355
+ readonly error?: ExceptionError;
356
+ readonly events: RenderEvent[];
357
+ /** Output data the fixture provided via `RenderResult.output` (counterpart of `RenderContext.input`). */
358
+ readonly output?: unknown;
359
+ readonly renderTimeMs: {
360
+ readonly sync: number;
361
+ readonly total: number;
362
+ };
363
+ /**
364
+ * Errors / events captured while disposing the previous fixture (the implicit
365
+ * dispose that runs at the start of `renderFixture`). Present only if the
366
+ * dispose actually surfaced something.
367
+ */
368
+ readonly previousDispose?: DisposeReport;
369
+ }
370
+
371
+ declare class FixturePath {
372
+ readonly value: string;
373
+ private _segments;
374
+ constructor(value: string);
375
+ get segments(): readonly string[];
376
+ toString(): string;
377
+ }
378
+
379
+ /**
380
+ * A node in the fixture tree.
381
+ * Can be a folder (with children), variants (with children, horizontal layout), or a component leaf.
382
+ */
383
+ interface FixtureNode {
384
+ readonly id: FixturePath;
385
+ /** Display name */
386
+ readonly name: string;
387
+ /** Node type: folder for groups, variants for horizontal variant display, component for leaves */
388
+ readonly type: 'folder' | 'variants' | 'component';
389
+ /** Children (for folders and variants) */
390
+ readonly children?: readonly FixtureNode[];
391
+ /** Component definition (only for component nodes) */
392
+ readonly component?: ComponentDefinition;
393
+ /** Labels for categorization and filtering */
394
+ readonly labels: readonly string[];
395
+ /** Source fixture file path — present on skeleton nodes (component is undefined) for on-demand loading */
396
+ readonly sourceFile?: string;
397
+ }
398
+ /**
399
+ * Creates a fixture tree from a map of fixture exports.
400
+ * Entries with `undefined` value are rendered as skeleton nodes (loaded on demand).
401
+ */
402
+ declare function createFixtureTree(fixtures: Map<string, FixtureExport>): FixtureNode;
403
+ /**
404
+ * Finds a node in the tree by path.
405
+ */
406
+ declare function findNodeByPath(root: FixtureNode, path: string[]): FixtureNode | undefined;
407
+ /**
408
+ * Collects all component nodes from a subtree.
409
+ */
410
+ declare function collectComponents(node: FixtureNode): ComponentDefinition[];
411
+
412
+ /**
413
+ * Viewport preset - either a named preset or custom dimensions.
414
+ */
415
+ type ViewportPreset = ViewportPresetName | {
416
+ readonly name: string;
417
+ readonly width: number;
418
+ readonly height: number;
419
+ };
420
+ type ViewportPresetName = 'mobile' | 'tablet' | 'desktop';
421
+ /**
422
+ * Standard viewport dimensions for presets.
423
+ */
424
+ declare const VIEWPORT_SIZES: Record<ViewportPresetName, {
425
+ readonly width: number;
426
+ readonly height: number;
427
+ }>;
428
+ /**
429
+ * Resolves a viewport preset to actual dimensions.
430
+ */
431
+ declare function resolveViewport(preset: ViewportPreset): {
432
+ name: string;
433
+ width: number;
434
+ height: number;
435
+ };
436
+
437
+ declare class FixtureRegistry {
438
+ readonly storageScope?: string | undefined;
439
+ constructor(storageScope?: string | undefined);
440
+ private readonly _fixtures;
441
+ readonly loading: ISettableObservable<boolean, void>;
442
+ readonly error: ISettableObservable<string | undefined, void>;
443
+ readonly root: IObservable$1<FixtureNode>;
444
+ register(path: string, fixtureExport: FixtureExport): void;
445
+ unregister(path: string): void;
446
+ clear(): void;
447
+ getNode(reader: IReader$1, path: string[]): FixtureNode | undefined;
448
+ getComponentByPath(path: string[]): ComponentDefinition | undefined;
449
+ }
450
+
451
+ interface FixtureModules {
452
+ [path: string]: {
453
+ default?: unknown;
454
+ };
455
+ }
456
+ interface ExplorerRuntime {
457
+ updateFixtures(fixtureModules: FixtureModules): void;
458
+ bumpVersion(): void;
459
+ }
460
+
461
+ /**
462
+ * Configuration injected by the daemon via the Vite plugin.
463
+ * Passed to ExplorerApp as `options.daemonConfig`.
464
+ */
465
+ interface DaemonConfig {
466
+ /** Name of the session this explorer instance belongs to (e.g. 'current' or 'baseline') */
467
+ readonly sessionName: string;
468
+ /** Runtime version required by the vite plugin for the explorer bundle it serves. */
469
+ readonly runtimeVersionNeededByPlugin: string;
470
+ }
471
+
472
+ type ExplorerMode = 'headless' | 'embedded';
473
+ interface ExplorerQueryParams {
474
+ readonly mode?: ExplorerMode;
475
+ readonly fixture?: string;
476
+ readonly file?: string;
477
+ readonly report?: string;
478
+ }
479
+
480
+ //#region src/protocol/jsonValue.d.ts
481
+ /**
482
+ * The JSON value lattice. Anything the wire can carry.
483
+ *
484
+ * Object values are `JsonValue | undefined` so `undefined`-valued fields
485
+ * may be present in source and are simply omitted at canonicalisation
486
+ * time (rather than serialised as `null`).
487
+ */
488
+ type JsonValue = null | boolean | number | string | JsonValue[] | {
489
+ [key: string]: JsonValue | undefined;
490
+ };
491
+ //#endregion
492
+ //#region src/protocol/jsonRpc.d.ts
493
+ type RequestId = number | string;
494
+ interface JsonRpcRequest<TParams = JsonValue> {
495
+ jsonrpc: "2.0";
496
+ id: RequestId;
497
+ method: string;
498
+ params?: TParams;
499
+ }
500
+ interface JsonRpcNotification<TParams = JsonValue> {
501
+ jsonrpc: "2.0";
502
+ method: string;
503
+ params?: TParams;
504
+ }
505
+ interface JsonRpcSuccess {
506
+ jsonrpc: "2.0";
507
+ id: RequestId | null;
508
+ result: JsonValue;
509
+ }
510
+ interface JsonRpcError {
511
+ jsonrpc: "2.0";
512
+ id: RequestId | null;
513
+ error: {
514
+ code: number;
515
+ message: string;
516
+ data?: JsonValue;
517
+ };
518
+ }
519
+ type JsonRpcResponse = JsonRpcSuccess | JsonRpcError;
520
+ type JsonRpcMessage = JsonRpcRequest | JsonRpcNotification | JsonRpcResponse;
521
+ //#endregion
522
+ //#region src/schema/linkRpcJsonSchema.d.ts
523
+ type LinkRpcJsonSchema = true | false | NullSchema | BooleanSchema | NumberSchema | IntegerSchema | StringSchema | ConstSchema | EnumSchema | ArraySchema | TupleSchema | ObjectSchema | UnionSchema | OneOfSchema | RefSchema;
524
+ interface SchemaBase {
525
+ [key: `x-${string}`]: unknown;
526
+ title?: string;
527
+ description?: string;
528
+ /**
529
+ * Additional draft 2020-12 constraints that refine (never replace) this
530
+ * node. This extension is non-normative for LinkRPC identity; use
531
+ * {@link materializeJsonSchema} when exporting to a general validator.
532
+ */
533
+ "x-json-schema"?: boolean | Record<string, unknown>;
534
+ }
535
+ interface NullSchema extends SchemaBase {
536
+ type: "null";
537
+ }
538
+ interface BooleanSchema extends SchemaBase {
539
+ type: "boolean";
540
+ }
541
+ interface NumberSchema extends SchemaBase {
542
+ type: "number";
543
+ /** Opaque well-known refinement tag, e.g. "float32", "percentage". */
544
+ format?: string;
545
+ }
546
+ interface IntegerSchema extends SchemaBase {
547
+ type: "integer";
548
+ /** Opaque well-known refinement tag, e.g. "int32", "uint8", "unix-time". */
549
+ format?: string;
550
+ }
551
+ interface StringSchema extends SchemaBase {
552
+ type: "string";
553
+ /** Opaque well-known refinement tag, e.g. "email", "uri", "uuid", "date-time". */
554
+ format?: string;
555
+ }
556
+ /** Single literal value. */
557
+ interface ConstSchema extends SchemaBase {
558
+ const: JsonValue;
559
+ }
560
+ /** Finite set of literal values. */
561
+ interface EnumSchema extends SchemaBase {
562
+ enum: JsonValue[];
563
+ }
564
+ /** Homogeneous array. */
565
+ interface ArraySchema extends SchemaBase {
566
+ type: "array";
567
+ items: LinkRpcJsonSchema;
568
+ }
569
+ /** Fixed-length head plus optional rest element type. */
570
+ interface TupleSchema extends SchemaBase {
571
+ type: "array";
572
+ prefixItems: LinkRpcJsonSchema[];
573
+ /** `false` => exact length; schema => typed rest; omitted => exact length. */
574
+ items?: LinkRpcJsonSchema | false;
575
+ }
576
+ interface ObjectSchema extends SchemaBase {
577
+ type: "object";
578
+ properties: Record<string, LinkRpcJsonSchema>;
579
+ /** Names of required properties. Must all be keys of `properties`. */
580
+ required?: string[];
581
+ /** `false` => closed; schema => value type for unknown keys. */
582
+ additionalProperties: LinkRpcJsonSchema | false;
583
+ }
584
+ /** Untagged union. Assignability distributes over branches. */
585
+ interface UnionSchema extends SchemaBase {
586
+ anyOf: LinkRpcJsonSchema[];
587
+ }
588
+ /**
589
+ * Tagged-or-disjoint union (`oneOf`). Structurally treated the same as
590
+ * `UnionSchema` for assignability; the distinction is preserved so the
591
+ * wire schema faithfully reflects whether the source was a
592
+ * discriminated union (e.g. Zod's `z.discriminatedUnion`) or a plain
593
+ * union.
594
+ *
595
+ * `discriminator`, when present, is a pure consumer hint: it names the
596
+ * property that branches dispatch on. Every branch SHOULD be an object
597
+ * with that property set to a distinct `const` value, but the subset
598
+ * does not enforce this — broken discriminators are tolerated.
599
+ */
600
+ interface OneOfSchema extends SchemaBase {
601
+ oneOf: LinkRpcJsonSchema[];
602
+ discriminator?: DiscriminatorSchema;
603
+ }
604
+ interface DiscriminatorSchema {
605
+ propertyName: string;
606
+ }
607
+ /** Reference to a named entry in `SvcInterfaceSchema.components.schemas`. */
608
+ interface RefSchema extends SchemaBase {
609
+ /** JSON Pointer, restricted to "#/components/schemas/<name>". */
610
+ $ref: string;
611
+ }
612
+ //#endregion
613
+ //#region src/schema/linkRpcInterfaceSchema.d.ts
614
+ /**
615
+ * Minimal interface schema for linkrpc. A strict subset of OpenRPC 1.x:
616
+ * identity & addressing live in linkrpc, so this format only describes the
617
+ * contract of a single interface (methods + reusable JSON Schemas).
618
+ */
619
+ interface LinkRpcInterfaceSchema {
620
+ [key: `x-${string}`]: unknown;
621
+ /** Stable interface id, e.g. "de.hediet.notification-target". */
622
+ id: string;
623
+ /**
624
+ * Content hash of the normalized schema. Pairs with `id` to form `id@hash`.
625
+ * Normalization: serialize this object with `hash` omitted, object keys
626
+ * sorted recursively, and no insignificant whitespace; hash the bytes.
627
+ */
628
+ hash: string;
629
+ /**
630
+ * Normative human description (GitHub-flavored markdown). Part of the
631
+ * interface hash — changing `description` is a contract change. Use it
632
+ * for the canonical purpose / semantics of the interface.
633
+ */
634
+ description?: string;
635
+ /**
636
+ * Non-normative implementation notes (markdown). Stripped from the hash,
637
+ * so editing `comment` never changes the interface identity. Use it for
638
+ * rationale, changelog notes, examples, etc.
639
+ */
640
+ comment?: string;
641
+ /** Non-normative discovery labels, excluded from the interface hash. */
642
+ tags?: string[];
643
+ /** Methods keyed by local member name. */
644
+ methods: Record<string, MethodSchema>;
645
+ /** Reusable schema definitions, referenced via `#/components/schemas/<name>`. */
646
+ components?: {
647
+ schemas?: Record<string, LinkRpcJsonSchema>;
648
+ };
649
+ }
650
+ interface MethodSchema {
651
+ [key: `x-${string}`]: unknown;
652
+ /** Schema for the user params object. */
653
+ params: LinkRpcJsonSchema;
654
+ /** Result schema. Omit to declare a notification-only method. */
655
+ result?: LinkRpcJsonSchema;
656
+ /**
657
+ * Schema for client-emitted stream messages (`$stream::send` from
658
+ * caller to callee) on an in-flight call. Absent means the client
659
+ * may not stream on this method.
660
+ */
661
+ clientStream?: LinkRpcJsonSchema;
662
+ /**
663
+ * Schema for server-emitted stream messages (`$stream::send` from
664
+ * callee to caller) on an in-flight call. Absent means the server
665
+ * may not stream on this method.
666
+ */
667
+ serverStream?: LinkRpcJsonSchema;
668
+ /** Raw codes are exclusive; named and legacy declarations may form a union per code. */
669
+ errors?: ErrorSchema[];
670
+ summary?: string;
671
+ /**
672
+ * Normative description of this method's contract (markdown). Part of
673
+ * the interface hash — changing it is a contract change.
674
+ */
675
+ description?: string;
676
+ /** Non-normative implementation notes. Stripped from the hash. */
677
+ comment?: string;
678
+ deprecated?: boolean;
679
+ /**
680
+ * Behavioral claims about this method. All flags default to `false`;
681
+ * setting one is always a positive refinement of the contract.
682
+ * Part of the interface hash — these are normative claims callers
683
+ * may rely on, so changing them is a contract change.
684
+ */
685
+ annotations?: MemberAnnotations;
686
+ }
687
+ /**
688
+ * Behavioral claims about a method. Every flag is a positive assertion
689
+ * (default `false` ≡ "no claim"); setting one strengthens the contract
690
+ * the caller may rely on.
691
+ *
692
+ * These are normative — they are included in the interface hash.
693
+ */
694
+ interface MemberAnnotations {
695
+ /**
696
+ * The method does not modify any observable state on the callee
697
+ * (or anywhere reachable from it). Pure query.
698
+ *
699
+ * Implies `idempotent` and `reversible` (a no-op has nothing to
700
+ * undo and repeats trivially).
701
+ */
702
+ readOnly?: boolean;
703
+ /**
704
+ * Calling N times with the same params has the same observable effect
705
+ * as calling once. Safe to retry on transport failure.
706
+ */
707
+ idempotent?: boolean;
708
+ /**
709
+ * Effects of this method are reversible — the caller (or operator)
710
+ * can undo them with a follow-up call. Implies the method is not
711
+ * `dangerous`.
712
+ */
713
+ reversible?: boolean;
714
+ /**
715
+ * Calling this method is expensive (slow, costly, or rate-limited).
716
+ * Callers should avoid unnecessary invocations and may want to
717
+ * confirm / batch.
718
+ */
719
+ expensive?: boolean;
720
+ /**
721
+ * Method has irreversible or destructive effects (data loss, money
722
+ * spent, message sent, etc.). UIs should require confirmation.
723
+ */
724
+ dangerous?: boolean;
725
+ }
726
+ type ErrorSchema = LegacyErrorSchema | RawErrorSchema;
727
+ interface RawErrorSchema {
728
+ code: number;
729
+ /** Schema of the wire body { message, data? }, excluding the outer code. */
730
+ schema: LinkRpcJsonSchema;
731
+ type?: never;
732
+ message?: never;
733
+ data?: never;
734
+ }
735
+ interface LegacyErrorSchema {
736
+ schema?: never;
737
+ /** Named error discriminator in `error.data.type`. Absent for legacy numeric errors. */
738
+ type?: string;
739
+ /** JSON-RPC error code. -32768..-32000 and LinkRPC cancellation code -32800 are reserved. */
740
+ code: number;
741
+ message: string;
742
+ /** Payload schema: `error.data.data` for named errors, `error.data` for legacy errors. */
743
+ data?: LinkRpcJsonSchema;
744
+ }
745
+ //#endregion
746
+ //#region src/connection/rpcFailure.d.ts
747
+ declare const rpcFailureBrand: unique symbol;
748
+ /** A nominal failure wrapper: successful application objects can never collide with it. */
749
+ declare class RpcFailure<E> {
750
+ readonly error: E;
751
+ readonly [rpcFailureBrand] = true;
752
+ constructor(error: E);
753
+ }
754
+ type Result$1<T, E = never> = T | RpcFailure<E>;
755
+ //#endregion
756
+ //#region src/schema/applicationErrorBrand.d.ts
757
+ declare const applicationErrorBrand: unique symbol;
758
+ //#endregion
759
+ //#region src/schema/memberTypes.d.ts
760
+ /**
761
+ * The schema type linkrpc accepts everywhere: the zod *core* base shared by
762
+ * both classic `zod` and `zod/mini`. Typing against it (instead of classic
763
+ * `z.ZodType`) lets callers author interfaces with either flavour — classic
764
+ * for ergonomics, mini for minimal bundle size — while linkrpc's own internal
765
+ * interfaces use mini. `O` is the validated output type.
766
+ */
767
+ type Schema<O = unknown> = $ZodType<O>;
768
+ /**
769
+ * Marker base for a typed method member. Carries enough metadata to:
770
+ * - validate / parse params at runtime (via the zod schemas),
771
+ * - emit a JSON schema for reflection,
772
+ * - propagate TS types up to the interface definition.
773
+ */
774
+ type MemberType = RequestType<any, any, any, any, any, any, any> | NotificationType<any>;
775
+ type ApplicationErrorValue<TCode extends number = number, TMessage extends string = string, TData = never, TType extends string | undefined = undefined> = {
776
+ readonly kind: 'application';
777
+ readonly code: TCode;
778
+ readonly message: TMessage;
779
+ } & ([TData] extends [never] ? {
780
+ readonly data?: never;
781
+ } : {
782
+ readonly data: TData;
783
+ }) & (TType extends string ? {
784
+ readonly type: TType;
785
+ } : {
786
+ readonly type?: never;
787
+ });
788
+ type CreatedApplicationErrorValue<TCode extends number = number, TMessage extends string = string, TData = never, TType extends string | undefined = undefined> = ApplicationErrorValue<TCode, TMessage, TData, TType> & {
789
+ readonly [applicationErrorBrand]: true;
790
+ readonly kind: 'application';
791
+ readonly code: TCode;
792
+ readonly message: TMessage;
793
+ readonly data?: TData;
794
+ readonly type?: TType;
795
+ };
796
+ interface ApplicationErrorDescriptor<TCode extends number = number, TMessage extends string = string, TData = never, TType extends string | undefined = undefined> {
797
+ readonly code: TCode;
798
+ readonly message: TMessage;
799
+ readonly dataSchema?: Schema<TData>;
800
+ readonly type: TType;
801
+ /** Match a validated application payload or its failure wrapper. */
802
+ is(value: RpcFailure<unknown>): value is RpcFailure<ApplicationErrorValue<TCode, string, TData, TType>>;
803
+ is(value: {
804
+ readonly kind: 'application';
805
+ }): value is ApplicationErrorValue<TCode, string, TData, TType>;
806
+ is(value: unknown): value is ApplicationErrorValue<TCode, string, TData, TType> | RpcFailure<ApplicationErrorValue<TCode, string, TData, TType>>;
807
+ readonly create: [TData] extends [never] ? () => CreatedApplicationErrorValue<TCode, TMessage, TData, TType> : (data: TData) => CreatedApplicationErrorValue<TCode, TMessage, TData, TType>;
808
+ }
809
+ interface ApplicationErrorDescriptorBase {
810
+ readonly type?: string;
811
+ readonly code: number;
812
+ readonly message?: string;
813
+ readonly bodySchema?: Schema;
814
+ readonly dataSchema?: Schema<any>;
815
+ readonly create: (...args: any[]) => {
816
+ readonly kind: 'application';
817
+ readonly code: number;
818
+ readonly message: string;
819
+ readonly data?: unknown;
820
+ readonly type?: string;
821
+ readonly [applicationErrorBrand]: true;
822
+ };
823
+ }
824
+ type ApplicationErrorOf<T> = T extends RpcErrorDescriptor<infer C, infer B> ? CreatedRpcErrorValue<C, B> : T extends ApplicationErrorDescriptor<infer C, infer M, infer D, infer N> ? CreatedApplicationErrorValue<C, M, D, N> : never;
825
+ type PublicApplicationErrorOf<T> = 0 extends (1 & T) ? never : T extends {
826
+ readonly [rawErrorBrand]: true;
827
+ } ? Omit<T, typeof applicationErrorBrand | typeof rawErrorBrand> : T extends CreatedApplicationErrorValue<infer C, infer M, infer D, infer N> ? ApplicationErrorValue<C, N extends string ? string : M, D, N> : never;
828
+ type DeclaredApplicationErrorOf<T> = 0 extends (1 & T) ? never : Extract<T, ReturnType<ApplicationErrorDescriptorBase['create']>>;
829
+ type ApplicationErrorsOf<T extends readonly ApplicationErrorDescriptorBase[]> = ApplicationErrorOf<T[number]>;
830
+ declare const rawErrorBrand: unique symbol;
831
+ type RpcErrorBody = {
832
+ readonly message: string;
833
+ readonly data?: unknown;
834
+ };
835
+ type RpcErrorValue<C extends number, B extends RpcErrorBody> = B & {
836
+ readonly kind: 'application';
837
+ readonly code: C;
838
+ readonly type?: never;
839
+ };
840
+ type CreatedRpcErrorValue<C extends number, B extends RpcErrorBody> = RpcErrorValue<C, B> & {
841
+ readonly [applicationErrorBrand]: true;
842
+ readonly [rawErrorBrand]: true;
843
+ };
844
+ interface RpcErrorDescriptor<C extends number = number, B extends RpcErrorBody = RpcErrorBody> {
845
+ readonly code: C;
846
+ readonly bodySchema: Schema<B>;
847
+ readonly type?: never;
848
+ readonly message?: never;
849
+ readonly dataSchema?: never;
850
+ create(body: B): CreatedRpcErrorValue<C, B>;
851
+ is(value: RpcFailure<unknown>): value is RpcFailure<RpcErrorValue<C, B>>;
852
+ is(value: {
853
+ readonly kind: 'application';
854
+ }): value is RpcErrorValue<C, B>;
855
+ is(value: unknown): value is RpcErrorValue<C, B> | RpcFailure<RpcErrorValue<C, B>>;
856
+ }
857
+ /**
858
+ * Optional documentation for a method member.
859
+ *
860
+ * - `description` is the **normative** contract of the method (included in the
861
+ * interface hash — changing it changes `schemaHash`).
862
+ * - `comment` is non-normative implementation notes (stripped from the hash).
863
+ * - `annotations` are normative behavioral claims (e.g. `readOnly`,
864
+ * `idempotent`); included in the hash.
865
+ */
866
+ interface MemberDocs {
867
+ description?: string;
868
+ comment?: string;
869
+ annotations?: MemberAnnotations;
870
+ }
871
+ declare class RequestType<TParams = unknown, TResult = void, TError = void, TClientStream = never, TServerStream = never, TErrors extends readonly ApplicationErrorDescriptorBase[] = readonly ApplicationErrorDescriptorBase[], TLegacyError = TError> {
872
+ readonly paramsSchema: Schema<TParams>;
873
+ readonly resultSchema: Schema<TResult>;
874
+ readonly errorSchema: Schema<TLegacyError>;
875
+ readonly docs: MemberDocs;
876
+ /**
877
+ * Schema for stream messages the **client** may emit on an
878
+ * in-flight call (e.g. cancellation, input). `undefined` means
879
+ * the client may not stream on this method.
880
+ */
881
+ readonly clientStreamSchema?: Schema<TClientStream> | undefined;
882
+ /**
883
+ * Schema for stream messages the **server** may emit while
884
+ * handling an in-flight call (e.g. progress, partial results).
885
+ * `undefined` means the server may not stream on this method.
886
+ */
887
+ readonly serverStreamSchema?: Schema<TServerStream> | undefined;
888
+ /** Checked application errors explicitly declared with `.withErrors()`. */
889
+ readonly applicationErrors: TErrors;
890
+ readonly kind: "request";
891
+ constructor(paramsSchema: Schema<TParams>, resultSchema: Schema<TResult>, errorSchema: Schema<TLegacyError>, docs?: MemberDocs,
892
+ /**
893
+ * Schema for stream messages the **client** may emit on an
894
+ * in-flight call (e.g. cancellation, input). `undefined` means
895
+ * the client may not stream on this method.
896
+ */
897
+ clientStreamSchema?: Schema<TClientStream> | undefined,
898
+ /**
899
+ * Schema for stream messages the **server** may emit while
900
+ * handling an in-flight call (e.g. progress, partial results).
901
+ * `undefined` means the server may not stream on this method.
902
+ */
903
+ serverStreamSchema?: Schema<TServerStream> | undefined,
904
+ /** Checked application errors explicitly declared with `.withErrors()`. */
905
+ applicationErrors?: TErrors);
906
+ /** Declared checked errors, retained as a tuple for generated-contract consumers. */
907
+ readonly errors: TErrors;
908
+ /** Phantom field — typed-only, do not access at runtime. */
909
+ readonly _params: TParams;
910
+ readonly _result: TResult;
911
+ readonly _error: TError;
912
+ readonly _clientStream: TClientStream;
913
+ readonly _serverStream: TServerStream;
914
+ /**
915
+ * Return a copy of this request type with stream payload schemas
916
+ * attached. Pass `undefined` for either direction to leave it
917
+ * closed.
918
+ * `NoInfer` keeps a contextual MemberMap's `any` stream slots from
919
+ * widening undeclared directions; only the supplied schemas infer payloads.
920
+ */
921
+ withStream<TClient = TClientStream, TServer = TServerStream>(opts: {
922
+ client?: Schema<TClient>;
923
+ server?: Schema<TServer>;
924
+ }): RequestType<TParams, TResult, TError, NoInfer<TClient>, NoInfer<TServer>, TErrors, TLegacyError>;
925
+ /**
926
+ * Return a copy with an explicit, typed set of checked application errors.
927
+ * The legacy third `requestType` schema remains accepted for compatibility,
928
+ * but does not opt a method into checked errors.
929
+ */
930
+ withErrors<const TErrors extends readonly ApplicationErrorDescriptorBase[]>(errors: TErrors): RequestType<TParams, TResult, ApplicationErrorsOf<TErrors>, TClientStream, TServerStream, TErrors, TLegacyError>;
931
+ }
932
+ declare class NotificationType<TParams = unknown> {
933
+ readonly paramsSchema: Schema<TParams>;
934
+ readonly docs: MemberDocs;
935
+ readonly kind: "notification";
936
+ constructor(paramsSchema: Schema<TParams>, docs?: MemberDocs);
937
+ readonly _params: TParams;
938
+ }
939
+ interface SchemaParameterReference<TName extends string = string> {
940
+ readonly $parameter: TName;
941
+ }
942
+ type NonRecursiveJsonSchema = Exclude<LinkRpcJsonSchema, ArraySchema | TupleSchema | ObjectSchema | UnionSchema | OneOfSchema>;
943
+ type InterfaceTemplateJsonSchema<TParameter extends string = string> = NonRecursiveJsonSchema | SchemaParameterReference<TParameter> | (Omit<ArraySchema, "items"> & {
944
+ readonly items: InterfaceTemplateJsonSchema<TParameter>;
945
+ }) | (Omit<TupleSchema, "prefixItems" | "items"> & {
946
+ readonly prefixItems: readonly InterfaceTemplateJsonSchema<TParameter>[];
947
+ readonly items?: InterfaceTemplateJsonSchema<TParameter> | false;
948
+ }) | (Omit<ObjectSchema, "properties" | "additionalProperties"> & {
949
+ readonly properties: Readonly<Record<string, InterfaceTemplateJsonSchema<TParameter>>>;
950
+ readonly additionalProperties: InterfaceTemplateJsonSchema<TParameter> | false;
951
+ }) | (Omit<UnionSchema, "anyOf"> & {
952
+ readonly anyOf: readonly InterfaceTemplateJsonSchema<TParameter>[];
953
+ }) | (Omit<OneOfSchema, "oneOf"> & {
954
+ readonly oneOf: readonly InterfaceTemplateJsonSchema<TParameter>[];
955
+ });
956
+ type InterfaceTemplateMethodSchema<TParameter extends string = string> = Omit<MethodSchema, "params" | "result" | "clientStream" | "serverStream" | "errors"> & {
957
+ readonly params: InterfaceTemplateJsonSchema<TParameter>;
958
+ readonly result?: InterfaceTemplateJsonSchema<TParameter>;
959
+ readonly clientStream?: InterfaceTemplateJsonSchema<TParameter>;
960
+ readonly serverStream?: InterfaceTemplateJsonSchema<TParameter>;
961
+ readonly errors?: readonly InterfaceTemplateErrorSchema<TParameter>[];
962
+ };
963
+ type InterfaceTemplateErrorSchema<TParameter extends string = string> = {
964
+ readonly code: number;
965
+ readonly schema: InterfaceTemplateJsonSchema<TParameter>;
966
+ readonly type?: never;
967
+ readonly message?: never;
968
+ readonly data?: never;
969
+ } | {
970
+ readonly schema?: never;
971
+ readonly type?: string;
972
+ readonly code: number;
973
+ readonly message: string;
974
+ readonly data?: InterfaceTemplateJsonSchema<TParameter>;
975
+ };
976
+ interface InterfaceTemplateSchema<TParameter extends string = string> {
977
+ readonly id: string;
978
+ /** Non-normative discovery labels contributed when this template is instantiated. */
979
+ readonly tags?: readonly string[];
980
+ readonly parameters: readonly TParameter[];
981
+ readonly methods: Readonly<Record<string, InterfaceTemplateMethodSchema<TParameter>>>;
982
+ readonly components?: {
983
+ readonly schemas?: Readonly<Record<string, InterfaceTemplateJsonSchema<TParameter>>>;
984
+ };
985
+ }
986
+ interface InterfaceTemplateArgument {
987
+ readonly schema: LinkRpcJsonSchema;
988
+ readonly components?: {
989
+ readonly schemas?: Readonly<Record<string, LinkRpcJsonSchema>>;
990
+ };
991
+ }
992
+ interface InterfaceTemplateInstance {
993
+ readonly name: string;
994
+ readonly template: string;
995
+ readonly members: Readonly<Record<string, string>>;
996
+ readonly arguments: Readonly<Record<string, InterfaceTemplateArgument>>;
997
+ }
998
+ interface MappedInterfaceTemplate {
999
+ readonly template: InterfaceTemplateSchema;
1000
+ readonly schema: Omit<InterfaceTemplateInstance, "name">;
1001
+ }
1002
+ //#endregion
1003
+ //#region src/schema/validationIssue.d.ts
1004
+ interface JsonSchemaValidationIssue {
1005
+ readonly path: string;
1006
+ readonly message: string;
1007
+ }
1008
+ //#endregion
1009
+ //#region src/connection/nonCompliantServerError.d.ts
1010
+ /** JSON Pointer diagnostics relative to the original wire error. */
1011
+ type RpcValidationIssue = JsonSchemaValidationIssue;
1012
+ declare class NonCompliantServerError extends Error {
1013
+ readonly original: JsonRpcError['error'];
1014
+ readonly issues: readonly RpcValidationIssue[];
1015
+ readonly kind: "nonCompliantServer";
1016
+ constructor(original: JsonRpcError['error'], issues: readonly RpcValidationIssue[]);
1017
+ }
1018
+ //#endregion
1019
+ //#region src/schema/interfaceTemplateGroup.d.ts
1020
+ /** Local authoring marker. Never serialized into the wire contract. */
1021
+ declare const interfaceTemplateGroup: unique symbol;
1022
+ interface InterfaceTemplateGroup<M extends Record<string, MemberType> = Record<string, MemberType>, Mapping extends Record<keyof M, string> | undefined = Record<keyof M, string> | undefined> {
1023
+ readonly [interfaceTemplateGroup]: true;
1024
+ readonly members: M;
1025
+ readonly template: InterfaceTemplateSchema;
1026
+ readonly arguments: Readonly<Record<string, InterfaceTemplateArgument>>;
1027
+ readonly mapping: Mapping;
1028
+ }
1029
+ //#endregion
1030
+ //#region src/connection/interfaceDefinition.d.ts
1031
+ /**
1032
+ * Per-call stream API handed to a request handler as its third argument.
1033
+ * Allows the handler to consume {@link STREAM_METHOD} notifications
1034
+ * emitted by the caller (`onMessage`) and emit stream notifications to
1035
+ * the caller (`send`) while the request is in flight.
1036
+ *
1037
+ * Members are typed by the originating method's
1038
+ * {@link RequestType.clientStreamSchema} / `serverStreamSchema`.
1039
+ * Streams whose schema is `undefined` make the corresponding member
1040
+ * effectively unusable: `send` is typed `(payload: never) => void` and
1041
+ * the registered `onMessage` listener can never fire because the
1042
+ * receiver-side validator rejects the wire payload.
1043
+ */
1044
+ interface StreamApi<TClient = unknown, TServer = unknown> {
1045
+ /** Emit a server→client stream message. */
1046
+ send(payload: TServer): Promise<void>;
1047
+ /**
1048
+ * Register a listener for client→server stream messages on this
1049
+ * request. Calling twice replaces the previous listener.
1050
+ */
1051
+ onMessage(listener: (payload: TClient) => void): void;
1052
+ /**
1053
+ * Liveness probe toward the caller: resolves once the caller
1054
+ * acknowledges with a matching pong, rejects if the call settles
1055
+ * first. Independent of the channel's automatic keepalive ping.
1056
+ */
1057
+ ping(): Promise<void>;
1058
+ /**
1059
+ * Aborts when the caller cancels this in-flight request, or when the
1060
+ * hub cancels it on the caller's behalf (caller disconnect / idle
1061
+ * timeout). Observe it to stop work early and settle the request
1062
+ * (e.g. `signal.throwIfAborted()`), which surfaces as a `cancelled`
1063
+ * error to the caller.
1064
+ */
1065
+ readonly signal: AbortSignal;
1066
+ }
1067
+ interface InterfaceInfo {
1068
+ id: string;
1069
+ /** Non-normative discovery labels; do not affect interface identity. */
1070
+ tags?: readonly string[];
1071
+ /**
1072
+ * Normative description of the interface (markdown). Part of the
1073
+ * interface hash — changing it is a contract change.
1074
+ */
1075
+ description?: string;
1076
+ /** Non-normative implementation notes. Stripped from the hash. */
1077
+ comment?: string;
1078
+ /**
1079
+ * Optional expected content hash (see `computeInterfaceHash`). When
1080
+ * set, {@link InterfaceDefinition}'s constructor verifies that the
1081
+ * computed {@link InterfaceDefinition.schemaHash} matches and throws
1082
+ * otherwise — a guard against silent contract drift when the wire
1083
+ * shape changes but a pinned hash was not updated.
1084
+ */
1085
+ hash?: string;
1086
+ }
1087
+ type MemberMap = Record<string, MemberType>;
1088
+ type InterfaceDeclarations = Record<string, MemberType | InterfaceTemplateGroup>;
1089
+ /** Stable wire identity of one member in an interface definition. */
1090
+ interface InterfaceMemberRef<TName extends string = string> {
1091
+ readonly interfaceId: string;
1092
+ readonly interfaceHash: string;
1093
+ readonly member: TName;
1094
+ }
1095
+ type InterfaceMemberRefMap<TMembers extends MemberMap> = { readonly [K in keyof TMembers & string]: InterfaceMemberRef<K>; };
1096
+ /**
1097
+ * Per-call options accepted by a streaming-enabled client method. Currently
1098
+ * only `onMessage` for consuming server→client stream notifications; the
1099
+ * caller addresses client→server stream messages via the returned
1100
+ * {@link StreamingCall}.
1101
+ */
1102
+ interface StreamCallOptions<TServer> {
1103
+ /** Listener for server→client stream messages on this in-flight call. */
1104
+ onMessage?: (payload: TServer) => void;
1105
+ }
1106
+ /**
1107
+ * Return shape of a streaming-enabled client method. Behaves as a
1108
+ * `Promise<TResult>` for the final response, and exposes `send` for
1109
+ * emitting client→server stream messages on the in-flight call. The
1110
+ * wire request id is also exposed (resolved once the request has
1111
+ * been allocated).
1112
+ *
1113
+ * For methods whose interface schema declares no client stream
1114
+ * (`TClient = never`), `send` is typed `(payload: never) => Promise<void>`
1115
+ * and is effectively uncallable — matching the runtime behavior, where
1116
+ * the receiver would drop client-emitted stream messages anyway.
1117
+ */
1118
+ interface StreamingCall<TResult, TClient> extends Promise<TResult> {
1119
+ /** Resolves to the wire request id once the call has been sent. */
1120
+ readonly requestId: Promise<RequestId>;
1121
+ /** Emit a client→server stream message on this in-flight call. */
1122
+ send(payload: TClient): Promise<void>;
1123
+ /**
1124
+ * Ask the callee to abort this in-flight call. Advisory: the call
1125
+ * settles via its normal response (typically a `cancelled` error).
1126
+ * `reason` is an open-set diagnostic string (see `StreamControlReason`).
1127
+ */
1128
+ cancel(reason?: string): Promise<void>;
1129
+ /**
1130
+ * Stop tracking this call locally. This does not notify the callee; call
1131
+ * {@link cancel} first when remote work should also be cancelled.
1132
+ */
1133
+ dispose?(reason?: string): void;
1134
+ /**
1135
+ * Liveness probe toward the callee: resolves once the callee
1136
+ * acknowledges with a matching pong, rejects if the call settles
1137
+ * first. Independent of the channel's automatic keepalive ping.
1138
+ */
1139
+ ping(): Promise<void>;
1140
+ }
1141
+ interface RemoteRpcError {
1142
+ readonly kind: 'remote';
1143
+ readonly code: number;
1144
+ readonly message: string;
1145
+ readonly data?: JsonValue;
1146
+ }
1147
+ interface LocalRpcError {
1148
+ readonly kind: 'local';
1149
+ readonly cause: unknown;
1150
+ }
1151
+ interface TransportRpcError {
1152
+ readonly kind: 'transport';
1153
+ readonly cause: unknown;
1154
+ }
1155
+ type GenericRpcError = RemoteRpcError | LocalRpcError | TransportRpcError | NonCompliantServerError;
1156
+ type RpcCallError<E = never> = {
1157
+ readonly kind: 'application';
1158
+ readonly error: E;
1159
+ } | {
1160
+ readonly kind: 'generic';
1161
+ readonly error: GenericRpcError;
1162
+ };
1163
+ type CheckedCallResult<TResult, TApplicationError = never> = {
1164
+ readonly ok: true;
1165
+ readonly value: TResult;
1166
+ } | {
1167
+ readonly ok: false;
1168
+ readonly error: TApplicationError | GenericRpcError;
1169
+ };
1170
+ interface CheckedCall<TResult, TApplicationError = never> extends Promise<Result$1<TResult, TApplicationError>> {
1171
+ /**
1172
+ * @deprecated Use getResultClient() for values that include generic errors.
1173
+ */
1174
+ result(): Promise<CheckedCallResult<TResult, TApplicationError>>;
1175
+ }
1176
+ /**
1177
+ * `true` iff at least one stream direction is declared (either client or
1178
+ * server stream schema present). Used by {@link InterfaceClient} to pick
1179
+ * between the plain `Promise<R>` shape and the {@link StreamingCall}
1180
+ * shape per method.
1181
+ */
1182
+ type _HasStream<TClient, TServer> = [TClient] extends [never] ? ([TServer] extends [never] ? false : true) : true;
1183
+ type ClientCall<TResult, TApplicationError> = [TApplicationError] extends [never] ? Promise<TResult> : CheckedCall<TResult, TApplicationError>;
1184
+ type ClientResult<R, E> = [E] extends [never] ? R : Result$1<R, E>;
1185
+ /**
1186
+ * Compile-time TypeScript shape of an interface — useful for typed
1187
+ * client/server implementations on top of the runtime definition.
1188
+ *
1189
+ * Methods whose `RequestType` declares stream payloads via
1190
+ * `.withStream({ client, server })` return a {@link StreamingCall}
1191
+ * augmented with `send`; all others return a plain `Promise<TResult>`.
1192
+ *
1193
+ * @example
1194
+ * type Client = InterfaceClient<typeof myInterface>;
1195
+ * // => { bar(p: {...}): Promise<string>; foo(p: {...}): void; }
1196
+ */
1197
+ type InterfaceClientMember<TMember> = TMember extends RequestType<infer P, infer R, infer E, infer TC, infer TS, any, any> ? (_HasStream<TC, TS> extends true ? (params: P, opts?: StreamCallOptions<TS>) => StreamingCall<ClientResult<R, PublicApplicationErrorOf<E>>, TC> & ClientCall<R, PublicApplicationErrorOf<E>> : (params: P) => ClientCall<R, PublicApplicationErrorOf<E>>) : TMember extends NotificationType<infer P> ? (params: P) => void : never;
1198
+ type MembersClient<M extends MemberMap> = { [K in keyof M]: InterfaceClientMember<M[K]>; };
1199
+ /** A reusable consumer's client shape, independent of instance name or wire mapping. */
1200
+ type InterfaceTemplateClient<T extends InterfaceTemplateGroup> = MembersClient<T['members']>;
1201
+ type DeclarationClient<M> = M extends InterfaceTemplateGroup ? InterfaceTemplateClient<M> : InterfaceClientMember<M>;
1202
+ type InterfaceClient<TDef extends InterfaceDefinition<any>> = { [K in keyof TDef['_declarations']]: DeclarationClient<TDef['_declarations'][K]>; };
1203
+ type InterfaceResultClientMember<TMember> = TMember extends RequestType<infer P, infer R, infer E, infer TC, infer TS, any, any> ? _HasStream<TC, TS> extends true ? (params: P, opts?: StreamCallOptions<TS>) => StreamingCall<Result$1<R, RpcCallError<PublicApplicationErrorOf<E>>>, TC> : (params: P) => Promise<Result$1<R, RpcCallError<PublicApplicationErrorOf<E>>>> : TMember extends NotificationType<infer P> ? (params: P) => void : never;
1204
+ type MembersResultClient<M extends MemberMap> = { [K in keyof M]: InterfaceResultClientMember<M[K]>; };
1205
+ /** Result-client counterpart of {@link InterfaceTemplateClient}. */
1206
+ type InterfaceTemplateResultClient<T extends InterfaceTemplateGroup> = MembersResultClient<T['members']>;
1207
+ /** Every request returns failures as values, including methods with no declared errors. */
1208
+ type DeclarationResultClient<M> = M extends InterfaceTemplateGroup ? InterfaceTemplateResultClient<M> : InterfaceResultClientMember<M>;
1209
+ type InterfaceResultClient<TDef extends InterfaceDefinition<any>> = { [K in keyof TDef['_declarations']]: DeclarationResultClient<TDef['_declarations'][K]>; };
1210
+ /**
1211
+ * Compile-time shape of a server implementation for an interface — used by
1212
+ * `LinkRpcConnection.register`. Request handlers may return synchronously or
1213
+ * via a promise; notification handlers return void.
1214
+ *
1215
+ * `TCtx` is the call-context type carried by the hosting connection — see
1216
+ * `LinkRpcConnection<TCtx>`. For the default connection (`TCtx = undefined`)
1217
+ * handlers may take a single params arg; for ctx-aware connections (e.g.
1218
+ * the hub's self connection) they may take a second `ctx` arg of the
1219
+ * concrete type. A 1-arg handler remains assignable where a 2-arg handler
1220
+ * is expected, so existing handlers compile unchanged.
1221
+ */
1222
+ type InterfaceHandler<TMember, TCtx> = TMember extends RequestType<infer P, infer R, infer E, infer TC, infer TS, any, any> ? (params: P, ctx: TCtx, stream: StreamApi<TC, TS>) => R | DeclaredApplicationErrorOf<E> | Promise<R | DeclaredApplicationErrorOf<E>> : TMember extends NotificationType<infer P> ? (params: P, ctx: TCtx) => void | Promise<void> : never;
1223
+ type DeclarationHandler<M, TCtx> = M extends InterfaceTemplateGroup ? { [K in keyof M['members']]: InterfaceHandler<M['members'][K], TCtx>; } : InterfaceHandler<M, TCtx>;
1224
+ type KnownKeys<T> = keyof { [K in keyof T as string extends K ? never : number extends K ? never : symbol extends K ? never : K]: unknown; };
1225
+ type InterfaceHandlers<TDef extends InterfaceDefinition<any>, TCtx = undefined> = { [K in keyof TDef['_declarations']]: DeclarationHandler<TDef['_declarations'][K], TCtx>; } & { [K in Exclude<KnownKeys<TDef['members']>, keyof TDef['_declarations']>]?: K extends keyof Object ? Object[K] : never; };
1226
+ /**
1227
+ * Options accepted by {@link InterfaceDefinition}'s constructor.
1228
+ *
1229
+ * `frozenSchema` lets callers supply an externally-authored
1230
+ * `LinkRpcInterfaceSchema` (e.g. produced by codegen or, in the faker, by an
1231
+ * LLM at runtime) verbatim. When set, `toSchema()` returns that document
1232
+ * (with `hash` overlaid) and `schemaHash` is computed from it — the
1233
+ * `members` map is used only for runtime dispatch (param/result
1234
+ * validation, stream routing) and is no longer the source of truth for
1235
+ * the wire shape.
1236
+ */
1237
+ interface InterfaceAuthoringOptions {
1238
+ /** Checked structural instances; implementations remain in connection.register(). */
1239
+ readonly templates?: Readonly<Record<string, MappedInterfaceTemplate>>;
1240
+ }
1241
+ interface InterfaceDefinitionOpts extends InterfaceAuthoringOptions {
1242
+ frozenSchema?: LinkRpcInterfaceSchema;
1243
+ }
1244
+ declare class InterfaceDefinition<TMembers extends MemberMap, TDeclarations extends InterfaceDeclarations = TMembers> {
1245
+ readonly info: InterfaceInfo;
1246
+ readonly members: TMembers;
1247
+ /** Compile-time authoring shape shared by clients and handlers; wire members remain flat. */
1248
+ readonly _declarations: TDeclarations;
1249
+ /** Typed wire references for capability and access-request construction. */
1250
+ readonly ref: InterfaceMemberRefMap<TMembers>;
1251
+ constructor(info: InterfaceInfo, members: TMembers, opts?: InterfaceDefinitionOpts);
1252
+ /** @internal Materialize authored groups using the existing wire call functions verbatim. */
1253
+ nestClient(client: Record<string, unknown>): Record<string, unknown>;
1254
+ /** Validate grouped implementations atomically, then lower them to wire handlers. */
1255
+ flattenHandlers(handlers: unknown): Record<string, unknown>;
1256
+ /** Content hash of this interface (see `computeInterfaceHash`). */
1257
+ get schemaHash(): string;
1258
+ /** Lower the definition to a wire-format `LinkRpcInterfaceSchema`, hash filled in. */
1259
+ toSchema(): LinkRpcInterfaceSchema;
1260
+ }
1261
+ //#endregion
1262
+ //#region src/transport/messageTransport.d.ts
1263
+ interface IMessageTransport<TIncoming = JsonRpcMessage, TOutgoing = JsonRpcMessage> {
1264
+ send(message: TOutgoing): void | Promise<void>;
1265
+ /**
1266
+ * Sets the listener for incoming messages. Setting `undefined` detaches.
1267
+ * The transport buffers messages received before a listener is attached
1268
+ * and delivers them the next tick when one is set.
1269
+ * Forgetting to set a listener will cause the queue to leak.
1270
+ */
1271
+ setListener(listener: ((message: TIncoming) => void) | undefined): void;
1272
+ dispose(): void;
1273
+ }
1274
+ //#endregion
1275
+ //#region src/connection/channel.d.ts
1276
+ declare class Channel<TInCtx = undefined, TOutCtx = undefined> {
1277
+ readonly sender: IRequestSender<TOutCtx>;
1278
+ private readonly _setHandler;
1279
+ private readonly _setWireObserver?;
1280
+ constructor(sender: IRequestSender<TOutCtx>, _setHandler: (h: IRequestHandler<TInCtx> | undefined) => void, _setWireObserver?: ((observer: WireMessageObserver | undefined) => void) | undefined);
1281
+ /** Bind the inbound request/notification handler. May be called before or after construction of {@link LinkRpcConnection}. */
1282
+ setRequestHandler(handler: IRequestHandler<TInCtx> | undefined): void;
1283
+ /**
1284
+ * Install the endpoint inspection observer at the JSON-RPC wire boundary.
1285
+ * Intended for {@link LinkRpcConnection}; ordinary consumers should use the
1286
+ * public `hubrpc.traffic` service instead.
1287
+ */
1288
+ setWireMessageObserver(observer: WireMessageObserver | undefined): void;
1289
+ /**
1290
+ * Compose this channel with a sender-side decorator (typically the
1291
+ * signing layer). The decorator wraps {@link sender} only; the
1292
+ * {@link setRequestHandler} binding is shared with the original channel
1293
+ * so the receive side is bound exactly once regardless of decoration depth.
1294
+ */
1295
+ withSender<TNewOutCtx>(decorate: (raw: IRequestSender<TOutCtx>) => IRequestSender<TNewOutCtx>): Channel<TInCtx, TNewOutCtx>;
1296
+ }
1297
+ type WireMessageDirection = 'inbound' | 'outbound';
1298
+ type WireMessageObserver = (direction: WireMessageDirection, message: JsonRpcMessage) => void;
1299
+ interface IRequestHandler<TInCtx = undefined> {
1300
+ handleRequest(call: IncomingCall<TInCtx>): Promise<Result>;
1301
+ handleNotification(call: IncomingCall<TInCtx>): void;
1302
+ }
1303
+ /**
1304
+ * Inbound call observed by an {@link IRequestHandler}. `TInCtx` is the
1305
+ * per-call out-of-band context the transport attached on the receiving
1306
+ * side (e.g. the hub stamps `Participant` on overlay-bound messages).
1307
+ * For wire transports it's `undefined`.
1308
+ */
1309
+ interface IncomingCall<TInCtx = undefined> {
1310
+ method: string;
1311
+ params: JsonValue | undefined;
1312
+ /** Out-of-band context attached by the transport, if any. */
1313
+ context: TInCtx;
1314
+ /**
1315
+ * Per-call streaming handle. Both directions live on this object,
1316
+ * scoped to the request's lifetime. The inbound listener is auto-
1317
+ * detached when the handler's response settles. For notifications
1318
+ * (no request id) the handle is a no-op stub.
1319
+ */
1320
+ stream: IncomingStream;
1321
+ /**
1322
+ * Aborts when the caller cancels this in-flight request (a
1323
+ * `toCallee` `cancel` control), or when the hub cancels it on the
1324
+ * caller's behalf (caller disconnect / idle timeout). The handler
1325
+ * should observe this and settle promptly — typically by throwing,
1326
+ * which surfaces as a `cancelled` error response. For notifications
1327
+ * this never aborts.
1328
+ */
1329
+ signal: AbortSignal;
1330
+ }
1331
+ /**
1332
+ * Per-call streaming handle attached to {@link IncomingCall.stream}.
1333
+ * Scoped to a single in-flight request; the channel automatically
1334
+ * detaches the inbound listener when the handler's response settles.
1335
+ *
1336
+ * For notifications (which have no request id), `requestId` is
1337
+ * `undefined`, `send` is a no-op, and `onMessage` is a no-op.
1338
+ */
1339
+ interface IncomingStream {
1340
+ /** Emit a server→client stream notification correlated with this call. */
1341
+ send(payload: JsonValue): Promise<void>;
1342
+ /**
1343
+ * Register a listener for client→server stream messages correlated
1344
+ * with this call. Pass `undefined` to detach. Replaces any prior
1345
+ * listener. The channel detaches the listener automatically when
1346
+ * the handler's response settles.
1347
+ */
1348
+ onMessage(listener: ((payload: JsonValue) => void) | undefined): void;
1349
+ /**
1350
+ * Liveness probe toward the caller: emit a `toCaller` ping and
1351
+ * resolve once the caller's `pong` (matching nonce) returns. Rejects
1352
+ * if the request settles first. Independent of the channel's
1353
+ * automatic keepalive ping.
1354
+ */
1355
+ ping(): Promise<void>;
1356
+ }
1357
+ type Result = {
1358
+ result: JsonValue;
1359
+ } | {
1360
+ error: {
1361
+ code: number;
1362
+ message: string;
1363
+ data?: JsonValue;
1364
+ };
1365
+ };
1366
+ /**
1367
+ * What callers use to send. The {@link Channel} factory binds an
1368
+ * {@link IRequestHandler} at construction (immutable for the channel's
1369
+ * lifetime) and hands the caller back an `IRequestSender`.
1370
+ *
1371
+ * `TOutCtx` is the per-call context bag this sender understands. For
1372
+ * the base {@link JsonRpcChannel} it's `undefined` (the channel
1373
+ * doesn't read any overrides). Decorators like `SigningSender`
1374
+ * parametrise it on their own ctx shape.
1375
+ */
1376
+ interface IRequestSender<TOutCtx = undefined> {
1377
+ sendRequest(method: string, params: JsonValue | undefined, opts?: SendOpts<TOutCtx>): Promise<JsonValue>;
1378
+ sendNotification(method: string, params: JsonValue | undefined, opts?: SendOpts<TOutCtx>): Promise<void>;
1379
+ /**
1380
+ * Issue a request that participates in the streaming sub-protocol.
1381
+ * Returns synchronously with the wire request id, the result
1382
+ * promise, and a `send` for emitting client→server stream messages.
1383
+ */
1384
+ sendRequestWithStream(method: string, params: JsonValue | undefined, opts?: StreamSendOpts<TOutCtx>): RawStreamingCall;
1385
+ close(): void;
1386
+ }
1387
+ /**
1388
+ * Handle for a request issued via
1389
+ * {@link IRequestSender.sendRequestWithStream}. `send` emits
1390
+ * client→server stream messages correlated with this call. `result`
1391
+ * resolves with the call's response.
1392
+ */
1393
+ interface RawStreamingCall {
1394
+ readonly result: Promise<JsonValue>;
1395
+ /** Emit a client→server (`toCallee`) stream message correlated with this call. */
1396
+ send(payload: JsonValue): void;
1397
+ /**
1398
+ * Ask the callee to abort this in-flight request (a `toCallee`
1399
+ * `cancel` control). Advisory: the request settles via its normal
1400
+ * response (typically a `cancelled` error). `reason` is an open-set
1401
+ * diagnostic string (see `StreamControlReason`).
1402
+ */
1403
+ cancel(reason?: string): void;
1404
+ /**
1405
+ * Stop tracking this request locally and reject {@link result}. This does
1406
+ * not notify the callee; call {@link cancel} first when remote work should
1407
+ * also be cancelled. Safe to call after the request has already settled.
1408
+ */
1409
+ dispose?(reason?: string): void;
1410
+ /**
1411
+ * Liveness probe toward the callee: emit a `toCallee` ping and
1412
+ * resolve once the callee's `pong` (matching nonce) returns. Rejects
1413
+ * if the request settles first. Independent of the channel's
1414
+ * automatic keepalive ping.
1415
+ */
1416
+ ping(): Promise<void>;
1417
+ }
1418
+ /**
1419
+ * Per-send options.
1420
+ *
1421
+ * `interfaceHash` is interface-level call metadata: the schema hash of
1422
+ * the interface a typed proxy is calling. It is independent of
1423
+ * `TOutCtx` — the connection stamps it from the interface definition,
1424
+ * the base {@link JsonRpcChannel} ignores it, and signing decorators
1425
+ * bake it into the `$hubrpc` envelope.
1426
+ *
1427
+ * `ctx` is the sender's `TOutCtx`-typed override / extension bag for
1428
+ * per-call decorator overrides (e.g. `signerOverride`, `capsOverride`).
1429
+ * The base {@link JsonRpcChannel} ignores `ctx` entirely; decorators
1430
+ * like `SigningSender` interpret it.
1431
+ */
1432
+ interface SendOpts<TOutCtx = undefined> {
1433
+ readonly ctx?: TOutCtx;
1434
+ /** Interface schema hash for this call (interface-level metadata). */
1435
+ readonly interfaceHash?: string;
1436
+ }
1437
+ interface StreamSendOpts<TOutCtx = undefined> extends SendOpts<TOutCtx> {
1438
+ readonly onStreamMessage?: (payload: JsonValue) => void;
1439
+ }
1440
+ /**
1441
+ * Type of incoming messages on the channel's transport. With
1442
+ * `TInCtx = undefined` (default) this is just `JsonRpcMessage`. With a
1443
+ * concrete `TInCtx`, the transport carries a `context` field alongside
1444
+ * the message — out-of-band, never sent over a wire, set by the
1445
+ * in-process producer.
1446
+ */
1447
+ type MessageWithCtx<TInCtx> = [TInCtx] extends [undefined] ? JsonRpcMessage : JsonRpcMessage & {
1448
+ context: TInCtx;
1449
+ };
1450
+ declare const zParticipantDescriptorSource: zod_mini.ZodMiniObject<{
1451
+ source: zod_mini.ZodMiniEnum<{
1452
+ self: "self";
1453
+ attacher: "attacher";
1454
+ }>;
1455
+ descriptor: zod_mini.ZodMiniObject<{
1456
+ type: zod_mini.ZodMiniOptional<zod_mini.ZodMiniString<string>>;
1457
+ label: zod_mini.ZodMiniOptional<zod_mini.ZodMiniString<string>>;
1458
+ processId: zod_mini.ZodMiniOptional<zod_mini.ZodMiniNumber<number>>;
1459
+ processType: zod_mini.ZodMiniOptional<zod_mini.ZodMiniString<string>>;
1460
+ nodeStatusServiceId: zod_mini.ZodMiniOptional<zod_mini.ZodMiniString<string>>;
1461
+ metadata: zod_mini.ZodMiniOptional<zod_mini.ZodMiniRecord<zod_mini.ZodMiniString<string>, zod_mini.ZodMiniUnion<readonly [zod_mini.ZodMiniString<string>, zod_mini.ZodMiniNumber<number>, zod_mini.ZodMiniBoolean<boolean>]>>>;
1462
+ }, zod_v4_core.$strip>;
1463
+ }, zod_v4_core.$strip>;
1464
+ type ParticipantDescriptorSource = output<typeof zParticipantDescriptorSource>;
1465
+ declare const zTrafficTransitEvent: zod_mini.ZodMiniObject<{
1466
+ type: zod_mini.ZodMiniLiteral<"transit">;
1467
+ timeMs: zod_mini.ZodMiniNumber<number>;
1468
+ nodeId: zod_mini.ZodMiniString<string>;
1469
+ in: zod_mini.ZodMiniOptional<zod_mini.ZodMiniObject<{
1470
+ edgeId: zod_mini.ZodMiniString<string>;
1471
+ portId: zod_mini.ZodMiniString<string>;
1472
+ requestId: zod_mini.ZodMiniOptional<zod_mini.ZodMiniUnion<readonly [zod_mini.ZodMiniNumber<number>, zod_mini.ZodMiniString<string>]>>;
1473
+ }, zod_v4_core.$strip>>;
1474
+ out: zod_mini.ZodMiniOptional<zod_mini.ZodMiniObject<{
1475
+ edgeId: zod_mini.ZodMiniString<string>;
1476
+ portId: zod_mini.ZodMiniString<string>;
1477
+ requestId: zod_mini.ZodMiniOptional<zod_mini.ZodMiniUnion<readonly [zod_mini.ZodMiniNumber<number>, zod_mini.ZodMiniString<string>]>>;
1478
+ }, zod_v4_core.$strip>>;
1479
+ disposition: zod_mini.ZodMiniEnum<{
1480
+ forwarded: "forwarded";
1481
+ consumed: "consumed";
1482
+ dropped: "dropped";
1483
+ unroutable: "unroutable";
1484
+ }>;
1485
+ kind: zod_mini.ZodMiniEnum<{
1486
+ request: "request";
1487
+ notification: "notification";
1488
+ response: "response";
1489
+ stream: "stream";
1490
+ }>;
1491
+ method: zod_mini.ZodMiniOptional<zod_mini.ZodMiniString<string>>;
1492
+ params: zod_mini.ZodMiniOptional<zod_mini.ZodMiniUnknown>;
1493
+ result: zod_mini.ZodMiniOptional<zod_mini.ZodMiniUnknown>;
1494
+ error: zod_mini.ZodMiniOptional<zod_mini.ZodMiniObject<{
1495
+ code: zod_mini.ZodMiniNumber<number>;
1496
+ message: zod_mini.ZodMiniString<string>;
1497
+ data: zod_mini.ZodMiniOptional<zod_mini.ZodMiniUnknown>;
1498
+ }, zod_v4_core.$strip>>;
1499
+ }, zod_v4_core.$strip>;
1500
+ type TrafficTransitEvent = output<typeof zTrafficTransitEvent>;
1501
+ //#endregion
1502
+ //#region src/inspection/node.interfaces.d.ts
1503
+ declare const zNodeInfo: zod_mini.ZodMiniObject<{
1504
+ nodeId: zod_mini.ZodMiniString<string>;
1505
+ portId: zod_mini.ZodMiniString<string>;
1506
+ descriptors: zod_mini.ZodMiniOptional<zod_mini.ZodMiniArray<zod_mini.ZodMiniObject<{
1507
+ source: zod_mini.ZodMiniEnum<{
1508
+ self: "self";
1509
+ attacher: "attacher";
1510
+ }>;
1511
+ descriptor: zod_mini.ZodMiniObject<{
1512
+ type: zod_mini.ZodMiniOptional<zod_mini.ZodMiniString<string>>;
1513
+ label: zod_mini.ZodMiniOptional<zod_mini.ZodMiniString<string>>;
1514
+ processId: zod_mini.ZodMiniOptional<zod_mini.ZodMiniNumber<number>>;
1515
+ processType: zod_mini.ZodMiniOptional<zod_mini.ZodMiniString<string>>;
1516
+ nodeStatusServiceId: zod_mini.ZodMiniOptional<zod_mini.ZodMiniString<string>>;
1517
+ metadata: zod_mini.ZodMiniOptional<zod_mini.ZodMiniRecord<zod_mini.ZodMiniString<string>, zod_mini.ZodMiniUnion<readonly [zod_mini.ZodMiniString<string>, zod_mini.ZodMiniNumber<number>, zod_mini.ZodMiniBoolean<boolean>]>>>;
1518
+ }, zod_v4_core.$strip>;
1519
+ }, zod_v4_core.$strip>>>;
1520
+ }, zod_v4_core.$strip>;
1521
+ type NodeInfo = output<typeof zNodeInfo>;
1522
+ /**
1523
+ * Generates unique topology-correlation labels, not security identities.
1524
+ * Custom generators must avoid collisions across nodes and ports. Tests can
1525
+ * supply an independent deterministic sequence for each participant.
1526
+ */
1527
+ type TopologyIdGenerator = (kind: 'node' | 'port') => string;
1528
+ //#endregion
1529
+ //#region src/connection/bareInterfaceTarget.d.ts
1530
+ /** A metadata-free foreign-protocol interface and its wire-method prefix. */
1531
+ interface BareInterfaceTarget<TDef extends InterfaceDefinition<any>> {
1532
+ readonly mode: 'bare';
1533
+ readonly interface: TDef;
1534
+ readonly prefix: string;
1535
+ }
1536
+ //#endregion
1537
+ //#region src/connection/interfaceTarget.d.ts
1538
+ /** A qualified LinkRPC route. An empty serviceId addresses the root interface. */
1539
+ interface QualifiedInterfaceTarget<TDef extends InterfaceDefinition<any>> {
1540
+ readonly mode: 'qualified';
1541
+ readonly interface: TDef;
1542
+ readonly serviceId: string;
1543
+ }
1544
+ /** The peer's preset form-1 route, retaining LinkRPC metadata and streaming. */
1545
+ interface DefaultInterfaceTarget<TDef extends InterfaceDefinition<any>> {
1546
+ readonly mode: 'default';
1547
+ readonly interface: TDef;
1548
+ }
1549
+ type InterfaceTarget<TDef extends InterfaceDefinition<any>> = QualifiedInterfaceTarget<TDef> | DefaultInterfaceTarget<TDef> | BareInterfaceTarget<TDef>;
1550
+ /** One OR-set. The set is satisfied by holding *any one* of its principals. */
1551
+ declare const zRootPrincipalSet: zod_mini.ZodMiniArray<zod_mini.ZodMiniObject<{
1552
+ principal: zod_mini.ZodMiniString<string>;
1553
+ transitive: zod_mini.ZodMiniOptional<zod_mini.ZodMiniBoolean<boolean>>;
1554
+ }, zod_v4_core.$strip>>;
1555
+ type RootPrincipalSet = output<typeof zRootPrincipalSet>;
1556
+ //#endregion
1557
+ //#region src/connection/linkRpcConnection.d.ts
1558
+ interface LinkRpcConnectionOptions {
1559
+ /** Topology node/port ID generator. Defaults to cryptographic randomness. */
1560
+ readonly generateTopologyId?: TopologyIdGenerator;
1561
+ /**
1562
+ * Validate parameters passed through typed interface clients before sending
1563
+ * them. Enabled by default. Disable only when interoperating with a peer
1564
+ * whose accepted wire shape intentionally differs from the local schema.
1565
+ */
1566
+ readonly validateOutboundParams?: boolean;
1567
+ }
1568
+ /**
1569
+ * High-level linkrpc connection. Layers method-name routing and zod-driven
1570
+ * validation on top of a plain JSON-RPC channel.
1571
+ *
1572
+ * Typed proxies built by this class merely forward each call's
1573
+ * `interfaceHash` hint to the channel so the signer stamps it into the
1574
+ * `$hubrpc` envelope.
1575
+ *
1576
+ * `TInCtx` is the per-call out-of-band context the connection's transport
1577
+ * carries. Default `undefined` covers cross-process and ordinary in-process
1578
+ * transports. The hub's self/overlay connections instantiate with a
1579
+ * concrete `TInCtx` (e.g. `Participant`) so handlers can see who originated
1580
+ * the call.
1581
+ *
1582
+ * `TOutCtx` is the per-call override / extension bag the outbound sender
1583
+ * understands (see {@link SendOpts.ctx}). It only ever flows into the
1584
+ * sender as input, so it is a contravariant type parameter. Default `any`
1585
+ * keeps the bare `LinkRpcConnection` a valid supertype for holders that do
1586
+ * not care about the outbound ctx; pass a concrete shape (e.g.
1587
+ * `SigningCallCtx`) to get precise {@link get} typing. The connection
1588
+ * itself is agnostic to its contents — it merely forwards the `ctx`
1589
+ * defaults supplied to {@link get}.
1590
+ */
1591
+ declare class LinkRpcConnection<TInCtx = any, TOutCtx = any> {
1592
+ /**
1593
+ * Convenience: build a {@link JsonRpcChannel} `Channel` from the
1594
+ * given transport and wrap it in an `LinkRpcConnection`. Use this
1595
+ * when you have a transport at hand and don't need a decorator
1596
+ * stack (e.g. signing).
1597
+ */
1598
+ static fromTransport<TInCtx = undefined>(transport: IMessageTransport<MessageWithCtx<TInCtx>, JsonRpcMessage>, options?: LinkRpcConnectionOptions): LinkRpcConnection<TInCtx>;
1599
+ /** Underlying JSON-RPC sender — useful for callers that need raw access (e.g. to call hub-served methods that bypass the interface registry). */
1600
+ readonly channel: IRequestSender<TOutCtx>;
1601
+ /** key = `${serviceId ?? ""}::${interfaceId}` */
1602
+ private readonly _registry;
1603
+ /** Descriptions for services that have been registered with a `serviceDescription`. */
1604
+ private readonly _serviceDescriptions;
1605
+ /** Root-node-id requirement sets recorded per serviceId. */
1606
+ private readonly _serviceRootPrincipalSets;
1607
+ private readonly _directoryWatchers;
1608
+ private readonly _directoryListeners;
1609
+ private _inspection;
1610
+ private _inspectionHost;
1611
+ private readonly _serviceInspectionRegistrations;
1612
+ private readonly _wireObservers;
1613
+ private readonly _closeListeners;
1614
+ private _closed;
1615
+ private readonly _wireChannel;
1616
+ private readonly _validateOutboundParams;
1617
+ /** Bare-method bindings, keyed by their exact wire prefix. */
1618
+ private readonly _bareBindings;
1619
+ private readonly _generateTopologyId;
1620
+ /**
1621
+ * Construct from a {@link Channel} (binds the inbound handler and uses
1622
+ * `channel.sender` for outbound calls) or from a bare
1623
+ * {@link IRequestSender} (send-only — no inbound handler is registered,
1624
+ * useful for bootstrap flows like `createManagedIdentity`).
1625
+ */
1626
+ constructor(channel: Channel<TInCtx, TOutCtx> | IRequestSender<TOutCtx>, options?: LinkRpcConnectionOptions);
1627
+ /** Get a typed client using a bundled qualified, default, or bare route. */
1628
+ get<TDef extends InterfaceDefinition<any>>(target: InterfaceTarget<TDef>): InterfaceClient<TDef>;
1629
+ /** Get a typed client for `iface`, routed to the implicit (root) service. */
1630
+ get<TDef extends InterfaceDefinition<any>>(iface: TDef, opts?: GetOptions<TOutCtx>): InterfaceClient<TDef>;
1631
+ private _getClient;
1632
+ /**
1633
+ * Get a typed client that emits foreign-protocol bare method names.
1634
+ * Unlike {@link get}, these calls carry no LinkRPC interface metadata.
1635
+ */
1636
+ getBare<TDef extends InterfaceDefinition<any>>(iface: TDef, opts?: BareGetOptions): InterfaceClient<TDef>;
1637
+ private _buildBareClient;
1638
+ /** Return request failures as values for a bundled qualified, default, or bare route. */
1639
+ getResultClient<TDef extends InterfaceDefinition<any>>(target: InterfaceTarget<TDef>): InterfaceResultClient<TDef>;
1640
+ /** Return application and generic request failures as values instead of throwing. */
1641
+ getResultClient<TDef extends InterfaceDefinition<any>>(iface: TDef, opts?: GetOptions<TOutCtx>): InterfaceResultClient<TDef>;
1642
+ /** Get a service-scoped handle; all interfaces obtained from it route via `serviceId` (form 3). */
1643
+ service(serviceId: string): ServiceHandle<TInCtx, TOutCtx>;
1644
+ /** Register handlers, adding preset routing when passed a default or bare target. */
1645
+ register<TDef extends InterfaceDefinition<any>>(ifaceOrTarget: TDef | InterfaceTarget<TDef>, handlers: InterfaceHandlers<TDef, TInCtx>, opts?: RegisterOptions): InterfaceRegistration;
1646
+ /** Register inspection contracts without recursively enabling service inspection. */
1647
+ registerInspection<TDef extends InterfaceDefinition<any>>(iface: TDef, handlers: InterfaceHandlers<TDef, TInCtx>, opts?: RegisterOptions): InterfaceRegistration;
1648
+ /** Observe this connection without replacing another inspection scope's observer. */
1649
+ observeWireMessages(observer: WireMessageObserver): InterfaceRegistration;
1650
+ onDidClose(listener: () => void): InterfaceRegistration;
1651
+ private _register;
1652
+ /** Snapshot of every interface currently registered on this connection. */
1653
+ listRegisteredInterfaces(): readonly {
1654
+ readonly serviceId: string;
1655
+ readonly interfaceId: string;
1656
+ readonly interfaceHash: string;
1657
+ readonly tags?: readonly string[];
1658
+ readonly serviceDescription?: string;
1659
+ readonly rootPrincipalSets?: readonly RootPrincipalSet[];
1660
+ }[];
1661
+ /** Subscribe to coarse local directory changes; listeners must re-list. */
1662
+ onDidChangeDirectory(listener: () => void): () => void;
1663
+ /**
1664
+ * Look up a registered interface definition by id (and optional content
1665
+ * hash). Returns `undefined` if no registered interface matches.
1666
+ */
1667
+ findRegisteredInterface(interfaceId: string, hash?: string): InterfaceDefinition<any> | undefined;
1668
+ /**
1669
+ * Register the three linkrpc reflection interfaces (`defaults`,
1670
+ * `directory`, `schemas`), backed by this connection's live registry.
1671
+ *
1672
+ * By default they live under the root service (form-2 reachable as
1673
+ * `hubrpc.directory::list`). Pass `serviceId` to additionally mount
1674
+ * them under a specific service — useful for participants that live
1675
+ * behind a hub, so callers can reach reflection via form-3
1676
+ * `<serviceId>::hubrpc.directory::list`.
1677
+ *
1678
+ * Idempotent: re-registering the same `(serviceId, interfaceId)` pair
1679
+ * is a no-op.
1680
+ */
1681
+ enableReflection(opts?: {
1682
+ serviceId?: string;
1683
+ }): InterfaceRegistration;
1684
+ private _notifyDirectoryWatchers;
1685
+ /**
1686
+ * Enable the root `hubrpc.node::getNodeId` topology-bootstrap service.
1687
+ *
1688
+ * The generated ids are stable while this registration is active. They are
1689
+ * unauthenticated correlation labels only; callers must not use them for
1690
+ * identity, capability, or authorization decisions.
1691
+ */
1692
+ enableInspection(descriptors?: readonly ParticipantDescriptorSource[]): InspectionRegistration;
1693
+ /** Number of active endpoint traffic stream subscribers. */
1694
+ get trafficObserverCount(): number;
1695
+ close(): void;
1696
+ private _buildClient;
1697
+ private _validateOutboundParamsFor;
1698
+ private _handleRequest;
1699
+ private _buildStreamApi;
1700
+ private _handleNotification;
1701
+ private _parseRouted;
1702
+ private _installServiceInspection;
1703
+ private _removeServiceInspection;
1704
+ private _hasBusinessServiceRegistration;
1705
+ }
1706
+ /**
1707
+ * Options when obtaining a typed client for an interface.
1708
+ *
1709
+ * - `serviceId`: route to a specific service (form 3). Omit for form 2
1710
+ * (implicit / root service on the connection).
1711
+ * - any `TOutCtx` property: a per-client default merged into the `ctx`
1712
+ * of every call issued through the returned proxy (e.g.
1713
+ * `signerOverride`, `capsOverride` for a signing channel). The
1714
+ * connection forwards these verbatim; it does not interpret them.
1715
+ *
1716
+ * Schema-version pinning travels as interface-level call metadata
1717
+ * ({@link SendOpts.interfaceHash}); the typed proxy stamps
1718
+ * `iface.schemaHash` automatically, independent of `TOutCtx`.
1719
+ */
1720
+ type GetOptions<TOutCtx = undefined> = {
1721
+ serviceId?: string;
1722
+ } & Partial<TOutCtx>;
1723
+ /** Options for a metadata-free, bare-method typed client. */
1724
+ interface BareGetOptions {
1725
+ prefix?: string;
1726
+ }
1727
+ interface RegisterOptions {
1728
+ /**
1729
+ * If set, this interface is mounted under this service id (form 3).
1730
+ */
1731
+ serviceId?: string;
1732
+ /**
1733
+ * Optional human description recorded for `serviceId` and surfaced
1734
+ * through `hubrpc.directory::list`. Requires `serviceId`. The first
1735
+ * registration's description wins; any later registration that
1736
+ * supplies a *different* non-undefined description throws.
1737
+ */
1738
+ serviceDescription?: string;
1739
+ /**
1740
+ * Root node ids required to access `serviceId`, in CNF (AND of OR-sets):
1741
+ * the caller must satisfy **every** set, and a set is satisfied by **any
1742
+ * one** of its node ids. Surfaced through `hubrpc.directory::list`.
1743
+ * Requires `serviceId`. Recorded per service; a later registration that
1744
+ * supplies a *different* value for the same `serviceId` throws.
1745
+ */
1746
+ rootPrincipalSets?: readonly RootPrincipalSet[];
1747
+ }
1748
+ /** A live interface registration. Disposing it removes dispatch and reflection state. */
1749
+ interface InterfaceRegistration {
1750
+ /** Remove this exact registration. Idempotent. */
1751
+ dispose(): void;
1752
+ }
1753
+ /** Generated topology identity and its live root-interface registration. */
1754
+ interface InspectionRegistration extends InterfaceRegistration, NodeInfo {
1755
+ /**
1756
+ * Observe this endpoint's full-payload traffic in-process. Watch-control
1757
+ * flows are tracked even when no public observations are active.
1758
+ */
1759
+ observeTraffic(observer: (transit: TrafficTransitEvent) => void): InterfaceRegistration;
1760
+ }
1761
+ /** Service-scoped handle returned by `connection.service(id)`. */
1762
+ declare class ServiceHandle<TInCtx = undefined, TOutCtx = undefined> {
1763
+ private readonly _connection;
1764
+ private readonly _serviceId;
1765
+ constructor(_connection: LinkRpcConnection<TInCtx, TOutCtx>, _serviceId: string);
1766
+ getResultClient<TDef extends InterfaceDefinition<any>>(iface: TDef, opts?: Partial<TOutCtx>): InterfaceResultClient<TDef>;
1767
+ get<TDef extends InterfaceDefinition<any>>(iface: TDef, opts?: Partial<TOutCtx>): InterfaceClient<TDef>;
1768
+ register<TDef extends InterfaceDefinition<any>>(ifaceOrTarget: TDef | BareInterfaceTarget<TDef>, handlers: InterfaceHandlers<TDef, TInCtx>, opts?: Omit<RegisterOptions, 'serviceId'>): InterfaceRegistration;
1769
+ }
1770
+
1771
+ declare function createDaemonMethods(connection: LinkRpcConnection): {
1772
+ fixtures: {
1773
+ list: (params: {
1774
+ sessionName: string;
1775
+ sourceTreeId: string;
1776
+ }) => Promise<{
1777
+ fixtures: {
1778
+ fixtureId: string;
1779
+ fixtureName: string;
1780
+ groupPath: string[];
1781
+ background: "light" | "dark";
1782
+ labels: readonly string[];
1783
+ expectedVisualDescriptions: readonly string[];
1784
+ inputSchema?: unknown;
1785
+ }[];
1786
+ loadError?: string | undefined;
1787
+ }>;
1788
+ };
1789
+ screenshots: {
1790
+ take: (params: {
1791
+ fixtureId: string;
1792
+ sourceTreeId: string;
1793
+ sessionName: string;
1794
+ includeImage?: boolean | undefined;
1795
+ stabilityCheck?: boolean | undefined;
1796
+ reloadBeforeRender?: boolean | undefined;
1797
+ input?: unknown;
1798
+ disposeAfter?: boolean | undefined;
1799
+ }) => Promise<{
1800
+ hasError: boolean;
1801
+ sourceTreeId: string;
1802
+ hash?: string | undefined;
1803
+ image?: string | undefined;
1804
+ error?: {
1805
+ message: string;
1806
+ stack?: string | undefined;
1807
+ } | undefined;
1808
+ events?: {
1809
+ type: "console.error" | "console.warn" | "console.log" | "window.error" | "window.unhandledrejection";
1810
+ message: string;
1811
+ stack?: string | undefined;
1812
+ }[] | undefined;
1813
+ output?: unknown;
1814
+ isStable?: boolean | undefined;
1815
+ stabilityScreenshots?: {
1816
+ hash: string;
1817
+ delayMs: number;
1818
+ image?: string | undefined;
1819
+ }[] | undefined;
1820
+ previousDispose?: {
1821
+ hasError: boolean;
1822
+ errors: readonly {
1823
+ message: string;
1824
+ stack?: string | undefined;
1825
+ }[];
1826
+ events: readonly {
1827
+ type: "console.error" | "console.warn" | "console.log" | "window.error" | "window.unhandledrejection";
1828
+ message: string;
1829
+ stack?: string | undefined;
1830
+ }[];
1831
+ } | undefined;
1832
+ currentDispose?: {
1833
+ hasError: boolean;
1834
+ errors: readonly {
1835
+ message: string;
1836
+ stack?: string | undefined;
1837
+ }[];
1838
+ events: readonly {
1839
+ type: "console.error" | "console.warn" | "console.log" | "window.error" | "window.unhandledrejection";
1840
+ message: string;
1841
+ stack?: string | undefined;
1842
+ }[];
1843
+ } | undefined;
1844
+ }>;
1845
+ takeBatch: (params: {
1846
+ fixtureIds: string[];
1847
+ sourceTreeId: string;
1848
+ sessionName: string;
1849
+ includeImages?: boolean | undefined;
1850
+ reloadBetweenFixtures?: boolean | undefined;
1851
+ input?: unknown;
1852
+ }) => Promise<{
1853
+ sourceTreeId: string;
1854
+ screenshots: {
1855
+ hasError: boolean;
1856
+ fixtureId: string;
1857
+ hash?: string | undefined;
1858
+ image?: string | undefined;
1859
+ error?: {
1860
+ message: string;
1861
+ stack?: string | undefined;
1862
+ } | undefined;
1863
+ events?: {
1864
+ type: "console.error" | "console.warn" | "console.log" | "window.error" | "window.unhandledrejection";
1865
+ message: string;
1866
+ stack?: string | undefined;
1867
+ }[] | undefined;
1868
+ output?: unknown;
1869
+ }[];
1870
+ }>;
1871
+ compare: (params: {
1872
+ fixtureId: string;
1873
+ baselineSessionName: string;
1874
+ baselineSourceTreeId: string;
1875
+ currentSessionName: string;
1876
+ currentSourceTreeId: string;
1877
+ includeImages?: boolean | undefined;
1878
+ }) => Promise<{
1879
+ match: boolean;
1880
+ baselineHasError: boolean;
1881
+ currentHasError: boolean;
1882
+ baselineHash?: string | undefined;
1883
+ currentHash?: string | undefined;
1884
+ baselineImage?: string | undefined;
1885
+ currentImage?: string | undefined;
1886
+ baselineError?: {
1887
+ message: string;
1888
+ stack?: string | undefined;
1889
+ } | undefined;
1890
+ baselineEvents?: {
1891
+ type: "console.error" | "console.warn" | "console.log" | "window.error" | "window.unhandledrejection";
1892
+ message: string;
1893
+ stack?: string | undefined;
1894
+ }[] | undefined;
1895
+ baselineOutput?: unknown;
1896
+ currentError?: {
1897
+ message: string;
1898
+ stack?: string | undefined;
1899
+ } | undefined;
1900
+ currentEvents?: {
1901
+ type: "console.error" | "console.warn" | "console.log" | "window.error" | "window.unhandledrejection";
1902
+ message: string;
1903
+ stack?: string | undefined;
1904
+ }[] | undefined;
1905
+ currentOutput?: unknown;
1906
+ labels?: readonly string[] | undefined;
1907
+ labelsBefore?: readonly string[] | undefined;
1908
+ approval?: {
1909
+ fixtureId: string;
1910
+ originalHash: string;
1911
+ modifiedHash: string;
1912
+ comment: string;
1913
+ approvedAt: string;
1914
+ } | undefined;
1915
+ }>;
1916
+ };
1917
+ approvals: {
1918
+ approve: (params: {
1919
+ fixtureId: string;
1920
+ originalHash: string;
1921
+ modifiedHash: string;
1922
+ comment: string;
1923
+ }) => Promise<void>;
1924
+ revoke: (params: {
1925
+ fixtureId: string;
1926
+ originalHash: string;
1927
+ modifiedHash: string;
1928
+ }) => Promise<void>;
1929
+ list: (params: {
1930
+ fixtureId?: string | undefined;
1931
+ }) => Promise<{
1932
+ fixtureId: string;
1933
+ originalHash: string;
1934
+ modifiedHash: string;
1935
+ comment: string;
1936
+ approvedAt: string;
1937
+ }[]>;
1938
+ lookup: (params: {
1939
+ fixtureId: string;
1940
+ originalHash: string;
1941
+ modifiedHash: string;
1942
+ }) => Promise<{
1943
+ fixtureId: string;
1944
+ originalHash: string;
1945
+ modifiedHash: string;
1946
+ comment: string;
1947
+ approvedAt: string;
1948
+ } | null>;
1949
+ };
1950
+ visualReview: {
1951
+ getStatus: (params: {
1952
+ fixtureId: string;
1953
+ expectedVisualDescriptions: string[];
1954
+ screenshotHash: string;
1955
+ }) => Promise<"no-expectations" | {
1956
+ expectedVisualDescriptions: readonly string[];
1957
+ status: "approved" | "needs-review";
1958
+ approval?: {
1959
+ approvedAt: string;
1960
+ comment: string;
1961
+ } | undefined;
1962
+ }>;
1963
+ approve: (params: {
1964
+ fixtureId: string;
1965
+ expectedVisualDescriptions: string[];
1966
+ screenshotHash: string;
1967
+ comment: string;
1968
+ }) => Promise<void>;
1969
+ };
1970
+ evaluate: (params: {
1971
+ sessionName: string;
1972
+ sourceTreeId: string;
1973
+ expression: string;
1974
+ fixtureId?: string | undefined;
1975
+ }) => Promise<{
1976
+ result: unknown;
1977
+ }>;
1978
+ setBrowserVisibility: (params: {
1979
+ visible: boolean;
1980
+ }) => Promise<{
1981
+ visible: boolean;
1982
+ }>;
1983
+ events: (params: Record<string, never>, opts?: StreamCallOptions<NoInfer<{
1984
+ type: "source-change";
1985
+ sessionName: string;
1986
+ sourceTreeId: string;
1987
+ } | {
1988
+ type: "ref-change";
1989
+ sessionName: string;
1990
+ newCommit: string;
1991
+ } | {
1992
+ type: "session-change";
1993
+ } | {
1994
+ type: "log";
1995
+ level: "info" | "debug" | "trace";
1996
+ message: string;
1997
+ }>> | undefined) => StreamingCall<void, never> & Promise<void>;
1998
+ sessions: (params: Record<string, never>) => Promise<({
1999
+ name: string;
2000
+ sourceKind: "current" | "worktree";
2001
+ isLoading: true;
2002
+ } | {
2003
+ name: string;
2004
+ sourceKind: "current" | "worktree";
2005
+ serverUrl: string;
2006
+ sourceTreeId: string;
2007
+ isLoading?: false | undefined;
2008
+ worktreePath?: string | undefined;
2009
+ ref?: string | undefined;
2010
+ })[]>;
2011
+ restartSession: (params: {
2012
+ sessionName: string;
2013
+ }) => Promise<({
2014
+ name: string;
2015
+ sourceKind: "current" | "worktree";
2016
+ isLoading: true;
2017
+ } | {
2018
+ name: string;
2019
+ sourceKind: "current" | "worktree";
2020
+ serverUrl: string;
2021
+ sourceTreeId: string;
2022
+ isLoading?: false | undefined;
2023
+ worktreePath?: string | undefined;
2024
+ ref?: string | undefined;
2025
+ })[]>;
2026
+ openSession: (params: {
2027
+ name: string;
2028
+ ref: string;
2029
+ }) => Promise<{
2030
+ sessions: ({
2031
+ name: string;
2032
+ sourceKind: "current" | "worktree";
2033
+ isLoading: true;
2034
+ } | {
2035
+ name: string;
2036
+ sourceKind: "current" | "worktree";
2037
+ serverUrl: string;
2038
+ sourceTreeId: string;
2039
+ isLoading?: false | undefined;
2040
+ worktreePath?: string | undefined;
2041
+ ref?: string | undefined;
2042
+ })[];
2043
+ } | {
2044
+ error: string;
2045
+ }>;
2046
+ closeSession: (params: {
2047
+ name: string;
2048
+ }) => Promise<{
2049
+ sessions: ({
2050
+ name: string;
2051
+ sourceKind: "current" | "worktree";
2052
+ isLoading: true;
2053
+ } | {
2054
+ name: string;
2055
+ sourceKind: "current" | "worktree";
2056
+ serverUrl: string;
2057
+ sourceTreeId: string;
2058
+ isLoading?: false | undefined;
2059
+ worktreePath?: string | undefined;
2060
+ ref?: string | undefined;
2061
+ })[];
2062
+ } | {
2063
+ error: string;
2064
+ }>;
2065
+ updateSessionRef: (params: {
2066
+ name: string;
2067
+ ref: string;
2068
+ }) => Promise<{
2069
+ sessions: ({
2070
+ name: string;
2071
+ sourceKind: "current" | "worktree";
2072
+ isLoading: true;
2073
+ } | {
2074
+ name: string;
2075
+ sourceKind: "current" | "worktree";
2076
+ serverUrl: string;
2077
+ sourceTreeId: string;
2078
+ isLoading?: false | undefined;
2079
+ worktreePath?: string | undefined;
2080
+ ref?: string | undefined;
2081
+ })[];
2082
+ } | {
2083
+ error: string;
2084
+ }>;
2085
+ shutdown: (params: Record<string, never>) => Promise<void>;
2086
+ };
2087
+ type DaemonMethods = ReturnType<typeof createDaemonMethods>;
2088
+
2089
+ /** Screenshot result from the daemon */
2090
+ type DaemonScreenshotResult = Awaited<ReturnType<DaemonMethods['screenshots']['take']>>;
2091
+ /** Comparison result from the daemon */
2092
+ type DaemonCompareResult = Awaited<ReturnType<DaemonMethods['screenshots']['compare']>>;
2093
+ /** Fixture info from the daemon */
2094
+ type DaemonFixtureInfo = Awaited<ReturnType<DaemonMethods['fixtures']['list']>>['fixtures'][number];
2095
+ interface DaemonSession {
2096
+ readonly name: string;
2097
+ readonly serverUrl: string;
2098
+ readonly sourceKind: 'current' | 'worktree';
2099
+ }
2100
+ /**
2101
+ * Client-side model for interacting with the daemon.
2102
+ * Manages source tree IDs, screenshot caching, and the event stream.
2103
+ */
2104
+ declare class DaemonModel {
2105
+ readonly config: DaemonConfig;
2106
+ private readonly _sourceTreeIds;
2107
+ private readonly _sessions;
2108
+ private readonly _screenshotCache;
2109
+ private _client;
2110
+ private _stopEventStream;
2111
+ private _reconnectTimer;
2112
+ private _disposed;
2113
+ readonly sessionName: string;
2114
+ /** Observable map of sessionName → current sourceTreeId */
2115
+ readonly sourceTreeIds: IObservable$1<ReadonlyMap<string, string>>;
2116
+ /** Observable list of sessions from the daemon */
2117
+ readonly sessions: IObservable$1<readonly DaemonSession[]>;
2118
+ constructor(config: DaemonConfig);
2119
+ /**
2120
+ * Initializes the model: fetches initial session info and starts listening to events.
2121
+ * Call this once after construction.
2122
+ */
2123
+ initialize(): Promise<void>;
2124
+ /**
2125
+ * Get a screenshot for a fixture in a session, using cache when available.
2126
+ * Cache is keyed on sessionName + fixtureId and invalidated when sourceTreeId changes.
2127
+ */
2128
+ getScreenshot(sessionName: string, fixtureId: string): Promise<DaemonScreenshotResult>;
2129
+ /**
2130
+ * Compare a fixture across two sessions. Returns match status and hashes (no images).
2131
+ */
2132
+ compare(fixtureId: string, baselineSessionName: string, currentSessionName: string): Promise<DaemonCompareResult>;
2133
+ /**
2134
+ * List fixtures from a session.
2135
+ */
2136
+ listFixtures(sessionName: string): Promise<readonly DaemonFixtureInfo[]>;
2137
+ /**
2138
+ * Get the explorer URL for a different session (for session switching via full navigation).
2139
+ */
2140
+ getSessionExplorerUrl(sessionName: string): string | undefined;
2141
+ dispose(): void;
2142
+ private _requireClient;
2143
+ private _connect;
2144
+ private _fetchSessionInfos;
2145
+ private _startEventStream;
2146
+ private _onEventStreamEnded;
2147
+ private _scheduleReconnect;
2148
+ private _handleEvent;
2149
+ private _validateProtocolVersions;
2150
+ }
2151
+
2152
+ type FixtureStatus = 'unchanged' | 'changed' | 'added';
2153
+ interface ReportFixtureEntry {
2154
+ readonly status: FixtureStatus;
2155
+ readonly targetHash: string;
2156
+ readonly compareHash?: string;
2157
+ readonly background?: 'light' | 'dark';
2158
+ readonly baselineScreenshot?: string;
2159
+ readonly currentScreenshot?: string;
2160
+ readonly labels?: readonly string[];
2161
+ }
2162
+ interface ReportSummary {
2163
+ readonly total: number;
2164
+ readonly added: number;
2165
+ readonly changed: number;
2166
+ readonly unchanged: number;
2167
+ }
2168
+ interface ScreenshotReport {
2169
+ readonly timestamp: string;
2170
+ readonly target: string;
2171
+ readonly compareTarget: string;
2172
+ readonly summary: ReportSummary;
2173
+ readonly fixtures: {
2174
+ readonly [fixtureId: string]: ReportFixtureEntry | undefined;
2175
+ };
2176
+ }
2177
+
2178
+ type ExplorerTreeKind = 'components' | 'favorites';
2179
+ /**
2180
+ * Explorer's tree node structure, derived from FixtureNode.
2181
+ * This is the explorer's own representation of the fixture tree.
2182
+ */
2183
+ interface ExplorerTreeNode {
2184
+ readonly id: FixturePath;
2185
+ readonly name: string;
2186
+ readonly type: 'folder' | 'variants' | 'component';
2187
+ readonly children?: readonly ExplorerTreeNode[];
2188
+ readonly component?: ComponentDefinition;
2189
+ readonly labels: readonly string[];
2190
+ readonly isFavoritesRoot?: boolean;
2191
+ }
2192
+ /**
2193
+ * Converts a FixtureNode tree to ExplorerTreeNode tree.
2194
+ * This allows the explorer to have its own tree structure.
2195
+ */
2196
+ declare function toExplorerTree(node: FixtureNode): ExplorerTreeNode;
2197
+
2198
+ type ReportState = {
2199
+ readonly status: 'loading';
2200
+ } | {
2201
+ readonly status: 'ready';
2202
+ readonly report: ScreenshotReport;
2203
+ } | {
2204
+ readonly status: 'error';
2205
+ readonly message: string;
2206
+ };
2207
+ declare class ReportModel {
2208
+ readonly reportUrl: string;
2209
+ readonly state: ISettableObservable<ReportState, void>;
2210
+ private readonly _baseUrl;
2211
+ constructor(reportUrl: string);
2212
+ resolveScreenshotUrl(relativePath: string): string;
2213
+ buildTree(reader: IReader$1): ExplorerTreeNode;
2214
+ private _fetch;
2215
+ }
2216
+
2217
+ declare const Explorer: React.ComponentType<{
2218
+ registry: FixtureRegistry;
2219
+ daemonModel: DaemonModel | undefined;
2220
+ reportModel: ReportModel | undefined;
2221
+ } & {} & {
2222
+ daemonModel: DaemonModel | undefined;
2223
+ reportModel: ReportModel | undefined;
2224
+ } & {}>;
2225
+
2226
+ interface IDisposable {
2227
+ dispose(): void;
2228
+ }
2229
+ declare class DisposableStore implements IDisposable {
2230
+ private disposables;
2231
+ private _isDisposed;
2232
+ get isDisposed(): boolean;
2233
+ dispose(): void;
2234
+ add<T extends IDisposable | undefined>(disposable: T): T;
2235
+ remove<T extends IDisposable | undefined>(disposable: T): T;
2236
+ clear(): void;
2237
+ leakItems(): void;
2238
+ }
2239
+
2240
+ /**
2241
+ * Represents an observable value.
2242
+ *
2243
+ * @template T The type of the values the observable can hold.
2244
+ */
2245
+ interface IObservable<T> extends IObservableWithChange<T, unknown> {
2246
+ }
2247
+ /**
2248
+ * Represents an observable value.
2249
+ *
2250
+ * @template T The type of the values the observable can hold.
2251
+ * @template TChange The type used to describe value changes
2252
+ * (usually `void` and only used in advanced scenarios).
2253
+ * While observers can miss temporary values of an observable,
2254
+ * they will receive all change values (as long as they are subscribed)!
2255
+ */
2256
+ interface IObservableWithChange<T, TChange = unknown> {
2257
+ /**
2258
+ * Returns the current value.
2259
+ *
2260
+ * Calls {@link IObserver.handleChange} if the observable notices that the value changed.
2261
+ * Must not be called from {@link IObserver.handleChange}!
2262
+ */
2263
+ get(): T;
2264
+ /**
2265
+ * Forces the observable to check for changes and report them.
2266
+ *
2267
+ * Has the same effect as calling {@link IObservable.get}, but does not force the observable
2268
+ * to actually construct the value, e.g. if change deltas are used.
2269
+ * Calls {@link IObserver.handleChange} if the observable notices that the value changed.
2270
+ * Must not be called from {@link IObserver.handleChange}!
2271
+ */
2272
+ reportChanges(): void;
2273
+ /**
2274
+ * Adds the observer to the set of subscribed observers.
2275
+ * This method is idempotent.
2276
+ */
2277
+ addObserver(observer: IObserver): void;
2278
+ /**
2279
+ * Removes the observer from the set of subscribed observers.
2280
+ * This method is idempotent.
2281
+ */
2282
+ removeObserver(observer: IObserver): void;
2283
+ /**
2284
+ * Reads the current value and subscribes the reader to this observable.
2285
+ *
2286
+ * Calls {@link IReader.readObservable} if a reader is given, otherwise {@link IObservable.get}
2287
+ * (see {@link ConvenientObservable.read} for the implementation).
2288
+ */
2289
+ read(reader: IReader | undefined): T;
2290
+ /**
2291
+ * Makes sure this value is computed eagerly.
2292
+ */
2293
+ recomputeInitiallyAndOnChange(store: DisposableStore, handleValue?: (value: T) => void): IObservable<T>;
2294
+ /**
2295
+ * Makes sure this value is cached.
2296
+ */
2297
+ keepObserved(store: DisposableStore): IObservable<T>;
2298
+ /**
2299
+ * Creates a derived observable that depends on this observable.
2300
+ * Use the reader to read other observables
2301
+ * (see {@link ConvenientObservable.map} for the implementation).
2302
+ */
2303
+ map<TNew>(fn: (value: T, reader: IReader) => TNew): IObservable<TNew>;
2304
+ map<TNew>(owner: object, fn: (value: T, reader: IReader) => TNew): IObservable<TNew>;
2305
+ flatten<TNew>(this: IObservable<IObservable<TNew>>): IObservable<TNew>;
2306
+ /**
2307
+ * ONLY FOR DEBUGGING!
2308
+ * Logs computations of this derived.
2309
+ */
2310
+ log(): IObservableWithChange<T, TChange>;
2311
+ /**
2312
+ * A human-readable name for debugging purposes.
2313
+ */
2314
+ readonly debugName: string;
2315
+ /**
2316
+ * ONLY FOR DEBUGGING!
2317
+ */
2318
+ debugGetDependencyGraph(): string;
2319
+ /**
2320
+ * This property captures the type of the change object. Do not use it at runtime!
2321
+ */
2322
+ readonly TChange: TChange;
2323
+ }
2324
+ /**
2325
+ * Represents an observer that can be subscribed to an observable.
2326
+ *
2327
+ * If an observer is subscribed to an observable and that observable didn't signal
2328
+ * a change through one of the observer methods, the observer can assume that the
2329
+ * observable didn't change.
2330
+ * If an observable reported a possible change, {@link IObservable.reportChanges} forces
2331
+ * the observable to report an actual change if there was one.
2332
+ */
2333
+ interface IObserver {
2334
+ /**
2335
+ * Signals that the given observable might have changed and a transaction potentially modifying that observable started.
2336
+ * Before the given observable can call this method again, is must call {@link IObserver.endUpdate}.
2337
+ *
2338
+ * Implementations must not get/read the value of other observables, as they might not have received this event yet!
2339
+ * The method {@link IObservable.reportChanges} can be used to force the observable to report the changes.
2340
+ */
2341
+ beginUpdate<T>(observable: IObservable<T>): void;
2342
+ /**
2343
+ * Signals that the transaction that potentially modified the given observable ended.
2344
+ * This is a good place to react to (potential) changes.
2345
+ */
2346
+ endUpdate<T>(observable: IObservable<T>): void;
2347
+ /**
2348
+ * Signals that the given observable might have changed.
2349
+ * The method {@link IObservable.reportChanges} can be used to force the observable to report the changes.
2350
+ *
2351
+ * Implementations must not get/read the value of other observables, as they might not have received this event yet!
2352
+ * The change should be processed lazily or in {@link IObserver.endUpdate}.
2353
+ */
2354
+ handlePossibleChange<T>(observable: IObservable<T>): void;
2355
+ /**
2356
+ * Signals that the given {@link observable} changed.
2357
+ *
2358
+ * Implementations must not get/read the value of other observables, as they might not have received this event yet!
2359
+ * The change should be processed lazily or in {@link IObserver.endUpdate}.
2360
+ *
2361
+ * @param change Indicates how or why the value changed.
2362
+ */
2363
+ handleChange<T, TChange>(observable: IObservableWithChange<T, TChange>, change: TChange): void;
2364
+ }
2365
+ interface IReader {
2366
+ /**
2367
+ * Reads the value of an observable and subscribes to it.
2368
+ */
2369
+ readObservable<T>(observable: IObservableWithChange<T, any>): T;
2370
+ }
2371
+
2372
+ type Readable<T> = (reader: IReader) => T;
2373
+ interface IReadableObj<T> {
2374
+ /**
2375
+ * The reader of the component.
2376
+ */
2377
+ read(reader: IReader): T;
2378
+ }
2379
+ interface IPropertyTransformerFactory<TIn, TOut> {
2380
+ /** If set, this context's value is passed to create() */
2381
+ readonly _requiredContext?: Context<unknown>;
2382
+ /** @param contextValue - value of _requiredContext if declared, otherwise undefined */
2383
+ create(readable: Readable<TIn>, contextValue: unknown): IReadableObj<TOut>;
2384
+ }
2385
+
2386
+ declare const ViewModelContextSymbol: unique symbol;
2387
+ type PropsDesc = Record<string, IPropertyTransformerFactory<any, any>>;
2388
+ type PropsIn<T extends PropsDesc> = {
2389
+ [K in keyof T]: T[K] extends IPropertyTransformerFactory<infer U, any> ? U : never;
2390
+ };
2391
+ type PropsOut<T extends PropsDesc> = {
2392
+ [K in keyof T]: T[K] extends IPropertyTransformerFactory<any, infer U> ? U : never;
2393
+ };
2394
+ declare class BaseViewModel<TProps> implements IDisposable {
2395
+ protected readonly props: TProps;
2396
+ protected _store: DisposableStore;
2397
+ constructor(props: TProps);
2398
+ dispose(): void;
2399
+ }
2400
+ type ViewModelClass<TProps extends PropsDesc> = {
2401
+ new (arg: PropsOut<TProps>): BaseViewModel<PropsOut<TProps>>;
2402
+ _props: TProps;
2403
+ [ViewModelContextSymbol]?: Context<unknown>;
2404
+ };
2405
+
2406
+ interface ReportFixtureItem {
2407
+ readonly fixtureId: string;
2408
+ readonly name: string;
2409
+ readonly path: string;
2410
+ readonly entry: ReportFixtureEntry;
2411
+ }
2412
+
2413
+ type PagePreviewMode = 'fit' | 'responsive' | 'actual';
2414
+ type ComponentPreviewMode = Exclude<PagePreviewMode, 'responsive'>;
2415
+ interface PageViewportSettings {
2416
+ readonly viewportIndex: number;
2417
+ readonly width: number;
2418
+ readonly height: number;
2419
+ readonly mode: PagePreviewMode;
2420
+ }
2421
+ declare class FixtureViewportStore {
2422
+ private readonly _values;
2423
+ readonly mode: ISettableObservable<PagePreviewMode, void>;
2424
+ constructor();
2425
+ read(reader: IReader$1, fixtureId: string, pageMode: PageMode): PageViewportSettings;
2426
+ get(fixtureId: string, pageMode: PageMode): PageViewportSettings;
2427
+ readComponentMode(reader: IReader$1): ComponentPreviewMode;
2428
+ selectViewport(fixtureId: string, pageMode: PageMode, viewportIndex: number): void;
2429
+ setWidth(fixtureId: string, pageMode: PageMode, width: number): void;
2430
+ setHeight(fixtureId: string, pageMode: PageMode, height: number): void;
2431
+ private _set;
2432
+ private _load;
2433
+ private _persist;
2434
+ }
2435
+
2436
+ interface ActiveDebugPanelSession extends IDisposable$2 {
2437
+ sendAction(action: unknown): void;
2438
+ }
2439
+
2440
+ declare class ComponentRendering {
2441
+ readonly component: ComponentDefinition;
2442
+ private readonly _renderHost;
2443
+ private readonly _input?;
2444
+ private readonly _onInputReport?;
2445
+ readonly renderTarget: HTMLElement;
2446
+ readonly iframe: HTMLIFrameElement | null;
2447
+ private readonly _abortController;
2448
+ private _resolvedResult;
2449
+ private _injectedElements;
2450
+ private _adoptedSheets;
2451
+ private _styleTarget;
2452
+ private readonly _disposables;
2453
+ private readonly _rendered;
2454
+ private readonly _inputRuntime;
2455
+ private readonly _debugRuntime;
2456
+ private readonly _iframeActiveSessions;
2457
+ private readonly _iframePanelStateHandlers;
2458
+ private _iframeHasOutput;
2459
+ private _iframeOutputEditable;
2460
+ private _nextIframePanelSessionId;
2461
+ private _currentInput;
2462
+ constructor(host: HTMLElement, component: ComponentDefinition, _renderHost?: RenderHost, _input?: unknown | undefined, _onInputReport?: ((key: string, value: unknown) => void) | undefined);
2463
+ private readonly _pendingInputReports;
2464
+ private _queueInputReport;
2465
+ updateInput(input: unknown): boolean;
2466
+ get hasOutput(): boolean;
2467
+ get outputEditable(): boolean;
2468
+ getOutputSnapshot(): unknown;
2469
+ activateDebugPanel(panelId: string, publish: (state: unknown) => void): ActiveDebugPanelSession;
2470
+ private _connectDebugPanel;
2471
+ waitForRendering(): Promise<RenderResult | undefined>;
2472
+ dispose(): Promise<readonly ExceptionError[]>;
2473
+ }
2474
+
2475
+ interface FixtureDebugInfo {
2476
+ readonly fixture: FixtureItem;
2477
+ readonly rendering: ComponentRendering;
2478
+ readonly ready: boolean;
2479
+ readonly hasOutput: boolean;
2480
+ readonly outputEditable: boolean;
2481
+ }
2482
+ declare class FixtureDebugStore {
2483
+ private readonly _entries;
2484
+ read(reader: IReader$1, fixtureId: string): FixtureDebugInfo | undefined;
2485
+ get(fixtureId: string): FixtureDebugInfo | undefined;
2486
+ setRendering(fixture: FixtureItem, rendering: ComponentRendering): void;
2487
+ markReady(fixture: FixtureItem, rendering: ComponentRendering): void;
2488
+ remove(fixtureId: string, rendering: ComponentRendering): void;
2489
+ private _set;
2490
+ }
2491
+
2492
+ type DebugSplitOrientation = 'horizontal' | 'vertical';
2493
+ interface DebugStackNode {
2494
+ readonly type: 'stack';
2495
+ readonly id: string;
2496
+ readonly entryKeys: readonly string[];
2497
+ readonly activeEntryKey: string;
2498
+ }
2499
+ interface DebugSplitNode {
2500
+ readonly type: 'split';
2501
+ readonly id: string;
2502
+ readonly orientation: DebugSplitOrientation;
2503
+ readonly ratio: number;
2504
+ readonly first: DebugWorkbenchNode;
2505
+ readonly second: DebugWorkbenchNode;
2506
+ }
2507
+ type DebugWorkbenchNode = DebugStackNode | DebugSplitNode;
2508
+
2509
+ declare class DebugWorkbenchStateStore {
2510
+ private readonly _storage?;
2511
+ readonly error: ISettableObservable<string | undefined, void>;
2512
+ private readonly _state;
2513
+ private readonly _bindings;
2514
+ private readonly _storageKey;
2515
+ static forBrowser(projectScope: string): DebugWorkbenchStateStore;
2516
+ constructor(projectScope?: string, _storage?: Pick<Storage, "getItem" | "setItem"> | undefined);
2517
+ readonly synchronized: IObservableWithChange$1<boolean, void>;
2518
+ setSynchronized(enabled: boolean, seedWorkbenchId?: string): void;
2519
+ getEntryKey(workbenchId: string, key: string): string;
2520
+ getPrimaryEntryKey(key: string): string;
2521
+ duplicateEntry(workbenchId: string, key: string): string;
2522
+ getLayout(workbenchId: string, entryKeys: readonly string[], _activeEntryKey?: string): ISettableObservable<DebugWorkbenchNode>;
2523
+ getActiveEntry(workbenchId: string): ISettableObservable<string | undefined>;
2524
+ readActiveEntry(reader: IReader$1 | undefined, workbenchId: string, entryKeys: readonly string[]): string | undefined;
2525
+ private _visibleActiveEntry;
2526
+ getPaneHeight(workbenchId: string): ISettableObservable<number | 'viewport' | undefined>;
2527
+ getPaneFraction(workbenchId: string): ISettableObservable<number>;
2528
+ viewState<T>(workbenchId: string, entryKey: string, fixtureId: string, options: DebugPanelViewStateOptions<T>): DebugPanelViewState<T>;
2529
+ private _binding;
2530
+ private _getState;
2531
+ private _visibleState;
2532
+ private _edit;
2533
+ private _save;
2534
+ private _reportError;
2535
+ }
2536
+
2537
+ type ViewMode = 'session' | 'diff' | 'report';
2538
+ /**
2539
+ * A fixture item to be rendered in the preview area.
2540
+ */
2541
+ interface FixtureItem {
2542
+ readonly id: string;
2543
+ readonly name: string;
2544
+ readonly path: string;
2545
+ readonly component: ComponentDefinition;
2546
+ }
2547
+ /**
2548
+ * A screenshot comparison item for diff mode.
2549
+ */
2550
+ interface ScreenshotComparisonItem {
2551
+ readonly fixtureId: string;
2552
+ readonly name: string;
2553
+ readonly path: string;
2554
+ }
2555
+ interface RevealTreeNodeRequest {
2556
+ readonly id: number;
2557
+ readonly nodeId: string;
2558
+ }
2559
+ /**
2560
+ * A preview row can be a live fixture, a variant group, or a screenshot comparison.
2561
+ */
2562
+ type PreviewRow = {
2563
+ readonly type: 'single';
2564
+ readonly fixture: FixtureItem;
2565
+ } | {
2566
+ readonly type: 'variants';
2567
+ readonly id: string;
2568
+ readonly name: string;
2569
+ readonly path: string;
2570
+ readonly fixtures: readonly FixtureItem[];
2571
+ } | {
2572
+ readonly type: 'screenshot-comparison';
2573
+ readonly id: string;
2574
+ readonly name: string;
2575
+ readonly path: string;
2576
+ readonly items: readonly ScreenshotComparisonItem[];
2577
+ } | {
2578
+ readonly type: 'report-comparison';
2579
+ readonly id: string;
2580
+ readonly name: string;
2581
+ readonly path: string;
2582
+ readonly items: readonly ReportFixtureItem[];
2583
+ };
2584
+ declare const ExplorerModel_base: ViewModelClass<{
2585
+ registry: IPropertyTransformerFactory<FixtureRegistry, FixtureRegistry>;
2586
+ daemonModel: IPropertyTransformerFactory<DaemonModel | undefined, DaemonModel | undefined>;
2587
+ reportModel: IPropertyTransformerFactory<ReportModel | undefined, ReportModel | undefined>;
2588
+ }>;
2589
+ declare class ExplorerModel extends ExplorerModel_base {
2590
+ readonly leftSidebarVisible: ISettableObservable<boolean, void>;
2591
+ readonly rightSidebarVisible: ISettableObservable<boolean, void>;
2592
+ readonly isDarkTheme: ISettableObservable<boolean, void>;
2593
+ readonly selectedNodeId: ISettableObservable<string | undefined, void>;
2594
+ readonly expandedNodeKeys: ISettableObservable<ReadonlySet<string>, void>;
2595
+ readonly revealTreeNodeRequest: ISettableObservable<RevealTreeNodeRequest | undefined, void>;
2596
+ private _nextRevealTreeNodeRequestId;
2597
+ readonly favoriteNodeIds: ISettableObservable<ReadonlySet<string>, void>;
2598
+ readonly viewMode: ISettableObservable<ViewMode, void>;
2599
+ get daemonAvailable(): boolean;
2600
+ get daemon(): DaemonModel | undefined;
2601
+ get reportModel(): ReportModel | undefined;
2602
+ get isReportMode(): boolean;
2603
+ readonly loading: IObservableWithChange$1<boolean, void>;
2604
+ readonly error: IObservableWithChange$1<string | undefined, void>;
2605
+ readonly searchQuery: ISettableObservable<string | undefined, void>;
2606
+ /** The explorer's tree derived from the registry or report */
2607
+ readonly tree: IObservableWithChange$1<ExplorerTreeNode, void>;
2608
+ readonly filteredTree: IObservableWithChange$1<ExplorerTreeNode, void>;
2609
+ readonly sidebarTrees: IObservableWithChange$1<readonly ExplorerTreeNode[], void>;
2610
+ readonly selectedNode: IObservableWithChange$1<ExplorerTreeNode | undefined, void>;
2611
+ /** List of preview rows to render based on current selection and view mode */
2612
+ readonly selectedFixtures: IObservableWithChange$1<readonly PreviewRow[], void>;
2613
+ /** Shared store of per-fixture `input` overrides, edited via the properties panel. */
2614
+ readonly inputStore: FixtureInputStore;
2615
+ /** Explorer-only page viewport size and presentation overrides. */
2616
+ readonly viewportStore: FixtureViewportStore;
2617
+ /** Live rendered fixture instances used by visibility-scoped debug panels. */
2618
+ readonly debugStore: FixtureDebugStore;
2619
+ /** Docking layouts and open-panel selections that survive preview-row recycling. */
2620
+ readonly debugWorkbenchState: DebugWorkbenchStateStore;
2621
+ /** Flattened list of the live fixtures currently shown in the preview area. */
2622
+ readonly renderedFixtures: IObservableWithChange$1<readonly FixtureItem[], void>;
2623
+ setViewMode: (mode: ViewMode) => void;
2624
+ navigateToSession: (sessionName: string) => void;
2625
+ toggleLeftSidebar: () => void;
2626
+ toggleRightSidebar: () => void;
2627
+ toggleTheme: () => void;
2628
+ selectNode: (nodeId: string) => void;
2629
+ toggleNodeExpanded: (treeKind: ExplorerTreeKind, nodeId: string) => void;
2630
+ toggleNodeFavorite: (nodeId: string) => void;
2631
+ revealSelectedNodeInTree: () => void;
2632
+ isNodeExpanded(treeKind: ExplorerTreeKind, nodeId: string, reader: IReader$1): boolean;
2633
+ private _initialExpandedNodes;
2634
+ private _findNode;
2635
+ private _collectPreviewRows;
2636
+ /**
2637
+ * In diff mode: fixtures become screenshot comparison items showing current vs baseline.
2638
+ * Variants become comparison groups.
2639
+ */
2640
+ private _collectDiffRows;
2641
+ private _collectReportRows;
2642
+ }
2643
+
2644
+ declare const TitleBar: React.ComponentType<PropsIn<{
2645
+ model: IPropertyTransformerFactory<ExplorerModel, ExplorerModel>;
2646
+ }>>;
2647
+
2648
+ declare const TitleBarButton: React.ComponentType<{
2649
+ active: boolean;
2650
+ } & {} & {
2651
+ onClick: () => void;
2652
+ title: string;
2653
+ children: React.ReactNode;
2654
+ } & {}>;
2655
+
2656
+ declare const LeftSidebar: React.ComponentType<PropsIn<{
2657
+ model: IPropertyTransformerFactory<ExplorerModel, ExplorerModel>;
2658
+ }>>;
2659
+
2660
+ /**
2661
+ * Properties panel: aggregates the input schemas of every fixture currently rendered in the
2662
+ * preview area and presents one control per shared property. Editing a control updates the
2663
+ * `input` of all fixtures that declare that property (same name + schema), so common values
2664
+ * like a theme can be switched across the whole view at once.
2665
+ */
2666
+ declare const RightSidebar: React.ComponentType<PropsIn<{
2667
+ model: IPropertyTransformerFactory<ExplorerModel, ExplorerModel>;
2668
+ }>>;
2669
+
2670
+ declare const TreeView: React.ComponentType<PropsIn<{
2671
+ model: IPropertyTransformerFactory<ExplorerModel, ExplorerModel>;
2672
+ nodes: IPropertyTransformerFactory<readonly ExplorerTreeNode[], readonly ExplorerTreeNode[]>;
2673
+ depth: IPropertyTransformerFactory<number, number>;
2674
+ treeKind: IPropertyTransformerFactory<ExplorerTreeKind, ExplorerTreeKind>;
2675
+ }>>;
2676
+ declare const TreeItem: React.ComponentType<{
2677
+ model: ExplorerModel;
2678
+ node: ExplorerTreeNode;
2679
+ depth: number;
2680
+ treeKind: ExplorerTreeKind;
2681
+ } & {} & {} & {}>;
2682
+
2683
+ declare const ChevronRightIcon: ({ style }: {
2684
+ style?: React.CSSProperties;
2685
+ }) => React.JSX.Element;
2686
+ declare const ChevronDownIcon: ({ style }: {
2687
+ style?: React.CSSProperties;
2688
+ }) => React.JSX.Element;
2689
+ declare const ComponentIcon: ({ style }: {
2690
+ style?: React.CSSProperties;
2691
+ }) => React.JSX.Element;
2692
+ declare const FolderIcon: ({ style }: {
2693
+ style?: React.CSSProperties;
2694
+ }) => React.JSX.Element;
2695
+ declare const StarIcon: ({ filled }: {
2696
+ filled?: boolean;
2697
+ }) => React.JSX.Element;
2698
+ declare const RevealInTreeIcon: () => React.JSX.Element;
2699
+ declare const PanelLeftIcon: () => React.JSX.Element;
2700
+ declare const PanelRightIcon: () => React.JSX.Element;
2701
+ declare const SunIcon: () => React.JSX.Element;
2702
+ declare const MoonIcon: () => React.JSX.Element;
2703
+
2704
+ declare const styles: {
2705
+ readonly container: {
2706
+ readonly display: "flex";
2707
+ readonly flexDirection: "row";
2708
+ readonly height: "100%";
2709
+ readonly width: "100%";
2710
+ readonly fontFamily: "var(--component-explorer-font-family)";
2711
+ readonly fontSize: "var(--component-explorer-font-size)";
2712
+ readonly color: "var(--component-explorer-foreground)";
2713
+ readonly backgroundColor: "var(--component-explorer-editor-background)";
2714
+ };
2715
+ readonly centerArea: {
2716
+ readonly display: "flex";
2717
+ readonly flexDirection: "column";
2718
+ readonly flex: 1;
2719
+ readonly overflow: "hidden";
2720
+ };
2721
+ readonly titleBar: {
2722
+ readonly display: "flex";
2723
+ readonly alignItems: "center";
2724
+ readonly justifyContent: "space-between";
2725
+ readonly height: "35px";
2726
+ readonly minHeight: "35px";
2727
+ readonly padding: "0 10px";
2728
+ readonly backgroundColor: "var(--component-explorer-titleBar-activeBackground)";
2729
+ readonly color: "var(--component-explorer-titleBar-activeForeground)";
2730
+ readonly borderBottom: "1px solid var(--component-explorer-titleBar-border, var(--component-explorer-panel-border))";
2731
+ };
2732
+ readonly titleBarSection: {
2733
+ readonly display: "flex";
2734
+ readonly alignItems: "center";
2735
+ readonly gap: "2px";
2736
+ };
2737
+ readonly titleBarCenter: {
2738
+ readonly display: "flex";
2739
+ readonly alignItems: "center";
2740
+ readonly gap: "4px";
2741
+ readonly fontSize: "13px";
2742
+ readonly fontWeight: 400;
2743
+ };
2744
+ readonly titleBarButton: {
2745
+ readonly display: "flex";
2746
+ readonly alignItems: "center";
2747
+ readonly justifyContent: "center";
2748
+ readonly width: "28px";
2749
+ readonly height: "28px";
2750
+ readonly border: "none";
2751
+ readonly background: "transparent";
2752
+ readonly color: "var(--component-explorer-titleBar-activeForeground)";
2753
+ readonly cursor: "pointer";
2754
+ readonly borderRadius: "4px";
2755
+ };
2756
+ readonly titleBarButtonHover: {
2757
+ readonly backgroundColor: "var(--component-explorer-toolbar-hoverBackground)";
2758
+ };
2759
+ readonly titleBarButtonActive: {
2760
+ readonly backgroundColor: "var(--component-explorer-toolbar-activeBackground)";
2761
+ readonly color: "var(--component-explorer-focusBorder)";
2762
+ };
2763
+ readonly sidebar: {
2764
+ readonly display: "flex";
2765
+ readonly flexDirection: "column";
2766
+ readonly width: "260px";
2767
+ readonly minWidth: "200px";
2768
+ readonly backgroundColor: "var(--component-explorer-sideBar-background)";
2769
+ readonly borderRight: "1px solid var(--component-explorer-titleBar-border, var(--component-explorer-panel-border))";
2770
+ };
2771
+ readonly sidebarRight: {
2772
+ readonly borderRight: "none";
2773
+ readonly borderLeft: "1px solid var(--component-explorer-titleBar-border, var(--component-explorer-panel-border))";
2774
+ };
2775
+ readonly sidebarHeader: {
2776
+ readonly display: "flex";
2777
+ readonly alignItems: "center";
2778
+ readonly height: "35px";
2779
+ readonly minHeight: "35px";
2780
+ readonly padding: "0 12px";
2781
+ readonly fontSize: "11px";
2782
+ readonly fontWeight: 700;
2783
+ readonly textTransform: "uppercase";
2784
+ readonly letterSpacing: "0.04em";
2785
+ readonly color: "var(--component-explorer-titleBar-activeForeground)";
2786
+ readonly backgroundColor: "var(--component-explorer-titleBar-activeBackground)";
2787
+ readonly borderBottom: "1px solid var(--component-explorer-titleBar-border, var(--component-explorer-panel-border))";
2788
+ };
2789
+ readonly sidebarContent: {
2790
+ readonly flex: 1;
2791
+ readonly overflow: "auto";
2792
+ readonly padding: "4px 0";
2793
+ };
2794
+ readonly treeItem: {
2795
+ readonly display: "flex";
2796
+ readonly alignItems: "center";
2797
+ readonly height: "22px";
2798
+ readonly paddingRight: "8px";
2799
+ readonly cursor: "pointer";
2800
+ readonly userSelect: "none";
2801
+ };
2802
+ readonly treeItemSelected: {
2803
+ readonly backgroundColor: "var(--component-explorer-list-activeSelectionBackground)";
2804
+ readonly color: "var(--component-explorer-list-activeSelectionForeground)";
2805
+ };
2806
+ readonly treeItemHover: {
2807
+ readonly backgroundColor: "var(--component-explorer-list-hoverBackground)";
2808
+ };
2809
+ readonly treeItemChevron: {
2810
+ readonly display: "flex";
2811
+ readonly alignItems: "center";
2812
+ readonly justifyContent: "center";
2813
+ readonly width: "16px";
2814
+ readonly height: "16px";
2815
+ readonly color: "var(--component-explorer-foreground)";
2816
+ readonly opacity: 0.8;
2817
+ readonly cursor: "pointer";
2818
+ };
2819
+ readonly treeItemChevronPlaceholder: {
2820
+ readonly width: "16px";
2821
+ };
2822
+ readonly treeItemIcon: {
2823
+ readonly display: "flex";
2824
+ readonly alignItems: "center";
2825
+ readonly justifyContent: "center";
2826
+ readonly width: "16px";
2827
+ readonly height: "16px";
2828
+ readonly marginRight: "4px";
2829
+ };
2830
+ readonly treeItemLabel: {
2831
+ readonly flex: 1;
2832
+ readonly overflow: "hidden";
2833
+ readonly textOverflow: "ellipsis";
2834
+ readonly whiteSpace: "nowrap";
2835
+ readonly fontSize: "13px";
2836
+ };
2837
+ readonly treeItemCount: {
2838
+ readonly marginLeft: "8px";
2839
+ readonly fontSize: "11px";
2840
+ readonly color: "var(--component-explorer-descriptionForeground)";
2841
+ };
2842
+ readonly mainContent: {
2843
+ readonly flex: 1;
2844
+ readonly display: "flex";
2845
+ readonly alignItems: "center";
2846
+ readonly justifyContent: "center";
2847
+ readonly backgroundColor: "var(--component-explorer-editor-background)";
2848
+ readonly color: "var(--component-explorer-descriptionForeground)";
2849
+ readonly fontSize: "14px";
2850
+ };
2851
+ readonly propertiesPanel: {
2852
+ readonly padding: "12px";
2853
+ };
2854
+ readonly propertyRow: {
2855
+ readonly marginBottom: "12px";
2856
+ };
2857
+ readonly propertyLabel: {
2858
+ readonly fontSize: "12px";
2859
+ readonly color: "var(--component-explorer-foreground)";
2860
+ readonly marginBottom: "4px";
2861
+ };
2862
+ readonly propertyDescription: {
2863
+ readonly fontSize: "11px";
2864
+ readonly color: "var(--component-explorer-descriptionForeground)";
2865
+ readonly marginTop: "2px";
2866
+ };
2867
+ readonly propertyInput: {
2868
+ readonly width: "100%";
2869
+ readonly height: "26px";
2870
+ readonly padding: "0 8px";
2871
+ readonly fontSize: "13px";
2872
+ readonly color: "var(--component-explorer-input-foreground)";
2873
+ readonly backgroundColor: "var(--component-explorer-input-background)";
2874
+ readonly border: "1px solid var(--component-explorer-input-border, transparent)";
2875
+ readonly borderRadius: "2px";
2876
+ readonly outline: "none";
2877
+ readonly boxSizing: "border-box";
2878
+ };
2879
+ readonly propertySelect: {
2880
+ readonly width: "100%";
2881
+ readonly height: "26px";
2882
+ readonly padding: "0 8px";
2883
+ readonly fontSize: "13px";
2884
+ readonly color: "var(--component-explorer-dropdown-foreground)";
2885
+ readonly backgroundColor: "var(--component-explorer-dropdown-background)";
2886
+ readonly border: "1px solid var(--component-explorer-dropdown-border)";
2887
+ readonly borderRadius: "2px";
2888
+ readonly outline: "none";
2889
+ readonly boxSizing: "border-box";
2890
+ readonly cursor: "pointer";
2891
+ };
2892
+ };
2893
+ declare function mergeStyles(...styleObjects: (React.CSSProperties | undefined | false)[]): React.CSSProperties;
2894
+
2895
+ interface ExplorerAppOptions {
2896
+ readonly storageScope?: string;
23
2897
  readonly loadFixtures: (filter?: {
24
2898
  file: string;
25
2899
  }) => Promise<FixtureModules>;
26
2900
  readonly daemonConfig?: DaemonConfig;
27
2901
  }
28
- export declare class ExplorerApp implements ExplorerRuntime {
2902
+ declare class ExplorerApp implements ExplorerRuntime {
29
2903
  private readonly _runtime;
30
2904
  constructor(element: HTMLElement, options: ExplorerAppOptions);
31
2905
  updateFixtures(fixtureModules: FixtureModules): void;
32
2906
  bumpVersion(): void;
33
2907
  }
34
- //# sourceMappingURL=viewer.d.ts.map
2908
+
2909
+ export { ChevronDownIcon, ChevronRightIcon, ComponentIcon, DaemonModel, DebugPanelDefinition, DebugPanelViewState, DebugPanelViewStateOptions, DisplayMode, Explorer, ExplorerApp, ExplorerModel, FixtureExport, FixtureGroupExport, FixtureInputControlOptions, FixtureInputStore, FixturePath, FixtureRegistry, FixtureVariantsExport, FolderIcon, IDisposable$2 as IDisposable, IJsonSchema, LeftSidebar, MoonIcon, PageMode, PanelLeftIcon, PanelRightIcon, RenderContext, RenderHost, RenderResult, RenderReturn, ReportModel, RevealInTreeIcon, RightSidebar, SingleFixtureExport, StarIcon, StyleDefinition, SunIcon, TitleBar, TitleBarButton, TreeItem, TreeView, VIEWPORT_SIZES, aggregateInputProperties, applyInputDefaults, collectComponents, createComponentDefinition, createFixtureTree, effectiveInputValue, findNodeByPath, isComponentDefinition, isFixtureGroup, isFixtureVariants, isSingleFixture, mergeInputSchemas, mergeStyles, parseFixtureExport, parseFixtureGroup, parseFixtureVariants, parseSingleFixture, resolveViewport, styles, toExplorerTree };
2910
+ export type { AggregatedInputProperty, ComponentDefinition, ComponentInputInfo, DaemonCompareResult, DaemonFixtureInfo, DaemonScreenshotResult, ExceptionError, ExplorerAppOptions, ExplorerMode, ExplorerQueryParams, ExplorerRuntime, ExplorerTreeNode, FixtureInputOverride, FixtureModules, FixtureNode, FixtureStatus, ParseResult, RenderEvent, RenderEventType, RenderReport, ReportFixtureEntry, ReportSummary, ScreenshotReport };