@salesforce/storefront-next-runtime 0.1.1-alpha.0 → 0.2.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/dist/DesignComponent.js +150 -0
  2. package/dist/DesignComponent.js.map +1 -0
  3. package/dist/DesignFrame.js +196 -0
  4. package/dist/DesignFrame.js.map +1 -0
  5. package/dist/DesignRegion.js +83 -0
  6. package/dist/DesignRegion.js.map +1 -0
  7. package/dist/apply-url-config.js +130 -0
  8. package/dist/apply-url-config.js.map +1 -0
  9. package/dist/component.types.d.ts +87 -0
  10. package/dist/component.types.d.ts.map +1 -0
  11. package/dist/config.d.ts +2 -0
  12. package/dist/config.js +0 -0
  13. package/dist/design-data.d.ts +983 -0
  14. package/dist/design-data.d.ts.map +1 -0
  15. package/dist/design-data.js +908 -0
  16. package/dist/design-data.js.map +1 -0
  17. package/dist/design-messaging.d.ts +2 -2
  18. package/dist/design-react-core.d.ts +50 -5
  19. package/dist/design-react-core.d.ts.map +1 -1
  20. package/dist/design-react-core.js +81 -2
  21. package/dist/design-react-core.js.map +1 -1
  22. package/dist/design-react.d.ts +20 -95
  23. package/dist/design-react.d.ts.map +1 -1
  24. package/dist/design-react.js +3 -485
  25. package/dist/design-styles.css +2 -1
  26. package/dist/design.d.ts +110 -2
  27. package/dist/design.d.ts.map +1 -0
  28. package/dist/events.d.ts +1 -1
  29. package/dist/index.d.ts +1110 -154
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/multi-site.d.ts +154 -0
  32. package/dist/multi-site.d.ts.map +1 -0
  33. package/dist/multi-site.js +393 -0
  34. package/dist/multi-site.js.map +1 -0
  35. package/dist/routing-app-wrapper.d.ts +18 -0
  36. package/dist/routing-app-wrapper.d.ts.map +1 -0
  37. package/dist/routing-app-wrapper.js +21 -0
  38. package/dist/routing-app-wrapper.js.map +1 -0
  39. package/dist/routing.d.ts +42 -0
  40. package/dist/routing.d.ts.map +1 -0
  41. package/dist/routing.js +171 -0
  42. package/dist/routing.js.map +1 -0
  43. package/dist/scapi.d.ts +69 -5
  44. package/dist/scapi.d.ts.map +1 -1
  45. package/dist/scapi.js +1 -1
  46. package/dist/scapi.js.map +1 -1
  47. package/dist/types.d.ts +40 -13289
  48. package/dist/types.d.ts.map +1 -1
  49. package/dist/types2.d.ts +13293 -0
  50. package/dist/types2.d.ts.map +1 -0
  51. package/dist/types3.d.ts +110 -0
  52. package/dist/types3.d.ts.map +1 -0
  53. package/dist/workspace.d.ts +46 -0
  54. package/dist/workspace.d.ts.map +1 -0
  55. package/dist/workspace.js +52 -0
  56. package/dist/workspace.js.map +1 -0
  57. package/package.json +44 -2
  58. package/dist/design-react.js.map +0 -1
  59. package/dist/index2.d.ts +0 -1171
  60. package/dist/index2.d.ts.map +0 -1
  61. /package/{LICENSE.txt → LICENSE} +0 -0
package/dist/index.d.ts CHANGED
@@ -1,215 +1,1171 @@
1
- //#region src/design/registry/types.d.ts
1
+ import { r as ShopperExperience } from "./types2.js";
2
+
3
+ //#region src/design/messaging-api/domain-types.d.ts
4
+
5
+ interface WithBaseEvent {
6
+ eventType: string;
7
+ }
8
+ /**
9
+ * @inline
10
+ * @hidden
11
+ */
12
+ interface WithComponentId {
13
+ /**
14
+ * The id of the component that the event is related to.
15
+ */
16
+ componentId: string;
17
+ }
18
+ interface WithComponentType {
19
+ /**
20
+ * The component type that the event is related to.
21
+ */
22
+ componentType: string;
23
+ }
24
+ /**
25
+ * @inline
26
+ * @hidden
27
+ */
28
+ interface WithClientVector {
29
+ /**
30
+ * The x position of the event.
31
+ * The position is relative to the client window and does not take any scrolling into account.
32
+ */
33
+ x: number;
34
+ /**
35
+ * The y position of the event.
36
+ * The position is relative to the client window and does not take any scrolling into account.
37
+ */
38
+ y: number;
39
+ }
40
+ interface HostToClientConfiguration {
41
+ /**
42
+ * The components by id that are in the component tree.
43
+ */
44
+ components: Record<string, ComponentInfo>;
45
+ /**
46
+ * A map of component types by id.
47
+ */
48
+ componentTypes: Record<string, ComponentType>;
49
+ /**
50
+ * A map of labels by translation key. These labels will be in the locale of the user.
51
+ */
52
+ labels: Record<string, string>;
53
+ /**
54
+ * The locale to use on the client.
55
+ */
56
+ locale?: string;
57
+ }
2
58
  /**
3
- * Copyright 2026 Salesforce, Inc.
59
+ * The default keys that are forwarded from the host to the client.
60
+ * @hidden
61
+ */
62
+ type DefaultForwardedKeys = 'ArrowUp' | 'ArrowDown' | 'ArrowLeft' | 'ArrowRight' | 'Delete';
63
+ /**
64
+ * Information about a component on the page.
65
+ */
66
+ interface ComponentInfo {
67
+ /**
68
+ * The unique id of the component.
69
+ */
70
+ id: string;
71
+ /**
72
+ * The component type.
73
+ */
74
+ type: string;
75
+ }
76
+ /**
77
+ * Information about a component type.
78
+ */
79
+ interface ComponentType {
80
+ /**
81
+ * The unique id of the component type.
82
+ */
83
+ id: string;
84
+ /**
85
+ * The name of the component type.
86
+ */
87
+ name: string;
88
+ /**
89
+ * The image of the component type.
90
+ */
91
+ image: string;
92
+ /**
93
+ * The label for the component type.
94
+ */
95
+ label: string;
96
+ }
97
+ /**
98
+ * Emitted by the client to establish a connection with the host.
99
+ * This event should be emitted by the client on an interval until a ClientAcknowledgedEvent is received from the host.
4
100
  *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
101
+ * - If there is already a registered client with the host with the same client name,
102
+ * the old client will be replaced with the new one.
103
+ * - If there is already a registered client with the host with a different client id,
104
+ * an error will be thrown.
8
105
  *
9
- * http://www.apache.org/licenses/LICENSE-2.0
106
+ * A client is a 1 to 1 with a host.
10
107
  *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
108
+ * ```mermaid
109
+ * sequenceDiagram
110
+ * Client->>Host: ClientInitializedEvent
111
+ * Host->>Client: ClientAcknowledgedEvent
112
+ * Client->>Host: ClientReadyEvent
113
+ * activate Client
114
+ * Client->>Host: ComponentSelectedEvent
115
+ * Host->>Client: ComponentPropertiesChangedEvent
116
+ * ```
117
+ *
118
+ * If the host is not ready to register the client, the client should retry at an interval until the host is ready.
119
+ *
120
+ * ```mermaid
121
+ * sequenceDiagram
122
+ * Client-->>Host: ClientInitializedEvent
123
+ * Client-->>Host: ClientInitializedEvent
124
+ * Client->>Host: ClientInitializedEvent
125
+ * Host->>Client: ClientAcknowledgedEvent
126
+ * Client->>Host: ClientReadyEvent
127
+ * activate Client
128
+ * Client->>Host: ComponentSelectedEvent
129
+ * Host->>Client: ComponentPropertiesChangedEvent
130
+ * ```
131
+ *
132
+ * @see {ClientAcknowledgedEvent}
133
+ * @target host
134
+ * @group Events
16
135
  */
