@cydran/cydran 0.5.0 → 0.6.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/LICENSE +1 -1
- package/dist/cydran.d.ts +163 -84
- package/dist/cydran.js +10355 -12416
- package/dist/cydran.js.map +4 -4
- package/dist/cydran.min.js +61 -45
- package/dist/cydran.min.js.map +4 -4
- package/dist/cydran.min.mjs +98 -0
- package/dist/cydran.min.mjs.map +7 -0
- package/dist/cydran.mjs +10343 -0
- package/dist/cydran.mjs.map +7 -0
- package/package.json +57 -20
- package/validate_log.txt +0 -4534
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
3
|
+
Copyright (c) 2018-2026 The Cydran Team <https://cydran.io/>
|
|
4
4
|
|
|
5
5
|
Derivative work based on Lodash 4.17.15 <https://lodash.com/license>
|
|
6
6
|
Copyright (c) 2019 OpenJS Foundation and other contributors <https://openjsf.org/>
|
package/dist/cydran.d.ts
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
0.6.0
|
|
3
|
+
---
|
|
4
|
+
Cydran <https://cydran.io/>
|
|
5
|
+
Copyright (c) 2018-2026 The Cydran Team <https://cydran.io/>
|
|
6
|
+
SPDX-License-Identifier: MIT
|
|
7
|
+
---
|
|
8
|
+
Derivative work based on Lodash 4.17.15 <https://lodash.com/license>
|
|
9
|
+
Copyright (c) 2019 OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
10
|
+
---
|
|
11
|
+
Derivative work based on Underscore.js
|
|
12
|
+
Copyright (c) 2012 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
13
|
+
---
|
|
14
|
+
Derivative work based on docReady <https://github.com/jfriend00/docReady/blob/master/license>
|
|
15
|
+
Copyright (c) 2014, John Friend <https://github.com/jfriend00/docReady/>
|
|
16
|
+
---
|
|
17
|
+
Derivative work based on Math.uuid.js <http://www.broofa.com>
|
|
18
|
+
Copyright (c) 2010 Robert Kieffer <https://www.broofa.com/2008/09/javascript-uuid-function/>
|
|
19
|
+
---
|
|
20
|
+
Derivative work based on UMD <https://github.com/umdjs/umd/blob/master/LICENSE.md>
|
|
21
|
+
Copyright (c) 2014 the UMD contributors <https://github.com/umdjs/umd/>
|
|
2
22
|
|
|
23
|
+
*/
|
|
3
24
|
export declare abstract class AbstractBehavior<M, E extends HTMLElement | Text, P> implements Behavior<M, E, P> {
|
|
4
25
|
private ____internal$$cydran____;
|
|
5
26
|
constructor();
|
|
@@ -14,14 +35,14 @@ export declare abstract class AbstractBehavior<M, E extends HTMLElement | Text,
|
|
|
14
35
|
* Get the active context instance reference by id
|
|
15
36
|
* @return U
|
|
16
37
|
*/
|
|
17
|
-
getObject<U>(id: string, ...instanceArguments:
|
|
38
|
+
getObject<U>(id: string, ...instanceArguments: InstanceArgument[]): U;
|
|
18
39
|
/**
|
|
19
40
|
* [message description]
|
|
20
41
|
* @param {string} channelName [description]
|
|
21
42
|
* @param {string} messageName [description]
|
|
22
43
|
*/
|
|
23
|
-
send(messageName: string, payload?:
|
|
24
|
-
tell(name: string, payload?:
|
|
44
|
+
send(messageName: string, payload?: MessagePayload, startFrom?: string): SendContinuation;
|
|
45
|
+
tell(name: string, payload?: MessagePayload): void;
|
|
25
46
|
on(messageName: string): OnContinuation;
|
|
26
47
|
getParentId(): string;
|
|
27
48
|
getId(): string;
|
|
@@ -59,7 +80,7 @@ export declare abstract class AbstractBehavior<M, E extends HTMLElement | Text,
|
|
|
59
80
|
* @param {string} expression [description]
|
|
60
81
|
* @return {mediator} [description]
|
|
61
82
|
*/
|
|
62
|
-
protected mediate<T>(expression: string, reducerFn?: (input:
|
|
83
|
+
protected mediate<T>(expression: string, reducerFn?: (input: ModelValue) => T): Mediator<T>;
|
|
63
84
|
/**
|
|
64
85
|
* [getModel description]
|
|
65
86
|
* @return {unknown} [description]
|
|
@@ -95,7 +116,7 @@ export declare abstract class AbstractBehavior<M, E extends HTMLElement | Text,
|
|
|
95
116
|
protected setConverters(converters: BehaviorAttributeConverters): void;
|
|
96
117
|
protected setPrefixed(prefixed: boolean): void;
|
|
97
118
|
protected setLoggerName(name: string): void;
|
|
98
|
-
protected setReducerFn(reducerFn: (input:
|
|
119
|
+
protected setReducerFn(reducerFn: (input: ModelValue) => M): void;
|
|
99
120
|
}
|
|
100
121
|
export declare abstract class AbstractValueBehavior<M, E extends HTMLElement | Text, P> extends AbstractBehavior<M, E, P> {
|
|
101
122
|
constructor();
|
|
@@ -275,10 +296,16 @@ export declare function requireValid(value: string, name: string, regex: RegExp)
|
|
|
275
296
|
export declare function setStrictTypeChecksEnabled(value: boolean): void;
|
|
276
297
|
export declare function stateMachineBuilder<M>(startState: string): MachineBuilder<M>;
|
|
277
298
|
export declare function uuidV4(): string;
|
|
278
|
-
export interface ActionContinuation extends Tellable, Messagable
|
|
299
|
+
export interface ActionContinuation extends Tellable, Messagable {
|
|
300
|
+
onExpressionValueChange(expression: string): WatchContinuation;
|
|
301
|
+
/**
|
|
302
|
+
* Evaluates an expression.
|
|
303
|
+
* @param expression Expression to evaluate.
|
|
304
|
+
*/
|
|
305
|
+
evaluate<T>(expression: string): T;
|
|
279
306
|
getParent(): Nestable;
|
|
280
307
|
getEl(): HTMLElement;
|
|
281
|
-
getObject<T>(id: string, ...instanceArguments:
|
|
308
|
+
getObject<T>(id: string, ...instanceArguments: InstanceArgument[]): T;
|
|
282
309
|
getLogger(): Logger;
|
|
283
310
|
properties(): Properties;
|
|
284
311
|
getId(): string;
|
|
@@ -288,7 +315,7 @@ export interface ActionContinuation extends Tellable, Messagable, Watchable {
|
|
|
288
315
|
getValue<T>(): T;
|
|
289
316
|
isMounted(): boolean;
|
|
290
317
|
isConnected(): boolean;
|
|
291
|
-
send(messageName: string, payload?:
|
|
318
|
+
send(messageName: string, payload?: MessagePayload): SendContinuation;
|
|
292
319
|
onInterval(millis?: number): IntervalContinuation;
|
|
293
320
|
onMessage(messageName: string): OnContinuation;
|
|
294
321
|
/**
|
|
@@ -298,7 +325,7 @@ export interface ActionContinuation extends Tellable, Messagable, Watchable {
|
|
|
298
325
|
*/
|
|
299
326
|
createFilter(expression: string): FilterBuilder;
|
|
300
327
|
regions(): RegionContinuation;
|
|
301
|
-
tell(name: string, payload?:
|
|
328
|
+
tell(name: string, payload?: MessagePayload): void;
|
|
302
329
|
forElement<E extends HTMLElement>(name: string): ElementOperations<E>;
|
|
303
330
|
forSeries(name: string): SeriesOperations;
|
|
304
331
|
forForm(name: string): FormOperations;
|
|
@@ -333,48 +360,48 @@ export interface Appender {
|
|
|
333
360
|
* @param error error object to log stack with
|
|
334
361
|
* @param moreArgs additional objects to log
|
|
335
362
|
*/
|
|
336
|
-
trace(label: string, message: string, error?: Error, moreArgs?:
|
|
363
|
+
trace(label: string, message: string, error?: Error, moreArgs?: LogArgument[]): void;
|
|
337
364
|
/**
|
|
338
365
|
* Log payload at a "debug" level
|
|
339
366
|
* @param label name of logger
|
|
340
367
|
* @param message to be written out
|
|
341
368
|
* @param error error object to log stack with
|
|
342
369
|
*/
|
|
343
|
-
debug(label: string, message: string, error?: Error, moreArgs?:
|
|
370
|
+
debug(label: string, message: string, error?: Error, moreArgs?: LogArgument[]): void;
|
|
344
371
|
/**
|
|
345
372
|
* Log payload at a "info" level
|
|
346
373
|
* @param label name of logger
|
|
347
374
|
* @param message to be written out
|
|
348
375
|
* @param error error object to log stack with
|
|
349
376
|
*/
|
|
350
|
-
info(label: string, message: string, error?: Error, moreArgs?:
|
|
377
|
+
info(label: string, message: string, error?: Error, moreArgs?: LogArgument[]): void;
|
|
351
378
|
/**
|
|
352
379
|
* Log payload at a "warn" level
|
|
353
380
|
* @param label name of logger
|
|
354
381
|
* @param message to be written out
|
|
355
382
|
* @param error error object to log stack with
|
|
356
383
|
*/
|
|
357
|
-
warn(label: string, message: string, error?: Error, moreArgs?:
|
|
384
|
+
warn(label: string, message: string, error?: Error, moreArgs?: LogArgument[]): void;
|
|
358
385
|
/**
|
|
359
386
|
* Log payload at a "error" level
|
|
360
387
|
* @param label name of logger
|
|
361
388
|
* @param message to be written out
|
|
362
389
|
* @param error error object to log stack with
|
|
363
390
|
*/
|
|
364
|
-
error(label: string, message: string, error?: Error, moreArgs?:
|
|
391
|
+
error(label: string, message: string, error?: Error, moreArgs?: LogArgument[]): void;
|
|
365
392
|
/**
|
|
366
393
|
* Log payload at a "fatal" level
|
|
367
394
|
* @param label name of logger
|
|
368
395
|
* @param message to be written out
|
|
369
396
|
* @param error error object to log stack with
|
|
370
397
|
*/
|
|
371
|
-
fatal(label: string, message: string, error?: Error, moreArgs?:
|
|
398
|
+
fatal(label: string, message: string, error?: Error, moreArgs?: LogArgument[]): void;
|
|
372
399
|
}
|
|
373
400
|
export interface ArgumentOption {
|
|
374
401
|
type: ArgumentType;
|
|
375
402
|
}
|
|
376
403
|
export interface ArgumentsResolvers {
|
|
377
|
-
resolve(context: unknown, instanceArguments:
|
|
404
|
+
resolve(context: unknown, instanceArguments: InstanceArgument[]): ConstructorArgument[];
|
|
378
405
|
postProcess(context: unknown, targetObject: unknown, params: unknown[]): void;
|
|
379
406
|
}
|
|
380
407
|
export interface ArgumentsResolversBuilder extends Builder<ArgumentsResolvers> {
|
|
@@ -382,7 +409,7 @@ export interface ArgumentsResolversBuilder extends Builder<ArgumentsResolvers> {
|
|
|
382
409
|
* Intent to resolve a registered object in the Cydran service discovery functionality
|
|
383
410
|
* @param id unique string key of the registered object
|
|
384
411
|
*/
|
|
385
|
-
with(id: string, ...instanceArguments:
|
|
412
|
+
with(id: string, ...instanceArguments: InstanceArgument[]): ArgumentsResolversBuilder;
|
|
386
413
|
/**
|
|
387
414
|
* Intent to resolve function that will return a registered object in the Cydran service discovery functionality when invoked
|
|
388
415
|
* @param id unique string key of the registered object
|
|
@@ -492,13 +519,24 @@ export interface Context extends Sendable, Register<Context>, Tellable, Receivab
|
|
|
492
519
|
hasChild(name: string): boolean;
|
|
493
520
|
addChild(name: string, initializer?: (context: Context) => void): Context;
|
|
494
521
|
removeChild(name: string): Context;
|
|
495
|
-
getObject<T>(id: string, ...instanceArguments:
|
|
522
|
+
getObject<T>(id: string, ...instanceArguments: InstanceArgument[]): T;
|
|
496
523
|
getProperties(): MutableProperties;
|
|
497
524
|
getScope(): Scope;
|
|
498
525
|
getRoot(): Context;
|
|
499
526
|
isRoot(): boolean;
|
|
500
527
|
getParent(): Context;
|
|
501
528
|
registerImplicit(id: string, template: string, options?: ComponentOptions): Context;
|
|
529
|
+
/**
|
|
530
|
+
* Promotes this context's own object registration to its parent context, as an alias that resolves in this context.
|
|
531
|
+
* The alias is removed from the parent when this context is removed or released.
|
|
532
|
+
*
|
|
533
|
+
* @param id - the id of this context's own registration to promote
|
|
534
|
+
* @param overrideId - optional id to register the alias under in the parent, instead of id
|
|
535
|
+
* @returns this context
|
|
536
|
+
* @throws RegistrationError when this context has no registration of its own under id, or the parent already has one under the target id
|
|
537
|
+
* @throws UnsupportedOperationError when called on a root context or the global context
|
|
538
|
+
*/
|
|
539
|
+
promote(id: string, overrideId?: string): Context;
|
|
502
540
|
getName(): string;
|
|
503
541
|
getFullName(): string;
|
|
504
542
|
addPreInitializer(thisObject: CallBackThisObject, callback: (context?: Context) => void): void;
|
|
@@ -535,7 +573,7 @@ export interface Filter {
|
|
|
535
573
|
* Get the resulting array of items after the filter has been applied
|
|
536
574
|
* @returns array of filtered objects
|
|
537
575
|
*/
|
|
538
|
-
items():
|
|
576
|
+
items(): ListItem[];
|
|
539
577
|
/**
|
|
540
578
|
* Extend a {Filter filter} instance
|
|
541
579
|
* @returns a {FilterBuilder} object
|
|
@@ -544,8 +582,8 @@ export interface Filter {
|
|
|
544
582
|
}
|
|
545
583
|
export interface FilterBuilder {
|
|
546
584
|
withPredicate(expression: string, ...parameterExpressions: string[]): FilterBuilder;
|
|
547
|
-
withPhase(fn: (input:
|
|
548
|
-
withSimplePredicate(predicate: (index: number, value:
|
|
585
|
+
withPhase(fn: (input: ListItem[]) => ListItem[]): FilterBuilder;
|
|
586
|
+
withSimplePredicate(predicate: (index: number, value: ListItem) => boolean): FilterBuilder;
|
|
549
587
|
withSort(expression: string, ...parameterExpressions: string[]): FilterBuilder;
|
|
550
588
|
withLimit(limit: number): FilterBuilder;
|
|
551
589
|
with(fn: (builder: FilterBuilder) => void): FilterBuilder;
|
|
@@ -554,7 +592,7 @@ export interface FilterBuilder {
|
|
|
554
592
|
limited(): LimitOffsetFilter;
|
|
555
593
|
}
|
|
556
594
|
export interface ForChannelContinuation {
|
|
557
|
-
invoke(
|
|
595
|
+
invoke(name: string, before?: () => void, after?: () => void): void;
|
|
558
596
|
}
|
|
559
597
|
export interface FormOperations {
|
|
560
598
|
submit(): void;
|
|
@@ -570,7 +608,7 @@ export interface InternalComponentOptions extends ComponentOptions {
|
|
|
570
608
|
name?: string;
|
|
571
609
|
}
|
|
572
610
|
export interface IntervalContinuation {
|
|
573
|
-
invoke(
|
|
611
|
+
invoke(name: string): void;
|
|
574
612
|
}
|
|
575
613
|
export interface IsLevelType {
|
|
576
614
|
/**
|
|
@@ -627,73 +665,73 @@ export interface Logger extends IsLevelType {
|
|
|
627
665
|
* @param primaryMsg to be written out
|
|
628
666
|
* @param moreArgs additional optional arguments; the last argument as an Error is assumed to be required for the stack ouptut regardless of log level
|
|
629
667
|
*/
|
|
630
|
-
trace(primaryMsg: string, ...moreArgs:
|
|
668
|
+
trace(primaryMsg: string, ...moreArgs: LogArgument[]): void;
|
|
631
669
|
/**
|
|
632
670
|
* Log payload at a "debug" level
|
|
633
671
|
* @param primaryMsg to be written out
|
|
634
672
|
* @param moreArgs additional optional arguments; the last argument as an Error is assumed to be required for the stack ouptut regardless of log level
|
|
635
673
|
*/
|
|
636
|
-
debug(primaryMsg: string, ...moreArgs:
|
|
674
|
+
debug(primaryMsg: string, ...moreArgs: LogArgument[]): void;
|
|
637
675
|
/**
|
|
638
676
|
* Log payload at a "info" level
|
|
639
677
|
* @param primaryMsg to be written out
|
|
640
678
|
* @param moreArgs additional optional arguments; the last argument as an Error is assumed to be required for the stack ouptut regardless of log level
|
|
641
679
|
*/
|
|
642
|
-
info(primaryMsg: string, ...moreArgs:
|
|
680
|
+
info(primaryMsg: string, ...moreArgs: LogArgument[]): void;
|
|
643
681
|
/**
|
|
644
682
|
* Log payload at a "warn" level
|
|
645
683
|
* @param primaryMsg to be written out
|
|
646
684
|
* @param moreArgs additional optional arguments; the last argument as an Error is assumed to be required for the stack ouptut regardless of log level
|
|
647
685
|
*/
|
|
648
|
-
warn(primaryMsg: string, ...moreArgs:
|
|
686
|
+
warn(primaryMsg: string, ...moreArgs: LogArgument[]): void;
|
|
649
687
|
/**
|
|
650
688
|
* Log payload at a "error" level
|
|
651
689
|
* @param primaryMsg to be written out
|
|
652
690
|
* @param moreArgs additional optional arguments; the last argument as an Error is assumed to be required for the stack ouptut regardless of log level
|
|
653
691
|
*/
|
|
654
|
-
error(primaryMsg: string, ...moreArgs:
|
|
692
|
+
error(primaryMsg: string, ...moreArgs: LogArgument[]): void;
|
|
655
693
|
/**
|
|
656
694
|
* Log payload at a "fatal" level
|
|
657
695
|
* @param primaryMsg to be written out
|
|
658
696
|
* @param moreArgs additional optional arguments; the last argument as an Error is assumed to be required for the stack ouptut regardless of log level
|
|
659
697
|
*/
|
|
660
|
-
fatal(primaryMsg: string, ...moreArgs:
|
|
698
|
+
fatal(primaryMsg: string, ...moreArgs: LogArgument[]): void;
|
|
661
699
|
/**
|
|
662
700
|
* Only if log at a "trace" level execute fn() to derive payload to log
|
|
663
701
|
* @param primaryMsgFn result of to be written out
|
|
664
702
|
* @param moreArgs additional optional arguments; the last argument as an Error is assumed to be required for the stack ouptut regardless of log level
|
|
665
703
|
*/
|
|
666
|
-
ifTrace(primaryMsgFn: () =>
|
|
704
|
+
ifTrace(primaryMsgFn: () => LogArgument, ...moreArgs: LogArgument[]): void;
|
|
667
705
|
/**
|
|
668
706
|
* Only if log at a "debug" level execute fn() to derive payload to log
|
|
669
707
|
* @param primaryMsgFn result of to be written out
|
|
670
708
|
* @param moreArgs additional optional arguments; the last argument as an Error is assumed to be required for the stack ouptut regardless of log level
|
|
671
709
|
*/
|
|
672
|
-
ifDebug(primaryMsgFn: () =>
|
|
710
|
+
ifDebug(primaryMsgFn: () => LogArgument, ...moreArgs: LogArgument[]): void;
|
|
673
711
|
/**
|
|
674
712
|
* Only if log at a "info" level execute fn() to derive payload to log
|
|
675
713
|
* @param primaryMsgFn result of to be written out
|
|
676
714
|
* @param moreArgs additional optional arguments; the last argument as an Error is assumed to be required for the stack ouptut regardless of log level
|
|
677
715
|
*/
|
|
678
|
-
ifInfo(primaryMsgFn: () =>
|
|
716
|
+
ifInfo(primaryMsgFn: () => LogArgument, ...moreArgs: LogArgument[]): void;
|
|
679
717
|
/**
|
|
680
718
|
* Only if log at a "warn" level execute fn() to derive payload to log
|
|
681
719
|
* @param primaryMsgFn result of to be written out
|
|
682
720
|
* @param moreArgs additional optional arguments; the last argument as an Error is assumed to be required for the stack ouptut regardless of log level
|
|
683
721
|
*/
|
|
684
|
-
ifWarn(primaryMsgFn: () =>
|
|
722
|
+
ifWarn(primaryMsgFn: () => LogArgument, ...moreArgs: LogArgument[]): void;
|
|
685
723
|
/**
|
|
686
724
|
* Only if log at a "error" level execute fn() to derive payload to log
|
|
687
725
|
* @param primaryMsgFn result of to be written out
|
|
688
726
|
* @param moreArgs additional optional arguments; the last argument as an Error is assumed to be required for the stack ouptut regardless of log level
|
|
689
727
|
*/
|
|
690
|
-
ifError(primaryMsgFn: () =>
|
|
728
|
+
ifError(primaryMsgFn: () => LogArgument, ...moreArgs: LogArgument[]): void;
|
|
691
729
|
/**
|
|
692
730
|
* Only if log at a "fatal" level execute fn() to derive payload to log
|
|
693
731
|
* @param primaryMsgFn result of to be written out
|
|
694
732
|
* @param moreArgs additional optional arguments; the last argument as an Error is assumed to be required for the stack ouptut regardless of log level
|
|
695
733
|
*/
|
|
696
|
-
ifFatal(primaryMsgFn: () =>
|
|
734
|
+
ifFatal(primaryMsgFn: () => LogArgument, ...moreArgs: LogArgument[]): void;
|
|
697
735
|
}
|
|
698
736
|
export interface Machine<M> extends Releasable {
|
|
699
737
|
create(model: M): MachineState<M>;
|
|
@@ -711,11 +749,11 @@ export interface MachineState<M> extends Releasable {
|
|
|
711
749
|
}
|
|
712
750
|
export interface Mediator<T> extends Releasable, DigestionCandidate, Tellable {
|
|
713
751
|
get(): T;
|
|
714
|
-
set(value:
|
|
715
|
-
watch(thisObject: CallBackThisObject,
|
|
752
|
+
set(value: T): void;
|
|
753
|
+
watch(thisObject: CallBackThisObject, name: string): void;
|
|
716
754
|
}
|
|
717
755
|
export interface Messagable {
|
|
718
|
-
send(messageName: string, payload?:
|
|
756
|
+
send(messageName: string, payload?: MessagePayload): SendContinuation;
|
|
719
757
|
}
|
|
720
758
|
export interface MetadataContinuation {
|
|
721
759
|
has: (name: string) => boolean;
|
|
@@ -728,13 +766,13 @@ export interface MutableProperties extends Properties {
|
|
|
728
766
|
* @param value - any type of object
|
|
729
767
|
* @returns
|
|
730
768
|
*/
|
|
731
|
-
set(key: string, value:
|
|
769
|
+
set(key: string, value: PropertyValue): MutableProperties;
|
|
732
770
|
/**
|
|
733
771
|
* Load additional properties in
|
|
734
772
|
* @param values - any type of object
|
|
735
773
|
* @returns
|
|
736
774
|
*/
|
|
737
|
-
load(values: SimpleMap<
|
|
775
|
+
load(values: SimpleMap<PropertyValue>): MutableProperties;
|
|
738
776
|
/**
|
|
739
777
|
* Remove a specific property by key
|
|
740
778
|
* @param key - string value
|
|
@@ -783,7 +821,7 @@ export interface Notifyable {
|
|
|
783
821
|
notify(): void;
|
|
784
822
|
}
|
|
785
823
|
export interface OnContinuation {
|
|
786
|
-
invoke(
|
|
824
|
+
invoke(name: string, before?: () => void, after?: () => void): void;
|
|
787
825
|
forChannel(channelName: string): ForChannelContinuation;
|
|
788
826
|
}
|
|
789
827
|
export interface PagedFilter extends Filter {
|
|
@@ -818,16 +856,16 @@ export interface PropFlagVals {
|
|
|
818
856
|
export interface Properties {
|
|
819
857
|
/**
|
|
820
858
|
* Add an observer for all property changes.
|
|
821
|
-
* @param thisObject Object used as this when calling the
|
|
822
|
-
* @param
|
|
859
|
+
* @param thisObject Object that owns and is used as this when calling the named method
|
|
860
|
+
* @param name - name of the method (on thisObject) to be called when any property is changed
|
|
823
861
|
*/
|
|
824
|
-
addObserver(thisObject: CallBackThisObject,
|
|
862
|
+
addObserver(thisObject: CallBackThisObject, name: string): void;
|
|
825
863
|
/**
|
|
826
864
|
* Remove an observer that listened for all property changes.
|
|
827
|
-
* @param thisObject Object
|
|
828
|
-
* @param
|
|
865
|
+
* @param thisObject Object that owns the named method
|
|
866
|
+
* @param name name of the previously-registered method to be removed
|
|
829
867
|
*/
|
|
830
|
-
removeObserver(thisObject: CallBackThisObject,
|
|
868
|
+
removeObserver(thisObject: CallBackThisObject, name: string): void;
|
|
831
869
|
/**
|
|
832
870
|
* Add an observer for a specific property changes, or changes of more general property when the preferred is unavailable.
|
|
833
871
|
* @param thisObject Object used as this when calling the callback
|
|
@@ -835,27 +873,27 @@ export interface Properties {
|
|
|
835
873
|
* @param preferredKey Preferred property key to observe
|
|
836
874
|
* @param prefix Property key prefix for keys which should be included for consideration
|
|
837
875
|
*/
|
|
838
|
-
addFallbackObserver(thisObject: CallBackThisObject,
|
|
876
|
+
addFallbackObserver(thisObject: CallBackThisObject, name: string, preferredKey: string, prefix?: string): void;
|
|
839
877
|
/**
|
|
840
878
|
* Remove an observer for a specific property changes, or changes of more general property when the preferred is unavailable.
|
|
841
|
-
* @param thisObject Object
|
|
842
|
-
* @param
|
|
879
|
+
* @param thisObject Object that owns the named method
|
|
880
|
+
* @param name name of the previously-registered method to be removed
|
|
843
881
|
*/
|
|
844
|
-
removeFallbackObserver(thisObject: CallBackThisObject,
|
|
882
|
+
removeFallbackObserver(thisObject: CallBackThisObject, name: string): void;
|
|
845
883
|
/**
|
|
846
884
|
* Add an observer for specific property.
|
|
847
885
|
* @param key Specific property key
|
|
848
|
-
* @param thisObject Object used as this when calling the
|
|
849
|
-
* @param
|
|
886
|
+
* @param thisObject Object that owns and is used as this when calling the named method
|
|
887
|
+
* @param name name of the method (on thisObject) to be called when the specific property is changed
|
|
850
888
|
*/
|
|
851
|
-
addPropertyObserver(key: string, thisObject: CallBackThisObject,
|
|
889
|
+
addPropertyObserver(key: string, thisObject: CallBackThisObject, name: string): void;
|
|
852
890
|
/**
|
|
853
891
|
* Remove an observer for specific property.
|
|
854
892
|
* @param key Specific property key
|
|
855
|
-
* @param thisObject Object
|
|
856
|
-
* @param
|
|
893
|
+
* @param thisObject Object that owns the named method
|
|
894
|
+
* @param name name of the previously-registered method to remove
|
|
857
895
|
*/
|
|
858
|
-
removePropertyObserver(key: string, thisObject: CallBackThisObject,
|
|
896
|
+
removePropertyObserver(key: string, thisObject: CallBackThisObject, name: string): void;
|
|
859
897
|
snapshot(): MutableProperties;
|
|
860
898
|
/**
|
|
861
899
|
* Get all the keys present in the properties object
|
|
@@ -927,7 +965,7 @@ export interface Receivable {
|
|
|
927
965
|
* @param messageName The name of the message to send.
|
|
928
966
|
* @param payload The optional payload to include with the message.
|
|
929
967
|
*/
|
|
930
|
-
message(channelName: string, messageName: string, payload?:
|
|
968
|
+
message(channelName: string, messageName: string, payload?: MessagePayload): void;
|
|
931
969
|
}
|
|
932
970
|
export interface Receiver extends Releasable, Receivable {
|
|
933
971
|
on(messageName: string): OnContinuation;
|
|
@@ -939,17 +977,17 @@ export interface RegionContinuation {
|
|
|
939
977
|
*/
|
|
940
978
|
has(name: string): boolean;
|
|
941
979
|
/**
|
|
942
|
-
* Get
|
|
943
|
-
* @param name - string name value of the
|
|
944
|
-
* @returns Component
|
|
980
|
+
* Get the child component in a region.
|
|
981
|
+
* @param name - string name value of the region
|
|
982
|
+
* @returns the {@link Component} in the region, or null when the region holds no component
|
|
945
983
|
*/
|
|
946
|
-
get<N extends Nestable>(name: string): N;
|
|
984
|
+
get<N extends Nestable>(name: string): N | null;
|
|
947
985
|
/**
|
|
948
|
-
* Set a child component into a region.
|
|
949
|
-
* @param name - string name value of the
|
|
950
|
-
* @param component - the {@link Component} reference
|
|
986
|
+
* Set a child component into a region, or clear the region.
|
|
987
|
+
* @param name - string name value of the region
|
|
988
|
+
* @param component - the {@link Component} reference, or null to remove the region's component and leave it empty
|
|
951
989
|
*/
|
|
952
|
-
set(name: string, component: Nestable): void;
|
|
990
|
+
set(name: string, component: Nestable | null): void;
|
|
953
991
|
setByObjectId(name: string, componentName: string, defaultComponentName?: string): void;
|
|
954
992
|
}
|
|
955
993
|
export interface Register<R> extends Releasable {
|
|
@@ -959,7 +997,6 @@ export interface Register<R> extends Releasable {
|
|
|
959
997
|
registerSingleton<T>(id: string, classInstance: Type<T>, resolvers?: ArgumentsResolvers, localResolution?: boolean): R;
|
|
960
998
|
registerSingletonWithFactory<T>(id: string, factoryFn: () => T, resolvers?: ArgumentsResolvers, localResolution?: boolean): R;
|
|
961
999
|
hasRegistration(id: string): boolean;
|
|
962
|
-
expose(id: string): R;
|
|
963
1000
|
}
|
|
964
1001
|
export interface Releasable {
|
|
965
1002
|
$release(): void;
|
|
@@ -968,7 +1005,7 @@ export interface Renderer {
|
|
|
968
1005
|
render(): HTMLElement;
|
|
969
1006
|
}
|
|
970
1007
|
export interface Scope {
|
|
971
|
-
add(name: string, item:
|
|
1008
|
+
add(name: string, item: ScopeItem): Scope;
|
|
972
1009
|
remove(name: string): Scope;
|
|
973
1010
|
extend(): Scope;
|
|
974
1011
|
}
|
|
@@ -987,7 +1024,7 @@ export interface Sendable {
|
|
|
987
1024
|
* @param payload The optional payload to include with the message
|
|
988
1025
|
* @param startFrom The optional path to the context start the traversal from
|
|
989
1026
|
*/
|
|
990
|
-
send(propagation: To, channelName: string, messageName: string, payload?:
|
|
1027
|
+
send(propagation: To, channelName: string, messageName: string, payload?: MessagePayload, startFrom?: string): void;
|
|
991
1028
|
}
|
|
992
1029
|
export interface SeriesOperations {
|
|
993
1030
|
getAt<N extends Nestable>(index: number): N;
|
|
@@ -1009,40 +1046,82 @@ export interface Stage extends Releasable {
|
|
|
1009
1046
|
before(): SeriesOperations;
|
|
1010
1047
|
after(): SeriesOperations;
|
|
1011
1048
|
start(): Stage;
|
|
1012
|
-
|
|
1049
|
+
/**
|
|
1050
|
+
* Set the top-level component of the stage, or remove it.
|
|
1051
|
+
* @param component - the {@link Component} to place, or null to remove the current component and leave the stage empty
|
|
1052
|
+
* @returns the stage
|
|
1053
|
+
*/
|
|
1054
|
+
setComponent(component: Nestable | null): Stage;
|
|
1013
1055
|
setComponentByObjectId(componentName: string, defaultComponentName?: string): Stage;
|
|
1014
1056
|
isStarted(): boolean;
|
|
1015
1057
|
addInitializer(thisObject: CallBackThisObject, callback: (stage: Stage) => void): Stage;
|
|
1016
1058
|
}
|
|
1017
1059
|
export interface Tellable {
|
|
1018
|
-
tell(name: string, payload?:
|
|
1060
|
+
tell(name: string, payload?: MessagePayload): void;
|
|
1019
1061
|
}
|
|
1020
|
-
export interface
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
* Evaluates an expression.
|
|
1024
|
-
* @param expression Expression to evaluate.
|
|
1025
|
-
*/
|
|
1026
|
-
evaluate<T>(expression: string): T;
|
|
1027
|
-
getWatchScope(): unknown;
|
|
1062
|
+
export interface WatchContinuation {
|
|
1063
|
+
reducedBy<T>(reducerFn: (input: ModelValue) => T): WatchContinuation;
|
|
1064
|
+
invoke(name: string): void;
|
|
1028
1065
|
}
|
|
1029
1066
|
export type BehaviorAttributeConverters = SimpleMap<(value: string) => unknown>;
|
|
1030
1067
|
export type BiConsumer<T, U> = (value0: T, value1?: U) => void;
|
|
1031
1068
|
export type BiPredicate<T, U> = (value0: T, value1: U) => boolean;
|
|
1032
1069
|
export type CallBackThisObject = object;
|
|
1070
|
+
/**
|
|
1071
|
+
* A resolved argument that is passed to the constructor or factory function that creates a registered object. It is
|
|
1072
|
+
* `unknown`: any value is accepted, and a value must be narrowed before use. The name documents intent only, so compiler
|
|
1073
|
+
* errors report it as `unknown`.
|
|
1074
|
+
*/
|
|
1075
|
+
export type ConstructorArgument = unknown;
|
|
1033
1076
|
export type Consumer<T> = (value: T) => void;
|
|
1034
1077
|
export type FieldValidations<S> = SimpleMap<((field: unknown, instance: unknown, state: S) => string)[]>;
|
|
1035
|
-
|
|
1078
|
+
/**
|
|
1079
|
+
* An extra argument a caller passes when resolving an object by id, as in `getObject(id, ...instanceArguments)`. It is
|
|
1080
|
+
* `unknown`: any value is accepted, and a value must be narrowed before use. The name documents intent only, so compiler
|
|
1081
|
+
* errors report it as `unknown`.
|
|
1082
|
+
*/
|
|
1083
|
+
export type InstanceArgument = unknown;
|
|
1084
|
+
/**
|
|
1085
|
+
* An element of an array rendered by `c-each` or processed by a filter. It is `unknown`: any value is accepted, and a
|
|
1086
|
+
* value must be narrowed before use. The name documents intent only, so compiler errors report it as `unknown`.
|
|
1087
|
+
*/
|
|
1088
|
+
export type ListItem = unknown;
|
|
1089
|
+
/**
|
|
1090
|
+
* A value passed to a logger method, after or in place of the primary message. It is `unknown`: any value is accepted, and
|
|
1091
|
+
* a value must be narrowed before use. The name documents intent only, so compiler errors report it as `unknown`.
|
|
1092
|
+
*/
|
|
1093
|
+
export type LogArgument = unknown;
|
|
1094
|
+
export type MessageCallback = (channelName: string, messageName: string, payload: MessagePayload) => void;
|
|
1095
|
+
/**
|
|
1096
|
+
* The payload of a message that is sent, told, delivered or received. It is `unknown`: any value is accepted, and a value
|
|
1097
|
+
* must be narrowed before use. The name documents intent only, so compiler errors report it as `unknown`.
|
|
1098
|
+
*/
|
|
1099
|
+
export type MessagePayload = unknown;
|
|
1100
|
+
/**
|
|
1101
|
+
* A value read from or written to the model through a template expression. It is `unknown`: any value is accepted, and a
|
|
1102
|
+
* value must be narrowed before use. The name documents intent only, so compiler errors report it as `unknown`.
|
|
1103
|
+
*/
|
|
1104
|
+
export type ModelValue = unknown;
|
|
1036
1105
|
export type Predicate<T> = (value: T) => boolean;
|
|
1037
1106
|
export type PropertyChangeCallback<T> = (value: T) => void;
|
|
1038
1107
|
export type PropertyChangeFallbackCallback<T> = (key: string, value: T) => void;
|
|
1039
|
-
export type PropertyFallBackSubscriber
|
|
1108
|
+
export type PropertyFallBackSubscriber = (thisObject: CallBackThisObject, name: string) => void;
|
|
1040
1109
|
export type PropertyProvider<T> = () => T;
|
|
1041
|
-
export type PropertySubscriber
|
|
1110
|
+
export type PropertySubscriber = (thisObject: CallBackThisObject, name: string) => void;
|
|
1111
|
+
/**
|
|
1112
|
+
* The value of a configuration property. It is `unknown`: any value is accepted, and a value must be narrowed before use.
|
|
1113
|
+
* The name documents intent only, so compiler errors report it as `unknown`.
|
|
1114
|
+
*/
|
|
1115
|
+
export type PropertyValue = unknown;
|
|
1116
|
+
/**
|
|
1117
|
+
* A value added to a scope, and reachable from template expressions through `s()`. It is `unknown`: any value is accepted,
|
|
1118
|
+
* and a value must be narrowed before use. The name documents intent only, so compiler errors report it as `unknown`.
|
|
1119
|
+
*/
|
|
1120
|
+
export type ScopeItem = unknown;
|
|
1042
1121
|
export type SimpleMap<T> = Record<string, T>;
|
|
1043
1122
|
export type Transmitter = Sendable;
|
|
1044
1123
|
export type Type<T> = new (...args: any[]) => T;
|
|
1045
|
-
export type VarConsumer<T, U> =
|
|
1124
|
+
export type VarConsumer<T, U> = Consumer<T> | BiConsumer<T, U>;
|
|
1046
1125
|
export type VarPredicate<T, U> = Predicate<T> | BiPredicate<T, U>;
|
|
1047
1126
|
|
|
1048
1127
|
export as namespace cydran;
|