@cydran/testsupport 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/testsupport.d.ts +146 -67
- package/dist/testsupport.js +290 -273
- package/dist/testsupport.js.map +4 -4
- package/dist/testsupport.min.js +66 -0
- package/dist/testsupport.min.js.map +7 -0
- package/dist/testsupport.min.mjs +33 -0
- package/dist/testsupport.min.mjs.map +7 -0
- package/dist/testsupport.mjs +261 -0
- package/dist/testsupport.mjs.map +7 -0
- package/package.json +44 -19
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/testsupport.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
|
import { Matchers } from 'expect';
|
|
4
25
|
|
|
5
26
|
declare enum To {
|
|
@@ -73,10 +94,16 @@ export declare function isDefined<T>(value: T): boolean;
|
|
|
73
94
|
export declare function merge<T>(sources: unknown[]): T;
|
|
74
95
|
export declare function overlay<T>(destination: T, sources: unknown[]): T;
|
|
75
96
|
export declare function requireNotNull<T>(value: T, name: string): T;
|
|
76
|
-
export interface ActionContinuation extends Tellable, Messagable
|
|
97
|
+
export interface ActionContinuation extends Tellable, Messagable {
|
|
98
|
+
onExpressionValueChange(expression: string): WatchContinuation;
|
|
99
|
+
/**
|
|
100
|
+
* Evaluates an expression.
|
|
101
|
+
* @param expression Expression to evaluate.
|
|
102
|
+
*/
|
|
103
|
+
evaluate<T>(expression: string): T;
|
|
77
104
|
getParent(): Nestable;
|
|
78
105
|
getEl(): HTMLElement;
|
|
79
|
-
getObject<T>(id: string, ...instanceArguments:
|
|
106
|
+
getObject<T>(id: string, ...instanceArguments: InstanceArgument[]): T;
|
|
80
107
|
getLogger(): Logger;
|
|
81
108
|
properties(): Properties;
|
|
82
109
|
getId(): string;
|
|
@@ -86,7 +113,7 @@ export interface ActionContinuation extends Tellable, Messagable, Watchable {
|
|
|
86
113
|
getValue<T>(): T;
|
|
87
114
|
isMounted(): boolean;
|
|
88
115
|
isConnected(): boolean;
|
|
89
|
-
send(messageName: string, payload?:
|
|
116
|
+
send(messageName: string, payload?: MessagePayload): SendContinuation;
|
|
90
117
|
onInterval(millis?: number): IntervalContinuation;
|
|
91
118
|
onMessage(messageName: string): OnContinuation;
|
|
92
119
|
/**
|
|
@@ -96,7 +123,7 @@ export interface ActionContinuation extends Tellable, Messagable, Watchable {
|
|
|
96
123
|
*/
|
|
97
124
|
createFilter(expression: string): FilterBuilder;
|
|
98
125
|
regions(): RegionContinuation;
|
|
99
|
-
tell(name: string, payload?:
|
|
126
|
+
tell(name: string, payload?: MessagePayload): void;
|
|
100
127
|
forElement<E extends HTMLElement>(name: string): ElementOperations<E>;
|
|
101
128
|
forSeries(name: string): SeriesOperations;
|
|
102
129
|
forForm(name: string): FormOperations;
|
|
@@ -114,7 +141,7 @@ export interface Actionable<T> {
|
|
|
114
141
|
$c(): T;
|
|
115
142
|
}
|
|
116
143
|
export interface ArgumentsResolvers {
|
|
117
|
-
resolve(context: unknown, instanceArguments:
|
|
144
|
+
resolve(context: unknown, instanceArguments: InstanceArgument[]): ConstructorArgument[];
|
|
118
145
|
postProcess(context: unknown, targetObject: unknown, params: unknown[]): void;
|
|
119
146
|
}
|
|
120
147
|
export interface ComponentOptions {
|
|
@@ -128,13 +155,24 @@ export interface Context extends Sendable, Register<Context>, Tellable, Receivab
|
|
|
128
155
|
hasChild(name: string): boolean;
|
|
129
156
|
addChild(name: string, initializer?: (context: Context) => void): Context;
|
|
130
157
|
removeChild(name: string): Context;
|
|
131
|
-
getObject<T>(id: string, ...instanceArguments:
|
|
158
|
+
getObject<T>(id: string, ...instanceArguments: InstanceArgument[]): T;
|
|
132
159
|
getProperties(): MutableProperties;
|
|
133
160
|
getScope(): Scope;
|
|
134
161
|
getRoot(): Context;
|
|
135
162
|
isRoot(): boolean;
|
|
136
163
|
getParent(): Context;
|
|
137
164
|
registerImplicit(id: string, template: string, options?: ComponentOptions): Context;
|
|
165
|
+
/**
|
|
166
|
+
* Promotes this context's own object registration to its parent context, as an alias that resolves in this context.
|
|
167
|
+
* The alias is removed from the parent when this context is removed or released.
|
|
168
|
+
*
|
|
169
|
+
* @param id - the id of this context's own registration to promote
|
|
170
|
+
* @param overrideId - optional id to register the alias under in the parent, instead of id
|
|
171
|
+
* @returns this context
|
|
172
|
+
* @throws RegistrationError when this context has no registration of its own under id, or the parent already has one under the target id
|
|
173
|
+
* @throws UnsupportedOperationError when called on a root context or the global context
|
|
174
|
+
*/
|
|
175
|
+
promote(id: string, overrideId?: string): Context;
|
|
138
176
|
getName(): string;
|
|
139
177
|
getFullName(): string;
|
|
140
178
|
addPreInitializer(thisObject: CallBackThisObject, callback: (context?: Context) => void): void;
|
|
@@ -163,7 +201,7 @@ export interface Filter {
|
|
|
163
201
|
* Get the resulting array of items after the filter has been applied
|
|
164
202
|
* @returns array of filtered objects
|
|
165
203
|
*/
|
|
166
|
-
items():
|
|
204
|
+
items(): ListItem[];
|
|
167
205
|
/**
|
|
168
206
|
* Extend a {Filter filter} instance
|
|
169
207
|
* @returns a {FilterBuilder} object
|
|
@@ -172,8 +210,8 @@ export interface Filter {
|
|
|
172
210
|
}
|
|
173
211
|
export interface FilterBuilder {
|
|
174
212
|
withPredicate(expression: string, ...parameterExpressions: string[]): FilterBuilder;
|
|
175
|
-
withPhase(fn: (input:
|
|
176
|
-
withSimplePredicate(predicate: (index: number, value:
|
|
213
|
+
withPhase(fn: (input: ListItem[]) => ListItem[]): FilterBuilder;
|
|
214
|
+
withSimplePredicate(predicate: (index: number, value: ListItem) => boolean): FilterBuilder;
|
|
177
215
|
withSort(expression: string, ...parameterExpressions: string[]): FilterBuilder;
|
|
178
216
|
withLimit(limit: number): FilterBuilder;
|
|
179
217
|
with(fn: (builder: FilterBuilder) => void): FilterBuilder;
|
|
@@ -182,7 +220,7 @@ export interface FilterBuilder {
|
|
|
182
220
|
limited(): LimitOffsetFilter;
|
|
183
221
|
}
|
|
184
222
|
export interface ForChannelContinuation {
|
|
185
|
-
invoke(
|
|
223
|
+
invoke(name: string, before?: () => void, after?: () => void): void;
|
|
186
224
|
}
|
|
187
225
|
export interface FormOperations {
|
|
188
226
|
submit(): void;
|
|
@@ -190,7 +228,7 @@ export interface FormOperations {
|
|
|
190
228
|
reset(): void;
|
|
191
229
|
}
|
|
192
230
|
export interface IntervalContinuation {
|
|
193
|
-
invoke(
|
|
231
|
+
invoke(name: string): void;
|
|
194
232
|
}
|
|
195
233
|
export interface IsLevelType {
|
|
196
234
|
/**
|
|
@@ -247,76 +285,76 @@ export interface Logger extends IsLevelType {
|
|
|
247
285
|
* @param primaryMsg to be written out
|
|
248
286
|
* @param moreArgs additional optional arguments; the last argument as an Error is assumed to be required for the stack ouptut regardless of log level
|
|
249
287
|
*/
|
|
250
|
-
trace(primaryMsg: string, ...moreArgs:
|
|
288
|
+
trace(primaryMsg: string, ...moreArgs: LogArgument[]): void;
|
|
251
289
|
/**
|
|
252
290
|
* Log payload at a "debug" level
|
|
253
291
|
* @param primaryMsg to be written out
|
|
254
292
|
* @param moreArgs additional optional arguments; the last argument as an Error is assumed to be required for the stack ouptut regardless of log level
|
|
255
293
|
*/
|
|
256
|
-
debug(primaryMsg: string, ...moreArgs:
|
|
294
|
+
debug(primaryMsg: string, ...moreArgs: LogArgument[]): void;
|
|
257
295
|
/**
|
|
258
296
|
* Log payload at a "info" level
|
|
259
297
|
* @param primaryMsg to be written out
|
|
260
298
|
* @param moreArgs additional optional arguments; the last argument as an Error is assumed to be required for the stack ouptut regardless of log level
|
|
261
299
|
*/
|
|
262
|
-
info(primaryMsg: string, ...moreArgs:
|
|
300
|
+
info(primaryMsg: string, ...moreArgs: LogArgument[]): void;
|
|
263
301
|
/**
|
|
264
302
|
* Log payload at a "warn" level
|
|
265
303
|
* @param primaryMsg to be written out
|
|
266
304
|
* @param moreArgs additional optional arguments; the last argument as an Error is assumed to be required for the stack ouptut regardless of log level
|
|
267
305
|
*/
|
|
268
|
-
warn(primaryMsg: string, ...moreArgs:
|
|
306
|
+
warn(primaryMsg: string, ...moreArgs: LogArgument[]): void;
|
|
269
307
|
/**
|
|
270
308
|
* Log payload at a "error" level
|
|
271
309
|
* @param primaryMsg to be written out
|
|
272
310
|
* @param moreArgs additional optional arguments; the last argument as an Error is assumed to be required for the stack ouptut regardless of log level
|
|
273
311
|
*/
|
|
274
|
-
error(primaryMsg: string, ...moreArgs:
|
|
312
|
+
error(primaryMsg: string, ...moreArgs: LogArgument[]): void;
|
|
275
313
|
/**
|
|
276
314
|
* Log payload at a "fatal" level
|
|
277
315
|
* @param primaryMsg to be written out
|
|
278
316
|
* @param moreArgs additional optional arguments; the last argument as an Error is assumed to be required for the stack ouptut regardless of log level
|
|
279
317
|
*/
|
|
280
|
-
fatal(primaryMsg: string, ...moreArgs:
|
|
318
|
+
fatal(primaryMsg: string, ...moreArgs: LogArgument[]): void;
|
|
281
319
|
/**
|
|
282
320
|
* Only if log at a "trace" level execute fn() to derive payload to log
|
|
283
321
|
* @param primaryMsgFn result of to be written out
|
|
284
322
|
* @param moreArgs additional optional arguments; the last argument as an Error is assumed to be required for the stack ouptut regardless of log level
|
|
285
323
|
*/
|
|
286
|
-
ifTrace(primaryMsgFn: () =>
|
|
324
|
+
ifTrace(primaryMsgFn: () => LogArgument, ...moreArgs: LogArgument[]): void;
|
|
287
325
|
/**
|
|
288
326
|
* Only if log at a "debug" level execute fn() to derive payload to log
|
|
289
327
|
* @param primaryMsgFn result of to be written out
|
|
290
328
|
* @param moreArgs additional optional arguments; the last argument as an Error is assumed to be required for the stack ouptut regardless of log level
|
|
291
329
|
*/
|
|
292
|
-
ifDebug(primaryMsgFn: () =>
|
|
330
|
+
ifDebug(primaryMsgFn: () => LogArgument, ...moreArgs: LogArgument[]): void;
|
|
293
331
|
/**
|
|
294
332
|
* Only if log at a "info" level execute fn() to derive payload to log
|
|
295
333
|
* @param primaryMsgFn result of to be written out
|
|
296
334
|
* @param moreArgs additional optional arguments; the last argument as an Error is assumed to be required for the stack ouptut regardless of log level
|
|
297
335
|
*/
|
|
298
|
-
ifInfo(primaryMsgFn: () =>
|
|
336
|
+
ifInfo(primaryMsgFn: () => LogArgument, ...moreArgs: LogArgument[]): void;
|
|
299
337
|
/**
|
|
300
338
|
* Only if log at a "warn" level execute fn() to derive payload to log
|
|
301
339
|
* @param primaryMsgFn result of to be written out
|
|
302
340
|
* @param moreArgs additional optional arguments; the last argument as an Error is assumed to be required for the stack ouptut regardless of log level
|
|
303
341
|
*/
|
|
304
|
-
ifWarn(primaryMsgFn: () =>
|
|
342
|
+
ifWarn(primaryMsgFn: () => LogArgument, ...moreArgs: LogArgument[]): void;
|
|
305
343
|
/**
|
|
306
344
|
* Only if log at a "error" level execute fn() to derive payload to log
|
|
307
345
|
* @param primaryMsgFn result of to be written out
|
|
308
346
|
* @param moreArgs additional optional arguments; the last argument as an Error is assumed to be required for the stack ouptut regardless of log level
|
|
309
347
|
*/
|
|
310
|
-
ifError(primaryMsgFn: () =>
|
|
348
|
+
ifError(primaryMsgFn: () => LogArgument, ...moreArgs: LogArgument[]): void;
|
|
311
349
|
/**
|
|
312
350
|
* Only if log at a "fatal" level execute fn() to derive payload to log
|
|
313
351
|
* @param primaryMsgFn result of to be written out
|
|
314
352
|
* @param moreArgs additional optional arguments; the last argument as an Error is assumed to be required for the stack ouptut regardless of log level
|
|
315
353
|
*/
|
|
316
|
-
ifFatal(primaryMsgFn: () =>
|
|
354
|
+
ifFatal(primaryMsgFn: () => LogArgument, ...moreArgs: LogArgument[]): void;
|
|
317
355
|
}
|
|
318
356
|
export interface Messagable {
|
|
319
|
-
send(messageName: string, payload?:
|
|
357
|
+
send(messageName: string, payload?: MessagePayload): SendContinuation;
|
|
320
358
|
}
|
|
321
359
|
export interface MetadataContinuation {
|
|
322
360
|
has: (name: string) => boolean;
|
|
@@ -329,13 +367,13 @@ export interface MutableProperties extends Properties {
|
|
|
329
367
|
* @param value - any type of object
|
|
330
368
|
* @returns
|
|
331
369
|
*/
|
|
332
|
-
set(key: string, value:
|
|
370
|
+
set(key: string, value: PropertyValue): MutableProperties;
|
|
333
371
|
/**
|
|
334
372
|
* Load additional properties in
|
|
335
373
|
* @param values - any type of object
|
|
336
374
|
* @returns
|
|
337
375
|
*/
|
|
338
|
-
load(values: SimpleMap<
|
|
376
|
+
load(values: SimpleMap<PropertyValue>): MutableProperties;
|
|
339
377
|
/**
|
|
340
378
|
* Remove a specific property by key
|
|
341
379
|
* @param key - string value
|
|
@@ -381,7 +419,7 @@ export interface Nestable extends Actionable<ActionContinuation> {
|
|
|
381
419
|
onRemount(): void;
|
|
382
420
|
}
|
|
383
421
|
export interface OnContinuation {
|
|
384
|
-
invoke(
|
|
422
|
+
invoke(name: string, before?: () => void, after?: () => void): void;
|
|
385
423
|
forChannel(channelName: string): ForChannelContinuation;
|
|
386
424
|
}
|
|
387
425
|
export interface Operations {
|
|
@@ -416,16 +454,16 @@ export interface PagedFilter extends Filter {
|
|
|
416
454
|
export interface Properties {
|
|
417
455
|
/**
|
|
418
456
|
* Add an observer for all property changes.
|
|
419
|
-
* @param thisObject Object used as this when calling the
|
|
420
|
-
* @param
|
|
457
|
+
* @param thisObject Object that owns and is used as this when calling the named method
|
|
458
|
+
* @param name - name of the method (on thisObject) to be called when any property is changed
|
|
421
459
|
*/
|
|
422
|
-
addObserver(thisObject: CallBackThisObject,
|
|
460
|
+
addObserver(thisObject: CallBackThisObject, name: string): void;
|
|
423
461
|
/**
|
|
424
462
|
* Remove an observer that listened for all property changes.
|
|
425
|
-
* @param thisObject Object
|
|
426
|
-
* @param
|
|
463
|
+
* @param thisObject Object that owns the named method
|
|
464
|
+
* @param name name of the previously-registered method to be removed
|
|
427
465
|
*/
|
|
428
|
-
removeObserver(thisObject: CallBackThisObject,
|
|
466
|
+
removeObserver(thisObject: CallBackThisObject, name: string): void;
|
|
429
467
|
/**
|
|
430
468
|
* Add an observer for a specific property changes, or changes of more general property when the preferred is unavailable.
|
|
431
469
|
* @param thisObject Object used as this when calling the callback
|
|
@@ -433,27 +471,27 @@ export interface Properties {
|
|
|
433
471
|
* @param preferredKey Preferred property key to observe
|
|
434
472
|
* @param prefix Property key prefix for keys which should be included for consideration
|
|
435
473
|
*/
|
|
436
|
-
addFallbackObserver(thisObject: CallBackThisObject,
|
|
474
|
+
addFallbackObserver(thisObject: CallBackThisObject, name: string, preferredKey: string, prefix?: string): void;
|
|
437
475
|
/**
|
|
438
476
|
* Remove an observer for a specific property changes, or changes of more general property when the preferred is unavailable.
|
|
439
|
-
* @param thisObject Object
|
|
440
|
-
* @param
|
|
477
|
+
* @param thisObject Object that owns the named method
|
|
478
|
+
* @param name name of the previously-registered method to be removed
|
|
441
479
|
*/
|
|
442
|
-
removeFallbackObserver(thisObject: CallBackThisObject,
|
|
480
|
+
removeFallbackObserver(thisObject: CallBackThisObject, name: string): void;
|
|
443
481
|
/**
|
|
444
482
|
* Add an observer for specific property.
|
|
445
483
|
* @param key Specific property key
|
|
446
|
-
* @param thisObject Object used as this when calling the
|
|
447
|
-
* @param
|
|
484
|
+
* @param thisObject Object that owns and is used as this when calling the named method
|
|
485
|
+
* @param name name of the method (on thisObject) to be called when the specific property is changed
|
|
448
486
|
*/
|
|
449
|
-
addPropertyObserver(key: string, thisObject: CallBackThisObject,
|
|
487
|
+
addPropertyObserver(key: string, thisObject: CallBackThisObject, name: string): void;
|
|
450
488
|
/**
|
|
451
489
|
* Remove an observer for specific property.
|
|
452
490
|
* @param key Specific property key
|
|
453
|
-
* @param thisObject Object
|
|
454
|
-
* @param
|
|
491
|
+
* @param thisObject Object that owns the named method
|
|
492
|
+
* @param name name of the previously-registered method to remove
|
|
455
493
|
*/
|
|
456
|
-
removePropertyObserver(key: string, thisObject: CallBackThisObject,
|
|
494
|
+
removePropertyObserver(key: string, thisObject: CallBackThisObject, name: string): void;
|
|
457
495
|
snapshot(): MutableProperties;
|
|
458
496
|
/**
|
|
459
497
|
* Get all the keys present in the properties object
|
|
@@ -525,7 +563,7 @@ export interface Receivable {
|
|
|
525
563
|
* @param messageName The name of the message to send.
|
|
526
564
|
* @param payload The optional payload to include with the message.
|
|
527
565
|
*/
|
|
528
|
-
message(channelName: string, messageName: string, payload?:
|
|
566
|
+
message(channelName: string, messageName: string, payload?: MessagePayload): void;
|
|
529
567
|
}
|
|
530
568
|
export interface RegionContinuation {
|
|
531
569
|
/**
|
|
@@ -534,17 +572,17 @@ export interface RegionContinuation {
|
|
|
534
572
|
*/
|
|
535
573
|
has(name: string): boolean;
|
|
536
574
|
/**
|
|
537
|
-
* Get
|
|
538
|
-
* @param name - string name value of the
|
|
539
|
-
* @returns Component
|
|
575
|
+
* Get the child component in a region.
|
|
576
|
+
* @param name - string name value of the region
|
|
577
|
+
* @returns the {@link Component} in the region, or null when the region holds no component
|
|
540
578
|
*/
|
|
541
|
-
get<N extends Nestable>(name: string): N;
|
|
579
|
+
get<N extends Nestable>(name: string): N | null;
|
|
542
580
|
/**
|
|
543
|
-
* Set a child component into a region.
|
|
544
|
-
* @param name - string name value of the
|
|
545
|
-
* @param component - the {@link Component} reference
|
|
581
|
+
* Set a child component into a region, or clear the region.
|
|
582
|
+
* @param name - string name value of the region
|
|
583
|
+
* @param component - the {@link Component} reference, or null to remove the region's component and leave it empty
|
|
546
584
|
*/
|
|
547
|
-
set(name: string, component: Nestable): void;
|
|
585
|
+
set(name: string, component: Nestable | null): void;
|
|
548
586
|
setByObjectId(name: string, componentName: string, defaultComponentName?: string): void;
|
|
549
587
|
}
|
|
550
588
|
export interface Register<R> extends Releasable {
|
|
@@ -554,13 +592,12 @@ export interface Register<R> extends Releasable {
|
|
|
554
592
|
registerSingleton<T>(id: string, classInstance: Type<T>, resolvers?: ArgumentsResolvers, localResolution?: boolean): R;
|
|
555
593
|
registerSingletonWithFactory<T>(id: string, factoryFn: () => T, resolvers?: ArgumentsResolvers, localResolution?: boolean): R;
|
|
556
594
|
hasRegistration(id: string): boolean;
|
|
557
|
-
expose(id: string): R;
|
|
558
595
|
}
|
|
559
596
|
export interface Releasable {
|
|
560
597
|
$release(): void;
|
|
561
598
|
}
|
|
562
599
|
export interface Scope {
|
|
563
|
-
add(name: string, item:
|
|
600
|
+
add(name: string, item: ScopeItem): Scope;
|
|
564
601
|
remove(name: string): Scope;
|
|
565
602
|
extend(): Scope;
|
|
566
603
|
}
|
|
@@ -579,7 +616,7 @@ export interface Sendable {
|
|
|
579
616
|
* @param payload The optional payload to include with the message
|
|
580
617
|
* @param startFrom The optional path to the context start the traversal from
|
|
581
618
|
*/
|
|
582
|
-
send(propagation: To, channelName: string, messageName: string, payload?:
|
|
619
|
+
send(propagation: To, channelName: string, messageName: string, payload?: MessagePayload, startFrom?: string): void;
|
|
583
620
|
}
|
|
584
621
|
export interface SeriesOperations {
|
|
585
622
|
getAt<N extends Nestable>(index: number): N;
|
|
@@ -601,25 +638,67 @@ export interface Stage extends Releasable {
|
|
|
601
638
|
before(): SeriesOperations;
|
|
602
639
|
after(): SeriesOperations;
|
|
603
640
|
start(): Stage;
|
|
604
|
-
|
|
641
|
+
/**
|
|
642
|
+
* Set the top-level component of the stage, or remove it.
|
|
643
|
+
* @param component - the {@link Component} to place, or null to remove the current component and leave the stage empty
|
|
644
|
+
* @returns the stage
|
|
645
|
+
*/
|
|
646
|
+
setComponent(component: Nestable | null): Stage;
|
|
605
647
|
setComponentByObjectId(componentName: string, defaultComponentName?: string): Stage;
|
|
606
648
|
isStarted(): boolean;
|
|
607
649
|
addInitializer(thisObject: CallBackThisObject, callback: (stage: Stage) => void): Stage;
|
|
608
650
|
}
|
|
609
651
|
export interface Tellable {
|
|
610
|
-
tell(name: string, payload?:
|
|
652
|
+
tell(name: string, payload?: MessagePayload): void;
|
|
611
653
|
}
|
|
612
|
-
export interface
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
* Evaluates an expression.
|
|
616
|
-
* @param expression Expression to evaluate.
|
|
617
|
-
*/
|
|
618
|
-
evaluate<T>(expression: string): T;
|
|
619
|
-
getWatchScope(): unknown;
|
|
654
|
+
export interface WatchContinuation {
|
|
655
|
+
reducedBy<T>(reducerFn: (input: ModelValue) => T): WatchContinuation;
|
|
656
|
+
invoke(name: string): void;
|
|
620
657
|
}
|
|
621
658
|
export type CallBackThisObject = object;
|
|
622
|
-
|
|
659
|
+
/**
|
|
660
|
+
* A resolved argument that is passed to the constructor or factory function that creates a registered object. It is
|
|
661
|
+
* `unknown`: any value is accepted, and a value must be narrowed before use. The name documents intent only, so compiler
|
|
662
|
+
* errors report it as `unknown`.
|
|
663
|
+
*/
|
|
664
|
+
export type ConstructorArgument = unknown;
|
|
665
|
+
/**
|
|
666
|
+
* An extra argument a caller passes when resolving an object by id, as in `getObject(id, ...instanceArguments)`. It is
|
|
667
|
+
* `unknown`: any value is accepted, and a value must be narrowed before use. The name documents intent only, so compiler
|
|
668
|
+
* errors report it as `unknown`.
|
|
669
|
+
*/
|
|
670
|
+
export type InstanceArgument = unknown;
|
|
671
|
+
/**
|
|
672
|
+
* An element of an array rendered by `c-each` or processed by a filter. It is `unknown`: any value is accepted, and a
|
|
673
|
+
* value must be narrowed before use. The name documents intent only, so compiler errors report it as `unknown`.
|
|
674
|
+
*/
|
|
675
|
+
export type ListItem = unknown;
|
|
676
|
+
/**
|
|
677
|
+
* A value passed to a logger method, after or in place of the primary message. It is `unknown`: any value is accepted, and
|
|
678
|
+
* a value must be narrowed before use. The name documents intent only, so compiler errors report it as `unknown`.
|
|
679
|
+
*/
|
|
680
|
+
export type LogArgument = unknown;
|
|
681
|
+
export type MessageCallback = (channelName: string, messageName: string, payload: MessagePayload) => void;
|
|
682
|
+
/**
|
|
683
|
+
* The payload of a message that is sent, told, delivered or received. It is `unknown`: any value is accepted, and a value
|
|
684
|
+
* must be narrowed before use. The name documents intent only, so compiler errors report it as `unknown`.
|
|
685
|
+
*/
|
|
686
|
+
export type MessagePayload = unknown;
|
|
687
|
+
/**
|
|
688
|
+
* A value read from or written to the model through a template expression. It is `unknown`: any value is accepted, and a
|
|
689
|
+
* value must be narrowed before use. The name documents intent only, so compiler errors report it as `unknown`.
|
|
690
|
+
*/
|
|
691
|
+
export type ModelValue = unknown;
|
|
692
|
+
/**
|
|
693
|
+
* The value of a configuration property. It is `unknown`: any value is accepted, and a value must be narrowed before use.
|
|
694
|
+
* The name documents intent only, so compiler errors report it as `unknown`.
|
|
695
|
+
*/
|
|
696
|
+
export type PropertyValue = unknown;
|
|
697
|
+
/**
|
|
698
|
+
* A value added to a scope, and reachable from template expressions through `s()`. It is `unknown`: any value is accepted,
|
|
699
|
+
* and a value must be narrowed before use. The name documents intent only, so compiler errors report it as `unknown`.
|
|
700
|
+
*/
|
|
701
|
+
export type ScopeItem = unknown;
|
|
623
702
|
export type SimpleMap<T> = Record<string, T>;
|
|
624
703
|
export type Type<T> = new (...args: any[]) => T;
|
|
625
704
|
|