@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
package/index.d.ts CHANGED
@@ -3,27 +3,27 @@ import { ServiceIdentifier, CommandType, CommandHandler, Event, EventType, Event
3
3
  import { ContextProvider, ContextConsumer } from '@lit/context';
4
4
 
5
5
  /**
6
- * Represents any object with string or symbol keys.
6
+ * Any object with string or symbol keys.
7
7
  *
8
- * @group types
8
+ * @group Types
9
9
  */
10
10
  type AnyObject = Record<string | symbol, any>;
11
11
  /**
12
- * Represents a type that can be null.
12
+ * Type that can be null.
13
13
  *
14
- * @group types
14
+ * @group Types
15
15
  */
16
16
  type Optional<T> = T | null;
17
17
  /**
18
- * Represents a type that can be a value or a promise of that value.
18
+ * Value or a promise of that value.
19
19
  *
20
- * @group types
20
+ * @group Types
21
21
  */
22
22
  type MaybePromise<T> = T | Promise<T>;
23
23
  /**
24
24
  * Helper to extract the interface of a type.
25
25
  *
26
- * @group types
26
+ * @group Types
27
27
  */
28
28
  type Interface<T> = {
29
29
  [K in keyof T]: T[K];
@@ -31,13 +31,13 @@ type Interface<T> = {
31
31
  /**
32
32
  * Return type for decorators.
33
33
  *
34
- * @group types
34
+ * @group Types
35
35
  */
36
36
  type DecoratorReturn = void | any;
37
37
  /**
38
- * Type helper to ensure that a decorated field matches the type being provided.
38
+ * Ensures that a decorated field matches the type being provided.
39
39
  *
40
- * @group types
40
+ * @group Types
41
41
  */
42
42
  type FieldMustMatchProvidedType<Obj, Key extends PropertyKey, ProvidedType> = Obj extends Record<Key, infer ConsumingType> ? [ProvidedType] extends [ConsumingType] ? DecoratorReturn : {
43
43
  message: "provided type not assignable to consuming field";
@@ -50,39 +50,43 @@ type FieldMustMatchProvidedType<Obj, Key extends PropertyKey, ProvidedType> = Ob
50
50
  } : DecoratorReturn;
51
51
 
52
52
  /**
53
- * Type definition for the injection decorator.
53
+ * Represents definition of the injection decorator.
54
54
  *
55
- * @group consumption
55
+ * @remarks
56
+ * Supports both TC39 and legacy experimental decorators.
57
+ *
58
+ * @group Consumption
56
59
  */
57
60
  interface InjectionDecorator<T> {
58
61
  <C extends Interface<Omit<ReactiveElement, "renderRoot">>, V extends T>(value: ClassAccessorDecoratorTarget<C, V>, context: ClassAccessorDecoratorContext<C, V>): void;
59
62
  <K extends PropertyKey, Proto extends Interface<Omit<ReactiveElement, "renderRoot">>>(protoOrDescriptor: Proto, name?: K): FieldMustMatchProvidedType<Proto, K, T>;
60
63
  }
61
64
  /**
62
- * Options for the {@link injection} decorator.
65
+ * Represents options for the {@link injection} decorator.
63
66
  *
64
- * @group consumption
67
+ * @group Consumption
65
68
  */
66
69
  interface InjectionOptions<T> {
67
70
  /**
68
- * The service identifier to inject from the IoC container.
71
+ * The service identifier to inject.
69
72
  */
70
73
  injectionId: ServiceIdentifier<T>;
71
74
  /**
72
- * Whether to subscribe to changes in the context.
75
+ * Whether to subscribe to container changes.
73
76
  *
77
+ * @remarks
74
78
  * If true, the property will be updated if the container in the context changes.
75
- * False by default.
79
+ * Defaults to false.
76
80
  */
77
81
  once?: boolean;
78
82
  }
79
83
  /**
80
84
  * Decorator to inject a service from the IoC container into a Lit element property.
81
85
  *
82
- * @group consumption
86
+ * @group Consumption
83
87
  *
84
- * @param optionsOrInjectionId - injection options including the service identifier or the service identifier itself
85
- * @returns injection decorator instance
88
+ * @param optionsOrInjectionId - Injection options or service identifier.
89
+ * @returns An instance of {@link InjectionDecorator}.
86
90
  *
87
91
  * @example
88
92
  * ```typescript
@@ -111,18 +115,21 @@ interface InjectionOptions<T> {
111
115
  declare function injection<T>(optionsOrInjectionId: InjectionOptions<T> | ServiceIdentifier<T>): InjectionDecorator<T>;
112
116
 
113
117
  /**
114
- * Options for the {@link useInjection} hook.
118
+ * Represents options for the {@link useInjection} hook.
115
119
  *
116
- * @group consumption
120
+ * @group Consumption
117
121
  */
118
122
  interface UseInjectionOptions<T> {
119
123
  /**
124
+ * Whether to subscribe to container changes.
125
+ *
126
+ * @remarks
120
127
  * If true, the service will be fetched only once when the controller is created.
121
- * If false (default), it will update if the container in the context changes.
128
+ * Defaults to false.
122
129
  */
123
130
  once?: boolean;
124
131
  /**
125
- * Initial value for the injection before it's fetched from the container.
132
+ * Initial value before the service is fetched.
126
133
  */
127
134
  value?: Optional<T>;
128
135
  /**
@@ -131,9 +138,9 @@ interface UseInjectionOptions<T> {
131
138
  injectionId: ServiceIdentifier<T>;
132
139
  }
133
140
  /**
134
- * The return value of the {@link useInjection} hook, containing the injected service.
141
+ * Represents result of the {@link useInjection} hook.
135
142
  *
136
- * @group consumption
143
+ * @group Consumption
137
144
  */
138
145
  interface UseInjectionValue<T> {
139
146
  /**
@@ -146,13 +153,13 @@ interface UseInjectionValue<T> {
146
153
  value: T;
147
154
  }
148
155
  /**
149
- * Hook (controller) to inject a service from the IoC container in a Lit component.
156
+ * Hook (controller) to inject a service from the IoC container.
150
157
  *
151
- * @group consumption
158
+ * @group Consumption
152
159
  *
153
- * @param host - the host element
154
- * @param optionsOrInjectionId - injection options including the service identifier or the service identifier itself
155
- * @returns injection descriptor object
160
+ * @param host - The host element.
161
+ * @param optionsOrInjectionId - Injection options or service identifier.
162
+ * @returns An instance of {@link UseInjectionValue}.
156
163
  *
157
164
  * @example
158
165
  * ```typescript
@@ -179,31 +186,33 @@ interface UseInjectionValue<T> {
179
186
  declare function useInjection<T extends object, E extends ReactiveControllerHost & HTMLElement>(host: E, optionsOrInjectionId: UseInjectionOptions<T> | ServiceIdentifier<T>): UseInjectionValue<T>;
180
187
 
181
188
  /**
182
- * Interface for the {@link onCommand} decorator.
189
+ * Represents interface for the {@link onCommand} decorator.
183
190
  *
184
- * Supports both standard (TC39) and legacy experimental decorators.
191
+ * @remarks
192
+ * Supports both TC39 and legacy experimental decorators.
185
193
  *
186
- * @group commands
194
+ * @group Commands
187
195
  */
188
196
  interface OnCommandDecorator<D = unknown, R = unknown> {
189
197
  <This extends Interface<Omit<ReactiveElement, "renderRoot">>>(value: (this: This, data: D) => MaybePromise<R>, context: ClassMethodDecoratorContext<This>): void;
190
198
  (target: object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;
191
199
  }
192
200
  /**
193
- * Decorator that registers a Lit element method as a command handler for the given type.
201
+ * Decorator for Lit element methods that handle a specific command.
194
202
  *
195
- * The handler is registered when the host element connects to the DOM and unregistered when it disconnects.
203
+ * @remarks
204
+ * The handler is registered when the host connects and unregistered when it disconnects.
196
205
  *
197
- * @group commands
206
+ * @group Commands
198
207
  *
199
- * @param type - the command type to handle
200
- * @returns the decorator function.
208
+ * @param type - Unique identifier of the command to handle.
209
+ * @returns A method decorator function.
201
210
  *
202
211
  * @example
203
212
  * ```typescript
204
213
  * class MyElement extends LitElement {
205
214
  * @onCommand("SAVE")
206
- * private handleSave(data: SomeData): void {
215
+ * private onSave(data: SomeData): void {
207
216
  * // handle command
208
217
  * }
209
218
  * }
@@ -212,12 +221,13 @@ interface OnCommandDecorator<D = unknown, R = unknown> {
212
221
  declare function onCommand<D = unknown, R = unknown>(type: CommandType): OnCommandDecorator<D, R>;
213
222
 
214
223
  /**
215
- * Reactive controller that registers a command handler on the {@link CommandBus} for the host element's lifetime.
224
+ * Controller that registers a command handler for the host element's lifetime.
216
225
  *
226
+ * @remarks
217
227
  * The handler is registered when the host connects and unregistered when it disconnects.
218
- * When the IoC context is updated (container revision change), the handler is re-registered automatically.
228
+ * It automatically re-registers if the IoC container is updated.
219
229
  *
220
- * @group commands
230
+ * @group Commands
221
231
  */
222
232
  declare class OnCommandController<D = unknown, R = unknown> implements ReactiveController {
223
233
  private bus;
@@ -226,7 +236,7 @@ declare class OnCommandController<D = unknown, R = unknown> implements ReactiveC
226
236
  private readonly handler;
227
237
  /**
228
238
  * @param host - The host element.
229
- * @param type - The command type to handle.
239
+ * @param type - Unique identifier of the command to handle.
230
240
  * @param handler - The command handler function.
231
241
  */
232
242
  constructor(host: ReactiveElement, type: CommandType, handler: CommandHandler<D, R>);
@@ -237,9 +247,9 @@ declare class OnCommandController<D = unknown, R = unknown> implements ReactiveC
237
247
  }
238
248
 
239
249
  /**
240
- * Options for the {@link useOnCommand} hook.
250
+ * Represents options for the {@link useOnCommand} hook.
241
251
  *
242
- * @group commands
252
+ * @group Commands
243
253
  */
244
254
  interface UseOnCommandOptions<D = unknown, R = unknown> {
245
255
  /**
@@ -252,15 +262,15 @@ interface UseOnCommandOptions<D = unknown, R = unknown> {
252
262
  handler: CommandHandler<D, R>;
253
263
  }
254
264
  /**
255
- * Registers a command handler on the CommandBus for the host element's lifetime.
265
+ * Hook that registers a command handler for the host element's lifetime.
256
266
  *
257
- * @group commands
267
+ * @group Commands
258
268
  *
259
- * @param host - the host element
260
- * @param options - command handling options
261
- * @param options.type - the command type to listen for
262
- * @param options.handler - the command handler function
263
- * @returns the command controller instance
269
+ * @param host - The host element.
270
+ * @param options - Command handling options.
271
+ * @param options.type - The command type to listen for.
272
+ * @param options.handler - The command handler function.
273
+ * @returns The command controller instance.
264
274
  *
265
275
  * @example
266
276
  * ```typescript
@@ -275,28 +285,34 @@ interface UseOnCommandOptions<D = unknown, R = unknown> {
275
285
  declare function useOnCommand<D = unknown, R = unknown>(host: ReactiveElement, { type, handler }: UseOnCommandOptions<D, R>): OnCommandController<D, R>;
276
286
 
277
287
  /**
278
- * Type definition for the on-event decorator.
288
+ * Represents type definition for the on-event decorator.
289
+ *
290
+ * @remarks
291
+ * Supports both TC39 and legacy experimental decorators.
279
292
  *
280
- * @group events
293
+ * @group Events
281
294
  */
282
295
  interface OnEventDecorator<E extends Event = Event> {
283
296
  <This extends Interface<Omit<ReactiveElement, "renderRoot">>>(value: (this: This, event: E) => void, context: ClassMethodDecoratorContext<This>): void;
284
297
  (target: object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;
285
298
  }
286
299
  /**
287
- * Decorator to handle events from the event bus.
300
+ * Decorator for Lit element methods that handle events from the event bus.
288
301
  *
289
- * @group events
302
+ * @remarks
303
+ * The handler is registered when the host connects and unregistered when it disconnects.
304
+ *
305
+ * @group Events
290
306
  *
291
307
  * @param types - Event types to listen for. If omitted, all events will be handled.
292
- * @returns The decorator function.
308
+ * @returns A method decorator function.
293
309
  *
294
310
  * @example
295
311
  * ```typescript
296
312
  * class MyElement extends LitElement {
297
313
  * @onEvent()
298
314
  * private onMyEvent(event: Event) {
299
- * console.log('Event received:', event);
315
+ * console.log("Event received:", event);
300
316
  * }
301
317
  * }
302
318
  * ```
@@ -304,9 +320,9 @@ interface OnEventDecorator<E extends Event = Event> {
304
320
  * @example
305
321
  * ```typescript
306
322
  * class MyElement extends LitElement {
307
- * @onEvent('MY_EVENT_TYPE')
323
+ * @onEvent("MY_EVENT_TYPE")
308
324
  * private onMyEvent(event: MyEvent) {
309
- * console.log('Event received:', event);
325
+ * console.log("Event received:", event);
310
326
  * }
311
327
  * }
312
328
  * ```
@@ -314,9 +330,9 @@ interface OnEventDecorator<E extends Event = Event> {
314
330
  * @example
315
331
  * ```typescript
316
332
  * class MyElement extends LitElement {
317
- * @onEvent(['MY_EVENT_TYPE_1', 'MY_EVENT_TYPE_2'])
333
+ * @onEvent(["MY_EVENT_TYPE_1", "MY_EVENT_TYPE_2"])
318
334
  * private onMyEvent(event: Event) {
319
- * console.log('Event received:', event);
335
+ * console.log("Event received:", event);
320
336
  * }
321
337
  * }
322
338
  * ```
@@ -324,11 +340,13 @@ interface OnEventDecorator<E extends Event = Event> {
324
340
  declare function onEvent<E extends Event = Event>(types?: EventType | ReadonlyArray<EventType>): OnEventDecorator<E>;
325
341
 
326
342
  /**
327
- * Controller that subscribes to events from the event bus.
343
+ * Controller that subscribes to events for the host element's lifetime.
328
344
  *
329
- * It automatically handles subscription and unsubscription based on the host element's lifecycle.
345
+ * @remarks
346
+ * The handler is registered when the host connects and unregistered when it disconnects.
347
+ * It automatically re-subscribes if the IoC container is updated.
330
348
  *
331
- * @group events
349
+ * @group Events
332
350
  */
333
351
  declare class OnEventController<E extends Event = Event> implements ReactiveController {
334
352
  private bus;
@@ -336,9 +354,9 @@ declare class OnEventController<E extends Event = Event> implements ReactiveCont
336
354
  private readonly types;
337
355
  private readonly handler;
338
356
  /**
339
- * @param host - the host element
340
- * @param types - event types to listen for, if null, all events will be handled
341
- * @param handler - the event handler function
357
+ * @param host - The host element.
358
+ * @param types - Event types to listen for. If null, all events will be handled.
359
+ * @param handler - The event handler function.
342
360
  */
343
361
  constructor(host: ReactiveElement, types: Optional<ReadonlyArray<EventType>>, handler: EventHandler<E>);
344
362
  hostConnected(): void;
@@ -348,13 +366,13 @@ declare class OnEventController<E extends Event = Event> implements ReactiveCont
348
366
  }
349
367
 
350
368
  /**
351
- * Options for the {@link useOnEvents} hook.
369
+ * Represents options for the {@link useOnEvents} hook.
352
370
  *
353
- * @group events
371
+ * @group Events
354
372
  */
355
373
  interface UseOnEventsOptions<E extends Event = Event> {
356
374
  /**
357
- * Event handler function.
375
+ * The event handler function.
358
376
  */
359
377
  handler: EventHandler<E>;
360
378
  /**
@@ -363,15 +381,15 @@ interface UseOnEventsOptions<E extends Event = Event> {
363
381
  types?: Optional<EventType | ReadonlyArray<EventType>>;
364
382
  }
365
383
  /**
366
- * Hook (controller) to handle events from the event bus.
384
+ * Hook that subscribes to events for the host element's lifetime.
367
385
  *
368
- * @group events
386
+ * @group Events
369
387
  *
370
- * @param host - the host element
371
- * @param options - event handling options
372
- * @param options.handler - event handler function
373
- * @param options.types - event types to listen for, if null or undefined, all events will be handled
374
- * @returns events subscription controller
388
+ * @param host - The host element.
389
+ * @param options - Event handling options.
390
+ * @param options.handler - Event handler function.
391
+ * @param options.types - Event types to listen for, if null or undefined, all events will be handled.
392
+ * @returns An instance of {@link OnEventController}.
375
393
  *
376
394
  * @example
377
395
  * ```typescript
@@ -386,7 +404,7 @@ interface UseOnEventsOptions<E extends Event = Event> {
386
404
  * ```typescript
387
405
  * class MyElement extends LitElement {
388
406
  * private eventHandler = useOnEvents(this, {
389
- * types: [MyEvent],
407
+ * types: ["MY_EVENT"],
390
408
  * handler: (event) => console.log(event),
391
409
  * });
392
410
  * }
@@ -395,31 +413,33 @@ interface UseOnEventsOptions<E extends Event = Event> {
395
413
  declare function useOnEvents<E extends Event = Event>(host: ReactiveElement, { types, handler }: UseOnEventsOptions): OnEventController<E>;
396
414
 
397
415
  /**
398
- * Interface for the {@link onQuery} decorator.
416
+ * Represents interface for the {@link onQuery} decorator.
399
417
  *
400
- * Supports both standard (TC39) and legacy experimental decorators.
418
+ * @remarks
419
+ * Supports both TC39 and legacy experimental decorators.
401
420
  *
402
- * @group queries
421
+ * @group Queries
403
422
  */
404
423
  interface OnQueryDecorator<D = unknown, R = unknown> {
405
424
  <This extends Interface<Omit<ReactiveElement, "renderRoot">>>(value: (this: This, data: D) => MaybePromise<R>, context: ClassMethodDecoratorContext<This>): void;
406
425
  (target: object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;
407
426
  }
408
427
  /**
409
- * Decorator that registers a Lit element method as a query handler for the given type.
428
+ * Decorator for Lit element methods that handle a specific query.
410
429
  *
411
- * The handler is registered when the host element connects to the DOM and unregistered when it disconnects.
430
+ * @remarks
431
+ * The handler is registered when the host connects and unregistered when it disconnects.
412
432
  *
413
- * @group queries
433
+ * @group Queries
414
434
  *
415
- * @param type - the query type to handle
416
- * @returns the decorator function
435
+ * @param type - Unique identifier of the query to handle.
436
+ * @returns A method decorator function.
417
437
  *
418
438
  * @example
419
439
  * ```typescript
420
440
  * class MyElement extends LitElement {
421
441
  * @onQuery("GET_USER_NAME")
422
- * public onGetUserName(data: QueryData) {
442
+ * private onGetUserName(data: QueryData) {
423
443
  * return "Alice";
424
444
  * }
425
445
  * }
@@ -430,10 +450,11 @@ declare function onQuery<D = unknown, R = unknown>(type: QueryType): OnQueryDeco
430
450
  /**
431
451
  * Reactive controller that registers a query handler on the {@link QueryBus} for the host element's lifetime.
432
452
  *
453
+ * @remarks
433
454
  * The handler is registered when the host connects and unregistered when it disconnects.
434
- * When the IoC context is updated (container revision change), the handler is re-registered automatically.
455
+ * It automatically re-registers if the IoC container is updated.
435
456
  *
436
- * @group queries
457
+ * @group Queries
437
458
  */
438
459
  declare class OnQueryController<D = unknown, R = unknown> implements ReactiveController {
439
460
  private bus;
@@ -441,9 +462,9 @@ declare class OnQueryController<D = unknown, R = unknown> implements ReactiveCon
441
462
  private readonly type;
442
463
  private readonly handler;
443
464
  /**
444
- * @param host - the host element
445
- * @param type - the query type to handle
446
- * @param handler - the query handler function
465
+ * @param host - The host element.
466
+ * @param type - Unique identifier of the query to handle.
467
+ * @param handler - The query handler function.
447
468
  */
448
469
  constructor(host: ReactiveElement, type: QueryType, handler: QueryHandler<D, R>);
449
470
  hostConnected(): void;
@@ -453,9 +474,9 @@ declare class OnQueryController<D = unknown, R = unknown> implements ReactiveCon
453
474
  }
454
475
 
455
476
  /**
456
- * Options for the {@link useOnQuery} hook.
477
+ * Represents options for the {@link useOnQuery} hook.
457
478
  *
458
- * @group queries
479
+ * @group Queries
459
480
  */
460
481
  interface UseOnQueryOptions<D = unknown, R = unknown> {
461
482
  /**
@@ -468,15 +489,15 @@ interface UseOnQueryOptions<D = unknown, R = unknown> {
468
489
  handler: QueryHandler<D, R>;
469
490
  }
470
491
  /**
471
- * Registers a query handler on the {@link QueryBus} for the host element's lifetime.
492
+ * Hook that registers a query handler for the host element's lifetime.
472
493
  *
473
- * @group queries
494
+ * @group Queries
474
495
  *
475
- * @param host - the host element
476
- * @param options - query handling options
477
- * @param options.type - the query type to handle
478
- * @param options.handler - the query handler function
479
- * @returns the query controller instance
496
+ * @param host - The host element.
497
+ * @param options - Query handling options.
498
+ * @param options.type - The query type to handle.
499
+ * @param options.handler - The query handler function.
500
+ * @returns An instance of {@link OnQueryController}.
480
501
  *
481
502
  * @example
482
503
  * ```typescript
@@ -493,11 +514,11 @@ declare function useOnQuery<D = unknown, R = unknown>(host: ReactiveElement, { t
493
514
  /**
494
515
  * Interface for the IoC context value.
495
516
  *
496
- * @group context
517
+ * @group Context
497
518
  */
498
519
  interface IocContext {
499
520
  /**
500
- * The Inversify IoC container.
521
+ * The IoC container instance.
501
522
  */
502
523
  readonly container: Container;
503
524
  /**
@@ -510,18 +531,18 @@ interface IocContext {
510
531
  readonly nextRevision: () => number;
511
532
  }
512
533
  /**
513
- * Lit context for providing and consuming the IoC container.
534
+ * Lit context object for providing and consuming the IoC container.
514
535
  *
515
- * @group context
536
+ * @group Context
516
537
  */
517
- declare const ContainerContext: {
538
+ declare const IocContextObject: {
518
539
  __context__: IocContext;
519
540
  };
520
541
 
521
542
  /**
522
- * Options for the {@link IocProviderController}.
543
+ * Represents options for the {@link IocProviderController}.
523
544
  *
524
- * @group provision
545
+ * @group Provision
525
546
  */
526
547
  interface IocProviderControllerOptions {
527
548
  /**
@@ -536,13 +557,16 @@ interface IocProviderControllerOptions {
536
557
  /**
537
558
  * Controller that provides an IoC container context to the host element and its children.
538
559
  *
560
+ * @remarks
539
561
  * It manages the lifecycle of the container and handles revision updates to notify consumers.
562
+ * The container is created (or used from options) when the controller is instantiated.
563
+ * Seed data is applied when the host connects.
540
564
  *
541
- * @group provision
565
+ * @group Provision
542
566
  */
543
567
  declare class IocProviderController<E extends ReactiveControllerHost & HTMLElement = ReactiveControllerHost & HTMLElement> implements ReactiveController {
544
568
  private readonly host;
545
- protected readonly provider: ContextProvider<typeof ContainerContext>;
569
+ protected readonly provider: ContextProvider<typeof IocContextObject>;
546
570
  protected readonly seed?: AnyObject;
547
571
  protected revision: number;
548
572
  /**
@@ -550,14 +574,14 @@ declare class IocProviderController<E extends ReactiveControllerHost & HTMLEleme
550
574
  */
551
575
  container: Container;
552
576
  /**
553
- * @returns current {@link IocContext} value served to child consumers
577
+ * @returns Current {@link IocContext} value served to child consumers.
554
578
  */
555
579
  get value(): IocContext;
556
580
  /**
557
- * @param host - the host element
558
- * @param options - provisioning options
559
- * @param options.container - optional existing container to use. If not provided, a new one will be created
560
- * @param options.seed - optional seed data to apply to the container
581
+ * @param host - The host element.
582
+ * @param options - Provisioning options.
583
+ * @param options.container - Optional existing container to use. If not provided, a new one will be created.
584
+ * @param options.seed - Optional seed data to apply to the container.
561
585
  */
562
586
  constructor(host: E, { container, seed }?: IocProviderControllerOptions);
563
587
  hostConnected(): void;
@@ -566,28 +590,34 @@ declare class IocProviderController<E extends ReactiveControllerHost & HTMLEleme
566
590
  }
567
591
 
568
592
  /**
569
- * Type definition for the ioc-provide decorator.
593
+ * Represents interface for the {@link iocProvide} decorator.
594
+ *
595
+ * @remarks
596
+ * Supports both TC39 and legacy experimental decorators.
570
597
  *
571
- * @group provision
598
+ * @group Provision
572
599
  */
573
600
  interface IocProviderDecorator<E extends ReactiveElement = ReactiveElement> {
574
601
  <C extends Interface<Omit<ReactiveElement, "renderRoot">>, V extends IocProviderController<E>>(value: ClassAccessorDecoratorTarget<C, V>, context: ClassAccessorDecoratorContext<C, V>): void;
575
602
  <K extends PropertyKey, Proto extends Interface<Omit<ReactiveElement, "renderRoot">>>(protoOrDescriptor: Proto, name?: K): FieldMustMatchProvidedType<Proto, K, IocProviderController<E>>;
576
603
  }
577
604
  /**
578
- * Decorator to provide an IoC container to child components.
605
+ * Decorator that provides an IoC container to child components.
579
606
  *
580
- * @group provision
607
+ * @remarks
608
+ * The container is provided via Lit context. It is created (or used from options) when the host connects.
581
609
  *
582
- * @param options - provisioning options including container and seed data
583
- * @param options.container - optional existing container to use, if not provided, a new one will be created
584
- * @param options.seed - optional seed data to apply to the container
585
- * @returns IOC provision controller instance
610
+ * @group Provision
611
+ *
612
+ * @param options - Provisioning options.
613
+ * @param options.container - Optional existing container to use, if not provided, a new one will be created.
614
+ * @param options.seed - Optional seed data to apply to the container.
615
+ * @returns An instance of {@link IocProviderDecorator}.
586
616
  *
587
617
  * @example
588
618
  * ```typescript
589
619
  * class MyRootElement extends LitElement {
590
- * @iocProvide({ seed: { someData: 'value' } })
620
+ * @iocProvide({ seed: { someData: "value" } })
591
621
  * private ioc!: IocProviderController;
592
622
  * }
593
623
  * ```
@@ -595,14 +625,18 @@ interface IocProviderDecorator<E extends ReactiveElement = ReactiveElement> {
595
625
  declare function iocProvide<E extends ReactiveElement>({ container, seed, }?: IocProviderControllerOptions): IocProviderDecorator<E>;
596
626
 
597
627
  /**
628
+ * Represents a function that returns a value of type `T`.
629
+ *
598
630
  * @group general-types
631
+ *
632
+ * @template T - The return type of the function.
599
633
  */
600
634
  type Callable<T> = () => T;
601
635
 
602
636
  /**
603
- * Options for the {@link InjectablesProviderController}.
637
+ * Represents options for the {@link InjectablesProviderController}.
604
638
  *
605
- * @group provision
639
+ * @group Provision
606
640
  */
607
641
  interface InjectablesProviderControllerOptions {
608
642
  /**
@@ -626,14 +660,14 @@ interface InjectablesProviderControllerOptions {
626
660
  seeds?: SeedEntries;
627
661
  }
628
662
  /**
629
- * Controller that binds a set of injectables to an IoC container when the host connects
630
- * and unbinds them when the host disconnects.
663
+ * Controller that binds injectables to an IoC container for the host element's lifetime.
631
664
  *
632
- * When no `into` context is provided, the controller uses the nearest {@link IocProviderController}
633
- * ancestor via Lit context. Seeds are applied before entries so that `@Inject(SEEDS_TOKEN)`
634
- * works during service activation.
665
+ * @remarks
666
+ * Entries are bound when the host connects and unbound when it disconnects.
667
+ * If no `into` context is provided, it uses the nearest {@link IocProviderController}.
668
+ * Seeds are applied before entries are bound.
635
669
  *
636
- * @group provision
670
+ * @group Provision
637
671
  *
638
672
  * @example
639
673
  * ```typescript
@@ -648,7 +682,7 @@ interface InjectablesProviderControllerOptions {
648
682
  */
649
683
  declare class InjectablesProviderController<E extends ReactiveControllerHost & HTMLElement = ReactiveControllerHost & HTMLElement> implements ReactiveController {
650
684
  private readonly host;
651
- protected readonly consumer?: ContextConsumer<typeof ContainerContext, E>;
685
+ protected readonly consumer?: ContextConsumer<typeof IocContextObject, E>;
652
686
  private readonly entries;
653
687
  private readonly activate;
654
688
  private readonly seeds;
@@ -658,12 +692,12 @@ declare class InjectablesProviderController<E extends ReactiveControllerHost & H
658
692
  */
659
693
  private boundContext;
660
694
  /**
661
- * @param host - the host element
662
- * @param options - provisioning options
663
- * @param options.entries - list of service entries to bind to the container
664
- * @param options.into - target IoC context; if omitted, uses the nearest provider context
665
- * @param options.activate - list of service identifiers to activate immediately after binding
666
- * @param options.seeds - seed data applied before binding
695
+ * @param host - The host element.
696
+ * @param options - Provisioning options.
697
+ * @param options.entries - List of service entries to bind to the container.
698
+ * @param options.into - Target IoC context; if omitted, uses the nearest provider context.
699
+ * @param options.activate - List of service identifiers to activate immediately after binding.
700
+ * @param options.seeds - Seed data applied before binding.
667
701
  */
668
702
  constructor(host: E, options: InjectablesProviderControllerOptions);
669
703
  hostConnected(): void;
@@ -673,11 +707,12 @@ declare class InjectablesProviderController<E extends ReactiveControllerHost & H
673
707
  }
674
708
 
675
709
  /**
676
- * Type for the {@link injectablesProvide} decorator.
710
+ * Represents type for the {@link injectablesProvide} decorator.
677
711
  *
678
- * Supports both standard (TC39) and legacy experimental decorators.
712
+ * @remarks
713
+ * Supports both TC39 and legacy experimental decorators.
679
714
  *
680
- * @group provision
715
+ * @group Provision
681
716
  */
682
717
  interface InjectablesProviderDecorator<T extends ReactiveElement = ReactiveElement> {
683
718
  <C extends Interface<Omit<ReactiveElement, "renderRoot">>, V extends InjectablesProviderController<T>>(value: ClassAccessorDecoratorTarget<C, V>, context: ClassAccessorDecoratorContext<C, V>): void;
@@ -686,38 +721,32 @@ interface InjectablesProviderDecorator<T extends ReactiveElement = ReactiveEleme
686
721
  /**
687
722
  * Decorator that binds a set of injectables to the nearest IoC container for the host element's lifetime.
688
723
  *
724
+ * @remarks
689
725
  * Entries are bound when the host connects and unbound when it disconnects.
690
- * The decorated accessor or property holds the resulting {@link InjectablesProviderController} instance.
691
726
  *
692
- * @group provision
727
+ * @group Provision
693
728
  *
694
- * @param options - provisioning options
695
- * @returns injectables provider decorator instance
729
+ * @param options - Provisioning options.
730
+ * @returns An instance of {@link InjectablesProviderDecorator}.
696
731
  *
697
732
  * @example
698
733
  * ```typescript
699
734
  * class MyComponent extends LitElement {
700
735
  * @injectablesProvide({ entries: [AuthService, UserService], activate: [AuthService] })
701
- * public services!: InjectablesProviderController<MyComponent>;
736
+ * public controller!: InjectablesProviderController<MyComponent>;
702
737
  * }
703
738
  * ```
704
739
  */
705
740
  declare function injectablesProvide<E extends ReactiveElement = ReactiveElement>(options: InjectablesProviderControllerOptions): InjectablesProviderDecorator<E>;
706
741
 
707
742
  /**
708
- * Binds a set of injectables to the nearest IoC container for the host element's lifetime.
709
- *
710
- * Entries are bound when the host connects and unbound when it disconnects.
743
+ * Hook that binds injectables to the nearest IoC container for the host element's lifetime.
711
744
  *
712
- * @group provision
745
+ * @group Provision
713
746
  *
714
- * @param host - the host element
715
- * @param options - provisioning options
716
- * @param options.entries - list of service entries to bind to the container
717
- * @param options.into - target IoC context; if omitted, uses the nearest provider context
718
- * @param options.activate - list of service identifiers to activate immediately after binding
719
- * @param options.seeds - seed data applied before binding
720
- * @returns the controller instance
747
+ * @param host - The host element.
748
+ * @param options - Provisioning options.
749
+ * @returns An instance of {@link InjectablesProviderController}.
721
750
  *
722
751
  * @example
723
752
  * ```typescript
@@ -732,9 +761,9 @@ declare function injectablesProvide<E extends ReactiveElement = ReactiveElement>
732
761
  declare function useInjectablesProvider<E extends ReactiveControllerHost & HTMLElement>(host: E, options: InjectablesProviderControllerOptions): InjectablesProviderController<E>;
733
762
 
734
763
  /**
735
- * Options for the {@link useIocProvision} hook.
764
+ * Represents options for the {@link useIocProvision} hook.
736
765
  *
737
- * @group provision
766
+ * @group Provision
738
767
  */
739
768
  interface UseIocProvisionOptions {
740
769
  /**
@@ -747,24 +776,22 @@ interface UseIocProvisionOptions {
747
776
  seed?: AnyObject;
748
777
  }
749
778
  /**
750
- * Hook (controller) to provide an IoC container to the host element and its children.
779
+ * Hook that provides an IoC container to the host element and its children.
751
780
  *
752
- * @group provision
781
+ * @group Provision
753
782
  *
754
- * @param host - the host element
755
- * @param options - provisioning options
756
- * @param options.container - optional existing container to use
757
- * @param options.seed - optional seed data to apply to the container
758
- * @returns ioc provision controller instance
783
+ * @param host - The host element.
784
+ * @param options - Provisioning options.
785
+ * @returns An instance of {@link IocProviderController}.
759
786
  *
760
787
  * @example
761
788
  * ```typescript
762
789
  * class MyRootElement extends LitElement {
763
- * private ioc = useIocProvision(this, { seed: { initialData: '...' } });
790
+ * private ioc = useIocProvision(this, { seed: { initialData: "..." } });
764
791
  * }
765
792
  * ```
766
793
  */
767
794
  declare function useIocProvision<E extends ReactiveControllerHost & HTMLElement>(host: E, options?: UseIocProvisionOptions): IocProviderController<E>;
768
795
 
769
- export { ContainerContext, InjectablesProviderController, IocProviderController, OnCommandController, OnEventController, OnQueryController, injectablesProvide, injection, iocProvide, onCommand, onEvent, onQuery, useInjectablesProvider, useInjection, useIocProvision, useOnCommand, useOnEvents, useOnQuery };
770
- export type { InjectablesProviderControllerOptions, InjectablesProviderDecorator, InjectionDecorator, InjectionOptions, IocProviderControllerOptions, IocProviderDecorator, OnCommandDecorator, OnEventDecorator, OnQueryDecorator, UseInjectionOptions, UseInjectionValue, UseIocProvisionOptions, UseOnCommandOptions, UseOnEventsOptions, UseOnQueryOptions };
796
+ export { InjectablesProviderController, IocContextObject, IocProviderController, OnCommandController, OnEventController, OnQueryController, injectablesProvide, injection, iocProvide, onCommand, onEvent, onQuery, useInjectablesProvider, useInjection, useIocProvision, useOnCommand, useOnEvents, useOnQuery };
797
+ export type { InjectablesProviderControllerOptions, InjectablesProviderDecorator, InjectionDecorator, InjectionOptions, IocContext, IocProviderControllerOptions, IocProviderDecorator, OnCommandDecorator, OnEventDecorator, OnQueryDecorator, UseInjectionOptions, UseInjectionValue, UseIocProvisionOptions, UseOnCommandOptions, UseOnEventsOptions, UseOnQueryOptions };