@wirestate/lit 0.6.1 → 0.7.0-experimental.1

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 (66) hide show
  1. package/CHANGELOG.md +10 -1
  2. package/README.md +44 -44
  3. package/cjs/development/index.js +136 -129
  4. package/cjs/development/index.js.map +1 -1
  5. package/cjs/production/index.js +1 -1
  6. package/cjs/production/index.js.map +1 -1
  7. package/esm/development/commands/on-command-controller.js +7 -6
  8. package/esm/development/commands/on-command-controller.js.map +1 -1
  9. package/esm/development/commands/on-command.js +7 -6
  10. package/esm/development/commands/on-command.js.map +1 -1
  11. package/esm/development/commands/use-on-command.js +7 -7
  12. package/esm/development/consumption/injection.js +6 -6
  13. package/esm/development/consumption/injection.js.map +1 -1
  14. package/esm/development/consumption/use-injection.js +7 -7
  15. package/esm/development/consumption/use-injection.js.map +1 -1
  16. package/esm/development/context/ioc-context.js +6 -6
  17. package/esm/development/context/ioc-context.js.map +1 -1
  18. package/esm/development/events/on-event-controller.js +10 -8
  19. package/esm/development/events/on-event-controller.js.map +1 -1
  20. package/esm/development/events/on-event.js +11 -8
  21. package/esm/development/events/on-event.js.map +1 -1
  22. package/esm/development/events/use-on-events.js +8 -8
  23. package/esm/development/index.js +1 -1
  24. package/esm/development/provision/injectables-provide.js +5 -5
  25. package/esm/development/provision/injectables-provide.js.map +1 -1
  26. package/esm/development/provision/injectables-provider-controller.js +14 -14
  27. package/esm/development/provision/injectables-provider-controller.js.map +1 -1
  28. package/esm/development/provision/ioc-provide.js +10 -7
  29. package/esm/development/provision/ioc-provide.js.map +1 -1
  30. package/esm/development/provision/ioc-provider-controller.js +13 -10
  31. package/esm/development/provision/ioc-provider-controller.js.map +1 -1
  32. package/esm/development/provision/use-injectables-provider.js +5 -11
  33. package/esm/development/provision/use-injectables-provider.js.map +1 -1
  34. package/esm/development/provision/use-ioc-provision.js +6 -8
  35. package/esm/development/provision/use-ioc-provision.js.map +1 -1
  36. package/esm/development/queries/on-query-controller.js +8 -7
  37. package/esm/development/queries/on-query-controller.js.map +1 -1
  38. package/esm/development/queries/on-query.js +7 -6
  39. package/esm/development/queries/on-query.js.map +1 -1
  40. package/esm/development/queries/use-on-query.js +7 -7
  41. package/esm/production/commands/on-command-controller.js +1 -1
  42. package/esm/production/commands/on-command-controller.js.map +1 -1
  43. package/esm/production/commands/on-command.js.map +1 -1
  44. package/esm/production/consumption/injection.js +1 -1
  45. package/esm/production/consumption/injection.js.map +1 -1
  46. package/esm/production/consumption/use-injection.js +1 -1
  47. package/esm/production/consumption/use-injection.js.map +1 -1
  48. package/esm/production/context/ioc-context.js +1 -1
  49. package/esm/production/context/ioc-context.js.map +1 -1
  50. package/esm/production/events/on-event-controller.js +1 -1
  51. package/esm/production/events/on-event-controller.js.map +1 -1
  52. package/esm/production/events/on-event.js.map +1 -1
  53. package/esm/production/index.js +1 -1
  54. package/esm/production/provision/injectables-provide.js.map +1 -1
  55. package/esm/production/provision/injectables-provider-controller.js +1 -1
  56. package/esm/production/provision/injectables-provider-controller.js.map +1 -1
  57. package/esm/production/provision/ioc-provide.js.map +1 -1
  58. package/esm/production/provision/ioc-provider-controller.js +1 -1
  59. package/esm/production/provision/ioc-provider-controller.js.map +1 -1
  60. package/esm/production/provision/use-injectables-provider.js.map +1 -1
  61. package/esm/production/provision/use-ioc-provision.js.map +1 -1
  62. package/esm/production/queries/on-query-controller.js +1 -1
  63. package/esm/production/queries/on-query-controller.js.map +1 -1
  64. package/esm/production/queries/on-query.js.map +1 -1
  65. package/index.d.ts +199 -172
  66. package/package.json +1 -1
