mol_wire_lib 1.0.1740 → 1.0.1742

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 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,48 @@ 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
+ /** Position in any resource. */
266
387
  class $mol_span extends $mol_object2 {
267
388
  readonly uri: string;
268
389
  readonly source: string;
@@ -270,9 +391,13 @@ declare namespace $ {
270
391
  readonly col: number;
271
392
  readonly length: number;
272
393
  constructor(uri: string, source: string, row: number, col: number, length: number);
394
+ /** Span for begin of unknown resource */
273
395
  static unknown: $mol_span;
396
+ /** Makes new span for begin of resource. */
274
397
  static begin(uri: string, source?: string): $mol_span;
398
+ /** Makes new span for end of resource. */
275
399
  static end(uri: string, source: string): $mol_span;
400
+ /** Makes new span for entire resource. */
276
401
  static entire(uri: string, source: string): $mol_span;
277
402
  toString(): string;
278
403
  toJSON(): {
@@ -281,14 +406,19 @@ declare namespace $ {
281
406
  col: number;
282
407
  length: number;
283
408
  };
409
+ /** Makes new error for this span. */
284
410
  error(message: string, Class?: ErrorConstructor): Error;
411
+ /** Makes new span for same uri. */
285
412
  span(row: number, col: number, length: number): $mol_span;
413
+ /** Makes new span after end of this. */
286
414
  after(length?: number): $mol_span;
415
+ /** Makes new span between begin and end. */
287
416
  slice(begin: number, end?: number): $mol_span;
288
417
  }
289
418
  }
290
419
 
291
420
  declare namespace $ {
421
+ /** Serializes tree to string in tree format. */
292
422
  function $mol_tree2_to_string(this: $, tree: $mol_tree2): string;
293
423
  }
294
424
 
@@ -297,37 +427,74 @@ declare namespace $ {
297
427
  }
298
428
 
299
429
  declare namespace $ {
430
+ /** Path by types in tree. */
300
431
  type $mol_tree2_path = Array<string | number | null>;
432
+ /** Hask tool for processing node. */
301
433
  type $mol_tree2_hack<Context> = (input: $mol_tree2, belt: $mol_tree2_belt<Context>, context: Context) => readonly $mol_tree2[];
434
+ /** Collection of hask tools for processing tree. */
302
435
  type $mol_tree2_belt<Context> = Record<string, $mol_tree2_hack<Context>>;
436
+ /**
437
+ * Abstract Syntax Tree with human readable serialization.
438
+ * Avoid direct instantiation. Use static factories instead.
439
+ * @see https://github.com/nin-jin/tree.d
440
+ */
303
441
  class $mol_tree2 extends Object {
442
+ /** Type of structural node, `value` should be empty */
304
443
  readonly type: string;
444
+ /** Content of data node, `type` should be empty */
305
445
  readonly value: string;
446
+ /** Child nodes */
306
447
  readonly kids: readonly $mol_tree2[];
448
+ /** Position in most far source resource */
307
449
  readonly span: $mol_span;
308
- constructor(type: string, value: string, kids: readonly $mol_tree2[], span: $mol_span);
450
+ constructor(
451
+ /** Type of structural node, `value` should be empty */
452
+ type: string,
453
+ /** Content of data node, `type` should be empty */
454
+ value: string,
455
+ /** Child nodes */
456
+ kids: readonly $mol_tree2[],
457
+ /** Position in most far source resource */
458
+ span: $mol_span);
459
+ /** Makes collection node. */
309
460
  static list(kids: readonly $mol_tree2[], span?: $mol_span): $mol_tree2;
461
+ /** Makes new derived collection node. */
310
462
  list(kids: readonly $mol_tree2[]): $mol_tree2;
463
+ /** Makes data node for any string. */
311
464
  static data(value: string, kids?: readonly $mol_tree2[], span?: $mol_span): $mol_tree2;
465
+ /** Makes new derived data node. */
312
466
  data(value: string, kids?: readonly $mol_tree2[]): $mol_tree2;
467
+ /** Makes struct node. */
313
468
  static struct(type: string, kids?: readonly $mol_tree2[], span?: $mol_span): $mol_tree2;
469
+ /** Makes new derived structural node. */
314
470
  struct(type: string, kids?: readonly $mol_tree2[]): $mol_tree2;
471
+ /** Makes new derived node with different kids id defined. */
315
472
  clone(kids: readonly $mol_tree2[], span?: $mol_span): $mol_tree2;
473
+ /** Returns multiline text content. */
316
474
  text(): string;
475
+ /** Parses tree format. */
476
+ /** @deprecated Use $mol_tree2_from_string */
317
477
  static fromString(str: string, uri?: string): $mol_tree2;
478
+ /** Serializes to tree format. */
318
479
  toString(): string;
480
+ /** Makes new tree with node overrided by path. */
319
481
  insert(value: $mol_tree2 | null, ...path: $mol_tree2_path): $mol_tree2;
482
+ /** Makes new tree with node overrided by path. */
320
483
  update(value: readonly $mol_tree2[], ...path: $mol_tree2_path): readonly $mol_tree2[];
484
+ /** Query nodes by path. */
321
485
  select(...path: $mol_tree2_path): $mol_tree2;
486
+ /** Filter kids by path or value. */
322
487
  filter(path: string[], value?: string): $mol_tree2;
323
488
  hack_self<Context extends {
324
489
  span?: $mol_span;
325
490
  [key: string]: unknown;
326
491
  } = {}>(belt: $mol_tree2_belt<Context>, context?: Context): readonly $mol_tree2[];
492
+ /** Transform tree through context with transformers */
327
493
  hack<Context extends {
328
494
  span?: $mol_span;
329
495
  [key: string]: unknown;
330
496
  } = {}>(belt: $mol_tree2_belt<Context>, context?: Context): $mol_tree2[];
497
+ /** Makes Error with node coordinates. */
331
498
  error(message: string, Class?: ErrorConstructor): Error;
332
499
  }
333
500
  class $mol_tree2_empty extends $mol_tree2 {
@@ -336,6 +503,7 @@ declare namespace $ {
336
503
  }
337
504
 
338
505
  declare namespace $ {
506
+ /** Syntax error with cordinates and source line snippet. */
339
507
  class $mol_error_syntax extends SyntaxError {
340
508
  reason: string;
341
509
  line: string;
@@ -345,6 +513,7 @@ declare namespace $ {
345
513
  }
346
514
 
347
515
  declare namespace $ {
516
+ /** Parses tree format from string. */
348
517
  function $mol_tree2_from_string(this: $, str: string, uri?: string): $mol_tree2;
349
518
  }
350
519
 
@@ -357,6 +526,7 @@ declare namespace $ {
357
526
  }
358
527
 
359
528
  declare namespace $ {
529
+ /** Module for working with terminal. Text coloring when output in terminal */
360
530
  class $mol_term_color {
361
531
  static reset: (str: string) => string;
362
532
  static bold: (str: string) => string;
@@ -388,6 +558,7 @@ declare namespace $ {
388
558
  }
389
559
 
390
560
  declare namespace $ {
561
+ /** One-shot fiber */
391
562
  class $mol_wire_task<Host, Args extends readonly unknown[], Result> extends $mol_wire_fiber<Host, Args, Result> {
392
563
  static getter<Host, Args extends readonly unknown[], Result>(task: (this: Host, ...args: Args) => Result): (host: Host, args: Args) => $mol_wire_task<Host, Args, Result>;
393
564
  get temp(): boolean;
@@ -398,6 +569,7 @@ declare namespace $ {
398
569
  }
399
570
 
400
571
  declare namespace $ {
572
+ /** Returns string key for any value. */
401
573
  function $mol_key<Value>(value: Value): string;
402
574
  }
403
575
 
@@ -419,6 +591,9 @@ declare namespace $ {
419
591
  }
420
592
 
421
593
  declare namespace $ {
594
+ /**
595
+ * Decorates method to fiber to ensure it is executed only once inside other fiber.
596
+ */
422
597
  function $mol_wire_method<Host extends object, Args extends readonly any[]>(host: Host, field: PropertyKey, descr?: TypedPropertyDescriptor<(...args: Args) => any>): {
423
598
  value: (this: Host, ...args: Args) => any;
424
599
  enumerable?: boolean;
@@ -430,10 +605,20 @@ declare namespace $ {
430
605
  }
431
606
 
432
607
  declare namespace $ {
608
+ /**
609
+ * Returns `Tuple` without first element.
610
+ *
611
+ * $mol_type_tail<[ 1 , 2 , 3 ]> // [ 2, 3 ]
612
+ */
433
613
  type $mol_type_tail<Tuple extends readonly any[]> = ((...tail: Tuple) => any) extends ((head: any, ...tail: infer Tail) => any) ? Tail : never;
434
614
  }
435
615
 
436
616
  declare namespace $ {
617
+ /**
618
+ * Returns last element of `Tuple`.
619
+ *
620
+ * $mol_type_tail<[ 1 , 2 , 3 ]> // 3
621
+ */
437
622
  type $mol_type_foot<Tuple extends readonly any[]> = Tuple['length'] extends 0 ? never : Tuple[$mol_type_tail<Tuple>['length']];
438
623
  }
439
624
 
@@ -450,6 +635,7 @@ declare namespace $ {
450
635
  }
451
636
 
452
637
  declare namespace $ {
638
+ /** Long-living fiber. */
453
639
  class $mol_wire_atom<Host, Args extends readonly unknown[], Result> extends $mol_wire_fiber<Host, Args, Result> {
454
640
  static solo<Host, Args extends readonly unknown[], Result>(host: Host, task: (this: Host, ...args: Args) => Result): $mol_wire_atom<Host, Args, Result>;
455
641
  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>;
@@ -457,6 +643,9 @@ declare namespace $ {
457
643
  static watcher: $mol_after_frame | null;
458
644
  static watch(): void;
459
645
  watch(): void;
646
+ /**
647
+ * Update atom value through another temp fiber.
648
+ */
460
649
  resync(args: Args): Error | Result | Promise<Error | Result>;
461
650
  once(): Awaited<Result>;
462
651
  channel(): ((next?: $mol_type_foot<Args>) => Awaited<Result>) & {
@@ -468,18 +657,30 @@ declare namespace $ {
468
657
  }
469
658
 
470
659
  declare namespace $ {
660
+ /** Run code without state changes */
471
661
  function $mol_wire_probe<Value>(task: () => Value, def?: Value): Value | undefined;
472
662
  }
473
663
 
474
664
  declare namespace $ {
665
+ /**
666
+ * Disable reaping of current subscriber
667
+ */
475
668
  function $mol_wire_solid(): void;
476
669
  }
477
670
 
478
671
  declare namespace $ {
672
+ /**
673
+ * Real-time refresh current atom.
674
+ * Don't use if possible. May reduce performance.
675
+ */
479
676
  function $mol_wire_watch(): void;
480
677
  }
481
678
 
482
679
  declare namespace $ {
680
+ /**
681
+ * Convert asynchronous (promise-based) API to synchronous by wrapping function and method calls in a fiber.
682
+ * @see https://mol.hyoo.ru/#!section=docs/=1fcpsq_1wh0h2
683
+ */
483
684
  export function $mol_wire_sync<Host extends object>(obj: Host): ObjectOrFunctionResultAwaited<Host>;
484
685
  type FunctionResultAwaited<Some> = Some extends (...args: infer Args) => infer Res ? (...args: Args) => Awaited<Res> : Some;
485
686
  type ConstructorResultAwaited<Some> = Some extends new (...args: infer Args) => infer Res ? new (...args: Args) => Res : {};
@@ -491,6 +692,7 @@ declare namespace $ {
491
692
  }
492
693
 
493
694
  declare namespace $ {
695
+ /** Convert a pseudo-synchronous (Suspense API) API to an explicit asynchronous one (for integrating with external systems). */
494
696
  export function $mol_wire_async<Host extends object>(obj: Host): ObjectOrFunctionResultPromisify<Host>;
495
697
  type FunctionResultPromisify<Some> = Some extends (...args: infer Args) => infer Res ? Res extends PromiseLike<unknown> ? Some : (...args: Args) => Promise<Res> : Some;
496
698
  type MethodsResultPromisify<Host extends Object> = {
@@ -501,18 +703,21 @@ declare namespace $ {
501
703
  }
502
704
 
503
705
  declare namespace $ {
706
+ /** Starts subtasks concurrently instead of serial. */
504
707
  function $mol_wire_race<Tasks extends ((...args: any) => any)[]>(...tasks: Tasks): {
505
708
  [index in keyof Tasks]: ReturnType<Tasks[index]>;
506
709
  };
507
710
  }
508
711
 
509
712
  declare namespace $ {
713
+ /** Decorates solo object channel to [mol_wire_atom](../atom/atom.ts). */
510
714
  export function $mol_wire_solo<Args extends any[]>(host: object, field: string, descr?: TypedPropertyDescriptor<(...args: Args) => any>): TypedPropertyDescriptor<(...args: First_optional<Args>) => any>;
511
715
  type First_optional<Args extends any[]> = Args extends [] ? [] : [Args[0] | undefined, ...$mol_type_tail<Args>];
512
716
  export {};
513
717
  }
514
718
 
515
719
  declare namespace $ {
720
+ /** Reactive memoizing multiplexed property decorator. */
516
721
  function $mol_wire_plex<Args extends [any, ...any[]]>(host: object, field: string, descr?: TypedPropertyDescriptor<(...args: Args) => any>): {
517
722
  value: (this: typeof host, ...args: Args) => any;
518
723
  enumerable?: boolean;
@@ -524,6 +729,11 @@ declare namespace $ {
524
729
  }
525
730
 
526
731
  declare namespace $ {
732
+ /**
733
+ * Returns closure that returns constant value.
734
+ * @example
735
+ * const rnd = $mol_const( Math.random() )
736
+ */
527
737
  function $mol_const<Value>(value: Value): {
528
738
  (): Value;
529
739
  '()': Value;
@@ -531,6 +741,7 @@ declare namespace $ {
531
741
  }
532
742
 
533
743
  declare namespace $ {
744
+ /** Incompatible with instance fields with initializators */
534
745
  function $mol_wire_field<Host extends object, Field extends keyof Host, Value extends Host[Field]>(host: Host, field: Field, descr?: TypedPropertyDescriptor<Value>): any;
535
746
  }
536
747
 
@@ -543,11 +754,30 @@ declare namespace $ {
543
754
  }
544
755
 
545
756
  declare namespace $ {
757
+ /**
758
+ * Reactive memoizing solo property decorator from [mol_wire](../wire/README.md)
759
+ * @example
760
+ * '@' $mol_mem
761
+ * name(next?: string) {
762
+ * return next ?? 'default'
763
+ * }
764
+ * @see https://mol.hyoo.ru/#!section=docs/=qxmh6t_sinbmb
765
+ */
546
766
  let $mol_mem: typeof $mol_wire_solo;
767
+ /**
768
+ * Reactive memoizing multiplexed property decorator [mol_wire](../wire/README.md)
769
+ * @example
770
+ * '@' $mol_mem_key
771
+ * name(id: number, next?: string) {
772
+ * return next ?? 'default'
773
+ * }
774
+ * @see https://mol.hyoo.ru/#!section=docs/=qxmh6t_sinbmb
775
+ */
547
776
  let $mol_mem_key: typeof $mol_wire_plex;
548
777
  }
549
778
 
550
779
  declare namespace $ {
780
+ /** State of time moment */
551
781
  class $mol_state_time extends $mol_object {
552
782
  static task(precision: number, reset?: null): $mol_after_timeout | $mol_after_frame;
553
783
  static now(precision: number): number;
@@ -555,6 +785,7 @@ declare namespace $ {
555
785
  }
556
786
 
557
787
  declare namespace $ {
788
+ /** Transition atom value */
558
789
  function $mol_wire_easing(next: any): any;
559
790
  }
560
791
 
@@ -563,6 +794,15 @@ declare namespace $ {
563
794
  }
564
795
 
565
796
  declare namespace $ {
797
+ /**
798
+ * Returns type of function result or class instance.
799
+ *
800
+ * // 777
801
+ * $mol_type_result< ()=> 777 >
802
+ *
803
+ * // 777
804
+ * $mol_type_result< new()=> 777 >
805
+ */
566
806
  type $mol_type_result<Func> = Func extends (...params: any) => infer Result ? Result : Func extends new (...params: any) => infer Result ? Result : never;
567
807
  }
568
808
 
@@ -573,6 +813,7 @@ declare namespace $ {
573
813
  }
574
814
 
575
815
  declare namespace $ {
816
+ /** Reactive Set */
576
817
  class $mol_wire_set<Value> extends Set<Value> {
577
818
  pub: $mol_wire_pub;
578
819
  has(value: Value): boolean;
@@ -595,6 +836,7 @@ declare namespace $ {
595
836
  }
596
837
 
597
838
  declare namespace $ {
839
+ /** reactive Dictionary */
598
840
  class $mol_wire_dict<Key, Value> extends Map<Key, Value> {
599
841
  pub: $mol_wire_pub;
600
842
  has(key: Key): boolean;
@@ -626,6 +868,7 @@ declare namespace $ {
626
868
  }
627
869
 
628
870
  declare namespace $ {
871
+ /** Watch and logs reactive states. Logger automatically added to test bundle which is adding to `test.html`. */
629
872
  class $mol_wire_log extends $mol_object2 {
630
873
  static watch(task?: () => any): (() => any) | undefined;
631
874
  static track(fiber: $mol_wire_fiber<any, any, any>): any;
package/node.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","../../../span/span.d.ts","../../../tree2/to/string/string.d.ts","../../../maybe/maybe.d.ts","../../../tree2/tree2.d.ts","../../../error/syntax/syntax.d.ts","../../../tree2/from/string/string.d.ts","../../../array/chunks/chunks.d.ts","../../../tree2/from/json/json.d.ts","../../../term/color/color.d.ts","../../../log3/log3.node.d.ts","../../task/task.d.ts","../../../key/key/key.d.ts","../../../after/timeout/timeout.d.ts","../../../after/frame/frame.node.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","../../../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","../../../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;ACHA;AACA;AACA;AACA;ACHA;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;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACbA;AACA;AACA;AACA;AACA;AACA;ACLA;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;ACpBA;AACA;AACA;AACA;AACA;AACA;ACLA;AACA;AACA;AACA;ACHA;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;ACpCA;AACA;AACA;AACA;AACA;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACpBA;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;ACzBA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACRA;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;AACA;AACA;AACA;AACA;AACA;AC1BA;AACA;AACA;AACA;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACTA;AACA;AACA;AACA;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACVA;AACA;AACA;AACA;ACHA;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;ACjBA;AACA;AACA;AACA;ACHA;AACA;AACA;AACA;ACHA;AACA;AACA;AACA;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACTA;AACA;AACA;AACA;AACA;AACA;ACLA;AACA;AACA;AACA;AACA;AACA;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;ACNA;AACA;AACA;AACA;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACPA;AACA;AACA;AACA;AACA;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;ACNA;AACA;AACA;AACA;ACHA;AACA;AACA;AACA;ACHA;AACA;AACA;AACA;ACHA;AACA;AACA;AACA;AACA;AACA;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AChBA;AACA;AACA;AACA;AACA;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACPA;AACA;AACA;AACA;AACA;ACJA;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,null,null,null,null,null,null,null]}
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","../../../span/span.d.ts","../../../tree2/to/string/string.d.ts","../../../maybe/maybe.d.ts","../../../tree2/tree2.d.ts","../../../error/syntax/syntax.d.ts","../../../tree2/from/string/string.d.ts","../../../array/chunks/chunks.d.ts","../../../tree2/from/json/json.d.ts","../../../term/color/color.d.ts","../../../log3/log3.node.d.ts","../../task/task.d.ts","../../../key/key/key.d.ts","../../../after/timeout/timeout.d.ts","../../../after/frame/frame.node.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","../../../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","../../../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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AClCA;AACA;AACA;AACA;AACA;ACJA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC3EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACTA;AACA;AACA;AACA;AACA;ACJA;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;AACA;AACA;AACA;AACA;AACA;AACA;AC3BA;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;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;ACNA;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;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;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,null,null,null,null,null,null,null]}