@cydran/cydran 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cydran.d.ts +106 -102
- package/dist/cydran.js +422 -217
- package/dist/cydran.js.map +4 -4
- package/dist/cydran.min.js +19 -17
- package/dist/cydran.min.js.map +4 -4
- package/package.json +4 -19
- package/validate_log.txt +4534 -0
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?:
|
|
7
|
+
onInit(dependencies?: unknown): void;
|
|
8
8
|
onMount(): void;
|
|
9
9
|
onUnmount(): void;
|
|
10
10
|
onRemount(): void;
|
|
11
|
-
protected notify(name: string, payload:
|
|
12
|
-
protected notifyElement(name: string, payload:
|
|
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:
|
|
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?:
|
|
24
|
-
tell(name: string, payload?:
|
|
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(): () =>
|
|
34
|
-
protected getValueFn(): () =>
|
|
33
|
+
protected getModelFn(): () => unknown;
|
|
34
|
+
protected getValueFn(): () => unknown;
|
|
35
35
|
protected bridge(name: string): void;
|
|
36
|
-
protected invoke(params?:
|
|
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:
|
|
62
|
+
protected mediate<T>(expression: string, reducerFn?: (input: unknown) => T): Mediator<T>;
|
|
63
63
|
/**
|
|
64
64
|
* [getModel description]
|
|
65
|
-
* @return {
|
|
65
|
+
* @return {unknown} [description]
|
|
66
66
|
*/
|
|
67
|
-
protected getModel():
|
|
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():
|
|
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:
|
|
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<
|
|
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:
|
|
264
|
-
export declare function merge<T>(sources:
|
|
265
|
-
export declare function noConflict():
|
|
266
|
-
export declare function overlay<T>(destination: T, sources:
|
|
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;
|
|
@@ -274,7 +278,7 @@ export declare function uuidV4(): string;
|
|
|
274
278
|
export interface ActionContinuation extends Tellable, Messagable, Watchable {
|
|
275
279
|
getParent(): Nestable;
|
|
276
280
|
getEl(): HTMLElement;
|
|
277
|
-
getObject<T>(id: string, ...instanceArguments:
|
|
281
|
+
getObject<T>(id: string, ...instanceArguments: unknown[]): T;
|
|
278
282
|
getLogger(): Logger;
|
|
279
283
|
properties(): Properties;
|
|
280
284
|
getId(): string;
|
|
@@ -284,8 +288,8 @@ export interface ActionContinuation extends Tellable, Messagable, Watchable {
|
|
|
284
288
|
getValue<T>(): T;
|
|
285
289
|
isMounted(): boolean;
|
|
286
290
|
isConnected(): boolean;
|
|
287
|
-
send(messageName: string, payload?:
|
|
288
|
-
onInterval(millis?:
|
|
291
|
+
send(messageName: string, payload?: unknown): SendContinuation;
|
|
292
|
+
onInterval(millis?: number): IntervalContinuation;
|
|
289
293
|
onMessage(messageName: string): OnContinuation;
|
|
290
294
|
/**
|
|
291
295
|
* Get a {@linkcode FilterBuilder} object back to create a {@linkcode Filter} of lists in the model
|
|
@@ -294,7 +298,7 @@ export interface ActionContinuation extends Tellable, Messagable, Watchable {
|
|
|
294
298
|
*/
|
|
295
299
|
createFilter(expression: string): FilterBuilder;
|
|
296
300
|
regions(): RegionContinuation;
|
|
297
|
-
tell(name: string, payload?:
|
|
301
|
+
tell(name: string, payload?: unknown): void;
|
|
298
302
|
forElement<E extends HTMLElement>(name: string): ElementOperations<E>;
|
|
299
303
|
forSeries(name: string): SeriesOperations;
|
|
300
304
|
forForm(name: string): FormOperations;
|
|
@@ -329,56 +333,56 @@ export interface Appender {
|
|
|
329
333
|
* @param error error object to log stack with
|
|
330
334
|
* @param moreArgs additional objects to log
|
|
331
335
|
*/
|
|
332
|
-
trace(label: string, message: string, error?: Error, moreArgs?:
|
|
336
|
+
trace(label: string, message: string, error?: Error, moreArgs?: unknown[]): void;
|
|
333
337
|
/**
|
|
334
338
|
* Log payload at a "debug" level
|
|
335
339
|
* @param label name of logger
|
|
336
340
|
* @param message to be written out
|
|
337
341
|
* @param error error object to log stack with
|
|
338
342
|
*/
|
|
339
|
-
debug(label: string, message: string, error?: Error, moreArgs?:
|
|
343
|
+
debug(label: string, message: string, error?: Error, moreArgs?: unknown[]): void;
|
|
340
344
|
/**
|
|
341
345
|
* Log payload at a "info" level
|
|
342
346
|
* @param label name of logger
|
|
343
347
|
* @param message to be written out
|
|
344
348
|
* @param error error object to log stack with
|
|
345
349
|
*/
|
|
346
|
-
info(label: string, message: string, error?: Error, moreArgs?:
|
|
350
|
+
info(label: string, message: string, error?: Error, moreArgs?: unknown[]): void;
|
|
347
351
|
/**
|
|
348
352
|
* Log payload at a "warn" level
|
|
349
353
|
* @param label name of logger
|
|
350
354
|
* @param message to be written out
|
|
351
355
|
* @param error error object to log stack with
|
|
352
356
|
*/
|
|
353
|
-
warn(label: string, message: string, error?: Error, moreArgs?:
|
|
357
|
+
warn(label: string, message: string, error?: Error, moreArgs?: unknown[]): void;
|
|
354
358
|
/**
|
|
355
359
|
* Log payload at a "error" level
|
|
356
360
|
* @param label name of logger
|
|
357
361
|
* @param message to be written out
|
|
358
362
|
* @param error error object to log stack with
|
|
359
363
|
*/
|
|
360
|
-
error(label: string, message: string, error?: Error, moreArgs?:
|
|
364
|
+
error(label: string, message: string, error?: Error, moreArgs?: unknown[]): void;
|
|
361
365
|
/**
|
|
362
366
|
* Log payload at a "fatal" level
|
|
363
367
|
* @param label name of logger
|
|
364
368
|
* @param message to be written out
|
|
365
369
|
* @param error error object to log stack with
|
|
366
370
|
*/
|
|
367
|
-
fatal(label: string, message: string, error?: Error, moreArgs?:
|
|
371
|
+
fatal(label: string, message: string, error?: Error, moreArgs?: unknown[]): void;
|
|
368
372
|
}
|
|
369
373
|
export interface ArgumentOption {
|
|
370
374
|
type: ArgumentType;
|
|
371
375
|
}
|
|
372
376
|
export interface ArgumentsResolvers {
|
|
373
|
-
resolve(context:
|
|
374
|
-
postProcess(context:
|
|
377
|
+
resolve(context: unknown, instanceArguments: unknown[]): unknown[];
|
|
378
|
+
postProcess(context: unknown, targetObject: unknown, params: unknown[]): void;
|
|
375
379
|
}
|
|
376
380
|
export interface ArgumentsResolversBuilder extends Builder<ArgumentsResolvers> {
|
|
377
381
|
/**
|
|
378
382
|
* Intent to resolve a registered object in the Cydran service discovery functionality
|
|
379
383
|
* @param id unique string key of the registered object
|
|
380
384
|
*/
|
|
381
|
-
with(id: string, ...instanceArguments:
|
|
385
|
+
with(id: string, ...instanceArguments: unknown[]): ArgumentsResolversBuilder;
|
|
382
386
|
/**
|
|
383
387
|
* Intent to resolve function that will return a registered object in the Cydran service discovery functionality when invoked
|
|
384
388
|
* @param id unique string key of the registered object
|
|
@@ -423,12 +427,12 @@ export interface ArgumentsResolversBuilder extends Builder<ArgumentsResolvers> {
|
|
|
423
427
|
* Intent to resolve a defined function
|
|
424
428
|
* @param fn function to resolve
|
|
425
429
|
*/
|
|
426
|
-
withFunction(fn: () =>
|
|
430
|
+
withFunction<T>(fn: () => T): ArgumentsResolversBuilder;
|
|
427
431
|
/**
|
|
428
432
|
* Intent to resolve raw constant value
|
|
429
433
|
* @param value treated as a literal constant
|
|
430
434
|
*/
|
|
431
|
-
withConstant(value:
|
|
435
|
+
withConstant<T>(value: T): ArgumentsResolversBuilder;
|
|
432
436
|
/**
|
|
433
437
|
* Intent to resolve a Cydran or application {Properties property} value
|
|
434
438
|
* @param name property key name
|
|
@@ -468,28 +472,27 @@ export interface Attributes {
|
|
|
468
472
|
}
|
|
469
473
|
export interface Behavior<M, E extends HTMLElement | Text, P> extends DigestableSource, Tellable, Messagable {
|
|
470
474
|
requestDigestionSources(sources: DigestableSource[]): void;
|
|
471
|
-
onInit(dependencies?:
|
|
475
|
+
onInit(dependencies?: unknown): void;
|
|
472
476
|
onMount(): void;
|
|
473
477
|
onUnmount(): void;
|
|
474
478
|
onRemount(): void;
|
|
475
479
|
isFlagged(name: string): boolean;
|
|
476
480
|
}
|
|
477
|
-
export interface BehaviorAttributeConverters extends SimpleMap<(value: any) => any> {
|
|
478
|
-
}
|
|
479
481
|
export interface Builder<T> {
|
|
480
482
|
build(): T;
|
|
481
483
|
}
|
|
482
484
|
export interface ComponentOptions {
|
|
483
|
-
metadata?: SimpleMap<
|
|
485
|
+
metadata?: SimpleMap<unknown>;
|
|
484
486
|
prefix?: string;
|
|
485
487
|
styles?: string;
|
|
488
|
+
name?: string;
|
|
486
489
|
}
|
|
487
490
|
export interface Context extends Sendable, Register<Context>, Tellable, Receivable {
|
|
488
491
|
getChild(name: string): Context;
|
|
489
492
|
hasChild(name: string): boolean;
|
|
490
493
|
addChild(name: string, initializer?: (context: Context) => void): Context;
|
|
491
494
|
removeChild(name: string): Context;
|
|
492
|
-
getObject<T>(id: string, ...instanceArguments:
|
|
495
|
+
getObject<T>(id: string, ...instanceArguments: unknown[]): T;
|
|
493
496
|
getProperties(): MutableProperties;
|
|
494
497
|
getScope(): Scope;
|
|
495
498
|
getRoot(): Context;
|
|
@@ -498,12 +501,12 @@ export interface Context extends Sendable, Register<Context>, Tellable, Receivab
|
|
|
498
501
|
registerImplicit(id: string, template: string, options?: ComponentOptions): Context;
|
|
499
502
|
getName(): string;
|
|
500
503
|
getFullName(): string;
|
|
501
|
-
addPreInitializer(thisObject:
|
|
502
|
-
addInitializer(thisObject:
|
|
503
|
-
addDisposer(thisObject:
|
|
504
|
-
configure(callback: (context: Context) => void, thisObject?:
|
|
505
|
-
addListener(thisObject:
|
|
506
|
-
removeListener(thisObject:
|
|
504
|
+
addPreInitializer(thisObject: CallBackThisObject, callback: (context?: Context) => void): void;
|
|
505
|
+
addInitializer(thisObject: CallBackThisObject, callback: (context?: Context) => void): void;
|
|
506
|
+
addDisposer(thisObject: CallBackThisObject, callback: (context?: Context) => void): void;
|
|
507
|
+
configure(callback: (context: Context) => void, thisObject?: CallBackThisObject): Context;
|
|
508
|
+
addListener(thisObject: CallBackThisObject, callback: MessageCallback): void;
|
|
509
|
+
removeListener(thisObject: CallBackThisObject, callback: MessageCallback): void;
|
|
507
510
|
}
|
|
508
511
|
export interface DestinationContinuation {
|
|
509
512
|
withPropagation(propagation: To): void;
|
|
@@ -527,14 +530,12 @@ export interface ElementOperations<E extends HTMLElement> {
|
|
|
527
530
|
export interface Evaluatable {
|
|
528
531
|
evaluate(): boolean;
|
|
529
532
|
}
|
|
530
|
-
export interface FieldValidations<S> extends SimpleMap<((field: any, instance: any, state: S) => string)[]> {
|
|
531
|
-
}
|
|
532
533
|
export interface Filter {
|
|
533
534
|
/**
|
|
534
535
|
* Get the resulting array of items after the filter has been applied
|
|
535
536
|
* @returns array of filtered objects
|
|
536
537
|
*/
|
|
537
|
-
items():
|
|
538
|
+
items(): unknown[];
|
|
538
539
|
/**
|
|
539
540
|
* Extend a {Filter filter} instance
|
|
540
541
|
* @returns a {FilterBuilder} object
|
|
@@ -543,8 +544,8 @@ export interface Filter {
|
|
|
543
544
|
}
|
|
544
545
|
export interface FilterBuilder {
|
|
545
546
|
withPredicate(expression: string, ...parameterExpressions: string[]): FilterBuilder;
|
|
546
|
-
withPhase(fn: (input:
|
|
547
|
-
withSimplePredicate(predicate: (index: number, value:
|
|
547
|
+
withPhase(fn: (input: unknown[]) => unknown[]): FilterBuilder;
|
|
548
|
+
withSimplePredicate(predicate: (index: number, value: unknown) => boolean): FilterBuilder;
|
|
548
549
|
withSort(expression: string, ...parameterExpressions: string[]): FilterBuilder;
|
|
549
550
|
withLimit(limit: number): FilterBuilder;
|
|
550
551
|
with(fn: (builder: FilterBuilder) => void): FilterBuilder;
|
|
@@ -553,7 +554,7 @@ export interface FilterBuilder {
|
|
|
553
554
|
limited(): LimitOffsetFilter;
|
|
554
555
|
}
|
|
555
556
|
export interface ForChannelContinuation {
|
|
556
|
-
invoke(callback: (payload:
|
|
557
|
+
invoke(callback: (payload: unknown) => void): void;
|
|
557
558
|
}
|
|
558
559
|
export interface FormOperations {
|
|
559
560
|
submit(): void;
|
|
@@ -561,8 +562,8 @@ export interface FormOperations {
|
|
|
561
562
|
reset(): void;
|
|
562
563
|
}
|
|
563
564
|
export interface InternalComponentOptions extends ComponentOptions {
|
|
564
|
-
itemFn?: () =>
|
|
565
|
-
parentModelFn?: () =>
|
|
565
|
+
itemFn?: () => unknown;
|
|
566
|
+
parentModelFn?: () => unknown;
|
|
566
567
|
context?: Context;
|
|
567
568
|
alwaysConnected?: boolean;
|
|
568
569
|
parent?: Nestable;
|
|
@@ -626,81 +627,81 @@ export interface Logger extends IsLevelType {
|
|
|
626
627
|
* @param primaryMsg to be written out
|
|
627
628
|
* @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
629
|
*/
|
|
629
|
-
trace(primaryMsg: string, ...moreArgs:
|
|
630
|
+
trace(primaryMsg: string, ...moreArgs: unknown[]): void;
|
|
630
631
|
/**
|
|
631
632
|
* Log payload at a "debug" level
|
|
632
633
|
* @param primaryMsg to be written out
|
|
633
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
|
|
634
635
|
*/
|
|
635
|
-
debug(primaryMsg: string, ...moreArgs:
|
|
636
|
+
debug(primaryMsg: string, ...moreArgs: unknown[]): void;
|
|
636
637
|
/**
|
|
637
638
|
* Log payload at a "info" level
|
|
638
639
|
* @param primaryMsg to be written out
|
|
639
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
|
|
640
641
|
*/
|
|
641
|
-
info(primaryMsg: string, ...moreArgs:
|
|
642
|
+
info(primaryMsg: string, ...moreArgs: unknown[]): void;
|
|
642
643
|
/**
|
|
643
644
|
* Log payload at a "warn" level
|
|
644
645
|
* @param primaryMsg to be written out
|
|
645
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
|
|
646
647
|
*/
|
|
647
|
-
warn(primaryMsg: string, ...moreArgs:
|
|
648
|
+
warn(primaryMsg: string, ...moreArgs: unknown[]): void;
|
|
648
649
|
/**
|
|
649
650
|
* Log payload at a "error" level
|
|
650
651
|
* @param primaryMsg to be written out
|
|
651
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
|
|
652
653
|
*/
|
|
653
|
-
error(primaryMsg: string, ...moreArgs:
|
|
654
|
+
error(primaryMsg: string, ...moreArgs: unknown[]): void;
|
|
654
655
|
/**
|
|
655
656
|
* Log payload at a "fatal" level
|
|
656
657
|
* @param primaryMsg to be written out
|
|
657
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
|
|
658
659
|
*/
|
|
659
|
-
fatal(primaryMsg: string, ...moreArgs:
|
|
660
|
+
fatal(primaryMsg: string, ...moreArgs: unknown[]): void;
|
|
660
661
|
/**
|
|
661
662
|
* Only if log at a "trace" level execute fn() to derive payload to log
|
|
662
663
|
* @param primaryMsgFn result of to be written out
|
|
663
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
|
|
664
665
|
*/
|
|
665
|
-
ifTrace(primaryMsgFn: () =>
|
|
666
|
+
ifTrace(primaryMsgFn: () => unknown, ...moreArgs: unknown[]): void;
|
|
666
667
|
/**
|
|
667
668
|
* Only if log at a "debug" level execute fn() to derive payload to log
|
|
668
669
|
* @param primaryMsgFn result of to be written out
|
|
669
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
|
|
670
671
|
*/
|
|
671
|
-
ifDebug(primaryMsgFn: () =>
|
|
672
|
+
ifDebug(primaryMsgFn: () => unknown, ...moreArgs: unknown[]): void;
|
|
672
673
|
/**
|
|
673
674
|
* Only if log at a "info" level execute fn() to derive payload to log
|
|
674
675
|
* @param primaryMsgFn result of to be written out
|
|
675
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
|
|
676
677
|
*/
|
|
677
|
-
ifInfo(primaryMsgFn: () =>
|
|
678
|
+
ifInfo(primaryMsgFn: () => unknown, ...moreArgs: unknown[]): void;
|
|
678
679
|
/**
|
|
679
680
|
* Only if log at a "warn" level execute fn() to derive payload to log
|
|
680
681
|
* @param primaryMsgFn result of to be written out
|
|
681
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
|
|
682
683
|
*/
|
|
683
|
-
ifWarn(primaryMsgFn: () =>
|
|
684
|
+
ifWarn(primaryMsgFn: () => unknown, ...moreArgs: unknown[]): void;
|
|
684
685
|
/**
|
|
685
686
|
* Only if log at a "error" level execute fn() to derive payload to log
|
|
686
687
|
* @param primaryMsgFn result of to be written out
|
|
687
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
|
|
688
689
|
*/
|
|
689
|
-
ifError(primaryMsgFn: () =>
|
|
690
|
+
ifError(primaryMsgFn: () => unknown, ...moreArgs: unknown[]): void;
|
|
690
691
|
/**
|
|
691
692
|
* Only if log at a "fatal" level execute fn() to derive payload to log
|
|
692
693
|
* @param primaryMsgFn result of to be written out
|
|
693
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
|
|
694
695
|
*/
|
|
695
|
-
ifFatal(primaryMsgFn: () =>
|
|
696
|
+
ifFatal(primaryMsgFn: () => unknown, ...moreArgs: unknown[]): void;
|
|
696
697
|
}
|
|
697
698
|
export interface Machine<M> extends Releasable {
|
|
698
699
|
create(model: M): MachineState<M>;
|
|
699
|
-
submit(input: string, machineState: MachineState<M>, parameter?:
|
|
700
|
+
submit(input: string, machineState: MachineState<M>, parameter?: unknown): void;
|
|
700
701
|
}
|
|
701
702
|
export interface MachineBuilder<M> {
|
|
702
|
-
withState(state: string, callbacks: VarConsumer<
|
|
703
|
-
withTransition(state: string, input: string, targetState: string, callbacks: VarConsumer<
|
|
703
|
+
withState(state: string, callbacks: VarConsumer<unknown, M>[]): MachineBuilder<M>;
|
|
704
|
+
withTransition(state: string, input: string, targetState: string, callbacks: VarConsumer<unknown, M>[], predicate?: VarPredicate<unknown, M>): MachineBuilder<M>;
|
|
704
705
|
build(): Machine<M>;
|
|
705
706
|
}
|
|
706
707
|
export interface MachineState<M> extends Releasable {
|
|
@@ -710,15 +711,15 @@ export interface MachineState<M> extends Releasable {
|
|
|
710
711
|
}
|
|
711
712
|
export interface Mediator<T> extends Releasable, DigestionCandidate, Tellable {
|
|
712
713
|
get(): T;
|
|
713
|
-
set(value:
|
|
714
|
-
watch(thisObject:
|
|
714
|
+
set(value: unknown): void;
|
|
715
|
+
watch(thisObject: CallBackThisObject, callback: (previous: T, current: T) => void): void;
|
|
715
716
|
}
|
|
716
717
|
export interface Messagable {
|
|
717
|
-
send(messageName: string, payload?:
|
|
718
|
+
send(messageName: string, payload?: unknown): SendContinuation;
|
|
718
719
|
}
|
|
719
720
|
export interface MetadataContinuation {
|
|
720
721
|
has: (name: string) => boolean;
|
|
721
|
-
get: (name: string) =>
|
|
722
|
+
get: <T>(name: string) => T;
|
|
722
723
|
}
|
|
723
724
|
export interface MutableProperties extends Properties {
|
|
724
725
|
/**
|
|
@@ -727,13 +728,13 @@ export interface MutableProperties extends Properties {
|
|
|
727
728
|
* @param value - any type of object
|
|
728
729
|
* @returns
|
|
729
730
|
*/
|
|
730
|
-
set(key: string, value:
|
|
731
|
+
set(key: string, value: unknown): MutableProperties;
|
|
731
732
|
/**
|
|
732
733
|
* Load additional properties in
|
|
733
734
|
* @param values - any type of object
|
|
734
735
|
* @returns
|
|
735
736
|
*/
|
|
736
|
-
load(values:
|
|
737
|
+
load(values: SimpleMap<unknown>): MutableProperties;
|
|
737
738
|
/**
|
|
738
739
|
* Remove a specific property by key
|
|
739
740
|
* @param key - string value
|
|
@@ -782,7 +783,7 @@ export interface Notifyable {
|
|
|
782
783
|
notify(): void;
|
|
783
784
|
}
|
|
784
785
|
export interface OnContinuation {
|
|
785
|
-
invoke(callback: (payload:
|
|
786
|
+
invoke(callback: (payload: unknown) => void): void;
|
|
786
787
|
forChannel(channelName: string): ForChannelContinuation;
|
|
787
788
|
}
|
|
788
789
|
export interface PagedFilter extends Filter {
|
|
@@ -820,13 +821,13 @@ export interface Properties {
|
|
|
820
821
|
* @param thisObject Object used as this when calling the callback
|
|
821
822
|
* @param callback - callback function to be called when any property is changed
|
|
822
823
|
*/
|
|
823
|
-
addObserver(thisObject:
|
|
824
|
+
addObserver(thisObject: CallBackThisObject, callback: (key: string, value: unknown) => void): void;
|
|
824
825
|
/**
|
|
825
826
|
* Remove an observer that listened for all property changes.
|
|
826
827
|
* @param thisObject Object used as this when calling the callback
|
|
827
828
|
* @param callback callback function to be removed
|
|
828
829
|
*/
|
|
829
|
-
removeObserver(thisObject:
|
|
830
|
+
removeObserver(thisObject: CallBackThisObject, callback: (key: string, value: unknown) => void): void;
|
|
830
831
|
/**
|
|
831
832
|
* Add an observer for a specific property changes, or changes of more general property when the preferred is unavailable.
|
|
832
833
|
* @param thisObject Object used as this when calling the callback
|
|
@@ -834,27 +835,27 @@ export interface Properties {
|
|
|
834
835
|
* @param preferredKey Preferred property key to observe
|
|
835
836
|
* @param prefix Property key prefix for keys which should be included for consideration
|
|
836
837
|
*/
|
|
837
|
-
addFallbackObserver(thisObject:
|
|
838
|
+
addFallbackObserver(thisObject: CallBackThisObject, callback: (key: string, value: unknown) => void, preferredKey: string, prefix?: string): void;
|
|
838
839
|
/**
|
|
839
840
|
* Remove an observer for a specific property changes, or changes of more general property when the preferred is unavailable.
|
|
840
841
|
* @param thisObject Object used as this when calling the callback
|
|
841
842
|
* @param callback callback function to be removed
|
|
842
843
|
*/
|
|
843
|
-
removeFallbackObserver(thisObject:
|
|
844
|
+
removeFallbackObserver(thisObject: CallBackThisObject, callback: (key: string, value: unknown) => void): void;
|
|
844
845
|
/**
|
|
845
846
|
* Add an observer for specific property.
|
|
846
847
|
* @param key Specific property key
|
|
847
848
|
* @param thisObject Object used as this when calling the callback
|
|
848
849
|
* @param callback callback function to be called when the specific property is changed
|
|
849
850
|
*/
|
|
850
|
-
addPropertyObserver(key: string, thisObject:
|
|
851
|
+
addPropertyObserver(key: string, thisObject: CallBackThisObject, callback: (value: unknown) => void): void;
|
|
851
852
|
/**
|
|
852
853
|
* Remove an observer for specific property.
|
|
853
854
|
* @param key Specific property key
|
|
854
855
|
* @param thisObject Object used as this when calling the callback
|
|
855
856
|
* @param callback callback function to remove
|
|
856
857
|
*/
|
|
857
|
-
removePropertyObserver(key: string, thisObject:
|
|
858
|
+
removePropertyObserver(key: string, thisObject: CallBackThisObject, callback: (value: unknown) => void): void;
|
|
858
859
|
snapshot(): MutableProperties;
|
|
859
860
|
/**
|
|
860
861
|
* Get all the keys present in the properties object
|
|
@@ -926,7 +927,7 @@ export interface Receivable {
|
|
|
926
927
|
* @param messageName The name of the message to send.
|
|
927
928
|
* @param payload The optional payload to include with the message.
|
|
928
929
|
*/
|
|
929
|
-
message(channelName: string, messageName: string, payload?:
|
|
930
|
+
message(channelName: string, messageName: string, payload?: unknown): void;
|
|
930
931
|
}
|
|
931
932
|
export interface Receiver extends Releasable, Receivable {
|
|
932
933
|
on(messageName: string): OnContinuation;
|
|
@@ -952,11 +953,11 @@ export interface RegionContinuation {
|
|
|
952
953
|
setByObjectId(name: string, componentName: string, defaultComponentName?: string): void;
|
|
953
954
|
}
|
|
954
955
|
export interface Register<R> extends Releasable {
|
|
955
|
-
registerConstant(id: string, instance:
|
|
956
|
-
registerPrototype(id: string, classInstance: Type<
|
|
957
|
-
registerPrototypeWithFactory(id: string, factoryFn: () =>
|
|
958
|
-
registerSingleton(id: string, classInstance: Type<
|
|
959
|
-
registerSingletonWithFactory(id: string, factoryFn: () =>
|
|
956
|
+
registerConstant<T>(id: string, instance: T): R;
|
|
957
|
+
registerPrototype<T>(id: string, classInstance: Type<T>, resolvers?: ArgumentsResolvers, localResolution?: boolean): R;
|
|
958
|
+
registerPrototypeWithFactory<T>(id: string, factoryFn: () => T, resolvers?: ArgumentsResolvers, localResolution?: boolean): R;
|
|
959
|
+
registerSingleton<T>(id: string, classInstance: Type<T>, resolvers?: ArgumentsResolvers, localResolution?: boolean): R;
|
|
960
|
+
registerSingletonWithFactory<T>(id: string, factoryFn: () => T, resolvers?: ArgumentsResolvers, localResolution?: boolean): R;
|
|
960
961
|
hasRegistration(id: string): boolean;
|
|
961
962
|
expose(id: string): R;
|
|
962
963
|
}
|
|
@@ -967,7 +968,7 @@ export interface Renderer {
|
|
|
967
968
|
render(): HTMLElement;
|
|
968
969
|
}
|
|
969
970
|
export interface Scope {
|
|
970
|
-
add(name: string, item:
|
|
971
|
+
add(name: string, item: unknown): Scope;
|
|
971
972
|
remove(name: string): Scope;
|
|
972
973
|
extend(): Scope;
|
|
973
974
|
}
|
|
@@ -986,7 +987,7 @@ export interface Sendable {
|
|
|
986
987
|
* @param payload The optional payload to include with the message
|
|
987
988
|
* @param startFrom The optional path to the context start the traversal from
|
|
988
989
|
*/
|
|
989
|
-
send(propagation: To, channelName: string, messageName: string, payload?:
|
|
990
|
+
send(propagation: To, channelName: string, messageName: string, payload?: unknown, startFrom?: string): void;
|
|
990
991
|
}
|
|
991
992
|
export interface SeriesOperations {
|
|
992
993
|
getAt<N extends Nestable>(index: number): N;
|
|
@@ -1003,9 +1004,6 @@ export interface SeriesOperations {
|
|
|
1003
1004
|
isEmpty(): boolean;
|
|
1004
1005
|
clear(): void;
|
|
1005
1006
|
}
|
|
1006
|
-
export interface SimpleMap<T> {
|
|
1007
|
-
[key: string]: T;
|
|
1008
|
-
}
|
|
1009
1007
|
export interface Stage extends Releasable {
|
|
1010
1008
|
getContext(): Context;
|
|
1011
1009
|
before(): SeriesOperations;
|
|
@@ -1014,30 +1012,36 @@ export interface Stage extends Releasable {
|
|
|
1014
1012
|
setComponent(component: Nestable): Stage;
|
|
1015
1013
|
setComponentByObjectId(componentName: string, defaultComponentName?: string): Stage;
|
|
1016
1014
|
isStarted(): boolean;
|
|
1017
|
-
addInitializer(thisObject:
|
|
1015
|
+
addInitializer(thisObject: CallBackThisObject, callback: (stage: Stage) => void): Stage;
|
|
1018
1016
|
}
|
|
1019
1017
|
export interface Tellable {
|
|
1020
|
-
tell(name: string, payload?:
|
|
1021
|
-
}
|
|
1022
|
-
export interface Transmitter extends Sendable {
|
|
1023
|
-
}
|
|
1024
|
-
export interface Type<T> extends Function {
|
|
1025
|
-
new (...args: any[]): T;
|
|
1018
|
+
tell(name: string, payload?: unknown): void;
|
|
1026
1019
|
}
|
|
1027
1020
|
export interface Watchable {
|
|
1028
|
-
onExpressionValueChange<T>(expression: string, callback: (previous: T, current: T) => void, reducerFn?: (input:
|
|
1021
|
+
onExpressionValueChange<T>(expression: string, callback: (previous: T, current: T) => void, reducerFn?: (input: unknown) => T, thisObject?: CallBackThisObject): void;
|
|
1029
1022
|
/**
|
|
1030
1023
|
* Evaluates an expression.
|
|
1031
1024
|
* @param expression Expression to evaluate.
|
|
1032
1025
|
*/
|
|
1033
1026
|
evaluate<T>(expression: string): T;
|
|
1034
|
-
getWatchScope():
|
|
1027
|
+
getWatchScope(): unknown;
|
|
1035
1028
|
}
|
|
1029
|
+
export type BehaviorAttributeConverters = SimpleMap<(value: string) => unknown>;
|
|
1036
1030
|
export type BiConsumer<T, U> = (value0: T, value1?: U) => void;
|
|
1037
1031
|
export type BiPredicate<T, U> = (value0: T, value1: U) => boolean;
|
|
1032
|
+
export type CallBackThisObject = object;
|
|
1038
1033
|
export type Consumer<T> = (value: T) => void;
|
|
1039
|
-
export type
|
|
1034
|
+
export type FieldValidations<S> = SimpleMap<((field: unknown, instance: unknown, state: S) => string)[]>;
|
|
1035
|
+
export type MessageCallback = (channelName: string, messageName: string, payload: unknown) => void;
|
|
1040
1036
|
export type Predicate<T> = (value: T) => boolean;
|
|
1037
|
+
export type PropertyChangeCallback<T> = (value: T) => void;
|
|
1038
|
+
export type PropertyChangeFallbackCallback<T> = (key: string, value: T) => void;
|
|
1039
|
+
export type PropertyFallBackSubscriber<T> = (thisObject: CallBackThisObject, callback: PropertyChangeFallbackCallback<T>) => void;
|
|
1040
|
+
export type PropertyProvider<T> = () => T;
|
|
1041
|
+
export type PropertySubscriber<T> = (thisObject: CallBackThisObject, callback: PropertyChangeCallback<T>) => void;
|
|
1042
|
+
export type SimpleMap<T> = Record<string, T>;
|
|
1043
|
+
export type Transmitter = Sendable;
|
|
1044
|
+
export type Type<T> = new (...args: any[]) => T;
|
|
1041
1045
|
export type VarConsumer<T, U> = (Consumer<T> | BiConsumer<T, U>);
|
|
1042
1046
|
export type VarPredicate<T, U> = Predicate<T> | BiPredicate<T, U>;
|
|
1043
1047
|
|