mol_wire_dom 0.0.1722 → 0.0.1724
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 +195 -1
- package/node.d.ts.map +1 -1
- package/node.deps.json +1 -1
- package/node.js +198 -12
- package/node.js.map +1 -1
- package/node.mjs +198 -12
- package/node.test.js +345 -13
- package/node.test.js.map +1 -1
- package/package.json +1 -1
- package/web.d.ts +145 -0
- package/web.d.ts.map +1 -1
- package/web.deps.json +1 -1
- package/web.js +138 -8
- package/web.js.map +1 -1
- package/web.mjs +138 -8
- package/web.test.js +151 -1
- package/web.test.js.map +1 -1
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;
|
|
@@ -237,6 +341,7 @@ declare namespace $ {
|
|
|
237
341
|
}
|
|
238
342
|
|
|
239
343
|
declare namespace $ {
|
|
344
|
+
/** Returns string key for any value. */
|
|
240
345
|
function $mol_key<Value>(value: Value): string;
|
|
241
346
|
}
|
|
242
347
|
|
|
@@ -259,31 +364,48 @@ declare namespace $ {
|
|
|
259
364
|
|
|
260
365
|
declare namespace $ {
|
|
261
366
|
let $mol_compare_deep_cache: WeakMap<any, WeakMap<any, boolean>>;
|
|
367
|
+
/**
|
|
368
|
+
* Deeply compares two values. Returns true if equal.
|
|
369
|
+
* Define `Symbol.toPrimitive` to customize.
|
|
370
|
+
*/
|
|
262
371
|
function $mol_compare_deep<Value>(left: Value, right: Value): boolean;
|
|
263
372
|
}
|
|
264
373
|
|
|
265
374
|
declare namespace $ {
|
|
375
|
+
/** Logger event data */
|
|
266
376
|
type $mol_log3_event<Fields> = {
|
|
267
377
|
[key in string]: unknown;
|
|
268
378
|
} & {
|
|
379
|
+
/** Time of event creation */
|
|
269
380
|
time?: string;
|
|
381
|
+
/** Place of event creation */
|
|
270
382
|
place: unknown;
|
|
383
|
+
/** Short description of event */
|
|
271
384
|
message: string;
|
|
272
385
|
} & Fields;
|
|
386
|
+
/** Logger function */
|
|
273
387
|
type $mol_log3_logger<Fields, Res = void> = (this: $, event: $mol_log3_event<Fields>) => Res;
|
|
388
|
+
/** Log begin of some task */
|
|
274
389
|
let $mol_log3_come: $mol_log3_logger<{}>;
|
|
390
|
+
/** Log end of some task */
|
|
275
391
|
let $mol_log3_done: $mol_log3_logger<{}>;
|
|
392
|
+
/** Log error */
|
|
276
393
|
let $mol_log3_fail: $mol_log3_logger<{}>;
|
|
394
|
+
/** Log warning message */
|
|
277
395
|
let $mol_log3_warn: $mol_log3_logger<{
|
|
278
396
|
hint: string;
|
|
279
397
|
}>;
|
|
398
|
+
/** Log some generic event */
|
|
280
399
|
let $mol_log3_rise: $mol_log3_logger<{}>;
|
|
400
|
+
/** Log begin of log group, returns func to close group */
|
|
281
401
|
let $mol_log3_area: $mol_log3_logger<{}, () => void>;
|
|
402
|
+
/** Log begin of collapsed group only when some logged inside, returns func to close group */
|
|
282
403
|
function $mol_log3_area_lazy(this: $, event: $mol_log3_event<{}>): () => void;
|
|
283
404
|
let $mol_log3_stack: (() => void)[];
|
|
284
405
|
}
|
|
285
406
|
|
|
286
407
|
declare namespace $ {
|
|
408
|
+
/** Position in any resource. */
|
|
287
409
|
class $mol_span extends $mol_object2 {
|
|
288
410
|
readonly uri: string;
|
|
289
411
|
readonly source: string;
|
|
@@ -291,9 +413,13 @@ declare namespace $ {
|
|
|
291
413
|
readonly col: number;
|
|
292
414
|
readonly length: number;
|
|
293
415
|
constructor(uri: string, source: string, row: number, col: number, length: number);
|
|
416
|
+
/** Span for begin of unknown resource */
|
|
294
417
|
static unknown: $mol_span;
|
|
418
|
+
/** Makes new span for begin of resource. */
|
|
295
419
|
static begin(uri: string, source?: string): $mol_span;
|
|
420
|
+
/** Makes new span for end of resource. */
|
|
296
421
|
static end(uri: string, source: string): $mol_span;
|
|
422
|
+
/** Makes new span for entire resource. */
|
|
297
423
|
static entire(uri: string, source: string): $mol_span;
|
|
298
424
|
toString(): string;
|
|
299
425
|
toJSON(): {
|
|
@@ -302,14 +428,19 @@ declare namespace $ {
|
|
|
302
428
|
col: number;
|
|
303
429
|
length: number;
|
|
304
430
|
};
|
|
431
|
+
/** Makes new error for this span. */
|
|
305
432
|
error(message: string, Class?: ErrorConstructor): Error;
|
|
433
|
+
/** Makes new span for same uri. */
|
|
306
434
|
span(row: number, col: number, length: number): $mol_span;
|
|
435
|
+
/** Makes new span after end of this. */
|
|
307
436
|
after(length?: number): $mol_span;
|
|
437
|
+
/** Makes new span between begin and end. */
|
|
308
438
|
slice(begin: number, end?: number): $mol_span;
|
|
309
439
|
}
|
|
310
440
|
}
|
|
311
441
|
|
|
312
442
|
declare namespace $ {
|
|
443
|
+
/** Serializes tree to string in tree format. */
|
|
313
444
|
function $mol_tree2_to_string(this: $, tree: $mol_tree2): string;
|
|
314
445
|
}
|
|
315
446
|
|
|
@@ -318,37 +449,74 @@ declare namespace $ {
|
|
|
318
449
|
}
|
|
319
450
|
|
|
320
451
|
declare namespace $ {
|
|
452
|
+
/** Path by types in tree. */
|
|
321
453
|
type $mol_tree2_path = Array<string | number | null>;
|
|
454
|
+
/** Hask tool for processing node. */
|
|
322
455
|
type $mol_tree2_hack<Context> = (input: $mol_tree2, belt: $mol_tree2_belt<Context>, context: Context) => readonly $mol_tree2[];
|
|
456
|
+
/** Collection of hask tools for processing tree. */
|
|
323
457
|
type $mol_tree2_belt<Context> = Record<string, $mol_tree2_hack<Context>>;
|
|
458
|
+
/**
|
|
459
|
+
* Abstract Syntax Tree with human readable serialization.
|
|
460
|
+
* Avoid direct instantiation. Use static factories instead.
|
|
461
|
+
* @see https://github.com/nin-jin/tree.d
|
|
462
|
+
*/
|
|
324
463
|
class $mol_tree2 extends Object {
|
|
464
|
+
/** Type of structural node, `value` should be empty */
|
|
325
465
|
readonly type: string;
|
|
466
|
+
/** Content of data node, `type` should be empty */
|
|
326
467
|
readonly value: string;
|
|
468
|
+
/** Child nodes */
|
|
327
469
|
readonly kids: readonly $mol_tree2[];
|
|
470
|
+
/** Position in most far source resource */
|
|
328
471
|
readonly span: $mol_span;
|
|
329
|
-
constructor(
|
|
472
|
+
constructor(
|
|
473
|
+
/** Type of structural node, `value` should be empty */
|
|
474
|
+
type: string,
|
|
475
|
+
/** Content of data node, `type` should be empty */
|
|
476
|
+
value: string,
|
|
477
|
+
/** Child nodes */
|
|
478
|
+
kids: readonly $mol_tree2[],
|
|
479
|
+
/** Position in most far source resource */
|
|
480
|
+
span: $mol_span);
|
|
481
|
+
/** Makes collection node. */
|
|
330
482
|
static list(kids: readonly $mol_tree2[], span?: $mol_span): $mol_tree2;
|
|
483
|
+
/** Makes new derived collection node. */
|
|
331
484
|
list(kids: readonly $mol_tree2[]): $mol_tree2;
|
|
485
|
+
/** Makes data node for any string. */
|
|
332
486
|
static data(value: string, kids?: readonly $mol_tree2[], span?: $mol_span): $mol_tree2;
|
|
487
|
+
/** Makes new derived data node. */
|
|
333
488
|
data(value: string, kids?: readonly $mol_tree2[]): $mol_tree2;
|
|
489
|
+
/** Makes struct node. */
|
|
334
490
|
static struct(type: string, kids?: readonly $mol_tree2[], span?: $mol_span): $mol_tree2;
|
|
491
|
+
/** Makes new derived structural node. */
|
|
335
492
|
struct(type: string, kids?: readonly $mol_tree2[]): $mol_tree2;
|
|
493
|
+
/** Makes new derived node with different kids id defined. */
|
|
336
494
|
clone(kids: readonly $mol_tree2[], span?: $mol_span): $mol_tree2;
|
|
495
|
+
/** Returns multiline text content. */
|
|
337
496
|
text(): string;
|
|
497
|
+
/** Parses tree format. */
|
|
498
|
+
/** @deprecated Use $mol_tree2_from_string */
|
|
338
499
|
static fromString(str: string, uri?: string): $mol_tree2;
|
|
500
|
+
/** Serializes to tree format. */
|
|
339
501
|
toString(): string;
|
|
502
|
+
/** Makes new tree with node overrided by path. */
|
|
340
503
|
insert(value: $mol_tree2 | null, ...path: $mol_tree2_path): $mol_tree2;
|
|
504
|
+
/** Makes new tree with node overrided by path. */
|
|
341
505
|
update(value: readonly $mol_tree2[], ...path: $mol_tree2_path): readonly $mol_tree2[];
|
|
506
|
+
/** Query nodes by path. */
|
|
342
507
|
select(...path: $mol_tree2_path): $mol_tree2;
|
|
508
|
+
/** Filter kids by path or value. */
|
|
343
509
|
filter(path: string[], value?: string): $mol_tree2;
|
|
344
510
|
hack_self<Context extends {
|
|
345
511
|
span?: $mol_span;
|
|
346
512
|
[key: string]: unknown;
|
|
347
513
|
} = {}>(belt: $mol_tree2_belt<Context>, context?: Context): readonly $mol_tree2[];
|
|
514
|
+
/** Transform tree through context with transformers */
|
|
348
515
|
hack<Context extends {
|
|
349
516
|
span?: $mol_span;
|
|
350
517
|
[key: string]: unknown;
|
|
351
518
|
} = {}>(belt: $mol_tree2_belt<Context>, context?: Context): $mol_tree2[];
|
|
519
|
+
/** Makes Error with node coordinates. */
|
|
352
520
|
error(message: string, Class?: ErrorConstructor): Error;
|
|
353
521
|
}
|
|
354
522
|
class $mol_tree2_empty extends $mol_tree2 {
|
|
@@ -357,6 +525,7 @@ declare namespace $ {
|
|
|
357
525
|
}
|
|
358
526
|
|
|
359
527
|
declare namespace $ {
|
|
528
|
+
/** Syntax error with cordinates and source line snippet. */
|
|
360
529
|
class $mol_error_syntax extends SyntaxError {
|
|
361
530
|
reason: string;
|
|
362
531
|
line: string;
|
|
@@ -366,6 +535,7 @@ declare namespace $ {
|
|
|
366
535
|
}
|
|
367
536
|
|
|
368
537
|
declare namespace $ {
|
|
538
|
+
/** Parses tree format from string. */
|
|
369
539
|
function $mol_tree2_from_string(this: $, str: string, uri?: string): $mol_tree2;
|
|
370
540
|
}
|
|
371
541
|
|
|
@@ -378,6 +548,7 @@ declare namespace $ {
|
|
|
378
548
|
}
|
|
379
549
|
|
|
380
550
|
declare namespace $ {
|
|
551
|
+
/** Module for working with terminal. Text coloring when output in terminal */
|
|
381
552
|
class $mol_term_color {
|
|
382
553
|
static reset: (str: string) => string;
|
|
383
554
|
static bold: (str: string) => string;
|
|
@@ -409,6 +580,7 @@ declare namespace $ {
|
|
|
409
580
|
}
|
|
410
581
|
|
|
411
582
|
declare namespace $ {
|
|
583
|
+
/** One-shot fiber */
|
|
412
584
|
class $mol_wire_task<Host, Args extends readonly unknown[], Result> extends $mol_wire_fiber<Host, Args, Result> {
|
|
413
585
|
static getter<Host, Args extends readonly unknown[], Result>(task: (this: Host, ...args: Args) => Result): (host: Host, args: Args) => $mol_wire_task<Host, Args, Result>;
|
|
414
586
|
get temp(): boolean;
|
|
@@ -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>) & {
|
|
@@ -511,6 +700,10 @@ declare namespace $ {
|
|
|
511
700
|
}
|
|
512
701
|
|
|
513
702
|
declare namespace $ {
|
|
703
|
+
/**
|
|
704
|
+
* Convert asynchronous (promise-based) API to synchronous by wrapping function and method calls in a fiber.
|
|
705
|
+
* @see https://mol.hyoo.ru/#!section=docs/=1fcpsq_1wh0h2
|
|
706
|
+
*/
|
|
514
707
|
export function $mol_wire_sync<Host extends object>(obj: Host): ObjectOrFunctionResultAwaited<Host>;
|
|
515
708
|
type FunctionResultAwaited<Some> = Some extends (...args: infer Args) => infer Res ? (...args: Args) => Awaited<Res> : Some;
|
|
516
709
|
type ConstructorResultAwaited<Some> = Some extends new (...args: infer Args) => infer Res ? new (...args: Args) => Res : {};
|
|
@@ -578,6 +771,7 @@ declare namespace $ {
|
|
|
578
771
|
function lookup_descr<Obj extends {
|
|
579
772
|
[field in Field]: any;
|
|
580
773
|
}, Field extends PropertyKey>(obj: Obj, field: Field): PropertyDescriptor | null;
|
|
774
|
+
/** Polyfill makes DOM reactive. */
|
|
581
775
|
function $mol_wire_dom<El extends Element>(el: El): El;
|
|
582
776
|
}
|
|
583
777
|
|
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","../../../key/key/key.d.ts","../../../after/timeout/timeout.d.ts","../../../after/frame/frame.node.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","../../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","../../../dom/context/context.d.ts","../../../../node/internal/check/check.node.d.ts","../../../../node/autoinstall/autoinstall.node.d.ts","../../../../node/node.node.d.ts","../../../error/mix/mix.d.ts","../../../object/object.d.ts","../../../env/env.d.ts","../../../env/env.node.d.ts","../../sync/sync.d.ts","../../../run/run.node.d.ts","../../../dom/context/context.node.d.ts","../../../dom/dom.d.ts","../../../dom/render/children/children.d.ts","../../patch/patch.d.ts","../dom.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","../../../key/key/key.d.ts","../../../after/timeout/timeout.d.ts","../../../after/frame/frame.node.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","../../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","../../../dom/context/context.d.ts","../../../../node/internal/check/check.node.d.ts","../../../../node/autoinstall/autoinstall.node.d.ts","../../../../node/node.node.d.ts","../../../error/mix/mix.d.ts","../../../object/object.d.ts","../../../env/env.d.ts","../../../env/env.node.d.ts","../../sync/sync.d.ts","../../../run/run.node.d.ts","../../../dom/context/context.node.d.ts","../../../dom/dom.d.ts","../../../dom/render/children/children.d.ts","../../patch/patch.d.ts","../dom.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;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;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;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;ACHA;AACA;AACA;AACA;ACHA;AACA;AACA;AACA;ACHA;AACA;AACA;AACA;AACA;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACPA;AACA;AACA;AACA;ACHA;AACA;AACA;ACFA;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;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;ACFA;AACA;AACA;AACA;ACHA;AACA;AACA;AACA;ACHA;AACA;AACA;AACA;ACHA;AACA;AACA;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]}
|