17
-
18
- /* ==================== Framework Agnostic Types ==================== */
19
-
136
+ interface ClientInitializedEvent extends WithBaseEvent {
137
+ eventType: 'ClientInitialized';
138
+ /**
139
+ * The id to use for the client.
140
+ */
141
+ clientId: string;
142
+ /**
143
+ * The keys that are forwarded from the host to the client.
144
+ */
145
+ forwardedKeys?: string[];
146
+ /**
147
+ * The user session ID.
148
+ */
149
+ usid?: string;
150
+ }
151
+ interface ClientReady extends WithBaseEvent {
152
+ eventType: 'ClientReady';
153
+ /**
154
+ * The id to use for the client.
155
+ */
156
+ clientId: string;
157
+ }
158
+ /**
159
+ * Emits when a client disconnects from the host.
160
+ * This event may not fire depending on the circumstances of the disconnect.
161
+ * For example, if a crash occurs in the client environment, the event may not fire.
162
+ * @target host
163
+ * @group Events
164
+ */
165
+ interface ClientDisconnectedEvent extends WithBaseEvent {
166
+ eventType: 'ClientDisconnected';
167
+ /**
168
+ * The id of the client that disconnected.
169
+ */
170
+ clientId: string;
171
+ /**
172
+ * Whether the client is attempting to reconnect to the host.
173
+ * This occurs when the client as a configuration change.
174
+ */
175
+ reconnect: boolean;
176
+ }
177
+ /**
178
+ * Emits when the components in the client configuration change.
179
+ * @target client
180
+ * @group Events
181
+ */
182
+ interface ClientPageChangedEvent extends WithBaseEvent {
183
+ eventType: 'ClientPageChanged';
184
+ /**
185
+ * The page data from the client.
186
+ */
187
+ page: ShopperExperience.schemas['Page'];
188
+ }
189
+ /**
190
+ * Emits when the host disconnects from the client.
191
+ * @target client
192
+ * @group Events
193
+ */
194
+ interface HostDisconnected extends WithBaseEvent {
195
+ eventType: 'HostDisconnected';
196
+ }
20
197
  /**
21
- * Unique identifier for a component type.
198
+ * Emits from the host to the client to acknowledge that the client has been initialized.
199
+ * This event must be received by the client before any other events can be emitted from the client.
200
+ * @target client
201
+ * @group Events
22
202
  */
23
- type ComponentId = string;
203
+ interface ClientAcknowledgedEvent extends WithBaseEvent, HostToClientConfiguration {
204
+ eventType: 'ClientAcknowledged';
205
+ }
206
+ /**
207
+ * Emits when the client configuration changes from the host since the last ClientAcknowledgedEvent.
208
+ * @target client
209
+ * @group Events
210
+ */
211
+ interface ClientConfigurationChangedEvent extends WithBaseEvent, HostToClientConfiguration {
212
+ eventType: 'ClientConfigurationChanged';
213
+ }
24
214
  /**
25
- * Loader and fallback function names for external invocation.
215
+ * Emits when dragging from the host enters the client window.
216
+ * @target client
217
+ * @group Events
26
218
  */
