@cydran/cydran 0.4.0 → 0.5.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.
package/dist/cydran.d.ts CHANGED
@@ -4,24 +4,24 @@ export declare abstract class AbstractBehavior<M, E extends HTMLElement | Text,
4
4
  private ____internal$$cydran____;
5
5
  constructor();
6
6
  requestDigestionSources(sources: DigestableSource[]): void;
7
- onInit(dependencies?: any): void;
7
+ onInit(dependencies?: unknown): void;
8
8
  onMount(): void;
9
9
  onUnmount(): void;
10
10
  onRemount(): void;
11
- protected notify(name: string, payload: any): void;
12
- protected notifyElement(name: string, payload: any, element: HTMLElement): void;
11
+ protected notify(name: string, payload: unknown): void;
12
+ protected notifyElement(name: string, payload: unknown, element: HTMLElement): void;
13
13
  /**
14
14
  * Get the active context instance reference by id
15
15
  * @return U
16
16
  */
17
- getObject<U>(id: string, ...instanceArguments: any[]): U;
17
+ getObject<U>(id: string, ...instanceArguments: unknown[]): U;
18
18
  /**
19
19
  * [message description]
20
20
  * @param {string} channelName [description]
21
21
  * @param {string} messageName [description]
22
22
  */
23
- send(messageName: string, payload?: any, startFrom?: string): SendContinuation;
24
- tell(name: string, payload?: any): void;
23
+ send(messageName: string, payload?: unknown, startFrom?: string): SendContinuation;
24
+ tell(name: string, payload?: unknown): void;
25
25
  on(messageName: string): OnContinuation;
26
26
  getParentId(): string;
27
27
  getId(): string;
@@ -30,10 +30,10 @@ export declare abstract class AbstractBehavior<M, E extends HTMLElement | Text,
30
30
  protected setDefaultExpression(defaultExpression: string): void;
31
31
  protected getExtractor(): Attributes;
32
32
  protected getParams(): P;
33
- protected getModelFn(): () => any;
34
- protected getValueFn(): () => any;
33
+ protected getModelFn(): () => unknown;
34
+ protected getValueFn(): () => unknown;
35
35
  protected bridge(name: string): void;
36
- protected invoke(params?: any): void;
36
+ protected invoke(params?: unknown): void;
37
37
  /**
38
38
  * Get the associated {HTMLElement html element} of this behavior.
39
39
  * @return {HTMLElement} [description]
@@ -59,12 +59,12 @@ export declare abstract class AbstractBehavior<M, E extends HTMLElement | Text,
59
59
  * @param {string} expression [description]
60
60
  * @return {mediator} [description]
61
61
  */
62
- protected mediate<T>(expression: string, reducerFn?: (input: any) => T): Mediator<T>;
62
+ protected mediate<T>(expression: string, reducerFn?: (input: unknown) => T): Mediator<T>;
63
63
  /**
64
64
  * [getModel description]
65
- * @return {any} [description]
65
+ * @return {unknown} [description]
66
66
  */
67
- protected getModel(): any;
67
+ protected getModel(): unknown;
68
68
  /**
69
69
  * [getTargetComponent description]
70
70
  * @return {Component} [description]
@@ -75,7 +75,7 @@ export declare abstract class AbstractBehavior<M, E extends HTMLElement | Text,
75
75
  * @return {Mediator} [description]
76
76
  */
77
77
  protected getMediator(): Mediator<M>;
78
- protected sync(): any;
78
+ protected sync(): void;
79
79
  /**
80
80
  * Get the expression specified
81
81
  * @return {string} [description]
@@ -95,7 +95,7 @@ export declare abstract class AbstractBehavior<M, E extends HTMLElement | Text,
95
95
  protected setConverters(converters: BehaviorAttributeConverters): void;
96
96
  protected setPrefixed(prefixed: boolean): void;
97
97
  protected setLoggerName(name: string): void;
98
- protected setReducerFn(reducerFn: (input: any) => M): void;
98
+ protected setReducerFn(reducerFn: (input: unknown) => M): void;
99
99
  }
100
100
  export declare abstract class AbstractValueBehavior<M, E extends HTMLElement | Text, P> extends AbstractBehavior<M, E, P> {
101
101
  constructor();
@@ -243,6 +243,10 @@ export declare enum To {
243
243
  * Sends a message to all immediate children of the current context.
244
244
  */
245
245
  IMMEDIATE_CHILDREN = "IMMEDIATE_CHILDREN",
246
+ /**
247
+ * Sends a message to all immediate child components of the current component.
248
+ */
249
+ IMMEDIATE_CHILD_COMPONENTS = "IMMEDIATE_CHILD_COMPONENTS",
246
250
  /**
247
251
  * Sends a message to the parent of the current context.
248
252
  */