@@ -5,25 +5,25 @@ var core = require('@wirestate/core');
5
5
  var tslib = require('tslib');
6
6
 
7
7
  /**
8
- * Context key for the IoC container.
8
+ * Unique symbol used as a key for the IoC context.
9
9
  *
10
- * @group context
10
+ * @group Context
11
11
  */
12
12
  var IOC_CONTAINER_KEY = Symbol("ContainerContext");
13
13
  /**
14
- * Lit context for providing and consuming the IoC container.
14
+ * Lit context object for providing and consuming the IoC container.
15
15
  *
16
- * @group context
16
+ * @group Context
17
17
  */
18
- var ContainerContext = context.createContext(IOC_CONTAINER_KEY);
18
+ var IocContextObject = context.createContext(IOC_CONTAINER_KEY);
19
19
 
20
20
  /**
21
21
  * Decorator to inject a service from the IoC container into a Lit element property.
22
22
  *
23
- * @group consumption
23
+ * @group Consumption
24
24
  *
25
- * @param optionsOrInjectionId - injection options including the service identifier or the service identifier itself
26
- * @returns injection decorator instance
25
+ * @param optionsOrInjectionId - Injection options or service identifier.
26
+ * @returns An instance of {@link InjectionDecorator}.
27
27
  *
28
28
  * @example
29
29
  * ```typescript
@@ -61,7 +61,7 @@ function injection(optionsOrInjectionId) {
61
61
  nameOrContext.addInitializer(function () {
62
62
  var _this = this;
63
63
  new context.ContextConsumer(this, {
64
- context: ContainerContext,
64
+ context: IocContextObject,
65
65
  callback: function (it) {
66
66
  protoOrTarget.set.call(_this, it.container.get(injectionId));
67
67
  },
@@ -72,7 +72,7 @@ function injection(optionsOrInjectionId) {
72
72
  // Experimental decorators branch.
73
73
  protoOrTarget.constructor.addInitializer(function (element) {
74
74
  new context.ContextConsumer(element, {
75
- context: ContainerContext,
75
+ context: IocContextObject,
76
76
  callback: function (it) {
77
77
  element[nameOrContext] = it.container.get(injectionId);
78
78
  },
@@ -84,13 +84,13 @@ function injection(optionsOrInjectionId) {
84
84
  }
85
85
 
86
86
  /**
87
- * Hook (controller) to inject a service from the IoC container in a Lit component.
87
+ * Hook (controller) to inject a service from the IoC container.
88
88
  *
89
- * @group consumption
89
+ * @group Consumption
90
90
  *
91
- * @param host - the host element
92
- * @param optionsOrInjectionId - injection options including the service identifier or the service identifier itself
93
- * @returns injection descriptor object
91
+ * @param host - The host element.
92
+ * @param optionsOrInjectionId - Injection options or service identifier.
93
+ * @returns An instance of {@link UseInjectionValue}.
94
94
  *
95
95
  * @example
96
96
  * ```typescript
@@ -126,7 +126,7 @@ function useInjection(host, optionsOrInjectionId) {
126
126
  injectionId: injectionId
127
127
  };
128
128
  new context.ContextConsumer(host, {
129
- context: ContainerContext,
129
+ context: IocContextObject,
130
130
  subscribe: !once,
131
131
  callback: function (it) {
132
132
  current.value = it.container.get(injectionId);
@@ -136,17 +136,18 @@ function useInjection(host, optionsOrInjectionId) {
136
136
  }
137
137
 
138
138
  /**
139
- * Reactive controller that registers a command handler on the {@link CommandBus} for the host element's lifetime.
139
+ * Controller that registers a command handler for the host element's lifetime.
140
140
  *
141
+ * @remarks
141
142
  * The handler is registered when the host connects and unregistered when it disconnects.
142
- * When the IoC context is updated (container revision change), the handler is re-registered automatically.
143
+ * It automatically re-registers if the IoC container is updated.
143
144
  *
144
- * @group commands
145
+ * @group Commands
145
146
  */