27
- interface LoaderNames {
28
- /** Server-side loader function name */
29
- loader?: string;
30
- /** Client-side loader function name */
31
- clientLoader?: string;
32
- /** Fallback component function name */
33
- fallback?: string;
219
+ interface ClientWindowDragEnteredEvent extends WithBaseEvent, WithComponentType {
220
+ eventType: 'ClientWindowDragEntered';
34
221
  }
35
222
  /**
36
- * Shape of a dynamically imported component module.
37
- * This is what import.meta.glob() returns for each component.
223
+ * Emits when dragging from the host moves over the client window.
224
+ * @target client
225
+ * @group Events
38
226
  */
39
- interface ComponentModule<TProps, TFrameworkComponent = unknown> {
40
- /** The main component export */
41
- default: TFrameworkComponent;
42
- /** Optional fallback component for Suspense boundaries */
43
- fallback?: TFrameworkComponent;
44
- /** Any additional exports (loaders, etc.) */
45
- [key: string]: unknown;
227
+ interface ClientWindowDragMovedEvent extends WithBaseEvent, WithClientVector, WithComponentType {
228
+ eventType: 'ClientWindowDragMoved';
46
229
  }
47
230
  /**
48
- * Generic design metadata interface - framework agnostic.
49
- * Different frameworks can extend this with their specific metadata.
231
+ * Emits when dragging from the host exits the client window.
232
+ * @target client
233
+ * @group Events
50
234
  */
51
- interface DesignMetadata {
52
- /** Component identifier */
53
- id?: string;
54
- /** Component name for display */
55
- name?: string;
56
- /** Component group/category */
57
- group?: string;
58
- /** Component description */
59
- description?: string;
60
- /** Additional framework-specific metadata */
61
- [key: string]: any;
235
+ interface ClientWindowDragExitedEvent extends WithBaseEvent, WithComponentType {
236
+ eventType: 'ClientWindowDragExited';
62
237
  }
63
238
  /**
64
- * Internal registry entry for a component.
65
- * Framework agnostic - no specific component types.
239
+ * Emits when dragging from the host is released over the client window.
240
+ * @target client
241
+ * @group Events
66
242
  */
67
- interface Entry<TProps, TFrameworkComponent = unknown> {
68
- /** Component identifier */
69
- id: ComponentId;
70
- /** Eagerly loaded component (if registered directly) */
71
- raw: TFrameworkComponent | null;
72
- /** Lazily loaded component (if discovered via dynamic import) */
73
- lazy?: TFrameworkComponent;
74
- /** Dynamic importer function */
75
- import?: () => Promise<ComponentModule<TProps, TFrameworkComponent>>;
76
- /** Fallback component for loading states */
77
- fallback?: TFrameworkComponent;
78
- /** Loader function names for external invocation */
79
- loaderNames?: LoaderNames;
243
+ interface ClientWindowDragDroppedEvent extends WithBaseEvent, WithComponentType {
244
+ eventType: 'ClientWindowDragDropped';
80
245
  }
81
246
  /**
82
- * Framework adapter interface.
83
- * Each framework implements this to provide framework-specific behavior.
247
+ * Emits when a component's properties change.
248
+ * @target client
249
+ * @group Events
84
250
  */
85
- interface FrameworkAdapter<TProps, TFrameworkComponent = unknown> {
251
+ interface ComponentPropertiesChangedEvent<TProps extends Record<string, unknown> = Record<string, unknown>> extends WithBaseEvent, WithComponentId {
252
+ eventType: 'ComponentPropertiesChanged';
86
253
  /**
87
- * Creates a lazy-loaded component from an importer function.
254
+ * The new properties of the component.
88
255
  */
89
- createLazyComponent(importer: () => Promise<ComponentModule<TProps, TFrameworkComponent>>): TFrameworkComponent;
90
-
256
+ properties: TProps;
257
+ }
258
+ /**
259
+ * Emits when a component is focused.
260
+ * @target client
261
+ * @group Events
262
+ */
263
+ interface ComponentFocusedEvent extends WithBaseEvent, WithComponentId {
264
+ eventType: 'ComponentFocused';
265
+ }
266
+ /**
267
+ * Event emitted from the host to the client when a key is pressed.
268
+ * Used to forward keypress events from the host environment to the client.
269
+ *
270
+ * @template TKey - The type of key being forwarded.
271
+ * @target client
272
+ * @group Events
273
+ */
274
+ interface HostKeyPressedEvent<TKey extends string = DefaultForwardedKeys> extends WithBaseEvent {
275
+ eventType: 'HostKeyPressed';
276
+ key: TKey;
277
+ }
278
+ /**
279
+ * Emits when the page settings are modified within the host.
280
+ * @target client
281
+ * @group Events
282
+ */
283
+ interface PageSettingsChangedEvent<TSettings extends Record<string, unknown> = Record<string, unknown>> extends WithBaseEvent {
284
+ eventType: 'PageSettingsChanged';
285
+ settings: TSettings;
286
+ }
287
+ /**
288
+ * Emits when the media is changed on the host.
289
+ * Media would include images, videos, style sheets, etc.
290
+ * @target client
291
+ * @group Events
292
+ */
293
+ interface MediaChangedEvent extends WithBaseEvent {
294
+ eventType: 'MediaChanged';
295
+ }
296
+ /**
297
+ * Emits when the clients window is scrolled.
298
+ * @target host
299
+ * @group Events
300
+ */
301
+ interface WindowScrollChangedEvent extends WithBaseEvent {
302
+ eventType: 'WindowScrollChanged';
303
+ /**
304
+ * The horizontal scroll position of the window.
305
+ */
306
+ scrollX?: number;
307
+ /**
308
+ * The vertical scroll position of the window.
309
+ */
310
+ scrollY?: number;
311
+ }
312
+ /**
313
+ * Emits when a component is moved to a different region of a component.
314
+ * @target isomorphic
315
+ * @group Events
316
+ */
317
+ interface ComponentMovedToRegionEvent extends WithBaseEvent, WithComponentId {
318
+ eventType: 'ComponentMovedToRegion';
319
+ /**
320
+ * The id of the component that comes before the insert component.
321
+ */
322
+ beforeComponentId?: string;
323
+ /**
324
+ * The id of the component that comes afterthe insert component.
325
+ */
326
+ afterComponentId?: string;
327
+ /**
328
+ * The id of the component this component should be inserted before or after.
329
+ * If not provided, then it is up to the host to determine where in the target region this is inserted.
330
+ */
331
+ insertComponentId?: string;
332
+ /**
333
+ * When an insertComponentId is provided, this will insert the new component before or after the component with that component id.
334
+ */
335
+ insertType?: 'before' | 'after';
336
+ /**
337
+ * The id of the component that owns the region this component is being moved to.
338
+ */
339
+ targetComponentId: string;
340
+ /**
341
+ * The id of the region that the component is being moved to.
342
+ */
343
+ targetRegionId: string;
344
+ /**
345
+ * The region that the component is being moved from.
346
+ */
347
+ sourceRegionId: string;
348
+ }
349
+ /**
350
+ * Emits when a component is hovered over.
351
+ * @target isomorphic
352
+ * @group Events
353
+ */
354
+ interface ComponentHoveredInEvent extends WithBaseEvent, WithComponentId {
355
+ eventType: 'ComponentHoveredIn';
356
+ }
357
+ /**
358
+ * Emits when a component is hovered out of.
359
+ * @target isomorphic
360
+ * @group Events
361
+ */
362
+ interface ComponentHoveredOutEvent extends WithBaseEvent, WithComponentId {
363
+ eventType: 'ComponentHoveredOut';
364
+ }
365
+ /**
366
+ * Emits when a component is selected.
367
+ * @target isomorphic
368
+ * @group Events
369
+ */
370
+ interface ComponentSelectedEvent extends WithBaseEvent, WithComponentId {
371
+ eventType: 'ComponentSelected';
372
+ }
373
+ /**
374
+ * Emits when a component is deselected.
375
+ * @target isomorphic
376
+ * @group Events
377
+ */
378
+ interface ComponentDeselectedEvent extends WithBaseEvent, WithComponentId {
379
+ eventType: 'ComponentDeselected';
380
+ }
381
+ /**
382
+ * Emits when a component is deleted.
383
+ * @target isomorphic
384
+ * @group Events
385
+ */
386
+ interface ComponentDeletedEvent extends WithBaseEvent, WithComponentId {
387
+ eventType: 'ComponentDeleted';
388
+ /**
389
+ * The id of the component that the component was deleted from.
390
+ */
391
+ sourceComponentId: string;
91
392
  /**
92
- * Decorates a component with design-time capabilities.
93
- * Each framework adapter implements its own decoration logic.
393
+ * The region that the component was deleted from.
94
394
  */
95
- decorateComponent(component: TFrameworkComponent): TFrameworkComponent;
395
+ sourceRegionId: string;
96
396
  }
97
397
  /**
98
- * Configuration options for ComponentRegistry.
99
- * Framework agnostic with adapter injection.
398
+ * Emits when a component is added to a region of a component.
399
+ * @template TProps - The type of the component properties.
400
+ * @target isomorphic
401
+ * @group Events
100
402
  */
101
- interface ComponentRegistryOptions<TProps, TFrameworkComponent> {
403
+ interface ComponentAddedToRegionEvent<TProps extends Record<string, unknown> = Record<string, unknown>> extends WithBaseEvent {
404
+ eventType: 'ComponentAddedToRegion';
405
+ /**
406
+ * The specifier of the component to add.
407
+ * This will be used to lookup the component in the registry.
408
+ */
409
+ componentType: string;
102
410
  /**
103
- * Framework adapter for framework-specific operations.
104
- * The adapter handles all framework-specific behavior including decoration.
411
+ * The properties of the component to add.
412
+ * These will be used to initialize the component.
105
413
  */
106
- adapter: FrameworkAdapter<TProps, TFrameworkComponent>;
414
+ componentProperties: TProps;
415
+ /**
416
+ * The id of the component that owns the region this component is being added to.
417
+ */
418
+ targetComponentId: string;
419
+ /**
420
+ * The id of the region that the component is being added to.
421
+ */
422
+ targetRegionId: string;
423
+ /**
424
+ * When an insertComponentId is provided, this will insert the new component before or after the component with that component id.
425
+ */
426
+ insertType?: 'before' | 'after';
427
+ /**
428
+ * The id of the component this component should be inserted before or after.
429
+ * If not provided, then it is up to the host to determine where in the target region this is inserted.
430
+ */
431
+ insertComponentId?: string;
432
+ /**
433
+ * The id of the component that comes before the insert component.
434
+ */
435
+ beforeComponentId?: string;
436
+ /**
437
+ * The id of the component that comes afterthe insert component.
438
+ */
439
+ afterComponentId?: string;
440
+ }
441
+ /**
442
+ * Emits when a component drag starts from the host or client.
443
+ * @target isomorphic
444
+ * @group Events
445
+ */
446
+ interface ComponentDragStartedEvent extends WithBaseEvent {
447
+ eventType: 'ComponentDragStarted';
448
+ /**
449
+ * The type of the component that is being dragged.
450
+ */
451
+ componentType: string;
452
+ }
453
+ /**
454
+ * Emits when an error occurs.
455
+ * @target isomorphic
456
+ * @group Events
457
+ */
458
+ interface ErrorEvent extends WithBaseEvent {
459
+ eventType: 'Error';
460
+ /**
461
+ * The error message.
462
+ */
463
+ message: string;
464
+ /**
465
+ * TODO: Add error codes if we need the app to recover from the error.
466
+ * Add once scenarios are defined.
467
+ */
468
+ code?: unknown;
107
469
  }
108
470
  //#endregion
109
- //#region src/design/registry/registry.d.ts
471
+ //#region src/design/messaging-api/api-types.d.ts
472
+ type Source = 'host' | 'client';
110
473
  /**
111
- * Framework-agnostic ComponentRegistry manages component loading with static registration.
112
- *
113
- * Features:
114
- * - Framework agnostic core with adapter pattern
115
- * - Lazy loading via framework adapters for code splitting
116
- * - Static component registration via build plugins (no dynamic discovery)
117
- * - Design mode decoration via framework adapters
118
- * - Request deduplication for concurrent component loads
119
- * - Component metadata handled via API (not stored in registry)
120
- *
121
- * @template TProps - Component props type
122
- *
123
- * @example
124
- * ```tsx
125
- * const registry = new ComponentRegistry({
126
- * adapter: new ReactAdapter(),
127
- * designDecorator: createDesignDecorator,
128
- * });
474
+ * A type that adds metadata to an event.
475
+ * @inline
476
+ * @expand
477
+ * @hidden
478
+ */
479
+ interface WithMeta {
480
+ /**
481
+ * Metadata attached to an event.
482
+ */
483
+ meta: {
484
+ /**
485
+ * Indicates that the event is part of the messaging api.
486
+ * Primarily used to distinguish messages events from other services.
487
+ */
488
+ pdMessagingApi: true;
489
+ /**
490
+ * The source of the event.
491
+ * Since some events are bidirectional, we need to know which side the event is coming from.
492
+ */
493
+ source: Source;
494
+ /**
495
+ * The id of the connected client.
496
+ */
497
+ clientId?: string;
498
+ /**
499
+ * The id of the connected host.
500
+ */
501
+ hostId?: string;
502
+ };
503
+ }
504
+ type EventPayload<TEvent> = Omit<TEvent, 'eventType' | 'meta'>;
505
+ /**
506
+ * The mapping of events, emitted on the host and client, to their corresponding event and API name.
507
+ * @hidden
508
+ */
509
+ interface IsomorphicEventNameMapping {
510
+ ComponentDragStarted: ComponentDragStartedEvent;
511
+ ComponentHoveredIn: ComponentHoveredInEvent;
512
+ ComponentHoveredOut: ComponentHoveredOutEvent;
513
+ ComponentSelected: ComponentSelectedEvent;
514
+ ComponentDeselected: ComponentDeselectedEvent;
515
+ ComponentAddedToRegion: ComponentAddedToRegionEvent;
516
+ ComponentDeleted: ComponentDeletedEvent;
517
+ ComponentMovedToRegion: ComponentMovedToRegionEvent;
518
+ WindowScrollChanged: WindowScrollChangedEvent;
519
+ Error: ErrorEvent;
520
+ }
521
+ /**
522
+ * The mapping of host events, emitted on the host, to their corresponding event and API name.
523
+ * @hidden
524
+ */
525
+ interface HostEventNameMapping extends IsomorphicEventNameMapping {
526
+ ClientInitialized: ClientInitializedEvent;
527
+ ClientReady: ClientReady;
528
+ ClientDisconnected: ClientDisconnectedEvent;
529
+ ClientPageChanged: ClientPageChangedEvent;
530
+ }
531
+ /**
532
+ * The mapping of client events to their corresponding event.
533
+ * @hidden
534
+ */
535
+ interface ClientEventNameMapping extends IsomorphicEventNameMapping {
536
+ HostDisconnected: HostDisconnected;
537
+ PageSettingsChanged: PageSettingsChangedEvent;
538
+ HostKeyPressed: HostKeyPressedEvent;
539
+ ClientAcknowledged: ClientAcknowledgedEvent;
540
+ ClientConfigurationChanged: ClientConfigurationChangedEvent;
541
+ ClientWindowDragEntered: ClientWindowDragEnteredEvent;
542
+ ClientWindowDragMoved: ClientWindowDragMovedEvent;
543
+ ClientWindowDragExited: ClientWindowDragExitedEvent;
544
+ ClientWindowDragDropped: ClientWindowDragDroppedEvent;
545
+ ComponentPropertiesChanged: ComponentPropertiesChangedEvent;
546
+ MediaChangedEvent: MediaChangedEvent;
547
+ ComponentFocused: ComponentFocusedEvent;
548
+ }
549
+ /**
550
+ * @hidden
551
+ */
552
+ type ClientMessage = ClientEventNameMapping[keyof ClientEventNameMapping];
553
+ /**
554
+ * @hidden
555
+ */
556
+ type HostMessage = HostEventNameMapping[keyof HostEventNameMapping];
557
+ /**
558
+ * @hidden
559
+ */
560
+ type EventTypeName = keyof HostEventNameMapping | keyof ClientEventNameMapping;
561
+ /**
562
+ * @inline
563
+ * @expand
564
+ * @hidden
565
+ */
566
+ type WithEventType<TMapping, TEvent extends keyof TMapping = keyof TMapping> = {
567
+ /**
568
+ * The event type of the event.
569
+ */
570
+ eventType: TEvent;
571
+ };
572
+ /**
573
+ * The type of a handler for an event.
129
574
  *
130
- * // Components are pre-registered via static registry plugin
131
- * // Get a component
132
- * const Hero = registry.getComponent('hero');
575
+ * @template TMapping - The mapping of event names to their payload types.
576
+ * @template TEvent - The type of the event.
577
+ * @template TPartial - Whether the event is partial.
578
+ */
579
+ type EventHandler<TMapping, TEvent extends keyof TMapping = keyof TMapping, TPartial = false> = (event: TPartial extends true ? Readonly<Partial<WithMeta & WithEventType<TMapping, TEvent> & TMapping[TEvent]>> : Readonly<WithMeta & WithEventType<TMapping, TEvent> & TMapping[TEvent]>) => unknown;
580
+ /**
581
+ * An emitter that will perform the underlying communication with the client or host.
582
+ */
583
+ interface MessageEmitter<TInMapping, TOutMapping> {
584
+ /**
585
+ * Sends a message to the other side of the connection.
586
+ * @param message - The message to send.
587
+ */
588
+ postMessage(message: WithMeta & WithEventType<TOutMapping>): void;
589
+ /**
590
+ * Provides a handler for incoming messages.
591
+ * The provided handler will determine if the message is for the messaging api and direct it accordingly.
592
+ * @param handler
593
+ * @returns A function to remove the event listener.
594
+ */
595
+ addEventListener(handler: EventHandler<TInMapping, keyof TInMapping, true>): () => void;
596
+ }
597
+ /**
598
+ * Configuration that applies for both host and client.
133
599
  *
134
- * // Preload for SSR
135
- * await registry.preload('hero');
136
- * ```
600
+ * @inline
601
+ * @expand
602
+ * @hidden
603
+ * @stability development
604
+ */
605
+ interface IsomorphicConfiguration {
606
+ /**
607
+ * The id of the client.
608
+ */
609
+ id: string;
610
+ /**
611
+ * A logger for logging all messages.
612
+ */
613
+ logger?: (message: unknown, source: 'host' | 'client') => void;
614
+ }
615
+ interface ClientConfiguration extends IsomorphicConfiguration {
616
+ /**
617
+ * The underlying message emitter that will be used to send events.
618
+ */
619
+ emitter: MessageEmitter<ClientEventNameMapping, HostEventNameMapping>;
620
+ /**
621
+ * The keys that are forwarded from the host to the client.
622
+ */
623
+ forwardedKeys?: string[];
624
+ }
625
+ interface HostConfiguration extends IsomorphicConfiguration {
626
+ /**
627
+ * The underlying message emitter that will be used to send events.
628
+ */
629
+ emitter: MessageEmitter<HostEventNameMapping, ClientEventNameMapping>;
630
+ }
631
+ /**
632
+ * @inline
633
+ * @hidden
634
+ */
635
+ interface IsomorphicApi {
636
+ /**
637
+ * Starts a component drag operation.
638
+ * This method initiates dragging of a specific component, typically in response
639
+ * to user interaction or programmatic requirements.
640
+ *
641
+ * @param event - The component drag start event
642
+ * @param event.componentId - The ID of the component to start dragging
643
+ * @param event.x - The x position where the drag operation starts
644
+ * @param event.y - The y position where the drag operation starts
645
+ * @stability development
646
+ *
647
+ * @example
648
+ * ```typescript
649
+ * api.startComponentDrag({
650
+ * componentId: 'draggable-component',
651
+ * x: 100,
652
+ * y: 150
653
+ * });
654
+ * ```
655
+ *
656
+ * @see {Domain.ComponentDragStartedEvent}
657
+ */
658
+ startComponentDrag(event: EventPayload<ComponentDragStartedEvent>): void;
659
+ /**
660
+ * Moves a component to a different region of a component.
661
+ *
662
+ * @param event - The component move event containing the component and region information
663
+ * @param event.componentId - The ID of the component to move
664
+ * @param event.targetComponentId - The ID of the component where the component is being moved to
665
+ * @param event.targetRegionId - The ID of the region that the component is being moved to
666
+ * @stability development
667
+ *
668
+ * @example
669
+ * ```typescript
670
+ * api.moveComponentToRegion({
671
+ * componentId: 'component-123',
672
+ * targetComponentId: 'parent-component',
673
+ * targetRegionId: 'content-region'
674
+ * sourceRegionId: 'source-content-region'
675
+ * sourceComponentId: 'source-component'
676
+ * });
677
+ * ```
678
+ * @see {Domain.ComponentMovedToRegionEvent}
679
+ */
680
+ moveComponentToRegion(event: EventPayload<ComponentMovedToRegionEvent>): void;
681
+ /**
682
+ * Notifies the host that a component is being hovered over.
683
+ *
684
+ * @param event - The component hover event containing the component ID
685
+ * @param event.componentId - The ID of the component being hovered over
686
+ * @stability development
687
+ *
688
+ * @example
689
+ * ```typescript
690
+ * api.hoverInToComponent({
691
+ * componentId: 'component-123'
692
+ * });
693
+ * ```
694
+ */
695
+ hoverInToComponent(event: EventPayload<ComponentHoveredInEvent>): void;
696
+ /**
697
+ * Notifies the host that a component is no longer being hovered over.
698
+ *
699
+ * @param event - The component hover exit event containing the component ID
700
+ * @param event.componentId - The ID of the component that was hovered over
701
+ * @stability development
702
+ *
703
+ * @example
704
+ * ```typescript
705
+ * api.hoverOutOfComponent({
706
+ * componentId: 'component-123'
707
+ * });
708
+ * ```
709
+ */
710
+ hoverOutOfComponent(event: EventPayload<ComponentHoveredOutEvent>): void;
711
+ /**
712
+ * Notifies the host that a component has been selected.
713
+ *
714
+ * @param event - The component selection event containing the component ID
715
+ * @param event.componentId - The ID of the component that was selected
716
+ * @stability development
717
+ *
718
+ * @example
719
+ * ```typescript
720
+ * api.selectComponent({
721
+ * componentId: 'component-123'
722
+ * });
723
+ * ```
724
+ */
725
+ selectComponent(event: EventPayload<ComponentSelectedEvent>): void;
726
+ /**
727
+ * Notifies the host that a component has been deselected.
728
+ *
729
+ * @param event - The component deselection event containing the component ID
730
+ * @param event.componentId - The ID of the component that was deselected
731
+ * @stability development
732
+ *
733
+ * @example
734
+ * ```typescript
735
+ * api.deselectComponent({
736
+ * componentId: 'component-123'
737
+ * });
738
+ * ```
739
+ */
740
+ deselectComponent(event: EventPayload<ComponentDeselectedEvent>): void;
741
+ /**
742
+ * Notifies the host that a component has been added to a specific region of another component.
743
+ *
744
+ * @param event - The component addition event containing component and region information
745
+ * @param event.targetComponentId - The ID of the component that owns the region
746
+ * @param event.targetRegionId - The ID of the region where the component is being added
747
+ * @param event.sourceComponentId - The ID of the component being added to the region
748
+ * @stability development
749
+ *
750
+ * @example
751
+ * ```typescript
752
+ * api.addComponentToRegion({
753
+ * targetComponentId: 'parent-component',
754
+ * targetRegionId: 'content-region',
755
+ * componentId: 'child-component'
756
+ * });
757
+ * ```
758
+ */
759
+ addComponentToRegion(event: EventPayload<ComponentAddedToRegionEvent>): void;
760
+ /**
761
+ * Notifies the host that a component has been deleted.
762
+ *
763
+ * @param event - The component deletion event containing the component ID
764
+ * @param event.componentId - The ID of the component that was deleted
765
+ * @param event.sourceComponentId - The ID of the component that the component was deleted from
766
+ * @param event.sourceRegionId - The ID of the region that the component was deleted from
767
+ * @stability development
768
+ *
769
+ * @example
770
+ * ```typescript
771
+ * api.deleteComponent({
772
+ * componentId: 'component-123',
773
+ * sourceComponentId: 'parent-component',
774
+ * sourceRegionId: 'content-region'
775
+ * });
776
+ * ```
777
+ */
778
+ deleteComponent(event: EventPayload<ComponentDeletedEvent>): void;
779
+ /**
780
+ * Notifies that an error has occurred.
781
+ *
782
+ * @param event - The error event containing the error message and stack trace
783
+ * @param event.message - The error message
784
+ * @param event.stack - The stack trace of the error
785
+ * @stability development
786
+ *
787
+ * @example
788
+ * ```typescript
789
+ * api.notifyError({
790
+ * message: 'An error occurred',
791
+ * stack: 'Error: An error occurred\n at ...'
792
+ * });
793
+ * ```
794
+ */
795
+ notifyError(event: EventPayload<ErrorEvent>): void;
796
+ /**
797
+ * Notifies the host that the client window scroll position has changed.
798
+ *
799
+ * @param event - The window scroll change event containing the new scroll positions
800
+ * @param event.scrollX - The horizontal scroll position of the window
801
+ * @param event.scrollY - The vertical scroll position of the window
802
+ * @stability development
803
+ *
804
+ * @example
805
+ * ```typescript
806
+ * api.notifyWindowScrollChanged({
807
+ * scrollX: 100,
808
+ * scrollY: 200
809
+ * });
810
+ * ```
811
+ */
812
+ notifyWindowScrollChanged(event: Partial<EventPayload<WindowScrollChangedEvent>>): void;
813
+ /**
814
+ * Gets the id of the remote side of the connection.
815
+ * @returns The id of the remote side of the connection.
816
+ */
817
+ getRemoteId(): string | undefined;
818
+ }
819
+ interface ClientApi extends IsomorphicApi {
820
+ /**
821
+ * Disconnects the client from the host.
822
+ * @param options - Optional configuration for the disconnection process
823
+ * @param options.isReconnecting - Whether the client is attempting to reconnect to the host.
824
+ */
825
+ disconnect(options?: {
826
+ isReconnecting?: boolean;
827
+ }): void;
828
+ /**
829
+ * Connects the client or host to the messaging api.
830
+ * This should be called when the client or host is initialized.
831
+ * This will start listening for events from the other side.
832
+ *
833
+ * @param options - Optional configuration for the connection process
834
+ * @param options.interval - Optional interval in milliseconds for retrying initialization
835
+ * @param options.timeout - Optional timeout in milliseconds for the connection process
836
+ * @param options.prepareClient - Optional function to prepare the client for the connection process
837
+ * @returns The client acknowledged event
838
+ * @stability development
839
+ *
840
+ * @example
841
+ * ```typescript
842
+ * await api.connect({ interval: 1_000 });
843
+ * // Connected to host.
844
+ *
845
+ * // With prepare logic
846
+ * await api.connect({ prepareClient: async () => await doSomethingAsync() });
847
+ * ```
848
+ */
849
+ connect(options?: {
850
+ interval?: number;
851
+ prepareClient?: () => Promise<void>;
852
+ timeout?: number;
853
+ onHostConnected?: (event: HostToClientConfiguration) => void;
854
+ onHostDisconnected?: (reconnect: () => void) => void;
855
+ onError?: (error: Error) => void;
856
+ usid?: string;
857
+ }): void;
858
+ /**
859
+ * Notifies the host that the client is ready.
860
+ *
861
+ * @param event - The client ready event
862
+ * @stability development
863
+ *
864
+ * @example
865
+ * ```typescript
866
+ * api.notifyClientReady({});
867
+ * ```
868
+ *
869
+ * @see {Domain.ClientReady}
870
+ */
871
+ notifyClientReady(event: EventPayload<ClientReady>): void;
872
+ /**
873
+ * Notifies the host that the client components have changed.
874
+ *
875
+ * @param event - The client components change event containing the new components
876
+ * @stability development
877
+ *
878
+ * @example
879
+ * ```typescript
880
+ * api.notifyClientComponentsChanged({ components: { ... }});
881
+ * ```
882
+ */
883
+ notifyClientPageChanged(event: EventPayload<ClientPageChangedEvent>): void;
884
+ /**
885
+ * Registers an event handler for client-side events.
886
+ *
887
+ * @template TEvent - The type of client event to listen for
888
+ * @param event - The name of the event to listen for
889
+ * @param handler - The callback function that will be invoked when the event occurs
890
+ * @returns A function to remove the event listener.
891
+ * @stability development
892
+ *
893
+ * @example
894
+ * ```typescript
895
+ * api.on('ComponentSelected', (event) => {
896
+ * console.log('Component selected:', event.componentId);
897
+ * });
898
+ * ```
899
+ */
900
+ on<TEvent extends keyof ClientEventNameMapping>(event: TEvent, handler: (handlerEvent: Readonly<WithMeta & ClientEventNameMapping[TEvent]>) => void): () => void;
901
+ on(event: 'Event', handler: (handlerEvent: Readonly<WithMeta & ClientMessage>) => void): () => void;
902
+ }
903
+ /**
904
+ * A function that returns a promise that resolves to the client acknowledged event.
905
+ * This is used to configure the client when it is initialized.
137
906
  */
138
- declare class ComponentRegistry<TProps, TFrameworkComponent = unknown> {
139
- private readonly registry;
140
- private readonly pending;
141
- private readonly cancelled;
142
- private readonly adapter;
143
- constructor({
144
- adapter
145
- }: ComponentRegistryOptions<TProps, TFrameworkComponent>);
907
+ type ConfigFactory = () => Promise<EventPayload<ClientAcknowledgedEvent>>;
908
+ interface HostApi extends IsomorphicApi {
909
+ /**
910
+ * Disconnects the host instance.
911
+ * This will remove all event listeners and clean up any resources.
912
+ *
913
+ * @stability development
914
+ *
915
+ * @example
916
+ * ```typescript
917
+ * api.disconnect();
918
+ * ```
919
+ */
920
+ disconnect(): void;
921
+ /**
922
+ * Connects the client or host to the messaging api.
923
+ * This should be called when the client or host is initialized.
924
+ *
925
+ * @param params - The parameters for the connection process
926
+ * @param params.configFactory - A function for providing configuration to the client.
927
+ * This can be async if configuration needs to be fetched.
928
+ * @returns The boolean value that indicates if the connection process was successful
929
+ *
930
+ * @stability development
931
+ *
932
+ * @example
933
+ * ```typescript
934
+ * api.connect();
935
+ * // Start listening for client events.
936
+ * ```
937
+ */
938
+ connect(params: {
939
+ configFactory: ConfigFactory;
940
+ onClientConnected?: (clientId: string) => void;
941
+ onClientDisconnected?: (clientId: string) => void;
942
+ onError?: (error: Error) => void;
943
+ }): void;
146
944
  /**
147
- * Registers a component in the registry with the specified id.
148
- * If a component with the same id already exists, it will be overwritten.
945
+ * Registers an event handler for host-side events.
946
+ *
947
+ * @template TEvent - The type of host event to listen for
948
+ * @param event - The name of the event to listen for
949
+ * @param handler - The callback function that will be invoked when the event occurs
950
+ * @returns A function to remove the event listener.
951
+ * @stability development
952
+ *
953
+ * @example
954
+ * ```typescript
955
+ * api.on('ComponentSelected', (event) => {
956
+ * console.log('Component selection changed:', event.componentId);
957
+ * });
958
+ * ```
149
959
  */
150
- registerComponent(id: ComponentId, component: TFrameworkComponent): void;
960
+ on<TEvent extends keyof HostEventNameMapping>(event: TEvent, handler: (handlerEvent: Readonly<WithMeta & HostEventNameMapping[TEvent]>) => void): () => void;
961
+ on(event: 'Event', handler: (handlerEvent: Readonly<WithMeta & HostMessage>) => void): () => void;
151
962
  /**
152
- * Registers a dynamic importer for a component id. Useful if you don't want to rely on scanning.
963
+ * Notifies the host that the page settings have changed.
964
+ * This method allows the host to control the scroll position of connected clients.
965
+ *
966
+ * @param event - The page settings change event
967
+ * @stability development
968
+ *
969
+ * @example
970
+ * ```typescript
971
+ * api.notifyPageSettingsChanged({ settings: { ... }});
972
+ * ```
973
+ *
974
+ * @see {Domain.PageSettingsChangedEvent}
153
975
  */
154
- registerImporter(id: ComponentId, importer: () => Promise<ComponentModule<TProps, TFrameworkComponent>>, loaderNames?: LoaderNames): void;
976
+ notifyPageSettingsChanged(event: EventPayload<PageSettingsChangedEvent>): void;
155
977
  /**
156
- * Retrieves a component by id. Returns a framework-specific component type.
157
- * In lazy loading scenarios, this will be a lazy component if the component
158
- * is discovered via dynamic import. In design mode, the returned component
159
- * is decorated via `designDecorator`.
978
+ * Forwards a key press event from the host environment to the client.
979
+ * This allows the client to respond to keyboard input that occurs in the host context.
980
+ *
981
+ * @param event - The key press event containing the pressed key
982
+ * @param event.key - The key that was pressed (must be one of the forwarded keys)
983
+ * @stability development
984
+ *
985
+ * @example
986
+ * ```typescript
987
+ * // Forward arrow key navigation
988
+ * api.forwardKeyPress({ key: 'ArrowUp' });
989
+ * api.forwardKeyPress({ key: 'ArrowDown' });
990
+ *
991
+ * // Forward delete key
992
+ * api.forwardKeyPress({ key: 'Delete' });
993
+ * ```
994
+ *
995
+ * @see {Domain.HostKeyPressedEvent}
996
+ * @see {Domain.DefaultForwardedKeys}
160
997
  */
161
- getComponent(id: ComponentId): TFrameworkComponent | null;
998
+ forwardKeyPress(event: EventPayload<HostKeyPressedEvent>): void;
162
999
  /**
163
- * Preload the JS chunk for a component id (use in route loaders/SSR to avoid waterfalls).
1000
+ * Notifies the host that a client window drag operation has entered a component.
1001
+ * This event is triggered when a drag operation starts over a component in the client window.
1002
+ *
1003
+ * @param event - The drag enter event containing component and position information
1004
+ * @param event.componentId - The ID of the component being dragged over
1005
+ * @param event.x - The x position of the drag event relative to the window
1006
+ * @param event.y - The y position of the drag event relative to the window
1007
+ * @stability development
164
1008
  *
165
- * This method ensures the component module is loaded and cached. Concurrent calls
166
- * for the same component ID are automatically deduplicated via the pending map
167
- * in ensureDiscovered().
1009
+ * @example
1010
+ * ```typescript
1011
+ * api.notifyClientWindowDragEntered({
1012
+ * componentId: 'drop-zone-component',
1013
+ * x: 150,
1014
+ * y: 200
1015
+ * });
1016
+ * ```
168
1017
  *
169
- * @throws Error if the component cannot be discovered
1018
+ * @see {Domain.ClientWindowDragEnteredEvent}
170
1019
  */
171
- preload(id: ComponentId): Promise<void>;
172
- /** Get loader function names for external invocation. */
173
- getLoaderNames(id: ComponentId): LoaderNames | undefined;
174
- hasLoaders(id: ComponentId): boolean;
1020
+ notifyClientWindowDragEntered(event: EventPayload<ClientWindowDragEnteredEvent>): void;
175
1021
  /**
176
- * Call a loader function for a component externally.
1022
+ * Notifies the host that a client window drag operation has moved over a component.
1023
+ * This event is triggered as the drag operation continues over a component.
1024
+ *
1025
+ * @param event - The drag move event containing component and position information
1026
+ * @param event.componentId - The ID of the component being dragged over
1027
+ * @param event.x - The current x position of the drag event relative to the window
1028
+ * @param event.y - The current y position of the drag event relative to the window
1029
+ * @stability development
1030
+ *
1031
+ * @example
1032
+ * ```typescript
1033
+ * api.notifyClientWindowDragMoved({
1034
+ * componentId: 'drop-zone-component',
1035
+ * x: 160,
1036
+ * y: 200
1037
+ * });
1038
+ * ```
177
1039
  *
178
- * @param id - Component ID
179
- * @param loaderArgs - Arguments to pass to the loader function
180
- * @param loaderType - Type of loader to call ('loader' or 'clientLoader')
181
- * @returns Promise resolving to the loader result
1040
+ * @see {Domain.ClientWindowDragMovedEvent}
182
1041
  */
183
- callLoader(id: ComponentId, loaderArgs: unknown, loaderType?: keyof LoaderNames): Promise<unknown>;
184
- /** Get fallback component if available. */
185
- getFallback(id: ComponentId): TFrameworkComponent | undefined;
1042
+ notifyClientWindowDragMoved(event: EventPayload<ClientWindowDragMovedEvent>): void;
186
1043
  /**
187
- * Returns all registered component IDs.
188
- * Useful for debugging and introspection.
1044
+ * Notifies the host that a client window drag operation has exited a component.
1045
+ * This event is triggered when a drag operation leaves a component area.
1046
+ *
1047
+ * @param event - The drag exit event containing component and position information
1048
+ * @param event.componentId - The ID of the component that was being dragged over
1049
+ * @param event.x - The x position where the drag operation exited
1050
+ * @param event.y - The y position where the drag operation exited
1051
+ * @stability development
1052
+ *
1053
+ * @example
1054
+ * ```typescript
1055
+ * api.notifyClientWindowDragExited({
1056
+ * componentId: 'drop-zone-component',
1057
+ * x: 50,
1058
+ * y: 100
1059
+ * });
1060
+ * ```
1061
+ *
1062
+ * @see {Domain.ClientWindowDragExitedEvent}
189
1063
  */
190
- getRegisteredIds(): ComponentId[];
1064
+ notifyClientWindowDragExited(event: EventPayload<ClientWindowDragExitedEvent>): void;
191
1065
  /**
192
- * Checks if a component is registered.
1066
+ * Notifies the host that a client window drag operation has been dropped on a component.
1067
+ * This event is triggered when a drag operation completes with a drop action.
1068
+ *
1069
+ * @param event - The drag drop event containing component and position information
1070
+ * @param event.componentId - The ID of the component where the drop occurred
1071
+ * @param event.x - The x position where the drop occurred
1072
+ * @param event.y - The y position where the drop occurred
1073
+ * @stability development
1074
+ *
1075
+ * @example
1076
+ * ```typescript
1077
+ * api.notifyClientWindowDragDropped({
1078
+ * componentId: 'target-component',
1079
+ * x: 200,
1080
+ * y: 150
1081
+ * });
1082
+ * ```
1083
+ *
1084
+ * @see {Domain.ClientWindowDragDroppedEvent}
1085
+ */
1086
+ notifyClientWindowDragDropped(event: EventPayload<ClientWindowDragDroppedEvent>): void;
1087
+ /**
1088
+ * Notifies the host that media has changed or was updated.
1089
+ *
1090
+ * @param event - The media change event
1091
+ * @stability development
1092
+ *
1093
+ * @example
1094
+ * ```typescript
1095
+ * api.notifyMediaChanged({});
1096
+ * ```
1097
+ * @see {Domain.MediaChangedEvent}
1098
+ */
1099
+ notifyMediaChanged(): void;
1100
+ /**
1101
+ * Sets the properties of a component.
1102
+ *
1103
+ * @param event - The component properties change event containing the component and properties
1104
+ * @param event.componentId - The ID of the component to set the properties of
1105
+ * @param event.properties - The new properties of the component
1106
+ * @stability development
1107
+ *
1108
+ * @example
1109
+ * ```typescript
1110
+ * api.setComponentProperties({
1111
+ * componentId: 'component-123',
1112
+ * properties: { color: 'red' }
1113
+ * });
1114
+ * ```
1115
+ *
1116
+ * @see {@link Domain.ComponentPropertiesChangedEvent}
193
1117
  */
194
- has(id: ComponentId): boolean;
1118
+ setComponentProperties<TProps extends Record<string, unknown> = Record<string, unknown>>(event: EventPayload<ComponentPropertiesChangedEvent<TProps>>): void;
195
1119
  /**
196
- * Clears all cached components and cancels pending discoveries.
197
- * In-flight async operations will be cancelled and their promises will reject.
198
- * Useful for testing or hot module replacement.
1120
+ * Notifies the host that a component has been focused.
1121
+ *
1122
+ * @param event - The component focus event containing the component ID
1123
+ * @param event.componentId - The ID of the component that was focused
1124
+ * @stability development
199
1125
  */
200
- clear(): void;
201
- private ensureLocalEntry;
1126
+ focusComponent(event: EventPayload<ComponentFocusedEvent>): void;
202
1127
  /**
203
- * Ensures a component is discovered and cached.
204
- * Only returns early if a raw (eagerly loaded) component exists.
205
- * Otherwise, attempts to discover via registered importer.
1128
+ * Notifies the host that the client configuration has changed.
1129
+ *
1130
+ * @param event - The client configuration change event containing the new configuration
1131
+ * @stability development
206
1132
  *
207
- * @throws Error if the discovery is cancelled via clear()
1133
+ * @example
1134
+ * ```typescript
1135
+ * api.setClientConfiguration({ ... });
1136
+ * ```
208
1137
  */
209
- private ensureDiscovered;
210
- private buildFromImporter;
211
- private buildFromLoadedModule;
1138
+ setClientConfiguration(event: EventPayload<ClientConfigurationChangedEvent>): void;
212
1139
  }
213
1140
  //#endregion
214
- export { DesignMetadata as a, LoaderNames as c, ComponentRegistryOptions as i, ComponentId as n, Entry as o, ComponentModule as r, FrameworkAdapter as s, ComponentRegistry as t };
1141
+ //#region src/design/messaging-api/client.d.ts
1142
+ /**
1143
+ * Factory function to create a ClientApi instance.
1144
+ *
1145
+ * @public
1146
+ * @param _config - Configuration object for the client API (currently unused).
1147
+ * @returns {ClientApi} An instance of the ClientApi interface.
1148
+ */
1149
+ declare function createClientApi({
1150
+ emitter,
1151
+ id,
1152
+ forwardedKeys,
1153
+ logger
1154
+ }: ClientConfiguration): ClientApi;
1155
+ //#endregion
1156
+ //#region src/design/messaging-api/host.d.ts
1157
+ /**
1158
+ * Factory function to create a HostApi instance.
1159
+ *
1160
+ * @public
1161
+ * @param {HostConfiguration} config - Configuration object for the host API.
1162
+ * @returns {HostApi} An instance of the HostApi interface.
1163
+ */
1164
+ declare function createHostApi({
1165
+ emitter,
1166
+ id,
1167
+ logger
1168
+ }: HostConfiguration): HostApi;
1169
+ //#endregion
1170
+ export { ClientWindowDragExitedEvent as A, ComponentMovedToRegionEvent as B, ClientConfigurationChangedEvent as C, ClientReady as D, ClientPageChangedEvent as E, ComponentDragStartedEvent as F, ErrorEvent as G, ComponentSelectedEvent as H, ComponentFocusedEvent as I, HostToClientConfiguration as J, HostDisconnected as K, ComponentHoveredInEvent as L, ComponentAddedToRegionEvent as M, ComponentDeletedEvent as N, ClientWindowDragDroppedEvent as O, ComponentDeselectedEvent as P, ComponentHoveredOutEvent as R, ClientAcknowledgedEvent as S, ClientInitializedEvent as T, ComponentType as U, ComponentPropertiesChangedEvent as V, DefaultForwardedKeys as W, PageSettingsChangedEvent as X, MediaChangedEvent as Y, WindowScrollChangedEvent as Z, IsomorphicEventNameMapping as _, ClientEventNameMapping as a, WithEventType as b, EventHandler as c, HostApi as d, HostConfiguration as f, IsomorphicConfiguration as g, IsomorphicApi as h, ClientConfiguration as i, ClientWindowDragMovedEvent as j, ClientWindowDragEnteredEvent as k, EventPayload as l, HostMessage as m, createClientApi as n, ClientMessage as o, HostEventNameMapping as p, HostKeyPressedEvent as q, ClientApi as r, ConfigFactory as s, createHostApi as t, EventTypeName as u, MessageEmitter as v, ClientDisconnectedEvent as w, WithMeta as x, Source as y, ComponentInfo as z };
215
1171
  //# sourceMappingURL=index.d.ts.map