@@ -257,13 +261,13 @@ export declare enum To {
257
261
  ROOT = "ROOT"
258
262
  }
259
263
  export declare function argumentsBuilder(): ArgumentsResolversBuilder;
260
- export declare function create(rootSelector: string, properties: SimpleMap<any>, callback?: (context: Context) => void, thisObject?: Object): Stage;
264
+ export declare function create(rootSelector: string, properties: SimpleMap<unknown>, callback?: (context: Context) => void, thisObject?: CallBackThisObject): Stage;
261
265
  export declare function enumKeys<O extends object, K extends keyof O = keyof O>(obj: O): K[];
262
266
  export declare function getLogger(key: string, label?: string): Logger;
263
- export declare function isDefined(value: any): boolean;
264
- export declare function merge<T>(sources: any[], customizers?: SimpleMap<(currentValue: any, overlayValue: any) => any>): T;
265
- export declare function noConflict(): any;
266
- export declare function overlay<T>(destination: T, sources: any[], customizers?: SimpleMap<(currentValue: any, overlayValue: any) => any>): T;
267
+ export declare function isDefined<T>(value: T): boolean;
268
+ export declare function merge<T>(sources: unknown[], customizers?: SimpleMap<(currentValue: unknown, overlayValue: unknown) => unknown>): T;
269
+ export declare function noConflict(): unknown;
270
+ export declare function overlay<T>(destination: T, sources: unknown[], customizers?: SimpleMap<(currentValue: unknown, overlayValue: unknown) => unknown>): T;
267
271
  export declare function padLeft(text: string, desiredLength: number, padCharacter: string): string;
268
272
  export declare function padRight(text: string, desiredLength: number, padCharacter: string): string;
269
273
  export declare function requireNotNull<T>(value: T, name: string): T;
@@ -271,10 +275,16 @@ export declare function requireValid(value: string, name: string, regex: RegExp)
271
275
  export declare function setStrictTypeChecksEnabled(value: boolean): void;
272
276
  export declare function stateMachineBuilder<M>(startState: string): MachineBuilder<M>;
273
277
  export declare function uuidV4(): string;