146
147
  var OnCommandController = /** @class */function () {
147
148
  /**
148
149
  * @param host - The host element.
149
- * @param type - The command type to handle.
150
+ * @param type - Unique identifier of the command to handle.
150
151
  * @param handler - The command handler function.
151
152
  */
152
153
  function OnCommandController(host, type, handler) {
@@ -157,7 +158,7 @@ var OnCommandController = /** @class */function () {
157
158
  this.type = type;
158
159
  this.handler = handler;
159
160
  new context.ContextConsumer(host, {
160
- context: ContainerContext,
161
+ context: IocContextObject,
161
162
  subscribe: true,
162
163
  callback: function (context) {
163
164
  _this.bus = context.container.get(core.CommandBus);
@@ -188,20 +189,21 @@ var OnCommandController = /** @class */function () {
188
189
  }();
189
190
 
190
191
  /**
191
- * Decorator that registers a Lit element method as a command handler for the given type.
192
+ * Decorator for Lit element methods that handle a specific command.
192
193
  *
193
- * The handler is registered when the host element connects to the DOM and unregistered when it disconnects.
194
+ * @remarks
195
+ * The handler is registered when the host connects and unregistered when it disconnects.
194
196
  *
195
- * @group commands
197
+ * @group Commands
196
198
  *
197
- * @param type - the command type to handle
198
- * @returns the decorator function.
199
+ * @param type - Unique identifier of the command to handle.
200
+ * @returns A method decorator function.
199
201
  *
200
202
  * @example
201
203
  * ```typescript
202
204
  * class MyElement extends LitElement {
203
205
  * @onCommand("SAVE")
204
- * private handleSave(data: SomeData): void {
206
+ * private onSave(data: SomeData): void {
205
207
  * // handle command
206
208
  * }
207
209
  * }
@@ -229,15 +231,15 @@ function onCommand(type) {
229
231
  }
230
232
 
231
233
  /**
232
- * Registers a command handler on the CommandBus for the host element's lifetime.
234
+ * Hook that registers a command handler for the host element's lifetime.
233
235
  *
234
- * @group commands
236
+ * @group Commands
235
237
  *
236
- * @param host - the host element
237
- * @param options - command handling options
238
- * @param options.type - the command type to listen for
239
- * @param options.handler - the command handler function
240
- * @returns the command controller instance
238
+ * @param host - The host element.
239
+ * @param options - Command handling options.
240
+ * @param options.type - The command type to listen for.
241
+ * @param options.handler - The command handler function.
242
+ * @returns The command controller instance.
241
243
  *
242
244
  * @example
243
245
  * ```typescript
@@ -256,17 +258,19 @@ function useOnCommand(host, _a) {
256
258
  }
257
259
 
258
260
  /**
259
- * Controller that subscribes to events from the event bus.
261
+ * Controller that subscribes to events for the host element's lifetime.
260
262
  *
261
- * It automatically handles subscription and unsubscription based on the host element's lifecycle.
263
+ * @remarks
264
+ * The handler is registered when the host connects and unregistered when it disconnects.
265
+ * It automatically re-subscribes if the IoC container is updated.
262
266
  *
263
- * @group events
267
+ * @group Events
264
268
  */
265
269
  var OnEventController = /** @class */function () {
266
270
  /**
267
- * @param host - the host element
268
- * @param types - event types to listen for, if null, all events will be handled
269
- * @param handler - the event handler function
271
+ * @param host - The host element.
272
+ * @param types - Event types to listen for. If null, all events will be handled.
273
+ * @param handler - The event handler function.
270
274
  */
271
275
  function OnEventController(host, types, handler) {
272
276
  var _this = this;
@@ -276,7 +280,7 @@ var OnEventController = /** @class */function () {
276
280
  this.types = types;
277
281
  this.handler = handler;
278
282
  new context.ContextConsumer(host, {
279
- context: ContainerContext,
283
+ context: IocContextObject,
280
284
  subscribe: true,
281
285
  callback: function (context) {
282
286
  _this.bus = context.container.get(core.EventBus);
@@ -316,19 +320,22 @@ var OnEventController = /** @class */function () {
316
320
  }();
317
321
 
318
322
  /**
319
- * Decorator to handle events from the event bus.
323
+ * Decorator for Lit element methods that handle events from the event bus.
320
324
  *
321
- * @group events
325
+ * @remarks
326
+ * The handler is registered when the host connects and unregistered when it disconnects.
327
+ *
328
+ * @group Events
322
329
  *
323
330
  * @param types - Event types to listen for. If omitted, all events will be handled.
324
- * @returns The decorator function.
331
+ * @returns A method decorator function.
325
332
  *
326
333
  * @example
327
334
  * ```typescript
328
335
  * class MyElement extends LitElement {
329
336
  * @onEvent()
330
337
  * private onMyEvent(event: Event) {
331
- * console.log('Event received:', event);
338
+ * console.log("Event received:", event);
332
339
  * }
333
340
  * }
334
341
  * ```
@@ -336,9 +343,9 @@ var OnEventController = /** @class */function () {
336
343
  * @example
337
344
  * ```typescript
338
345
  * class MyElement extends LitElement {
339
- * @onEvent('MY_EVENT_TYPE')
346
+ * @onEvent("MY_EVENT_TYPE")
340
347
  * private onMyEvent(event: MyEvent) {
341
- * console.log('Event received:', event);
348
+ * console.log("Event received:", event);
342
349
  * }
343
350
  * }
344
351
  * ```
@@ -346,9 +353,9 @@ var OnEventController = /** @class */function () {
346
353
  * @example
347
354
  * ```typescript
348
355
  * class MyElement extends LitElement {
349
- * @onEvent(['MY_EVENT_TYPE_1', 'MY_EVENT_TYPE_2'])
356
+ * @onEvent(["MY_EVENT_TYPE_1", "MY_EVENT_TYPE_2"])
350
357
  * private onMyEvent(event: Event) {
351
- * console.log('Event received:', event);
358
+ * console.log("Event received:", event);
352
359
  * }
353
360
  * }
354
361
  * ```
@@ -376,15 +383,15 @@ function onEvent(types) {
376
383
  }
377
384
 
378
385
  /**
379
- * Hook (controller) to handle events from the event bus.
386
+ * Hook that subscribes to events for the host element's lifetime.
380
387
  *
381
- * @group events
388
+ * @group Events
382
389
  *
383
- * @param host - the host element
384
- * @param options - event handling options
385
- * @param options.handler - event handler function
386
- * @param options.types - event types to listen for, if null or undefined, all events will be handled
387
- * @returns events subscription controller
390
+ * @param host - The host element.
391
+ * @param options - Event handling options.
392
+ * @param options.handler - Event handler function.
393
+ * @param options.types - Event types to listen for, if null or undefined, all events will be handled.
394
+ * @returns An instance of {@link OnEventController}.
388
395
  *
389
396
  * @example
390
397
  * ```typescript
@@ -399,7 +406,7 @@ function onEvent(types) {
399
406
  * ```typescript
400
407
  * class MyElement extends LitElement {
401
408
  * private eventHandler = useOnEvents(this, {
402
- * types: [MyEvent],
409
+ * types: ["MY_EVENT"],
403
410
  * handler: (event) => console.log(event),
404
411
  * });
405
412
  * }
@@ -415,16 +422,17 @@ function useOnEvents(host, _a) {
415
422
  /**
416
423
  * Reactive controller that registers a query handler on the {@link QueryBus} for the host element's lifetime.
417
424
  *
425
+ * @remarks
418
426
  * The handler is registered when the host connects and unregistered when it disconnects.
419
- * When the IoC context is updated (container revision change), the handler is re-registered automatically.
427
+ * It automatically re-registers if the IoC container is updated.
420
428
  *
421
- * @group queries
429
+ * @group Queries
422
430
  */
423
431
  var OnQueryController = /** @class */function () {
424
432
  /**
425
- * @param host - the host element
426
- * @param type - the query type to handle
427
- * @param handler - the query handler function
433
+ * @param host - The host element.
434
+ * @param type - Unique identifier of the query to handle.
435
+ * @param handler - The query handler function.
428
436
  */
429
437
  function OnQueryController(host, type, handler) {
430
438
  var _this = this;
@@ -434,7 +442,7 @@ var OnQueryController = /** @class */function () {
434
442
  this.type = type;
435
443
  this.handler = handler;
436
444
  new context.ContextConsumer(host, {
437
- context: ContainerContext,
445
+ context: IocContextObject,
438
446
  subscribe: true,
439
447
  callback: function (context) {
440
448
  _this.bus = context.container.get(core.QueryBus);
@@ -465,20 +473,21 @@ var OnQueryController = /** @class */function () {
465
473
  }();
466
474
 
467
475
  /**
468
- * Decorator that registers a Lit element method as a query handler for the given type.
476
+ * Decorator for Lit element methods that handle a specific query.
469
477
  *
470
- * The handler is registered when the host element connects to the DOM and unregistered when it disconnects.
478
+ * @remarks
479
+ * The handler is registered when the host connects and unregistered when it disconnects.
471
480
  *
472
- * @group queries
481
+ * @group Queries
473
482
  *
474
- * @param type - the query type to handle
475
- * @returns the decorator function
483
+ * @param type - Unique identifier of the query to handle.
484
+ * @returns A method decorator function.
476
485
  *
477
486
  * @example
478
487
  * ```typescript
479
488
  * class MyElement extends LitElement {
480
489
  * @onQuery("GET_USER_NAME")
481
- * public onGetUserName(data: QueryData) {
490
+ * private onGetUserName(data: QueryData) {
482
491
  * return "Alice";
483
492
  * }
484
493
  * }
@@ -506,15 +515,15 @@ function onQuery(type) {
506
515
  }
507
516
 
508
517
  /**
509
- * Registers a query handler on the {@link QueryBus} for the host element's lifetime.
518
+ * Hook that registers a query handler for the host element's lifetime.
510
519
  *
511
- * @group queries
520
+ * @group Queries
512
521
  *
513
- * @param host - the host element
514
- * @param options - query handling options
515
- * @param options.type - the query type to handle
516
- * @param options.handler - the query handler function
517
- * @returns the query controller instance
522
+ * @param host - The host element.
523
+ * @param options - Query handling options.
524
+ * @param options.type - The query type to handle.
525
+ * @param options.handler - The query handler function.
526
+ * @returns An instance of {@link OnQueryController}.
518
527
  *
519
528
  * @example
520
529
  * ```typescript
@@ -535,16 +544,19 @@ function useOnQuery(host, _a) {
535
544
  /**
536
545
  * Controller that provides an IoC container context to the host element and its children.
537
546
  *
547
+ * @remarks
538
548
  * It manages the lifecycle of the container and handles revision updates to notify consumers.
549
+ * The container is created (or used from options) when the controller is instantiated.
550
+ * Seed data is applied when the host connects.
539
551
  *
540
- * @group provision
552
+ * @group Provision
541
553
  */
542
554
  var IocProviderController = /** @class */function () {
543
555
  /**
544
- * @param host - the host element
545
- * @param options - provisioning options
546
- * @param options.container - optional existing container to use. If not provided, a new one will be created
547
- * @param options.seed - optional seed data to apply to the container
556
+ * @param host - The host element.
557
+ * @param options - Provisioning options.
558
+ * @param options.container - Optional existing container to use. If not provided, a new one will be created.
559
+ * @param options.seed - Optional seed data to apply to the container.
548
560
  */
549
561
  function IocProviderController(host, _a) {
550
562
  var _b = _a === void 0 ? {} : _a,
@@ -554,10 +566,10 @@ var IocProviderController = /** @class */function () {
554
566
  this.host = host;
555
567
  this.revision = 1;
556
568
  this.host.addController(this);
557
- this.container = container !== null && container !== void 0 ? container : core.createIocContainer();
569
+ this.container = container !== null && container !== void 0 ? container : core.createContainer();
558
570
  this.seed = seed;
559
571
  this.provider = new context.ContextProvider(host, {
560
- context: ContainerContext,
572
+ context: IocContextObject,
561
573
  initialValue: {
562
574
  container: this.container,
563
575
  revision: this.revision,
@@ -569,7 +581,7 @@ var IocProviderController = /** @class */function () {
569
581
  }
570
582
  Object.defineProperty(IocProviderController.prototype, "value", {
571
583
  /**
572
- * @returns current {@link IocContext} value served to child consumers
584
+ * @returns Current {@link IocContext} value served to child consumers.
573
585
  */
574
586
  get: function () {
575
587
  return this.provider.value;
@@ -599,19 +611,22 @@ var IocProviderController = /** @class */function () {
599
611
  }();
600
612
 
601
613
  /**
602
- * Decorator to provide an IoC container to child components.
614
+ * Decorator that provides an IoC container to child components.
615
+ *
616
+ * @remarks
617
+ * The container is provided via Lit context. It is created (or used from options) when the host connects.
603
618
  *
604
- * @group provision
619
+ * @group Provision
605
620
  *
606
- * @param options - provisioning options including container and seed data
607
- * @param options.container - optional existing container to use, if not provided, a new one will be created
608
- * @param options.seed - optional seed data to apply to the container
609
- * @returns IOC provision controller instance
621
+ * @param options - Provisioning options.
622
+ * @param options.container - Optional existing container to use, if not provided, a new one will be created.
623
+ * @param options.seed - Optional seed data to apply to the container.
624
+ * @returns An instance of {@link IocProviderDecorator}.
610
625
  *
611
626
  * @example
612
627
  * ```typescript
613
628
  * class MyRootElement extends LitElement {
614
- * @iocProvide({ seed: { someData: 'value' } })
629
+ * @iocProvide({ seed: { someData: "value" } })
615
630
  * private ioc!: IocProviderController;
616
631
  * }
617
632
  * ```
@@ -652,14 +667,14 @@ function iocProvide(_a) {
652
667
  var ERROR_CODE_INVALID_ARGUMENTS = 2051;
653
668
 
654
669
  /**
655
- * Controller that binds a set of injectables to an IoC container when the host connects
656
- * and unbinds them when the host disconnects.
670
+ * Controller that binds injectables to an IoC container for the host element's lifetime.
657
671
  *
658
- * When no `into` context is provided, the controller uses the nearest {@link IocProviderController}
659
- * ancestor via Lit context. Seeds are applied before entries so that `@Inject(SEEDS_TOKEN)`
660
- * works during service activation.
672
+ * @remarks
673
+ * Entries are bound when the host connects and unbound when it disconnects.
674
+ * If no `into` context is provided, it uses the nearest {@link IocProviderController}.
675
+ * Seeds are applied before entries are bound.
661
676
  *
662
- * @group provision
677
+ * @group Provision
663
678
  *
664
679
  * @example
665
680
  * ```typescript
@@ -674,12 +689,12 @@ var ERROR_CODE_INVALID_ARGUMENTS = 2051;
674
689
  */
675
690
  var InjectablesProviderController = /** @class */function () {
676
691
  /**
677
- * @param host - the host element
678
- * @param options - provisioning options
679
- * @param options.entries - list of service entries to bind to the container
680
- * @param options.into - target IoC context; if omitted, uses the nearest provider context
681
- * @param options.activate - list of service identifiers to activate immediately after binding
682
- * @param options.seeds - seed data applied before binding
692
+ * @param host - The host element.
693
+ * @param options - Provisioning options.
694
+ * @param options.entries - List of service entries to bind to the container.
695
+ * @param options.into - Target IoC context; if omitted, uses the nearest provider context.
696
+ * @param options.activate - List of service identifiers to activate immediately after binding.
697
+ * @param options.seeds - Seed data applied before binding.
683
698
  */
684
699
  function InjectablesProviderController(host, options) {
685
700
  var _this = this;
@@ -697,7 +712,7 @@ var InjectablesProviderController = /** @class */function () {
697
712
  if (!this.into) {
698
713
  // subscribe: false — binding happens once per connect, not on every revision update.
699
714
  this.consumer = new context.ContextConsumer(host, {
700
- context: ContainerContext,
715
+ context: IocContextObject,
701
716
  subscribe: false,
702
717
  callback: function (context) {
703
718
  if (!host.isConnected) {
@@ -770,19 +785,19 @@ var InjectablesProviderController = /** @class */function () {
770
785
  /**
771
786
  * Decorator that binds a set of injectables to the nearest IoC container for the host element's lifetime.
772
787
  *
788
+ * @remarks
773
789
  * Entries are bound when the host connects and unbound when it disconnects.
774
- * The decorated accessor or property holds the resulting {@link InjectablesProviderController} instance.
775
790
  *
776
- * @group provision
791
+ * @group Provision
777
792
  *
778
- * @param options - provisioning options
779
- * @returns injectables provider decorator instance
793
+ * @param options - Provisioning options.
794
+ * @returns An instance of {@link InjectablesProviderDecorator}.
780
795
  *
781
796
  * @example
782
797
  * ```typescript
783
798
  * class MyComponent extends LitElement {
784
799
  * @injectablesProvide({ entries: [AuthService, UserService], activate: [AuthService] })
785
- * public services!: InjectablesProviderController<MyComponent>;
800
+ * public controller!: InjectablesProviderController<MyComponent>;
786
801
  * }
787
802
  * ```
788
803
  */
@@ -811,19 +826,13 @@ function injectablesProvide(options) {
811
826
  }
812
827
 
813
828
  /**
814
- * Binds a set of injectables to the nearest IoC container for the host element's lifetime.
815
- *
816
- * Entries are bound when the host connects and unbound when it disconnects.
829
+ * Hook that binds injectables to the nearest IoC container for the host element's lifetime.
817
830
  *
818
- * @group provision
831
+ * @group Provision
819
832
  *
820
- * @param host - the host element
821
- * @param options - provisioning options
822
- * @param options.entries - list of service entries to bind to the container
823
- * @param options.into - target IoC context; if omitted, uses the nearest provider context
824
- * @param options.activate - list of service identifiers to activate immediately after binding
825
- * @param options.seeds - seed data applied before binding
826
- * @returns the controller instance
833
+ * @param host - The host element.
834
+ * @param options - Provisioning options.
835
+ * @returns An instance of {@link InjectablesProviderController}.
827
836
  *
828
837
  * @example
829
838
  * ```typescript
@@ -840,20 +849,18 @@ function useInjectablesProvider(host, options) {
840
849
  }
841
850
 
842
851
  /**
843
- * Hook (controller) to provide an IoC container to the host element and its children.
852
+ * Hook that provides an IoC container to the host element and its children.
844
853
  *
845
- * @group provision
854
+ * @group Provision
846
855
  *
847
- * @param host - the host element
848
- * @param options - provisioning options
849
- * @param options.container - optional existing container to use
850
- * @param options.seed - optional seed data to apply to the container
851
- * @returns ioc provision controller instance
856
+ * @param host - The host element.
857
+ * @param options - Provisioning options.
858
+ * @returns An instance of {@link IocProviderController}.
852
859
  *
853
860
  * @example
854
861
  * ```typescript
855
862
  * class MyRootElement extends LitElement {
856
- * private ioc = useIocProvision(this, { seed: { initialData: '...' } });
863
+ * private ioc = useIocProvision(this, { seed: { initialData: "..." } });
857
864
  * }
858
865
  * ```
859
866
  */
@@ -864,8 +871,8 @@ function useIocProvision(host, options) {
864
871
  return new IocProviderController(host, options);
865
872
  }
866
873
 
867
- exports.ContainerContext = ContainerContext;
868
874
  exports.InjectablesProviderController = InjectablesProviderController;
875
+ exports.IocContextObject = IocContextObject;
869
876
  exports.IocProviderController = IocProviderController;
870
877
  exports.OnCommandController = OnCommandController;
871
878
  exports.OnEventController = OnEventController;