mol_wire_lib 1.0.1739 → 1.0.1741
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/node.d.ts +244 -1
- package/node.d.ts.map +1 -1
- package/node.deps.json +1 -1
- package/node.js +243 -10
- package/node.js.map +1 -1
- package/node.mjs +243 -10
- package/node.test.js +371 -14
- package/node.test.js.map +1 -1
- package/package.json +1 -1
- package/web.d.ts +198 -0
- package/web.d.ts.map +1 -1
- package/web.deps.json +1 -1
- package/web.js +191 -9
- package/web.js.map +1 -1
- package/web.mjs +191 -9
- package/web.test.js +124 -1
- package/web.test.js.map +1 -1
package/package.json
CHANGED
package/web.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ declare namespace $ {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
declare namespace $ {
|
|
18
|
+
/** Generates unique identifier. */
|
|
18
19
|
function $mol_guid(length?: number, exists?: (id: string) => boolean): string;
|
|
19
20
|
}
|
|
20
21
|
|
|
@@ -23,53 +24,125 @@ declare namespace $ {
|
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
declare namespace $ {
|
|
27
|
+
/** Special status statuses. */
|
|
26
28
|
enum $mol_wire_cursor {
|
|
29
|
+
/** Update required. */
|
|
27
30
|
stale = -1,
|
|
31
|
+
/** Some of (transitive) pub update required. */
|
|
28
32
|
doubt = -2,
|
|
33
|
+
/** Actual state but may be dropped. */
|
|
29
34
|
fresh = -3,
|
|
35
|
+
/** State will never be changed. */
|
|
30
36
|
final = -4
|
|
31
37
|
}
|
|
32
38
|
}
|
|
33
39
|
|
|
34
40
|
declare namespace $ {
|
|
41
|
+
/**
|
|
42
|
+
* Collects subscribers in compact array. 28B
|
|
43
|
+
*/
|
|
35
44
|
class $mol_wire_pub extends Object {
|
|
36
45
|
constructor(id?: string);
|
|
37
46
|
[Symbol.toStringTag]: string;
|
|
38
47
|
data: unknown[];
|
|
39
48
|
static get [Symbol.species](): ArrayConstructor;
|
|
49
|
+
/**
|
|
50
|
+
* Index of first subscriber.
|
|
51
|
+
*/
|
|
40
52
|
protected sub_from: number;
|
|
53
|
+
/**
|
|
54
|
+
* All current subscribers.
|
|
55
|
+
*/
|
|
41
56
|
get sub_list(): readonly $mol_wire_sub[];
|
|
57
|
+
/**
|
|
58
|
+
* Has any subscribers or not.
|
|
59
|
+
*/
|
|
42
60
|
get sub_empty(): boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Subscribe subscriber to this publisher events and return position of subscriber that required to unsubscribe.
|
|
63
|
+
*/
|
|
43
64
|
sub_on(sub: $mol_wire_pub, pub_pos: number): number;
|
|
65
|
+
/**
|
|
66
|
+
* Unsubscribe subscriber from this publisher events by subscriber position provided by `on(pub)`.
|
|
67
|
+
*/
|
|
44
68
|
sub_off(sub_pos: number): void;
|
|
69
|
+
/**
|
|
70
|
+
* Called when last sub was unsubscribed.
|
|
71
|
+
**/
|
|
45
72
|
reap(): void;
|
|
73
|
+
/**
|
|
74
|
+
* Autowire this publisher with current subscriber.
|
|
75
|
+
**/
|
|
46
76
|
promote(): void;
|
|
77
|
+
/**
|
|
78
|
+
* Enforce actualization. Should not throw errors.
|
|
79
|
+
*/
|
|
47
80
|
fresh(): void;
|
|
81
|
+
/**
|
|
82
|
+
* Allow to put data to caches in the subtree.
|
|
83
|
+
*/
|
|
48
84
|
complete(): void;
|
|
49
85
|
get incompleted(): boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Notify subscribers about self changes.
|
|
88
|
+
*/
|
|
50
89
|
emit(quant?: $mol_wire_cursor): void;
|
|
90
|
+
/**
|
|
91
|
+
* Moves peer from one position to another. Doesn't clear data at old position!
|
|
92
|
+
*/
|
|
51
93
|
peer_move(from_pos: number, to_pos: number): void;
|
|
94
|
+
/**
|
|
95
|
+
* Updates self position in the peer.
|
|
96
|
+
*/
|
|
52
97
|
peer_repos(peer_pos: number, self_pos: number): void;
|
|
53
98
|
}
|
|
54
99
|
}
|
|
55
100
|
|
|
56
101
|
declare namespace $ {
|
|
102
|
+
/** Generic subscriber interface */
|
|
57
103
|
interface $mol_wire_sub extends $mol_wire_pub {
|
|
58
104
|
temp: boolean;
|
|
59
105
|
pub_list: $mol_wire_pub[];
|
|
106
|
+
/**
|
|
107
|
+
* Begin auto wire to publishers.
|
|
108
|
+
* Returns previous auto subscriber that must me transfer to the `end`.
|
|
109
|
+
*/
|
|
60
110
|
track_on(): $mol_wire_sub | null;
|
|
111
|
+
/**
|
|
112
|
+
* Returns next auto wired publisher. It can be easely repormoted.
|
|
113
|
+
* Or promotes next publisher to auto wire its togeter.
|
|
114
|
+
* Must be used only between `track_on` and `track_off`.
|
|
115
|
+
*/
|
|
61
116
|
track_next(pub?: $mol_wire_pub): $mol_wire_pub | null;
|
|
62
117
|
pub_off(pub_pos: number): void;
|
|
118
|
+
/**
|
|
119
|
+
* Unsubscribes from unpromoted publishers.
|
|
120
|
+
*/
|
|
63
121
|
track_cut(sub: $mol_wire_pub | null): void;
|
|
122
|
+
/**
|
|
123
|
+
* Ends auto wire to publishers.
|
|
124
|
+
*/
|
|
64
125
|
track_off(sub: $mol_wire_pub | null): void;
|
|
126
|
+
/**
|
|
127
|
+
* Receive notification about publisher changes.
|
|
128
|
+
*/
|
|
65
129
|
absorb(quant: $mol_wire_cursor, pos: number): void;
|
|
130
|
+
/**
|
|
131
|
+
* Unsubscribes from all publishers.
|
|
132
|
+
*/
|
|
66
133
|
destructor(): void;
|
|
67
134
|
}
|
|
68
135
|
}
|
|
69
136
|
|
|
70
137
|
declare namespace $ {
|
|
71
138
|
let $mol_wire_auto_sub: $mol_wire_sub | null;
|
|
139
|
+
/**
|
|
140
|
+
* When fulfilled, all publishers are promoted to this subscriber on access to its.
|
|
141
|
+
*/
|
|
72
142
|
function $mol_wire_auto(next?: $mol_wire_sub | null): $mol_wire_sub | null;
|
|
143
|
+
/**
|
|
144
|
+
* Affection queue. Used to prevent accidental stack overflow on emit.
|
|
145
|
+
*/
|
|
73
146
|
const $mol_wire_affected: ($mol_wire_sub | number)[];
|
|
74
147
|
}
|
|
75
148
|
|
|
@@ -106,6 +179,13 @@ declare namespace $ {
|
|
|
106
179
|
}
|
|
107
180
|
|
|
108
181
|
declare namespace $ {
|
|
182
|
+
/**
|
|
183
|
+
* Publisher that can auto collect other publishers. 32B
|
|
184
|
+
*
|
|
185
|
+
* P1 P2 P3 P4 S1 S2 S3
|
|
186
|
+
* ^ ^
|
|
187
|
+
* pubs_from subs_from
|
|
188
|
+
*/
|
|
109
189
|
class $mol_wire_pub_sub extends $mol_wire_pub implements $mol_wire_sub {
|
|
110
190
|
protected pub_from: number;
|
|
111
191
|
protected cursor: $mol_wire_cursor;
|
|
@@ -122,17 +202,26 @@ declare namespace $ {
|
|
|
122
202
|
complete_pubs(): void;
|
|
123
203
|
absorb(quant?: $mol_wire_cursor, pos?: number): void;
|
|
124
204
|
[$mol_dev_format_head](): any[];
|
|
205
|
+
/**
|
|
206
|
+
* Is subscribed to any publisher or not.
|
|
207
|
+
*/
|
|
125
208
|
get pub_empty(): boolean;
|
|
126
209
|
}
|
|
127
210
|
}
|
|
128
211
|
|
|
129
212
|
declare namespace $ {
|
|
130
213
|
const $mol_ambient_ref: unique symbol;
|
|
214
|
+
/** @deprecated use $ instead */
|
|
131
215
|
type $mol_ambient_context = $;
|
|
132
216
|
function $mol_ambient(this: $ | void, overrides: Partial<$>): $;
|
|
133
217
|
}
|
|
134
218
|
|
|
135
219
|
declare namespace $ {
|
|
220
|
+
/**
|
|
221
|
+
* Proxy that delegates all to lazy returned target.
|
|
222
|
+
*
|
|
223
|
+
* $mol_delegate( Array.prototype , ()=> fetch_array() )
|
|
224
|
+
*/
|
|
136
225
|
function $mol_delegate<Value extends object>(proto: Value, target: () => Value): Value;
|
|
137
226
|
}
|
|
138
227
|
|
|
@@ -200,6 +289,13 @@ declare namespace $ {
|
|
|
200
289
|
}
|
|
201
290
|
|
|
202
291
|
declare namespace $ {
|
|
292
|
+
/**
|
|
293
|
+
* Suspendable task with support both sync/async api.
|
|
294
|
+
*
|
|
295
|
+
* A1 A2 A3 A4 P1 P2 P3 P4 S1 S2 S3
|
|
296
|
+
* ^ ^ ^
|
|
297
|
+
* args_from pubs_from subs_from
|
|
298
|
+
**/
|
|
203
299
|
abstract class $mol_wire_fiber<Host, Args extends readonly unknown[], Result> extends $mol_wire_pub_sub {
|
|
204
300
|
readonly task: (this: Host, ...args: Args) => Result;
|
|
205
301
|
readonly host?: Host | undefined;
|
|
@@ -226,7 +322,15 @@ declare namespace $ {
|
|
|
226
322
|
fresh(): this | undefined;
|
|
227
323
|
refresh(): void;
|
|
228
324
|
abstract put(next: Result | Error | Promise<Result | Error>): Result | Error | Promise<Result | Error>;
|
|
325
|
+
/**
|
|
326
|
+
* Synchronous execution. Throws Promise when waits async task (SuspenseAPI provider).
|
|
327
|
+
* Should be called inside SuspenseAPI consumer (ie fiber).
|
|
328
|
+
*/
|
|
229
329
|
sync(): Awaited<Result>;
|
|
330
|
+
/**
|
|
331
|
+
* Asynchronous execution.
|
|
332
|
+
* It's SuspenseAPI consumer. So SuspenseAPI providers can be called inside.
|
|
333
|
+
*/
|
|
230
334
|
async_raw(): Promise<Result>;
|
|
231
335
|
async(): Promise<Result> & {
|
|
232
336
|
destructor(): void;
|
|
@@ -238,31 +342,52 @@ declare namespace $ {
|
|
|
238
342
|
|
|
239
343
|
declare namespace $ {
|
|
240
344
|
let $mol_compare_deep_cache: WeakMap<any, WeakMap<any, boolean>>;
|
|
345
|
+
/**
|
|
346
|
+
* Deeply compares two values. Returns true if equal.
|
|
347
|
+
* Define `Symbol.toPrimitive` to customize.
|
|
348
|
+
*/
|
|
241
349
|
function $mol_compare_deep<Value>(left: Value, right: Value): boolean;
|
|
242
350
|
}
|
|
243
351
|
|
|
244
352
|
declare namespace $ {
|
|
353
|
+
/** Logger event data */
|
|
245
354
|
type $mol_log3_event<Fields> = {
|
|
246
355
|
[key in string]: unknown;
|
|
247
356
|
} & {
|
|
357
|
+
/** Time of event creation */
|
|
248
358
|
time?: string;
|
|
359
|
+
/** Place of event creation */
|
|
249
360
|
place: unknown;
|
|
361
|
+
/** Short description of event */
|
|
250
362
|
message: string;
|
|
251
363
|
} & Fields;
|
|
364
|
+
/** Logger function */
|
|
252
365
|
type $mol_log3_logger<Fields, Res = void> = (this: $, event: $mol_log3_event<Fields>) => Res;
|
|
366
|
+
/** Log begin of some task */
|
|
253
367
|
let $mol_log3_come: $mol_log3_logger<{}>;
|
|
368
|
+
/** Log end of some task */
|
|
254
369
|
let $mol_log3_done: $mol_log3_logger<{}>;
|
|
370
|
+
/** Log error */
|
|
255
371
|
let $mol_log3_fail: $mol_log3_logger<{}>;
|
|
372
|
+
/** Log warning message */
|
|
256
373
|
let $mol_log3_warn: $mol_log3_logger<{
|
|
257
374
|
hint: string;
|
|
258
375
|
}>;
|
|
376
|
+
/** Log some generic event */
|
|
259
377
|
let $mol_log3_rise: $mol_log3_logger<{}>;
|
|
378
|
+
/** Log begin of log group, returns func to close group */
|
|
260
379
|
let $mol_log3_area: $mol_log3_logger<{}, () => void>;
|
|
380
|
+
/** Log begin of collapsed group only when some logged inside, returns func to close group */
|
|
261
381
|
function $mol_log3_area_lazy(this: $, event: $mol_log3_event<{}>): () => void;
|
|
262
382
|
let $mol_log3_stack: (() => void)[];
|
|
263
383
|
}
|
|
264
384
|
|
|
265
385
|
declare namespace $ {
|
|
386
|
+
/**
|
|
387
|
+
* Extracts keys from `Input` which values extends `Upper` and extendable by `Lower`.
|
|
388
|
+
*
|
|
389
|
+
* type MathConstants = $mol_type_keys_extract< Math , number > // "E" | "PI" ...
|
|
390
|
+
*/
|
|
266
391
|
type $mol_type_keys_extract<Input, Upper, Lower = never> = {
|
|
267
392
|
[Field in keyof Input]: unknown extends Input[Field] ? never : Input[Field] extends never ? never : Input[Field] extends Upper ? [
|
|
268
393
|
Lower
|
|
@@ -275,6 +400,7 @@ declare namespace $ {
|
|
|
275
400
|
}
|
|
276
401
|
|
|
277
402
|
declare namespace $ {
|
|
403
|
+
/** One-shot fiber */
|
|
278
404
|
class $mol_wire_task<Host, Args extends readonly unknown[], Result> extends $mol_wire_fiber<Host, Args, Result> {
|
|
279
405
|
static getter<Host, Args extends readonly unknown[], Result>(task: (this: Host, ...args: Args) => Result): (host: Host, args: Args) => $mol_wire_task<Host, Args, Result>;
|
|
280
406
|
get temp(): boolean;
|
|
@@ -285,6 +411,7 @@ declare namespace $ {
|
|
|
285
411
|
}
|
|
286
412
|
|
|
287
413
|
declare namespace $ {
|
|
414
|
+
/** Returns string key for any value. */
|
|
288
415
|
function $mol_key<Value>(value: Value): string;
|
|
289
416
|
}
|
|
290
417
|
|
|
@@ -301,6 +428,9 @@ declare namespace $ {
|
|
|
301
428
|
}
|
|
302
429
|
|
|
303
430
|
declare namespace $ {
|
|
431
|
+
/**
|
|
432
|
+
* Decorates method to fiber to ensure it is executed only once inside other fiber.
|
|
433
|
+
*/
|
|
304
434
|
function $mol_wire_method<Host extends object, Args extends readonly any[]>(host: Host, field: PropertyKey, descr?: TypedPropertyDescriptor<(...args: Args) => any>): {
|
|
305
435
|
value: (this: Host, ...args: Args) => any;
|
|
306
436
|
enumerable?: boolean;
|
|
@@ -312,10 +442,20 @@ declare namespace $ {
|
|
|
312
442
|
}
|
|
313
443
|
|
|
314
444
|
declare namespace $ {
|
|
445
|
+
/**
|
|
446
|
+
* Returns `Tuple` without first element.
|
|
447
|
+
*
|
|
448
|
+
* $mol_type_tail<[ 1 , 2 , 3 ]> // [ 2, 3 ]
|
|
449
|
+
*/
|
|
315
450
|
type $mol_type_tail<Tuple extends readonly any[]> = ((...tail: Tuple) => any) extends ((head: any, ...tail: infer Tail) => any) ? Tail : never;
|
|
316
451
|
}
|
|
317
452
|
|
|
318
453
|
declare namespace $ {
|
|
454
|
+
/**
|
|
455
|
+
* Returns last element of `Tuple`.
|
|
456
|
+
*
|
|
457
|
+
* $mol_type_tail<[ 1 , 2 , 3 ]> // 3
|
|
458
|
+
*/
|
|
319
459
|
type $mol_type_foot<Tuple extends readonly any[]> = Tuple['length'] extends 0 ? never : Tuple[$mol_type_tail<Tuple>['length']];
|
|
320
460
|
}
|
|
321
461
|
|
|
@@ -336,6 +476,7 @@ declare namespace $ {
|
|
|
336
476
|
}
|
|
337
477
|
|
|
338
478
|
declare namespace $ {
|
|
479
|
+
/** Long-living fiber. */
|
|
339
480
|
class $mol_wire_atom<Host, Args extends readonly unknown[], Result> extends $mol_wire_fiber<Host, Args, Result> {
|
|
340
481
|
static solo<Host, Args extends readonly unknown[], Result>(host: Host, task: (this: Host, ...args: Args) => Result): $mol_wire_atom<Host, Args, Result>;
|
|
341
482
|
static plex<Host, Args extends readonly unknown[], Result>(host: Host, task: (this: Host, ...args: Args) => Result, key: Args[0]): $mol_wire_atom<Host, Args, Result>;
|
|
@@ -343,6 +484,9 @@ declare namespace $ {
|
|
|
343
484
|
static watcher: $mol_after_frame | null;
|
|
344
485
|
static watch(): void;
|
|
345
486
|
watch(): void;
|
|
487
|
+
/**
|
|
488
|
+
* Update atom value through another temp fiber.
|
|
489
|
+
*/
|
|
346
490
|
resync(args: Args): Error | Result | Promise<Error | Result>;
|
|
347
491
|
once(): Awaited<Result>;
|
|
348
492
|
channel(): ((next?: $mol_type_foot<Args>) => Awaited<Result>) & {
|
|
@@ -354,18 +498,30 @@ declare namespace $ {
|
|
|
354
498
|
}
|
|
355
499
|
|
|
356
500
|
declare namespace $ {
|
|
501
|
+
/** Run code without state changes */
|
|
357
502
|
function $mol_wire_probe<Value>(task: () => Value, def?: Value): Value | undefined;
|
|
358
503
|
}
|
|
359
504
|
|
|
360
505
|
declare namespace $ {
|
|
506
|
+
/**
|
|
507
|
+
* Disable reaping of current subscriber
|
|
508
|
+
*/
|
|
361
509
|
function $mol_wire_solid(): void;
|
|
362
510
|
}
|
|
363
511
|
|
|
364
512
|
declare namespace $ {
|
|
513
|
+
/**
|
|
514
|
+
* Real-time refresh current atom.
|
|
515
|
+
* Don't use if possible. May reduce performance.
|
|
516
|
+
*/
|
|
365
517
|
function $mol_wire_watch(): void;
|
|
366
518
|
}
|
|
367
519
|
|
|
368
520
|
declare namespace $ {
|
|
521
|
+
/**
|
|
522
|
+
* Convert asynchronous (promise-based) API to synchronous by wrapping function and method calls in a fiber.
|
|
523
|
+
* @see https://mol.hyoo.ru/#!section=docs/=1fcpsq_1wh0h2
|
|
524
|
+
*/
|
|
369
525
|
export function $mol_wire_sync<Host extends object>(obj: Host): ObjectOrFunctionResultAwaited<Host>;
|
|
370
526
|
type FunctionResultAwaited<Some> = Some extends (...args: infer Args) => infer Res ? (...args: Args) => Awaited<Res> : Some;
|
|
371
527
|
type ConstructorResultAwaited<Some> = Some extends new (...args: infer Args) => infer Res ? new (...args: Args) => Res : {};
|
|
@@ -377,6 +533,7 @@ declare namespace $ {
|
|
|
377
533
|
}
|
|
378
534
|
|
|
379
535
|
declare namespace $ {
|
|
536
|
+
/** Convert a pseudo-synchronous (Suspense API) API to an explicit asynchronous one (for integrating with external systems). */
|
|
380
537
|
export function $mol_wire_async<Host extends object>(obj: Host): ObjectOrFunctionResultPromisify<Host>;
|
|
381
538
|
type FunctionResultPromisify<Some> = Some extends (...args: infer Args) => infer Res ? Res extends PromiseLike<unknown> ? Some : (...args: Args) => Promise<Res> : Some;
|
|
382
539
|
type MethodsResultPromisify<Host extends Object> = {
|
|
@@ -387,18 +544,21 @@ declare namespace $ {
|
|
|
387
544
|
}
|
|
388
545
|
|
|
389
546
|
declare namespace $ {
|
|
547
|
+
/** Starts subtasks concurrently instead of serial. */
|
|
390
548
|
function $mol_wire_race<Tasks extends ((...args: any) => any)[]>(...tasks: Tasks): {
|
|
391
549
|
[index in keyof Tasks]: ReturnType<Tasks[index]>;
|
|
392
550
|
};
|
|
393
551
|
}
|
|
394
552
|
|
|
395
553
|
declare namespace $ {
|
|
554
|
+
/** Decorates solo object channel to [mol_wire_atom](../atom/atom.ts). */
|
|
396
555
|
export function $mol_wire_solo<Args extends any[]>(host: object, field: string, descr?: TypedPropertyDescriptor<(...args: Args) => any>): TypedPropertyDescriptor<(...args: First_optional<Args>) => any>;
|
|
397
556
|
type First_optional<Args extends any[]> = Args extends [] ? [] : [Args[0] | undefined, ...$mol_type_tail<Args>];
|
|
398
557
|
export {};
|
|
399
558
|
}
|
|
400
559
|
|
|
401
560
|
declare namespace $ {
|
|
561
|
+
/** Reactive memoizing multiplexed property decorator. */
|
|
402
562
|
function $mol_wire_plex<Args extends [any, ...any[]]>(host: object, field: string, descr?: TypedPropertyDescriptor<(...args: Args) => any>): {
|
|
403
563
|
value: (this: typeof host, ...args: Args) => any;
|
|
404
564
|
enumerable?: boolean;
|
|
@@ -410,6 +570,11 @@ declare namespace $ {
|
|
|
410
570
|
}
|
|
411
571
|
|
|
412
572
|
declare namespace $ {
|
|
573
|
+
/**
|
|
574
|
+
* Returns closure that returns constant value.
|
|
575
|
+
* @example
|
|
576
|
+
* const rnd = $mol_const( Math.random() )
|
|
577
|
+
*/
|
|
413
578
|
function $mol_const<Value>(value: Value): {
|
|
414
579
|
(): Value;
|
|
415
580
|
'()': Value;
|
|
@@ -417,6 +582,7 @@ declare namespace $ {
|
|
|
417
582
|
}
|
|
418
583
|
|
|
419
584
|
declare namespace $ {
|
|
585
|
+
/** Incompatible with instance fields with initializators */
|
|
420
586
|
function $mol_wire_field<Host extends object, Field extends keyof Host, Value extends Host[Field]>(host: Host, field: Field, descr?: TypedPropertyDescriptor<Value>): any;
|
|
421
587
|
}
|
|
422
588
|
|
|
@@ -429,7 +595,25 @@ declare namespace $ {
|
|
|
429
595
|
}
|
|
430
596
|
|
|
431
597
|
declare namespace $ {
|
|
598
|
+
/**
|
|
599
|
+
* Reactive memoizing solo property decorator from [mol_wire](../wire/README.md)
|
|
600
|
+
* @example
|
|
601
|
+
* '@' $mol_mem
|
|
602
|
+
* name(next?: string) {
|
|
603
|
+
* return next ?? 'default'
|
|
604
|
+
* }
|
|
605
|
+
* @see https://mol.hyoo.ru/#!section=docs/=qxmh6t_sinbmb
|
|
606
|
+
*/
|
|
432
607
|
let $mol_mem: typeof $mol_wire_solo;
|
|
608
|
+
/**
|
|
609
|
+
* Reactive memoizing multiplexed property decorator [mol_wire](../wire/README.md)
|
|
610
|
+
* @example
|
|
611
|
+
* '@' $mol_mem_key
|
|
612
|
+
* name(id: number, next?: string) {
|
|
613
|
+
* return next ?? 'default'
|
|
614
|
+
* }
|
|
615
|
+
* @see https://mol.hyoo.ru/#!section=docs/=qxmh6t_sinbmb
|
|
616
|
+
*/
|
|
433
617
|
let $mol_mem_key: typeof $mol_wire_plex;
|
|
434
618
|
}
|
|
435
619
|
|
|
@@ -444,6 +628,7 @@ declare namespace $ {
|
|
|
444
628
|
}
|
|
445
629
|
|
|
446
630
|
declare namespace $ {
|
|
631
|
+
/** State of time moment */
|
|
447
632
|
class $mol_state_time extends $mol_object {
|
|
448
633
|
static task(precision: number, reset?: null): $mol_after_timeout | $mol_after_frame;
|
|
449
634
|
static now(precision: number): number;
|
|
@@ -451,6 +636,7 @@ declare namespace $ {
|
|
|
451
636
|
}
|
|
452
637
|
|
|
453
638
|
declare namespace $ {
|
|
639
|
+
/** Transition atom value */
|
|
454
640
|
function $mol_wire_easing(next: any): any;
|
|
455
641
|
}
|
|
456
642
|
|
|
@@ -459,6 +645,15 @@ declare namespace $ {
|
|
|
459
645
|
}
|
|
460
646
|
|
|
461
647
|
declare namespace $ {
|
|
648
|
+
/**
|
|
649
|
+
* Returns type of function result or class instance.
|
|
650
|
+
*
|
|
651
|
+
* // 777
|
|
652
|
+
* $mol_type_result< ()=> 777 >
|
|
653
|
+
*
|
|
654
|
+
* // 777
|
|
655
|
+
* $mol_type_result< new()=> 777 >
|
|
656
|
+
*/
|
|
462
657
|
type $mol_type_result<Func> = Func extends (...params: any) => infer Result ? Result : Func extends new (...params: any) => infer Result ? Result : never;
|
|
463
658
|
}
|
|
464
659
|
|
|
@@ -469,6 +664,7 @@ declare namespace $ {
|
|
|
469
664
|
}
|
|
470
665
|
|
|
471
666
|
declare namespace $ {
|
|
667
|
+
/** Reactive Set */
|
|
472
668
|
class $mol_wire_set<Value> extends Set<Value> {
|
|
473
669
|
pub: $mol_wire_pub;
|
|
474
670
|
has(value: Value): boolean;
|
|
@@ -491,6 +687,7 @@ declare namespace $ {
|
|
|
491
687
|
}
|
|
492
688
|
|
|
493
689
|
declare namespace $ {
|
|
690
|
+
/** reactive Dictionary */
|
|
494
691
|
class $mol_wire_dict<Key, Value> extends Map<Key, Value> {
|
|
495
692
|
pub: $mol_wire_pub;
|
|
496
693
|
has(key: Key): boolean;
|
|
@@ -522,6 +719,7 @@ declare namespace $ {
|
|
|
522
719
|
}
|
|
523
720
|
|
|
524
721
|
declare namespace $ {
|
|
722
|
+
/** Watch and logs reactive states. Logger automatically added to test bundle which is adding to `test.html`. */
|
|
525
723
|
class $mol_wire_log extends $mol_object2 {
|
|
526
724
|
static watch(task?: () => any): (() => any) | undefined;
|
|
527
725
|
static track(fiber: $mol_wire_fiber<any, any, any>): any;
|
package/web.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../mam.d.ts","../../../guid/guid.d.ts","../../../fail/fail.d.ts","../../cursor/cursor.d.ts","../../pub/pub.d.ts","../../sub/sub.d.ts","../../wire.d.ts","../../../fail/hidden/hidden.d.ts","../../../dev/format/format.d.ts","../../pub/sub/sub.d.ts","../../../ambient/ambient.d.ts","../../../delegate/delegate.d.ts","../../../owning/owning.d.ts","../../../type/writable/writable.d.ts","../../../func/name/name.d.ts","../../../key/key.d.ts","../../../object2/object2.d.ts","../../../after/tick/tick.d.ts","../../../promise/like/like.d.ts","../../fiber/fiber.d.ts","../../../compare/deep/deep.d.ts","../../../log3/log3.d.ts","../../../type/keys/extract/extract.d.ts","../../../log3/log3.web.d.ts","../../task/task.d.ts","../../../key/key/key.d.ts","../../../after/frame/frame.web.d.ts","../../method/method.d.ts","../../../type/tail/tail.d.ts","../../../type/foot/foot.d.ts","../../../fail/catch/catch.d.ts","../../../try/try.d.ts","../../../try/try.web.d.ts","../../../fail/log/log.d.ts","../../atom/atom.d.ts","../../probe/probe.d.ts","../../solid/solid.d.ts","../../watch/watch.d.ts","../../sync/sync.d.ts","../../async/async.d.ts","../../race/race.d.ts","../../solo/solo.d.ts","../../plex/plex.d.ts","../../../const/const.d.ts","../../field/field.d.ts","../../../object/object.d.ts","../../../mem/mem.d.ts","../../../after/timeout/timeout.d.ts","../../../state/time/time.d.ts","../../easing/easing.d.ts","../../patch/patch.d.ts","../../../type/result/result.d.ts","../../let/let.d.ts","../../set/set.d.ts","../../proxy/proxy.d.ts","../../dict/dict.d.ts","../../../promise/promise/promise.d.ts","../../../wait/timeout/timeout.d.ts","../../log/log.d.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACfA;AACA;AACA;AACA;
|
|
1
|
+
{"version":3,"sources":["../../../../mam.d.ts","../../../guid/guid.d.ts","../../../fail/fail.d.ts","../../cursor/cursor.d.ts","../../pub/pub.d.ts","../../sub/sub.d.ts","../../wire.d.ts","../../../fail/hidden/hidden.d.ts","../../../dev/format/format.d.ts","../../pub/sub/sub.d.ts","../../../ambient/ambient.d.ts","../../../delegate/delegate.d.ts","../../../owning/owning.d.ts","../../../type/writable/writable.d.ts","../../../func/name/name.d.ts","../../../key/key.d.ts","../../../object2/object2.d.ts","../../../after/tick/tick.d.ts","../../../promise/like/like.d.ts","../../fiber/fiber.d.ts","../../../compare/deep/deep.d.ts","../../../log3/log3.d.ts","../../../type/keys/extract/extract.d.ts","../../../log3/log3.web.d.ts","../../task/task.d.ts","../../../key/key/key.d.ts","../../../after/frame/frame.web.d.ts","../../method/method.d.ts","../../../type/tail/tail.d.ts","../../../type/foot/foot.d.ts","../../../fail/catch/catch.d.ts","../../../try/try.d.ts","../../../try/try.web.d.ts","../../../fail/log/log.d.ts","../../atom/atom.d.ts","../../probe/probe.d.ts","../../solid/solid.d.ts","../../watch/watch.d.ts","../../sync/sync.d.ts","../../async/async.d.ts","../../race/race.d.ts","../../solo/solo.d.ts","../../plex/plex.d.ts","../../../const/const.d.ts","../../field/field.d.ts","../../../object/object.d.ts","../../../mem/mem.d.ts","../../../after/timeout/timeout.d.ts","../../../state/time/time.d.ts","../../easing/easing.d.ts","../../patch/patch.d.ts","../../../type/result/result.d.ts","../../let/let.d.ts","../../set/set.d.ts","../../proxy/proxy.d.ts","../../dict/dict.d.ts","../../../promise/promise/promise.d.ts","../../../wait/timeout/timeout.d.ts","../../log/log.d.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACfA;AACA;AACA;AACA;AACA;ACJA;AACA;AACA;AACA;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC5DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACXA;AACA;AACA;AACA;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACbA;AACA;AACA;AACA;AACA;AACA;ACLA;AACA;AACA;AACA;AACA;ACJA;AACA;AACA;AACA;AACA;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACTA;AACA;AACA;AACA;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACnDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AChCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACZA;AACA;AACA;AACA;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACVA;AACA;AACA;AACA;AACA;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACRA;AACA;AACA;AACA;ACHA;AACA;AACA;AACA;ACHA;AACA;AACA;AACA;ACHA;AACA;AACA;AACA;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACrBA;AACA;AACA;AACA;AACA;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACXA;AACA;AACA;AACA;AACA;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACPA;AACA;AACA;AACA;AACA;ACJA;AACA;AACA;AACA;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACZA;AACA;AACA;AACA;AACA;AACA;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACjBA;AACA;AACA;AACA;AACA;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACPA;AACA;AACA;AACA;AACA;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null]}
|