274
- export interface ActionContinuation extends Tellable, Messagable, Watchable {
278
+ export interface ActionContinuation extends Tellable, Messagable {
279
+ onExpressionValueChange(expression: string): WatchContinuation;
280
+ /**
281
+ * Evaluates an expression.
282
+ * @param expression Expression to evaluate.
283
+ */
284
+ evaluate<T>(expression: string): T;
275
285
  getParent(): Nestable;
276
286
  getEl(): HTMLElement;
277
- getObject<T>(id: string, ...instanceArguments: any[]): T;
287
+ getObject<T>(id: string, ...instanceArguments: unknown[]): T;
278
288
  getLogger(): Logger;
279
289
  properties(): Properties;
280
290
  getId(): string;
@@ -284,8 +294,8 @@ export interface ActionContinuation extends Tellable, Messagable, Watchable {
284
294
  getValue<T>(): T;
285
295
  isMounted(): boolean;
286
296
  isConnected(): boolean;
287
- send(messageName: string, payload?: any): SendContinuation;
288
- onInterval(millis?: Number): IntervalContinuation;
297
+ send(messageName: string, payload?: unknown): SendContinuation;
298
+ onInterval(millis?: number): IntervalContinuation;
289
299
  onMessage(messageName: string): OnContinuation;
290
300
  /**
291
301
  * Get a {@linkcode FilterBuilder} object back to create a {@linkcode Filter} of lists in the model
@@ -294,7 +304,7 @@ export interface ActionContinuation extends Tellable, Messagable, Watchable {
294
304
  */
295
305
  createFilter(expression: string): FilterBuilder;
296
306
  regions(): RegionContinuation;
297
- tell(name: string, payload?: any): void;
307
+ tell(name: string, payload?: unknown): void;
298
308
  forElement<E extends HTMLElement>(name: string): ElementOperations<E>;
299
309
  forSeries(name: string): SeriesOperations;
300
310
  forForm(name: string): FormOperations;
@@ -329,56 +339,56 @@ export interface Appender {
329
339
  * @param error error object to log stack with
330
340
  * @param moreArgs additional objects to log
331
341
  */
332
- trace(label: string, message: string, error?: Error, moreArgs?: any[]): void;
342
+ trace(label: string, message: string, error?: Error, moreArgs?: unknown[]): void;
333
343
  /**
334
344
  * Log payload at a "debug" level
335
345
  * @param label name of logger
336
346
  * @param message to be written out
337
347
  * @param error error object to log stack with
338
348
  */
339
- debug(label: string, message: string, error?: Error, moreArgs?: any[]): void;
349
+ debug(label: string, message: string, error?: Error, moreArgs?: unknown[]): void;
340
350
  /**
341
351
  * Log payload at a "info" level
342
352
  * @param label name of logger
343
353
  * @param message to be written out
344
354
  * @param error error object to log stack with
345
355
  */
346
- info(label: string, message: string, error?: Error, moreArgs?: any[]): void;
356
+ info(label: string, message: string, error?: Error, moreArgs?: unknown[]): void;
347
357
  /**
348
358
  * Log payload at a "warn" level
349
359
  * @param label name of logger
350
360
  * @param message to be written out
351
361
  * @param error error object to log stack with
352
362
  */
353
- warn(label: string, message: string, error?: Error, moreArgs?: any[]): void;
363
+ warn(label: string, message: string, error?: Error, moreArgs?: unknown[]): void;
354
364
  /**
355
365
  * Log payload at a "error" level
356
366
  * @param label name of logger
357
367
  * @param message to be written out
358
368
  * @param error error object to log stack with
359
369
  */
360
- error(label: string, message: string, error?: Error, moreArgs?: any[]): void;
370
+ error(label: string, message: string, error?: Error, moreArgs?: unknown[]): void;
361
371
  /**
362
372
  * Log payload at a "fatal" level
363
373
  * @param label name of logger
364
374
  * @param message to be written out
365
375
  * @param error error object to log stack with
366
376
  */
367
- fatal(label: string, message: string, error?: Error, moreArgs?: any[]): void;
377
+ fatal(label: string, message: string, error?: Error, moreArgs?: unknown[]): void;
368
378
  }
369
379
  export interface ArgumentOption {
370
380
  type: ArgumentType;
371
381
  }
372
382
  export interface ArgumentsResolvers {
373
- resolve(context: any, instanceArguments: any[]): any[];
374
- postProcess(context: any, targetObject: any, params: any[]): void;
383
+ resolve(context: unknown, instanceArguments: unknown[]): unknown[];
384
+ postProcess(context: unknown, targetObject: unknown, params: unknown[]): void;
375
385
  }
376
386
  export interface ArgumentsResolversBuilder extends Builder<ArgumentsResolvers> {
377
387
  /**
378
388
  * Intent to resolve a registered object in the Cydran service discovery functionality
379
389
  * @param id unique string key of the registered object
380
390
  */
381
- with(id: string, ...instanceArguments: any[]): ArgumentsResolversBuilder;
391
+ with(id: string, ...instanceArguments: unknown[]): ArgumentsResolversBuilder;
382
392
  /**
383
393
  * Intent to resolve function that will return a registered object in the Cydran service discovery functionality when invoked
384
394
  * @param id unique string key of the registered object
@@ -423,12 +433,12 @@ export interface ArgumentsResolversBuilder extends Builder<ArgumentsResolvers> {
423
433
  * Intent to resolve a defined function
424
434
  * @param fn function to resolve
425
435
  */
426
- withFunction(fn: () => any): ArgumentsResolversBuilder;
436
+ withFunction<T>(fn: () => T): ArgumentsResolversBuilder;
427
437
  /**
428
438
  * Intent to resolve raw constant value
429
439
  * @param value treated as a literal constant
430
440
  */
431
- withConstant(value: any): ArgumentsResolversBuilder;
441
+ withConstant<T>(value: T): ArgumentsResolversBuilder;
432
442
  /**
433
443
  * Intent to resolve a Cydran or application {Properties property} value
434
444
  * @param name property key name
@@ -468,28 +478,27 @@ export interface Attributes {
468
478
  }
469
479
  export interface Behavior<M, E extends HTMLElement | Text, P> extends DigestableSource, Tellable, Messagable {
470
480
  requestDigestionSources(sources: DigestableSource[]): void;
471
- onInit(dependencies?: any): void;
481
+ onInit(dependencies?: unknown): void;
472
482
  onMount(): void;
473
483
  onUnmount(): void;
474
484
  onRemount(): void;
475
485
  isFlagged(name: string): boolean;
476
486
  }
477
- export interface BehaviorAttributeConverters extends SimpleMap<(value: any) => any> {
478
- }
479
487
  export interface Builder<T> {
480
488
  build(): T;
481
489
  }
482
490
  export interface ComponentOptions {
483
- metadata?: SimpleMap<any>;
491
+ metadata?: SimpleMap<unknown>;
484
492
  prefix?: string;
485
493
  styles?: string;
494
+ name?: string;
486
495
  }
487
496
  export interface Context extends Sendable, Register<Context>, Tellable, Receivable {
488
497
  getChild(name: string): Context;
489
498
  hasChild(name: string): boolean;
490
499
  addChild(name: string, initializer?: (context: Context) => void): Context;
491
500
  removeChild(name: string): Context;
492
- getObject<T>(id: string, ...instanceArguments: any[]): T;
501
+ getObject<T>(id: string, ...instanceArguments: unknown[]): T;
493
502
  getProperties(): MutableProperties;
494
503
  getScope(): Scope;
495
504
  getRoot(): Context;
@@ -498,12 +507,12 @@ export interface Context extends Sendable, Register<Context>, Tellable, Receivab
498
507
  registerImplicit(id: string, template: string, options?: ComponentOptions): Context;
499
508
  getName(): string;
500
509
  getFullName(): string;
501
- addPreInitializer(thisObject: Object, callback: (context?: Context) => void): void;
502
- addInitializer(thisObject: Object, callback: (context?: Context) => void): void;
503
- addDisposer(thisObject: Object, callback: (context?: Context) => void): void;
504
- configure(callback: (context: Context) => void, thisObject?: Object): Context;
505
- addListener(thisObject: Object, callback: MessageCallback): void;
506
- removeListener(thisObject: Object, callback: MessageCallback): void;
510
+ addPreInitializer(thisObject: CallBackThisObject, callback: (context?: Context) => void): void;
511
+ addInitializer(thisObject: CallBackThisObject, callback: (context?: Context) => void): void;
512
+ addDisposer(thisObject: CallBackThisObject, callback: (context?: Context) => void): void;
513
+ configure(callback: (context: Context) => void, thisObject?: CallBackThisObject): Context;
514
+ addListener(thisObject: CallBackThisObject, callback: MessageCallback): void;
515
+ removeListener(thisObject: CallBackThisObject, callback: MessageCallback): void;
507
516
  }
508
517
  export interface DestinationContinuation {
509
518
  withPropagation(propagation: To): void;
@@ -527,14 +536,12 @@ export interface ElementOperations<E extends HTMLElement> {
527
536
  export interface Evaluatable {
528
537
  evaluate(): boolean;
529
538
  }
530
- export interface FieldValidations<S> extends SimpleMap<((field: any, instance: any, state: S) => string)[]> {
531
- }
532
539
  export interface Filter {
533
540
  /**
534
541
  * Get the resulting array of items after the filter has been applied
535
542
  * @returns array of filtered objects
536
543
  */
537
- items(): any[];
544
+ items(): unknown[];
538
545
  /**
539
546
  * Extend a {Filter filter} instance
540
547
  * @returns a {FilterBuilder} object
@@ -543,8 +550,8 @@ export interface Filter {
543
550
  }
544
551
  export interface FilterBuilder {
545
552
  withPredicate(expression: string, ...parameterExpressions: string[]): FilterBuilder;
546
- withPhase(fn: (input: any[]) => any[]): FilterBuilder;
547
- withSimplePredicate(predicate: (index: number, value: any) => boolean): FilterBuilder;
553
+ withPhase(fn: (input: unknown[]) => unknown[]): FilterBuilder;
554
+ withSimplePredicate(predicate: (index: number, value: unknown) => boolean): FilterBuilder;
548
555
  withSort(expression: string, ...parameterExpressions: string[]): FilterBuilder;
549
556
  withLimit(limit: number): FilterBuilder;
550
557
  with(fn: (builder: FilterBuilder) => void): FilterBuilder;
@@ -553,7 +560,7 @@ export interface FilterBuilder {
553
560
  limited(): LimitOffsetFilter;
554
561
  }
555
562
  export interface ForChannelContinuation {
556
- invoke(callback: (payload: any) => void): void;
563
+ invoke(name: string, before?: () => void, after?: () => void): void;
557
564
  }
558
565
  export interface FormOperations {
559
566
  submit(): void;
@@ -561,15 +568,15 @@ export interface FormOperations {
561
568
  reset(): void;
562
569
  }
563
570
  export interface InternalComponentOptions extends ComponentOptions {
564
- itemFn?: () => any;
565
- parentModelFn?: () => any;
571
+ itemFn?: () => unknown;
572
+ parentModelFn?: () => unknown;
566
573
  context?: Context;
567
574
  alwaysConnected?: boolean;
568
575
  parent?: Nestable;
569
576
  name?: string;
570
577
  }
571
578
  export interface IntervalContinuation {
572
- invoke(callback: () => void): void;
579
+ invoke(name: string): void;
573
580
  }
574
581
  export interface IsLevelType {
575
582
  /**
@@ -626,81 +633,81 @@ export interface Logger extends IsLevelType {
626
633
  * @param primaryMsg to be written out
627
634
  * @param moreArgs additional optional arguments; the last argument as an Error is assumed to be required for the stack ouptut regardless of log level
628
635
  */
629
- trace(primaryMsg: string, ...moreArgs: any[]): void;
636
+ trace(primaryMsg: string, ...moreArgs: unknown[]): void;
630
637
  /**
631
638
  * Log payload at a "debug" level
632
639
  * @param primaryMsg to be written out
633
640
  * @param moreArgs additional optional arguments; the last argument as an Error is assumed to be required for the stack ouptut regardless of log level
634
641
  */
635
- debug(primaryMsg: string, ...moreArgs: any[]): void;
642
+ debug(primaryMsg: string, ...moreArgs: unknown[]): void;
636
643
  /**
637
644
  * Log payload at a "info" level
638
645
  * @param primaryMsg to be written out
639
646
  * @param moreArgs additional optional arguments; the last argument as an Error is assumed to be required for the stack ouptut regardless of log level
640
647
  */
641
- info(primaryMsg: string, ...moreArgs: any[]): void;
648
+ info(primaryMsg: string, ...moreArgs: unknown[]): void;
642
649
  /**
643
650
  * Log payload at a "warn" level
644
651
  * @param primaryMsg to be written out
645
652
  * @param moreArgs additional optional arguments; the last argument as an Error is assumed to be required for the stack ouptut regardless of log level
646
653
  */
647
- warn(primaryMsg: string, ...moreArgs: any[]): void;
654
+ warn(primaryMsg: string, ...moreArgs: unknown[]): void;
648
655
  /**
649
656
  * Log payload at a "error" level
650
657
  * @param primaryMsg to be written out
651
658
  * @param moreArgs additional optional arguments; the last argument as an Error is assumed to be required for the stack ouptut regardless of log level
652
659
  */
653
- error(primaryMsg: string, ...moreArgs: any[]): void;
660
+ error(primaryMsg: string, ...moreArgs: unknown[]): void;
654
661
  /**
655
662
  * Log payload at a "fatal" level
656
663
  * @param primaryMsg to be written out
657
664
  * @param moreArgs additional optional arguments; the last argument as an Error is assumed to be required for the stack ouptut regardless of log level
658
665
  */
659
- fatal(primaryMsg: string, ...moreArgs: any[]): void;
666
+ fatal(primaryMsg: string, ...moreArgs: unknown[]): void;
660
667
  /**
661
668
  * Only if log at a "trace" level execute fn() to derive payload to log
662
669
  * @param primaryMsgFn result of to be written out
663
670
  * @param moreArgs additional optional arguments; the last argument as an Error is assumed to be required for the stack ouptut regardless of log level
664
671
  */
665
- ifTrace(primaryMsgFn: () => any, ...moreArgs: any[]): void;
672
+ ifTrace(primaryMsgFn: () => unknown, ...moreArgs: unknown[]): void;
666
673
  /**
667
674
  * Only if log at a "debug" level execute fn() to derive payload to log
668
675
  * @param primaryMsgFn result of to be written out
669
676
  * @param moreArgs additional optional arguments; the last argument as an Error is assumed to be required for the stack ouptut regardless of log level
670
677
  */
671
- ifDebug(primaryMsgFn: () => any, ...moreArgs: any[]): void;
678
+ ifDebug(primaryMsgFn: () => unknown, ...moreArgs: unknown[]): void;
672
679
  /**
673
680
  * Only if log at a "info" level execute fn() to derive payload to log
674
681
  * @param primaryMsgFn result of to be written out
675
682
  * @param moreArgs additional optional arguments; the last argument as an Error is assumed to be required for the stack ouptut regardless of log level
676
683
  */
677
- ifInfo(primaryMsgFn: () => any, ...moreArgs: any[]): void;
684
+ ifInfo(primaryMsgFn: () => unknown, ...moreArgs: unknown[]): void;
678
685
  /**
679
686
  * Only if log at a "warn" level execute fn() to derive payload to log
680
687
  * @param primaryMsgFn result of to be written out
681
688
  * @param moreArgs additional optional arguments; the last argument as an Error is assumed to be required for the stack ouptut regardless of log level
682
689
  */
683
- ifWarn(primaryMsgFn: () => any, ...moreArgs: any[]): void;
690
+ ifWarn(primaryMsgFn: () => unknown, ...moreArgs: unknown[]): void;
684
691
  /**
685
692
  * Only if log at a "error" level execute fn() to derive payload to log
686
693
  * @param primaryMsgFn result of to be written out
687
694
  * @param moreArgs additional optional arguments; the last argument as an Error is assumed to be required for the stack ouptut regardless of log level
688
695
  */
689
- ifError(primaryMsgFn: () => any, ...moreArgs: any[]): void;
696
+ ifError(primaryMsgFn: () => unknown, ...moreArgs: unknown[]): void;
690
697
  /**
691
698
  * Only if log at a "fatal" level execute fn() to derive payload to log
692
699
  * @param primaryMsgFn result of to be written out
693
700
  * @param moreArgs additional optional arguments; the last argument as an Error is assumed to be required for the stack ouptut regardless of log level
694
701
  */
695
- ifFatal(primaryMsgFn: () => any, ...moreArgs: any[]): void;
702
+ ifFatal(primaryMsgFn: () => unknown, ...moreArgs: unknown[]): void;
696
703
  }
697
704
  export interface Machine<M> extends Releasable {
698
705
  create(model: M): MachineState<M>;
699
- submit(input: string, machineState: MachineState<M>, parameter?: any): void;
706
+ submit(input: string, machineState: MachineState<M>, parameter?: unknown): void;
700
707
  }
701
708
  export interface MachineBuilder<M> {
702
- withState(state: string, callbacks: VarConsumer<any, M>[]): MachineBuilder<M>;
703
- withTransition(state: string, input: string, targetState: string, callbacks: VarConsumer<any, M>[], predicate?: VarPredicate<any, M>): MachineBuilder<M>;
709
+ withState(state: string, callbacks: VarConsumer<unknown, M>[]): MachineBuilder<M>;
710
+ withTransition(state: string, input: string, targetState: string, callbacks: VarConsumer<unknown, M>[], predicate?: VarPredicate<unknown, M>): MachineBuilder<M>;
704
711
  build(): Machine<M>;
705
712
  }
706
713
  export interface MachineState<M> extends Releasable {
@@ -710,15 +717,15 @@ export interface MachineState<M> extends Releasable {
710
717
  }
711
718
  export interface Mediator<T> extends Releasable, DigestionCandidate, Tellable {
712
719
  get(): T;
713
- set(value: any): void;
714
- watch(thisObject: Object, callback: (previous: T, current: T) => void): void;
720
+ set(value: unknown): void;
721
+ watch(thisObject: CallBackThisObject, name: string): void;
715
722
  }
716
723
  export interface Messagable {
717
- send(messageName: string, payload?: any): SendContinuation;
724
+ send(messageName: string, payload?: unknown): SendContinuation;
718
725
  }
719
726
  export interface MetadataContinuation {
720
727
  has: (name: string) => boolean;
721
- get: (name: string) => any;
728
+ get: <T>(name: string) => T;
722
729
  }
723
730
  export interface MutableProperties extends Properties {
724
731
  /**
@@ -727,13 +734,13 @@ export interface MutableProperties extends Properties {
727
734
  * @param value - any type of object
728
735
  * @returns
729
736
  */
730
- set(key: string, value: any): MutableProperties;
737
+ set(key: string, value: unknown): MutableProperties;
731
738
  /**
732
739
  * Load additional properties in
733
740
  * @param values - any type of object
734
741
  * @returns
735
742
  */
736
- load(values: any): MutableProperties;
743
+ load(values: SimpleMap<unknown>): MutableProperties;
737
744
  /**
738
745
  * Remove a specific property by key
739
746
  * @param key - string value
@@ -782,7 +789,7 @@ export interface Notifyable {
782
789
  notify(): void;
783
790
  }
784
791
  export interface OnContinuation {
785
- invoke(callback: (payload: any) => void): void;
792
+ invoke(name: string, before?: () => void, after?: () => void): void;
786
793
  forChannel(channelName: string): ForChannelContinuation;
787
794
  }
788
795
  export interface PagedFilter extends Filter {
@@ -817,16 +824,16 @@ export interface PropFlagVals {
817
824
  export interface Properties {
818
825
  /**
819
826
  * Add an observer for all property changes.
820
- * @param thisObject Object used as this when calling the callback
821
- * @param callback - callback function to be called when any property is changed
827
+ * @param thisObject Object that owns and is used as this when calling the named method
828
+ * @param name - name of the method (on thisObject) to be called when any property is changed
822
829
  */
823
- addObserver(thisObject: Object, callback: (key: string, value: any) => void): void;
830
+ addObserver(thisObject: CallBackThisObject, name: string): void;
824
831
  /**
825
832
  * Remove an observer that listened for all property changes.
826
- * @param thisObject Object used as this when calling the callback
827
- * @param callback callback function to be removed
833
+ * @param thisObject Object that owns the named method
834
+ * @param name name of the previously-registered method to be removed
828
835
  */
829
- removeObserver(thisObject: Object, callback: (key: string, value: any) => void): void;
836
+ removeObserver(thisObject: CallBackThisObject, name: string): void;
830
837
  /**
831
838
  * Add an observer for a specific property changes, or changes of more general property when the preferred is unavailable.
832
839
  * @param thisObject Object used as this when calling the callback
@@ -834,27 +841,27 @@ export interface Properties {
834
841
  * @param preferredKey Preferred property key to observe
835
842
  * @param prefix Property key prefix for keys which should be included for consideration
836
843
  */
837
- addFallbackObserver(thisObject: Object, callback: (key: string, value: any) => void, preferredKey: string, prefix?: string): void;
844
+ addFallbackObserver(thisObject: CallBackThisObject, name: string, preferredKey: string, prefix?: string): void;
838
845
  /**
839
846
  * Remove an observer for a specific property changes, or changes of more general property when the preferred is unavailable.
840
- * @param thisObject Object used as this when calling the callback
841
- * @param callback callback function to be removed
847
+ * @param thisObject Object that owns the named method
848
+ * @param name name of the previously-registered method to be removed
842
849
  */
843
- removeFallbackObserver(thisObject: Object, callback: (key: string, value: any) => void): void;
850
+ removeFallbackObserver(thisObject: CallBackThisObject, name: string): void;
844
851
  /**
845
852
  * Add an observer for specific property.
846
853
  * @param key Specific property key
847
- * @param thisObject Object used as this when calling the callback
848
- * @param callback callback function to be called when the specific property is changed
854
+ * @param thisObject Object that owns and is used as this when calling the named method
855
+ * @param name name of the method (on thisObject) to be called when the specific property is changed
849
856
  */
850
- addPropertyObserver(key: string, thisObject: Object, callback: (value: any) => void): void;
857
+ addPropertyObserver(key: string, thisObject: CallBackThisObject, name: string): void;
851
858
  /**
852
859
  * Remove an observer for specific property.
853
860
  * @param key Specific property key
854
- * @param thisObject Object used as this when calling the callback
855
- * @param callback callback function to remove
861
+ * @param thisObject Object that owns the named method
862
+ * @param name name of the previously-registered method to remove
856
863
  */
857
- removePropertyObserver(key: string, thisObject: Object, callback: (value: any) => void): void;
864
+ removePropertyObserver(key: string, thisObject: CallBackThisObject, name: string): void;
858
865
  snapshot(): MutableProperties;
859
866
  /**
860
867
  * Get all the keys present in the properties object
@@ -926,7 +933,7 @@ export interface Receivable {
926
933
  * @param messageName The name of the message to send.
927
934
  * @param payload The optional payload to include with the message.
928
935
  */
929
- message(channelName: string, messageName: string, payload?: any): void;
936
+ message(channelName: string, messageName: string, payload?: unknown): void;
930
937
  }
931
938
  export interface Receiver extends Releasable, Receivable {
932
939
  on(messageName: string): OnContinuation;
@@ -952,11 +959,11 @@ export interface RegionContinuation {
952
959
  setByObjectId(name: string, componentName: string, defaultComponentName?: string): void;
953
960
  }
954
961
  export interface Register<R> extends Releasable {
955
- registerConstant(id: string, instance: any): R;
956
- registerPrototype(id: string, classInstance: Type<any>, resolvers?: ArgumentsResolvers, localResolution?: boolean): R;
957
- registerPrototypeWithFactory(id: string, factoryFn: () => any, resolvers?: ArgumentsResolvers, localResolution?: boolean): R;
958
- registerSingleton(id: string, classInstance: Type<any>, resolvers?: ArgumentsResolvers, localResolution?: boolean): R;
959
- registerSingletonWithFactory(id: string, factoryFn: () => any, resolvers?: ArgumentsResolvers, localResolution?: boolean): R;
962
+ registerConstant<T>(id: string, instance: T): R;
963
+ registerPrototype<T>(id: string, classInstance: Type<T>, resolvers?: ArgumentsResolvers, localResolution?: boolean): R;
964
+ registerPrototypeWithFactory<T>(id: string, factoryFn: () => T, resolvers?: ArgumentsResolvers, localResolution?: boolean): R;
965
+ registerSingleton<T>(id: string, classInstance: Type<T>, resolvers?: ArgumentsResolvers, localResolution?: boolean): R;
966
+ registerSingletonWithFactory<T>(id: string, factoryFn: () => T, resolvers?: ArgumentsResolvers, localResolution?: boolean): R;
960
967
  hasRegistration(id: string): boolean;
961
968
  expose(id: string): R;
962
969
  }
@@ -967,7 +974,7 @@ export interface Renderer {
967
974
  render(): HTMLElement;
968
975
  }
969
976
  export interface Scope {
970
- add(name: string, item: any): Scope;
977
+ add(name: string, item: unknown): Scope;
971
978
  remove(name: string): Scope;
972
979
  extend(): Scope;
973
980
  }
@@ -986,7 +993,7 @@ export interface Sendable {
986
993
  * @param payload The optional payload to include with the message
987
994
  * @param startFrom The optional path to the context start the traversal from
988
995
  */
989
- send(propagation: To, channelName: string, messageName: string, payload?: any, startFrom?: string): void;
996
+ send(propagation: To, channelName: string, messageName: string, payload?: unknown, startFrom?: string): void;
990
997
  }
991
998
  export interface SeriesOperations {
992
999
  getAt<N extends Nestable>(index: number): N;
@@ -1003,9 +1010,6 @@ export interface SeriesOperations {
1003
1010
  isEmpty(): boolean;
1004
1011
  clear(): void;
1005
1012
  }
1006
- export interface SimpleMap<T> {
1007
- [key: string]: T;
1008
- }
1009
1013
  export interface Stage extends Releasable {
1010
1014
  getContext(): Context;
1011
1015
  before(): SeriesOperations;
@@ -1014,30 +1018,31 @@ export interface Stage extends Releasable {
1014
1018
  setComponent(component: Nestable): Stage;
1015
1019
  setComponentByObjectId(componentName: string, defaultComponentName?: string): Stage;
1016
1020
  isStarted(): boolean;
1017
- addInitializer(thisObject: Object, callback: (stage: Stage) => void): Stage;
1021
+ addInitializer(thisObject: CallBackThisObject, callback: (stage: Stage) => void): Stage;
1018
1022
  }
1019
1023
  export interface Tellable {
1020
- tell(name: string, payload?: any): void;
1021
- }
1022
- export interface Transmitter extends Sendable {
1024
+ tell(name: string, payload?: unknown): void;
1023
1025
  }
1024
- export interface Type<T> extends Function {
1025
- new (...args: any[]): T;
1026
- }
1027
- export interface Watchable {
1028
- onExpressionValueChange<T>(expression: string, callback: (previous: T, current: T) => void, reducerFn?: (input: any) => T, thisObject?: Object): void;
1029
- /**
1030
- * Evaluates an expression.
1031
- * @param expression Expression to evaluate.
1032
- */
1033
- evaluate<T>(expression: string): T;
1034
- getWatchScope(): any;
1026
+ export interface WatchContinuation {
1027
+ reducedBy<T>(reducerFn: (input: unknown) => T): WatchContinuation;
1028
+ invoke(name: string): void;
1035
1029
  }
1030
+ export type BehaviorAttributeConverters = SimpleMap<(value: string) => unknown>;
1036
1031
  export type BiConsumer<T, U> = (value0: T, value1?: U) => void;
1037
1032
  export type BiPredicate<T, U> = (value0: T, value1: U) => boolean;
1033
+ export type CallBackThisObject = object;
1038
1034
  export type Consumer<T> = (value: T) => void;
1039
- export type MessageCallback = (channelName: string, messageName: string, payload: any) => void;
1035
+ export type FieldValidations<S> = SimpleMap<((field: unknown, instance: unknown, state: S) => string)[]>;
1036
+ export type MessageCallback = (channelName: string, messageName: string, payload: unknown) => void;
1040
1037
  export type Predicate<T> = (value: T) => boolean;
1038
+ export type PropertyChangeCallback<T> = (value: T) => void;
1039
+ export type PropertyChangeFallbackCallback<T> = (key: string, value: T) => void;
1040
+ export type PropertyFallBackSubscriber = (thisObject: CallBackThisObject, name: string) => void;
1041
+ export type PropertyProvider<T> = () => T;
1042
+ export type PropertySubscriber = (thisObject: CallBackThisObject, name: string) => void;
1043
+ export type SimpleMap<T> = Record<string, T>;
1044
+ export type Transmitter = Sendable;
1045
+ export type Type<T> = new (...args: any[]) => T;
1041
1046
  export type VarConsumer<T, U> = (Consumer<T> | BiConsumer<T, U>);
1042
1047
  export type VarPredicate<T, U> = Predicate<T> | BiPredicate<T, U>;
1043
1048