hyoo_sync_client 0.0.18 → 0.0.20

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
@@ -69,628 +69,628 @@ declare namespace $ {
69
69
  }
70
70
  }
71
71
 
72
- declare namespace $ {
73
- enum $mol_wire_cursor {
74
- stale = -1,
75
- doubt = -2,
76
- fresh = -3,
77
- final = -4
78
- }
72
+ interface $node {
73
+ [key: string]: any;
79
74
  }
75
+ declare var $node: $node;
80
76
 
81
77
  declare namespace $ {
82
- class $mol_wire_pub extends Object {
83
- data: unknown[];
84
- static get [Symbol.species](): ArrayConstructor;
85
- protected sub_from: number;
86
- get sub_list(): readonly $mol_wire_sub[];
87
- get sub_empty(): boolean;
88
- sub_on(sub: $mol_wire_pub, pub_pos: number): number;
89
- sub_off(sub_pos: number): void;
90
- reap(): void;
91
- promote(): void;
92
- fresh(): void;
93
- complete(): void;
94
- emit(quant?: $mol_wire_cursor): void;
95
- peer_move(from_pos: number, to_pos: number): void;
96
- peer_repos(peer_pos: number, self_pos: number): void;
97
- }
78
+ type $mol_log3_event<Fields> = {
79
+ [key in string]: unknown;
80
+ } & {
81
+ time?: string;
82
+ place: unknown;
83
+ message: string;
84
+ } & Fields;
85
+ type $mol_log3_logger<Fields, Res = void> = (this: $, event: $mol_log3_event<Fields>) => Res;
86
+ let $mol_log3_come: $mol_log3_logger<{}>;
87
+ let $mol_log3_done: $mol_log3_logger<{}>;
88
+ let $mol_log3_fail: $mol_log3_logger<{}>;
89
+ let $mol_log3_warn: $mol_log3_logger<{
90
+ hint: string;
91
+ }>;
92
+ let $mol_log3_rise: $mol_log3_logger<{}>;
93
+ let $mol_log3_area: $mol_log3_logger<{}, () => void>;
94
+ function $mol_log3_area_lazy(this: $, event: $mol_log3_event<{}>): () => void;
95
+ let $mol_log3_stack: (() => void)[];
98
96
  }
99
97
 
100
98
  declare namespace $ {
101
- interface $mol_wire_sub extends $mol_wire_pub {
102
- temp: boolean;
103
- track_on(): $mol_wire_sub | null;
104
- track_next(pub?: $mol_wire_pub): $mol_wire_pub | null;
105
- pub_off(pub_pos: number): void;
106
- track_cut(sub: $mol_wire_pub | null): void;
107
- track_off(sub: $mol_wire_pub | null): void;
108
- absorb(quant: $mol_wire_cursor): void;
109
- destructor(): void;
99
+ class $mol_span extends $mol_object2 {
100
+ readonly uri: string;
101
+ readonly source: string;
102
+ readonly row: number;
103
+ readonly col: number;
104
+ readonly length: number;
105
+ constructor(uri: string, source: string, row: number, col: number, length: number);
106
+ static unknown: $mol_span;
107
+ static begin(uri: string, source?: string): $mol_span;
108
+ static end(uri: string, source: string): $mol_span;
109
+ static entire(uri: string, source: string): $mol_span;
110
+ toString(): string;
111
+ toJSON(): {
112
+ uri: string;
113
+ row: number;
114
+ col: number;
115
+ length: number;
116
+ };
117
+ error(message: string, Class?: ErrorConstructor): Error;
118
+ span(row: number, col: number, length: number): $mol_span;
119
+ after(length?: number): $mol_span;
120
+ slice(begin: number, end?: number): $mol_span;
110
121
  }
111
122
  }
112
123
 
113
124
  declare namespace $ {
114
- let $mol_wire_auto_sub: $mol_wire_sub | null;
115
- function $mol_wire_auto(next?: $mol_wire_sub | null): $mol_wire_sub | null;
116
- const $mol_wire_affected: (number | $mol_wire_sub)[];
117
- }
118
-
119
- declare namespace $ {
120
- function $mol_dev_format_register(config: {
121
- header: (val: any, config: any) => any;
122
- hasBody: (val: any, config: any) => false;
123
- } | {
124
- header: (val: any, config: any) => any;
125
- hasBody: (val: any, config: any) => boolean;
126
- body: (val: any, config: any) => any;
127
- }): void;
128
- let $mol_dev_format_head: symbol;
129
- let $mol_dev_format_body: symbol;
130
- function $mol_dev_format_native(obj: any): any;
131
- function $mol_dev_format_auto(obj: any): any;
132
- function $mol_dev_format_element(element: string, style: object, ...content: any[]): any[];
133
- function $mol_dev_format_span(style: object, ...content: any[]): any[];
134
- let $mol_dev_format_div: (style: object, ...content: any[]) => any[];
135
- let $mol_dev_format_ol: (style: object, ...content: any[]) => any[];
136
- let $mol_dev_format_li: (style: object, ...content: any[]) => any[];
137
- let $mol_dev_format_table: (style: object, ...content: any[]) => any[];
138
- let $mol_dev_format_tr: (style: object, ...content: any[]) => any[];
139
- let $mol_dev_format_td: (style: object, ...content: any[]) => any[];
140
- let $mol_dev_format_accent: (...args: any[]) => any[];
141
- let $mol_dev_format_strong: (...args: any[]) => any[];
142
- let $mol_dev_format_string: (...args: any[]) => any[];
143
- let $mol_dev_format_shade: (...args: any[]) => any[];
144
- let $mol_dev_format_indent: (...args: any[]) => any[];
125
+ function $mol_tree2_to_string(this: $, tree: $mol_tree2): string;
145
126
  }
146
127
 
147
128
  declare namespace $ {
148
- class $mol_wire_pub_sub extends $mol_wire_pub implements $mol_wire_sub {
149
- protected pub_from: number;
150
- protected cursor: $mol_wire_cursor;
151
- get temp(): boolean;
152
- get pub_list(): $mol_wire_pub[];
153
- track_on(): $mol_wire_sub | null;
154
- promote(): void;
155
- track_next(pub?: $mol_wire_pub): $mol_wire_pub | null;
156
- track_off(sub: $mol_wire_sub | null): void;
157
- pub_off(sub_pos: number): void;
158
- destructor(): void;
159
- track_cut(): void;
160
- complete(): void;
161
- complete_pubs(): void;
162
- absorb(quant?: $mol_wire_cursor): void;
163
- get pub_empty(): boolean;
129
+ type $mol_tree2_path = Array<string | number | null>;
130
+ type $mol_tree2_hack<Context> = (input: $mol_tree2, belt: $mol_tree2_belt<Context>, context: Context) => readonly $mol_tree2[];
131
+ type $mol_tree2_belt<Context> = Record<string, $mol_tree2_hack<Context>>;
132
+ class $mol_tree2 extends Object {
133
+ readonly type: string;
134
+ readonly value: string;
135
+ readonly kids: readonly $mol_tree2[];
136
+ readonly span: $mol_span;
137
+ constructor(type: string, value: string, kids: readonly $mol_tree2[], span: $mol_span);
138
+ static list(kids: readonly $mol_tree2[], span?: $mol_span): $mol_tree2;
139
+ list(kids: readonly $mol_tree2[]): $mol_tree2;
140
+ static data(value: string, kids?: readonly $mol_tree2[], span?: $mol_span): $mol_tree2;
141
+ data(value: string, kids?: readonly $mol_tree2[]): $mol_tree2;
142
+ static struct(type: string, kids?: readonly $mol_tree2[], span?: $mol_span): $mol_tree2;
143
+ struct(type: string, kids?: readonly $mol_tree2[]): $mol_tree2;
144
+ clone(kids: readonly $mol_tree2[], span?: $mol_span): $mol_tree2;
145
+ text(): string;
146
+ static fromString(str: string, uri?: string): $mol_tree2;
147
+ toString(): string;
148
+ insert(value: $mol_tree2 | null, ...path: $mol_tree2_path): $mol_tree2;
149
+ select(...path: $mol_tree2_path): $mol_tree2;
150
+ filter(path: string[], value?: string): $mol_tree2;
151
+ hack<Context extends {
152
+ span?: $mol_span;
153
+ [key: string]: unknown;
154
+ } = {}>(belt: $mol_tree2_belt<Context>, context?: Context): $mol_tree2[];
155
+ error(message: string, Class?: ErrorConstructor): Error;
156
+ }
157
+ class $mol_tree2_empty extends $mol_tree2 {
158
+ constructor();
164
159
  }
165
160
  }
166
161
 
167
162
  declare namespace $ {
168
- class $mol_after_timeout extends $mol_object2 {
169
- delay: number;
170
- task: () => void;
171
- id: any;
172
- constructor(delay: number, task: () => void);
173
- destructor(): void;
163
+ class $mol_error_syntax extends SyntaxError {
164
+ reason: string;
165
+ line: string;
166
+ span: $mol_span;
167
+ constructor(reason: string, line: string, span: $mol_span);
174
168
  }
175
169
  }
176
170
 
177
171
  declare namespace $ {
178
- class $mol_after_frame extends $mol_after_timeout {
179
- task: () => void;
180
- constructor(task: () => void);
181
- }
172
+ function $mol_tree2_from_string(this: $, str: string, uri?: string): $mol_tree2;
182
173
  }
183
174
 
184
175
  declare namespace $ {
185
- function $mol_promise_like(val: any): val is Promise<any>;
176
+ function $mol_tree2_from_json(json: any, span?: $mol_span): $mol_tree2;
186
177
  }
187
178
 
188
179
  declare namespace $ {
189
- abstract class $mol_wire_fiber<Host, Args extends readonly unknown[], Result> extends $mol_wire_pub_sub {
190
- readonly task: (this: Host, ...args: Args) => Result;
191
- readonly host?: Host | undefined;
192
- static warm: boolean;
193
- static planning: Set<$mol_wire_fiber<any, any, any>>;
194
- static reaping: Set<$mol_wire_fiber<any, any, any>>;
195
- static plan_task: $mol_after_frame | null;
196
- static plan(): void;
197
- static sync(): void;
198
- [Symbol.toStringTag]: string;
199
- cache: Result | Error | Promise<Result | Error>;
200
- get args(): Args;
201
- result(): Result | undefined;
202
- field(): string;
203
- constructor(id: string, task: (this: Host, ...args: Args) => Result, host?: Host | undefined, args?: Args);
204
- plan(): void;
205
- reap(): void;
206
- toString(): string;
207
- toJSON(): string;
208
- get $(): any;
209
- emit(quant?: $mol_wire_cursor): void;
210
- fresh(): void;
211
- refresh(): void;
212
- abstract put(next: Result | Error | Promise<Result | Error>): Result | Error | Promise<Result | Error>;
213
- sync(): Awaited<Result>;
214
- async(): Promise<Result>;
180
+ class $mol_term_color {
181
+ static reset: (str: string) => string;
182
+ static bold: (str: string) => string;
183
+ static italic: (str: string) => string;
184
+ static underline: (str: string) => string;
185
+ static inverse: (str: string) => string;
186
+ static hidden: (str: string) => string;
187
+ static strike: (str: string) => string;
188
+ static gray: (str: string) => string;
189
+ static red: (str: string) => string;
190
+ static green: (str: string) => string;
191
+ static yellow: (str: string) => string;
192
+ static blue: (str: string) => string;
193
+ static magenta: (str: string) => string;
194
+ static cyan: (str: string) => string;
195
+ static Gray: (str: string) => string;
196
+ static Red: (str: string) => string;
197
+ static Green: (str: string) => string;
198
+ static Yellow: (str: string) => string;
199
+ static Blue: (str: string) => string;
200
+ static Magenta: (str: string) => string;
201
+ static Cyan: (str: string) => string;
202
+ static ansi(open: number, close: number): (str: string) => string;
215
203
  }
216
204
  }
217
205
 
218
206
  declare namespace $ {
219
- function $mol_func_name(this: $, func: Function): string;
220
- function $mol_func_name_from<Target extends Function>(target: Target, source: Function): Target;
207
+ function $mol_log3_node_make(level: keyof Console, output: 'stdout' | 'stderr', type: string, color: (str: string) => string): (this: $, event: $mol_log3_event<{}>) => () => void;
221
208
  }
222
209
 
223
210
  declare namespace $ {
224
- function $mol_guid(length?: number, exists?: (id: string) => boolean): string;
211
+ function $mol_env(): Record<string, string | undefined>;
225
212
  }
226
213
 
227
214
  declare namespace $ {
228
- const $mol_key_store: WeakMap<object, string>;
229
- function $mol_key<Value>(value: Value): string;
230
215
  }
231
216
 
217
+ /// <reference types="node" />
218
+ /// <reference types="node" />
232
219
  declare namespace $ {
233
- let $mol_compare_deep_cache: WeakMap<any, WeakMap<any, boolean>>;
234
- function $mol_compare_deep<Value>(left: Value, right: Value): boolean;
220
+ function $mol_exec(this: $, dir: string, command: string, ...args: string[]): import("child_process").SpawnSyncReturns<Buffer>;
235
221
  }
236
222
 
237
223
  declare namespace $ {
238
- class $mol_wire_task<Host, Args extends readonly unknown[], Result> extends $mol_wire_fiber<Host, Args, Result> {
239
- static getter<Host, Args extends readonly unknown[], Result>(task: (this: Host, ...args: Args) => Result): (host: Host, args: Args) => $mol_wire_task<Host, Args, Result>;
240
- get temp(): boolean;
241
- complete(): void;
242
- put(next: Result | Error | Promise<Result | Error>): Error | Result | Promise<Error | Result>;
243
- }
224
+ function $mol_charset_encode(value: string): Uint8Array;
244
225
  }
245
226
 
246
227
  declare namespace $ {
247
- function $mol_wire_method<Host extends object, Args extends readonly any[]>(host: Host, field: PropertyKey, descr?: TypedPropertyDescriptor<(...args: Args) => any>): {
248
- value: (this: Host, ...args: Args) => any;
249
- enumerable?: boolean | undefined;
250
- configurable?: boolean | undefined;
251
- writable?: boolean | undefined;
252
- get?: (() => (...args: Args) => any) | undefined;
253
- set?: ((value: (...args: Args) => any) => void) | undefined;
228
+ type $mol_int62_string = `${string}_${string}`;
229
+ function $mol_int62_string_ensure(str: unknown): `${string}_${string}` | null;
230
+ type $mol_int62_pair = {
231
+ readonly lo: number;
232
+ readonly hi: number;
254
233
  };
255
- }
256
-
257
- declare namespace $ {
258
- type $mol_type_tail<Tuple extends readonly any[]> = ((...tail: Tuple) => any) extends ((head: any, ...tail: infer Tail) => any) ? Tail : never;
259
- }
234
+ const $mol_int62_max: number;
235
+ const $mol_int62_min: number;
236
+ const $mol_int62_range: number;
237
+ function $mol_int62_to_string({ lo, hi }: $mol_int62_pair): `${string}_${string}`;
238
+ function $mol_int62_from_string(str: string): null | $mol_int62_pair;
239
+ function $mol_int62_compare(left_lo: number, left_hi: number, right_lo: number, right_hi: number): number;
240
+ function $mol_int62_inc(lo: number, hi: number, max?: number): $mol_int62_pair;
241
+ function $mol_int62_random(): $mol_int62_pair;
242
+ function $mol_int62_hash_string(str: string): `${string}_${string}`;
243
+ function $mol_int62_hash_buffer(buf: Uint8Array, seed?: {
244
+ lo: number;
245
+ hi: number;
246
+ }): $mol_int62_pair;
247
+ }
260
248
 
261
249
  declare namespace $ {
262
- type $mol_type_foot<Tuple extends readonly any[]> = Tuple['length'] extends 0 ? never : Tuple[$mol_type_tail<Tuple>['length']];
250
+ type $mol_data_value<Input = any, Output = any> = (val: Input) => Output;
263
251
  }
264
252
 
265
253
  declare namespace $ {
266
- function $mol_fail_catch(error: unknown): boolean;
254
+ function $mol_data_setup<Value extends $mol_data_value, Config = never>(value: Value, config: Config): Value & {
255
+ config: Config;
256
+ Value: ReturnType<Value>;
257
+ };
267
258
  }
268
259
 
269
260
  declare namespace $ {
270
- function $mol_fail_log(error: unknown): boolean;
261
+ function $mol_diff_path<Item>(...paths: Item[][]): {
262
+ prefix: Item[];
263
+ suffix: Item[][];
264
+ };
271
265
  }
272
266
 
273
267
  declare namespace $ {
274
- class $mol_wire_atom<Host, Args extends readonly unknown[], Result> extends $mol_wire_fiber<Host, Args, Result> {
275
- static solo<Host, Args extends readonly unknown[], Result>(host: Host, task: (this: Host, ...args: Args) => Result): $mol_wire_atom<Host, Args, Result>;
276
- 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>;
277
- static watching: Set<$mol_wire_atom<any, any, any>>;
278
- static watcher: $mol_after_frame | null;
279
- static watch(): void;
280
- watch(): void;
281
- resync(args: Args): Error | Result | Promise<Error | Result>;
282
- once(): Awaited<Result>;
283
- channel(): ((next?: $mol_type_foot<Args>) => Awaited<Result>) & {
284
- atom: $mol_wire_atom<Host, Args, Result>;
285
- };
286
- destructor(): void;
287
- put(next: Result | Error | Promise<Result | Error>): Error | Result | Promise<Error | Result>;
268
+ class $mol_error_mix extends Error {
269
+ errors: Error[];
270
+ constructor(message: string, ...errors: Error[]);
271
+ toJSON(): string;
288
272
  }
289
273
  }
290
274
 
291
275
  declare namespace $ {
292
- export function $mol_wire_solo<Args extends any[]>(host: object, field: string, descr?: TypedPropertyDescriptor<(...args: Args) => any>): TypedPropertyDescriptor<(...args: First_optional<Args>) => any>;
293
- type First_optional<Args extends any[]> = Args extends [] ? [] : [Args[0] | undefined, ...$mol_type_tail<Args>];
294
- export {};
276
+ class $mol_data_error extends $mol_error_mix {
277
+ }
295
278
  }
296
279
 
297
280
  declare namespace $ {
298
- function $mol_wire_plex<Args extends [any, ...any[]]>(host: object, field: string, descr?: TypedPropertyDescriptor<(...args: Args) => any>): {
299
- value: (this: typeof host, ...args: Args) => any;
300
- enumerable?: boolean | undefined;
301
- configurable?: boolean | undefined;
302
- writable?: boolean | undefined;
303
- get?: (() => (...args: Args) => any) | undefined;
304
- set?: ((value: (...args: Args) => any) => void) | undefined;
281
+ function $mol_data_enum<Dict extends Record<number | string, number | string>>(name: string, dict: Dict): ((value: Dict[keyof Dict]) => Dict[keyof Dict]) & {
282
+ config: {
283
+ name: string;
284
+ dict: Dict;
285
+ };
286
+ Value: Dict[keyof Dict];
305
287
  };
306
288
  }
307
289
 
308
290
  declare namespace $ {
309
- let $mol_mem: typeof $mol_wire_solo;
310
- let $mol_mem_key: typeof $mol_wire_plex;
291
+ var $mol_crypto_native: Crypto;
311
292
  }
312
293
 
313
294
  declare namespace $ {
314
- function $mol_wire_sync<Host extends object>(obj: Host): (Host extends (...args: infer Args) => infer Res ? Res extends Promise<infer Res2> ? (...args: Args) => Res2 : Host : {}) & { [key in keyof Host]: Host[key] extends (...args: infer Args_1) => Promise<infer Res_1> ? (...args: Args_1) => Res_1 : Host[key]; };
295
+ function $mol_crypto_auditor_pair(this: $): Promise<{
296
+ public: $mol_crypto_auditor_public;
297
+ private: $mol_crypto_auditor_private;
298
+ }>;
299
+ class $mol_crypto_auditor_public extends Object {
300
+ readonly native: CryptoKey & {
301
+ type: 'public';
302
+ };
303
+ static size: number;
304
+ constructor(native: CryptoKey & {
305
+ type: 'public';
306
+ });
307
+ static from(serial: string): Promise<$mol_crypto_auditor_public>;
308
+ serial(): Promise<string>;
309
+ verify(data: BufferSource, sign: BufferSource): Promise<boolean>;
310
+ }
311
+ class $mol_crypto_auditor_private extends Object {
312
+ readonly native: CryptoKey & {
313
+ type: 'private';
314
+ };
315
+ static size: number;
316
+ constructor(native: CryptoKey & {
317
+ type: 'private';
318
+ });
319
+ static from(serial: string): Promise<$mol_crypto_auditor_private>;
320
+ serial(): Promise<string>;
321
+ sign(data: BufferSource): Promise<ArrayBuffer>;
322
+ public(): Promise<$mol_crypto_auditor_public>;
323
+ }
324
+ const $mol_crypto_auditor_sign_size = 64;
325
+ function $mol_crypto_auditor_private_to_public(serial: string): string;
315
326
  }
316
327
 
317
328
  declare namespace $ {
318
- namespace $$ { }
319
- const $mol_object_field: unique symbol;
320
- class $mol_object extends $mol_object2 {
321
- static make<Instance>(this: {
322
- new (): Instance;
323
- }, config: Partial<Instance>): Instance;
329
+ enum $hyoo_crowd_peer_level {
330
+ get = 0,
331
+ add = 1,
332
+ mod = 2,
333
+ law = 3
334
+ }
335
+ class $hyoo_crowd_peer extends Object {
336
+ readonly key_public: $mol_crypto_auditor_public;
337
+ readonly key_public_serial: string;
338
+ readonly key_private: $mol_crypto_auditor_private;
339
+ readonly key_private_serial: string;
340
+ id: $mol_int62_string;
341
+ constructor(key_public: $mol_crypto_auditor_public, key_public_serial: string, key_private: $mol_crypto_auditor_private, key_private_serial: string);
342
+ static generate(): Promise<$hyoo_crowd_peer>;
343
+ static restore(serial: string): Promise<$hyoo_crowd_peer>;
324
344
  }
325
345
  }
326
346
 
327
347
  declare namespace $ {
328
- var $mol_dom_context: typeof globalThis;
348
+ function $mol_dev_format_register(config: {
349
+ header: (val: any, config: any) => any;
350
+ hasBody: (val: any, config: any) => false;
351
+ } | {
352
+ header: (val: any, config: any) => any;
353
+ hasBody: (val: any, config: any) => boolean;
354
+ body: (val: any, config: any) => any;
355
+ }): void;
356
+ let $mol_dev_format_head: symbol;
357
+ let $mol_dev_format_body: symbol;
358
+ function $mol_dev_format_native(obj: any): any;
359
+ function $mol_dev_format_auto(obj: any): any;
360
+ function $mol_dev_format_element(element: string, style: object, ...content: any[]): any[];
361
+ function $mol_dev_format_span(style: object, ...content: any[]): any[];
362
+ let $mol_dev_format_div: (style: object, ...content: any[]) => any[];
363
+ let $mol_dev_format_ol: (style: object, ...content: any[]) => any[];
364
+ let $mol_dev_format_li: (style: object, ...content: any[]) => any[];
365
+ let $mol_dev_format_table: (style: object, ...content: any[]) => any[];
366
+ let $mol_dev_format_tr: (style: object, ...content: any[]) => any[];
367
+ let $mol_dev_format_td: (style: object, ...content: any[]) => any[];
368
+ let $mol_dev_format_accent: (...args: any[]) => any[];
369
+ let $mol_dev_format_strong: (...args: any[]) => any[];
370
+ let $mol_dev_format_string: (...args: any[]) => any[];
371
+ let $mol_dev_format_shade: (...args: any[]) => any[];
372
+ let $mol_dev_format_indent: (...args: any[]) => any[];
329
373
  }
330
374
 
331
- interface $node {
332
- [key: string]: any;
375
+ declare namespace $ {
376
+ type $mol_charset_encoding = 'utf8' | 'utf-16le' | 'utf-16be' | 'ibm866' | 'iso-8859-2' | 'iso-8859-3' | 'iso-8859-4' | 'iso-8859-5' | 'iso-8859-6' | 'iso-8859-7' | 'iso-8859-8' | 'iso-8859-8i' | 'iso-8859-10' | 'iso-8859-13' | 'iso-8859-14' | 'iso-8859-15' | 'iso-8859-16' | 'koi8-r' | 'koi8-u' | 'koi8-r' | 'macintosh' | 'windows-874' | 'windows-1250' | 'windows-1251' | 'windows-1252' | 'windows-1253' | 'windows-1254' | 'windows-1255' | 'windows-1256' | 'windows-1257' | 'windows-1258' | 'x-mac-cyrillic' | 'gbk' | 'gb18030' | 'hz-gb-2312' | 'big5' | 'euc-jp' | 'iso-2022-jp' | 'shift-jis' | 'euc-kr' | 'iso-2022-kr';
333
377
  }
334
- declare var $node: $node;
335
378
 
336
379
  declare namespace $ {
337
- type $mol_log3_event<Fields> = {
338
- [key in string]: unknown;
339
- } & {
340
- time?: string;
341
- place: unknown;
342
- message: string;
343
- } & Fields;
344
- type $mol_log3_logger<Fields, Res = void> = (this: $, event: $mol_log3_event<Fields>) => Res;
345
- let $mol_log3_come: $mol_log3_logger<{}>;
346
- let $mol_log3_done: $mol_log3_logger<{}>;
347
- let $mol_log3_fail: $mol_log3_logger<{}>;
348
- let $mol_log3_warn: $mol_log3_logger<{
349
- hint: string;
350
- }>;
351
- let $mol_log3_rise: $mol_log3_logger<{}>;
352
- let $mol_log3_area: $mol_log3_logger<{}, () => void>;
353
- function $mol_log3_area_lazy(this: $, event: $mol_log3_event<{}>): () => void;
354
- let $mol_log3_stack: (() => void)[];
380
+ function $mol_charset_decode(buffer: BufferSource, encoding?: $mol_charset_encoding): string;
355
381
  }
356
382
 
357
383
  declare namespace $ {
358
- class $mol_span extends $mol_object2 {
359
- readonly uri: string;
360
- readonly source: string;
361
- readonly row: number;
362
- readonly col: number;
363
- readonly length: number;
364
- constructor(uri: string, source: string, row: number, col: number, length: number);
365
- static unknown: $mol_span;
366
- static begin(uri: string, source?: string): $mol_span;
367
- static end(uri: string, source: string): $mol_span;
368
- static entire(uri: string, source: string): $mol_span;
369
- toString(): string;
370
- toJSON(): {
371
- uri: string;
372
- row: number;
373
- col: number;
374
- length: number;
375
- };
376
- error(message: string, Class?: ErrorConstructor): Error;
377
- span(row: number, col: number, length: number): $mol_span;
378
- after(length?: number): $mol_span;
379
- slice(begin: number, end?: number): $mol_span;
384
+ type $hyoo_crowd_unit_id = `${$mol_int62_string}!${$mol_int62_string}`;
385
+ enum $hyoo_crowd_unit_kind {
386
+ grab = 0,
387
+ join = 1,
388
+ give = 2,
389
+ data = 3
390
+ }
391
+ enum $hyoo_crowd_unit_group {
392
+ auth = 0,
393
+ data = 1
394
+ }
395
+ class $hyoo_crowd_unit extends Object {
396
+ readonly land: $mol_int62_string;
397
+ readonly auth: $mol_int62_string;
398
+ readonly head: $mol_int62_string;
399
+ readonly self: $mol_int62_string;
400
+ readonly next: $mol_int62_string;
401
+ readonly prev: $mol_int62_string;
402
+ readonly time: number;
403
+ readonly data: unknown;
404
+ bin: $hyoo_crowd_unit_bin | null;
405
+ constructor(land: $mol_int62_string, auth: $mol_int62_string, head: $mol_int62_string, self: $mol_int62_string, next: $mol_int62_string, prev: $mol_int62_string, time: number, data: unknown, bin: $hyoo_crowd_unit_bin | null);
406
+ kind(): $hyoo_crowd_unit_kind;
407
+ group(): $hyoo_crowd_unit_group;
408
+ level(): $hyoo_crowd_peer_level;
409
+ [Symbol.toPrimitive](): string;
380
410
  }
411
+ class $hyoo_crowd_unit_bin extends DataView {
412
+ static from_buffer(buffer: Int16Array): $hyoo_crowd_unit_bin;
413
+ static from_unit(unit: $hyoo_crowd_unit): $hyoo_crowd_unit_bin;
414
+ sign(next?: Uint8Array): Uint8Array;
415
+ size(): number;
416
+ sens(): Uint8Array;
417
+ unit(): $hyoo_crowd_unit;
418
+ }
419
+ function $hyoo_crowd_unit_compare(left: $hyoo_crowd_unit, right: $hyoo_crowd_unit): number;
381
420
  }
382
421
 
383
422
  declare namespace $ {
384
- function $mol_tree2_to_string(this: $, tree: $mol_tree2): string;
423
+ enum $mol_wire_cursor {
424
+ stale = -1,
425
+ doubt = -2,
426
+ fresh = -3,
427
+ final = -4
428
+ }
385
429
  }
386
430
 
387
431
  declare namespace $ {
388
- type $mol_tree2_path = Array<string | number | null>;
389
- type $mol_tree2_hack<Context> = (input: $mol_tree2, belt: $mol_tree2_belt<Context>, context: Context) => readonly $mol_tree2[];
390
- type $mol_tree2_belt<Context> = Record<string, $mol_tree2_hack<Context>>;
391
- class $mol_tree2 extends Object {
392
- readonly type: string;
393
- readonly value: string;
394
- readonly kids: readonly $mol_tree2[];
395
- readonly span: $mol_span;
396
- constructor(type: string, value: string, kids: readonly $mol_tree2[], span: $mol_span);
397
- static list(kids: readonly $mol_tree2[], span?: $mol_span): $mol_tree2;
398
- list(kids: readonly $mol_tree2[]): $mol_tree2;
399
- static data(value: string, kids?: readonly $mol_tree2[], span?: $mol_span): $mol_tree2;
400
- data(value: string, kids?: readonly $mol_tree2[]): $mol_tree2;
401
- static struct(type: string, kids?: readonly $mol_tree2[], span?: $mol_span): $mol_tree2;
402
- struct(type: string, kids?: readonly $mol_tree2[]): $mol_tree2;
403
- clone(kids: readonly $mol_tree2[], span?: $mol_span): $mol_tree2;
404
- text(): string;
405
- static fromString(str: string, uri?: string): $mol_tree2;
406
- toString(): string;
407
- insert(value: $mol_tree2 | null, ...path: $mol_tree2_path): $mol_tree2;
408
- select(...path: $mol_tree2_path): $mol_tree2;
409
- filter(path: string[], value?: string): $mol_tree2;
410
- hack<Context extends {
411
- span?: $mol_span;
412
- [key: string]: unknown;
413
- } = {}>(belt: $mol_tree2_belt<Context>, context?: Context): $mol_tree2[];
414
- error(message: string, Class?: ErrorConstructor): Error;
432
+ class $mol_wire_pub extends Object {
433
+ data: unknown[];
434
+ static get [Symbol.species](): ArrayConstructor;
435
+ protected sub_from: number;
436
+ get sub_list(): readonly $mol_wire_sub[];
437
+ get sub_empty(): boolean;
438
+ sub_on(sub: $mol_wire_pub, pub_pos: number): number;
439
+ sub_off(sub_pos: number): void;
440
+ reap(): void;
441
+ promote(): void;
442
+ fresh(): void;
443
+ complete(): void;
444
+ emit(quant?: $mol_wire_cursor): void;
445
+ peer_move(from_pos: number, to_pos: number): void;
446
+ peer_repos(peer_pos: number, self_pos: number): void;
415
447
  }
416
- class $mol_tree2_empty extends $mol_tree2 {
417
- constructor();
448
+ }
449
+
450
+ declare namespace $ {
451
+ interface $mol_wire_sub extends $mol_wire_pub {
452
+ temp: boolean;
453
+ track_on(): $mol_wire_sub | null;
454
+ track_next(pub?: $mol_wire_pub): $mol_wire_pub | null;
455
+ pub_off(pub_pos: number): void;
456
+ track_cut(sub: $mol_wire_pub | null): void;
457
+ track_off(sub: $mol_wire_pub | null): void;
458
+ absorb(quant: $mol_wire_cursor): void;
459
+ destructor(): void;
418
460
  }
419
461
  }
420
462
 
421
463
  declare namespace $ {
422
- class $mol_error_syntax extends SyntaxError {
423
- reason: string;
424
- line: string;
425
- span: $mol_span;
426
- constructor(reason: string, line: string, span: $mol_span);
464
+ let $mol_wire_auto_sub: $mol_wire_sub | null;
465
+ function $mol_wire_auto(next?: $mol_wire_sub | null): $mol_wire_sub | null;
466
+ const $mol_wire_affected: (number | $mol_wire_sub)[];
467
+ }
468
+
469
+ declare namespace $ {
470
+ class $mol_wire_pub_sub extends $mol_wire_pub implements $mol_wire_sub {
471
+ protected pub_from: number;
472
+ protected cursor: $mol_wire_cursor;
473
+ get temp(): boolean;
474
+ get pub_list(): $mol_wire_pub[];
475
+ track_on(): $mol_wire_sub | null;
476
+ promote(): void;
477
+ track_next(pub?: $mol_wire_pub): $mol_wire_pub | null;
478
+ track_off(sub: $mol_wire_sub | null): void;
479
+ pub_off(sub_pos: number): void;
480
+ destructor(): void;
481
+ track_cut(): void;
482
+ complete(): void;
483
+ complete_pubs(): void;
484
+ absorb(quant?: $mol_wire_cursor): void;
485
+ get pub_empty(): boolean;
427
486
  }
428
487
  }
429
488
 
430
489
  declare namespace $ {
431
- function $mol_tree2_from_string(this: $, str: string, uri?: string): $mol_tree2;
490
+ class $mol_after_timeout extends $mol_object2 {
491
+ delay: number;
492
+ task: () => void;
493
+ id: any;
494
+ constructor(delay: number, task: () => void);
495
+ destructor(): void;
496
+ }
432
497
  }
433
498
 
434
499
  declare namespace $ {
435
- function $mol_tree2_from_json(json: any, span?: $mol_span): $mol_tree2;
500
+ class $mol_after_frame extends $mol_after_timeout {
501
+ task: () => void;
502
+ constructor(task: () => void);
503
+ }
436
504
  }
437
505
 
438
506
  declare namespace $ {
439
- class $mol_term_color {
440
- static reset: (str: string) => string;
441
- static bold: (str: string) => string;
442
- static italic: (str: string) => string;
443
- static underline: (str: string) => string;
444
- static inverse: (str: string) => string;
445
- static hidden: (str: string) => string;
446
- static strike: (str: string) => string;
447
- static gray: (str: string) => string;
448
- static red: (str: string) => string;
449
- static green: (str: string) => string;
450
- static yellow: (str: string) => string;
451
- static blue: (str: string) => string;
452
- static magenta: (str: string) => string;
453
- static cyan: (str: string) => string;
454
- static Gray: (str: string) => string;
455
- static Red: (str: string) => string;
456
- static Green: (str: string) => string;
457
- static Yellow: (str: string) => string;
458
- static Blue: (str: string) => string;
459
- static Magenta: (str: string) => string;
460
- static Cyan: (str: string) => string;
461
- static ansi(open: number, close: number): (str: string) => string;
507
+ function $mol_promise_like(val: any): val is Promise<any>;
508
+ }
509
+
510
+ declare namespace $ {
511
+ abstract class $mol_wire_fiber<Host, Args extends readonly unknown[], Result> extends $mol_wire_pub_sub {
512
+ readonly task: (this: Host, ...args: Args) => Result;
513
+ readonly host?: Host | undefined;
514
+ static warm: boolean;
515
+ static planning: Set<$mol_wire_fiber<any, any, any>>;
516
+ static reaping: Set<$mol_wire_fiber<any, any, any>>;
517
+ static plan_task: $mol_after_frame | null;
518
+ static plan(): void;
519
+ static sync(): void;
520
+ [Symbol.toStringTag]: string;
521
+ cache: Result | Error | Promise<Result | Error>;
522
+ get args(): Args;
523
+ result(): Result | undefined;
524
+ field(): string;
525
+ constructor(id: string, task: (this: Host, ...args: Args) => Result, host?: Host | undefined, args?: Args);
526
+ plan(): void;
527
+ reap(): void;
528
+ toString(): string;
529
+ toJSON(): string;
530
+ get $(): any;
531
+ emit(quant?: $mol_wire_cursor): void;
532
+ fresh(): void;
533
+ refresh(): void;
534
+ abstract put(next: Result | Error | Promise<Result | Error>): Result | Error | Promise<Result | Error>;
535
+ sync(): Awaited<Result>;
536
+ async(): Promise<Result>;
462
537
  }
463
538
  }
464
539
 
465
540
  declare namespace $ {
466
- function $mol_log3_node_make(level: keyof Console, output: 'stdout' | 'stderr', type: string, color: (str: string) => string): (this: $, event: $mol_log3_event<{}>) => () => void;
467
- }
468
-
469
- declare namespace $ {
470
- function $mol_env(): Record<string, string | undefined>;
541
+ function $mol_func_name(this: $, func: Function): string;
542
+ function $mol_func_name_from<Target extends Function>(target: Target, source: Function): Target;
471
543
  }
472
544
 
473
545
  declare namespace $ {
546
+ function $mol_guid(length?: number, exists?: (id: string) => boolean): string;
474
547
  }
475
548
 
476
- /// <reference types="node" />
477
- /// <reference types="node" />
478
549
  declare namespace $ {
479
- function $mol_exec(this: $, dir: string, command: string, ...args: string[]): import("child_process").SpawnSyncReturns<Buffer>;
550
+ const $mol_key_store: WeakMap<object, string>;
551
+ function $mol_key<Value>(value: Value): string;
480
552
  }
481
553
 
482
554
  declare namespace $ {
555
+ let $mol_compare_deep_cache: WeakMap<any, WeakMap<any, boolean>>;
556
+ function $mol_compare_deep<Value>(left: Value, right: Value): boolean;
483
557
  }
484
558
 
485
559
  declare namespace $ {
486
- class $mol_state_local<Value> extends $mol_object {
487
- static 'native()': Pick<Storage, 'getItem' | 'setItem' | 'removeItem'>;
488
- static native(): Storage | {
489
- getItem(key: string): any;
490
- setItem(key: string, value: string): void;
491
- removeItem(key: string): void;
492
- };
493
- static changes(next?: StorageEvent): StorageEvent | undefined;
494
- static value<Value>(key: string, next?: Value | null): Value | null;
495
- prefix(): string;
496
- value(key: string, next?: Value): Value | null;
560
+ class $mol_wire_task<Host, Args extends readonly unknown[], Result> extends $mol_wire_fiber<Host, Args, Result> {
561
+ static getter<Host, Args extends readonly unknown[], Result>(task: (this: Host, ...args: Args) => Result): (host: Host, args: Args) => $mol_wire_task<Host, Args, Result>;
562
+ get temp(): boolean;
563
+ complete(): void;
564
+ put(next: Result | Error | Promise<Result | Error>): Error | Result | Promise<Error | Result>;
497
565
  }
498
566
  }
499
567
 
500
568
  declare namespace $ {
501
- function $mol_charset_encode(value: string): Uint8Array;
569
+ function $mol_wire_method<Host extends object, Args extends readonly any[]>(host: Host, field: PropertyKey, descr?: TypedPropertyDescriptor<(...args: Args) => any>): {
570
+ value: (this: Host, ...args: Args) => any;
571
+ enumerable?: boolean | undefined;
572
+ configurable?: boolean | undefined;
573
+ writable?: boolean | undefined;
574
+ get?: (() => (...args: Args) => any) | undefined;
575
+ set?: ((value: (...args: Args) => any) => void) | undefined;
576
+ };
502
577
  }
503
578
 
504
579
  declare namespace $ {
505
- type $mol_int62_string = `${string}_${string}`;
506
- function $mol_int62_string_ensure(str: unknown): `${string}_${string}` | null;
507
- type $mol_int62_pair = {
508
- readonly lo: number;
509
- readonly hi: number;
510
- };
511
- const $mol_int62_max: number;
512
- const $mol_int62_min: number;
513
- const $mol_int62_range: number;
514
- function $mol_int62_to_string({ lo, hi }: $mol_int62_pair): `${string}_${string}`;
515
- function $mol_int62_from_string(str: string): null | $mol_int62_pair;
516
- function $mol_int62_compare(left_lo: number, left_hi: number, right_lo: number, right_hi: number): number;
517
- function $mol_int62_inc(lo: number, hi: number, max?: number): $mol_int62_pair;
518
- function $mol_int62_random(): $mol_int62_pair;
519
- function $mol_int62_hash_string(str: string): `${string}_${string}`;
520
- function $mol_int62_hash_buffer(buf: Uint8Array, seed?: {
521
- lo: number;
522
- hi: number;
523
- }): $mol_int62_pair;
580
+ type $mol_type_tail<Tuple extends readonly any[]> = ((...tail: Tuple) => any) extends ((head: any, ...tail: infer Tail) => any) ? Tail : never;
524
581
  }
525
582
 
526
583
  declare namespace $ {
527
- var $mol_crypto_native: Crypto;
584
+ type $mol_type_foot<Tuple extends readonly any[]> = Tuple['length'] extends 0 ? never : Tuple[$mol_type_tail<Tuple>['length']];
528
585
  }
529
586
 
530
587
  declare namespace $ {
531
- function $mol_crypto_auditor_pair(this: $): Promise<{
532
- public: $mol_crypto_auditor_public;
533
- private: $mol_crypto_auditor_private;
534
- }>;
535
- class $mol_crypto_auditor_public extends Object {
536
- readonly native: CryptoKey & {
537
- type: 'public';
538
- };
539
- static size: number;
540
- constructor(native: CryptoKey & {
541
- type: 'public';
542
- });
543
- static from(serial: string): Promise<$mol_crypto_auditor_public>;
544
- serial(): Promise<string>;
545
- verify(data: BufferSource, sign: BufferSource): Promise<boolean>;
546
- }
547
- class $mol_crypto_auditor_private extends Object {
548
- readonly native: CryptoKey & {
549
- type: 'private';
550
- };
551
- static size: number;
552
- constructor(native: CryptoKey & {
553
- type: 'private';
554
- });
555
- static from(serial: string): Promise<$mol_crypto_auditor_private>;
556
- serial(): Promise<string>;
557
- sign(data: BufferSource): Promise<ArrayBuffer>;
558
- public(): Promise<$mol_crypto_auditor_public>;
559
- }
560
- const $mol_crypto_auditor_sign_size = 64;
561
- function $mol_crypto_auditor_private_to_public(serial: string): string;
588
+ function $mol_fail_catch(error: unknown): boolean;
562
589
  }
563
590
 
564
591
  declare namespace $ {
565
- enum $hyoo_crowd_peer_level {
566
- get = 0,
567
- add = 1,
568
- mod = 2,
569
- law = 3
570
- }
571
- class $hyoo_crowd_peer extends Object {
572
- readonly key_public: $mol_crypto_auditor_public;
573
- readonly key_public_serial: string;
574
- readonly key_private: $mol_crypto_auditor_private;
575
- readonly key_private_serial: string;
576
- id: $mol_int62_string;
577
- constructor(key_public: $mol_crypto_auditor_public, key_public_serial: string, key_private: $mol_crypto_auditor_private, key_private_serial: string);
578
- static generate(): Promise<$hyoo_crowd_peer>;
579
- static restore(serial: string): Promise<$hyoo_crowd_peer>;
580
- }
592
+ function $mol_fail_log(error: unknown): boolean;
581
593
  }
582
594
 
583
595
  declare namespace $ {
584
- function $hyoo_sync_peer(path: string): Promise<$hyoo_crowd_peer>;
596
+ class $mol_wire_atom<Host, Args extends readonly unknown[], Result> extends $mol_wire_fiber<Host, Args, Result> {
597
+ static solo<Host, Args extends readonly unknown[], Result>(host: Host, task: (this: Host, ...args: Args) => Result): $mol_wire_atom<Host, Args, Result>;
598
+ 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>;
599
+ static watching: Set<$mol_wire_atom<any, any, any>>;
600
+ static watcher: $mol_after_frame | null;
601
+ static watch(): void;
602
+ watch(): void;
603
+ resync(args: Args): Error | Result | Promise<Error | Result>;
604
+ once(): Awaited<Result>;
605
+ channel(): ((next?: $mol_type_foot<Args>) => Awaited<Result>) & {
606
+ atom: $mol_wire_atom<Host, Args, Result>;
607
+ };
608
+ destructor(): void;
609
+ put(next: Result | Error | Promise<Result | Error>): Error | Result | Promise<Error | Result>;
610
+ }
585
611
  }
586
612
 
587
613
  declare namespace $ {
588
- function $mol_wire_solid(): void;
614
+ export function $mol_wire_solo<Args extends any[]>(host: object, field: string, descr?: TypedPropertyDescriptor<(...args: Args) => any>): TypedPropertyDescriptor<(...args: First_optional<Args>) => any>;
615
+ type First_optional<Args extends any[]> = Args extends [] ? [] : [Args[0] | undefined, ...$mol_type_tail<Args>];
616
+ export {};
589
617
  }
590
618
 
591
619
  declare namespace $ {
592
- class $mol_wrapper extends $mol_object2 {
593
- static wrap: (task: (...ags: any[]) => any) => (...ags: any[]) => any;
594
- static run<Result>(task: () => Result): Result;
595
- static func<Args extends any[], Result, Host = void>(func: (this: Host, ...args: Args) => Result): (this: Host, ...args: Args) => Result;
596
- static get class(): <Class extends new (...args: any[]) => any>(Class: Class) => Class;
597
- static get method(): (obj: object, name: PropertyKey, descr: PropertyDescriptor) => PropertyDescriptor;
598
- static get field(): <Host, Field extends keyof Host, Args extends any[], Result>(obj: Host, name: Field, descr: TypedPropertyDescriptor<Result>) => TypedPropertyDescriptor<Result>;
599
- }
620
+ function $mol_wire_plex<Args extends [any, ...any[]]>(host: object, field: string, descr?: TypedPropertyDescriptor<(...args: Args) => any>): {
621
+ value: (this: typeof host, ...args: Args) => any;
622
+ enumerable?: boolean | undefined;
623
+ configurable?: boolean | undefined;
624
+ writable?: boolean | undefined;
625
+ get?: (() => (...args: Args) => any) | undefined;
626
+ set?: ((value: (...args: Args) => any) => void) | undefined;
627
+ };
600
628
  }
601
629
 
602
630
  declare namespace $ {
603
- class $mol_memo extends $mol_wrapper {
604
- static wrap<This extends object, Value>(task: (this: This, next?: Value) => Value): (this: This, next?: Value) => Value | undefined;
605
- }
631
+ let $mol_mem: typeof $mol_wire_solo;
632
+ let $mol_mem_key: typeof $mol_wire_plex;
606
633
  }
607
634
 
608
635
  declare namespace $ {
609
- type $mol_data_value<Input = any, Output = any> = (val: Input) => Output;
636
+ function $mol_wire_sync<Host extends object>(obj: Host): (Host extends (...args: infer Args) => infer Res ? Res extends Promise<infer Res2> ? (...args: Args) => Res2 : Host : {}) & { [key in keyof Host]: Host[key] extends (...args: infer Args_1) => Promise<infer Res_1> ? (...args: Args_1) => Res_1 : Host[key]; };
610
637
  }
611
638
 
612
639
  declare namespace $ {
613
- function $mol_data_setup<Value extends $mol_data_value, Config = never>(value: Value, config: Config): Value & {
614
- config: Config;
615
- Value: ReturnType<Value>;
616
- };
640
+ namespace $$ { }
641
+ const $mol_object_field: unique symbol;
642
+ class $mol_object extends $mol_object2 {
643
+ static make<Instance>(this: {
644
+ new (): Instance;
645
+ }, config: Partial<Instance>): Instance;
646
+ }
617
647
  }
618
648
 
619
649
  declare namespace $ {
620
- function $mol_diff_path<Item>(...paths: Item[][]): {
621
- prefix: Item[];
622
- suffix: Item[][];
623
- };
650
+ var $mol_dom_context: typeof globalThis;
624
651
  }
625
652
 
626
653
  declare namespace $ {
627
- class $mol_error_mix extends Error {
628
- errors: Error[];
629
- constructor(message: string, ...errors: Error[]);
630
- toJSON(): string;
631
- }
632
654
  }
633
655
 
634
656
  declare namespace $ {
635
- class $mol_data_error extends $mol_error_mix {
657
+ class $mol_state_local<Value> extends $mol_object {
658
+ static 'native()': Pick<Storage, 'getItem' | 'setItem' | 'removeItem'>;
659
+ static native(): Storage | {
660
+ getItem(key: string): any;
661
+ setItem(key: string, value: string): void;
662
+ removeItem(key: string): void;
663
+ };
664
+ static changes(next?: StorageEvent): StorageEvent | undefined;
665
+ static value<Value>(key: string, next?: Value | null): Value | null;
666
+ prefix(): string;
667
+ value(key: string, next?: Value): Value | null;
636
668
  }
637
669
  }
638
670
 
639
671
  declare namespace $ {
640
- function $mol_data_enum<Dict extends Record<number | string, number | string>>(name: string, dict: Dict): ((value: Dict[keyof Dict]) => Dict[keyof Dict]) & {
641
- config: {
642
- name: string;
643
- dict: Dict;
644
- };
645
- Value: Dict[keyof Dict];
646
- };
672
+ function $hyoo_sync_peer(path: string): Promise<$hyoo_crowd_peer>;
647
673
  }
648
674
 
649
675
  declare namespace $ {
650
- type $mol_charset_encoding = 'utf8' | 'utf-16le' | 'utf-16be' | 'ibm866' | 'iso-8859-2' | 'iso-8859-3' | 'iso-8859-4' | 'iso-8859-5' | 'iso-8859-6' | 'iso-8859-7' | 'iso-8859-8' | 'iso-8859-8i' | 'iso-8859-10' | 'iso-8859-13' | 'iso-8859-14' | 'iso-8859-15' | 'iso-8859-16' | 'koi8-r' | 'koi8-u' | 'koi8-r' | 'macintosh' | 'windows-874' | 'windows-1250' | 'windows-1251' | 'windows-1252' | 'windows-1253' | 'windows-1254' | 'windows-1255' | 'windows-1256' | 'windows-1257' | 'windows-1258' | 'x-mac-cyrillic' | 'gbk' | 'gb18030' | 'hz-gb-2312' | 'big5' | 'euc-jp' | 'iso-2022-jp' | 'shift-jis' | 'euc-kr' | 'iso-2022-kr';
676
+ function $mol_wire_solid(): void;
651
677
  }
652
678
 
653
679
  declare namespace $ {
654
- function $mol_charset_decode(buffer: BufferSource, encoding?: $mol_charset_encoding): string;
680
+ class $mol_wrapper extends $mol_object2 {
681
+ static wrap: (task: (...ags: any[]) => any) => (...ags: any[]) => any;
682
+ static run<Result>(task: () => Result): Result;
683
+ static func<Args extends any[], Result, Host = void>(func: (this: Host, ...args: Args) => Result): (this: Host, ...args: Args) => Result;
684
+ static get class(): <Class extends new (...args: any[]) => any>(Class: Class) => Class;
685
+ static get method(): (obj: object, name: PropertyKey, descr: PropertyDescriptor) => PropertyDescriptor;
686
+ static get field(): <Host, Field extends keyof Host, Args extends any[], Result>(obj: Host, name: Field, descr: TypedPropertyDescriptor<Result>) => TypedPropertyDescriptor<Result>;
687
+ }
655
688
  }
656
689
 
657
690
  declare namespace $ {
658
- type $hyoo_crowd_unit_id = `${$mol_int62_string}!${$mol_int62_string}`;
659
- enum $hyoo_crowd_unit_kind {
660
- grab = 0,
661
- join = 1,
662
- give = 2,
663
- data = 3
664
- }
665
- enum $hyoo_crowd_unit_group {
666
- auth = 0,
667
- data = 1
668
- }
669
- class $hyoo_crowd_unit extends Object {
670
- readonly land: $mol_int62_string;
671
- readonly auth: $mol_int62_string;
672
- readonly head: $mol_int62_string;
673
- readonly self: $mol_int62_string;
674
- readonly next: $mol_int62_string;
675
- readonly prev: $mol_int62_string;
676
- readonly time: number;
677
- readonly data: unknown;
678
- bin: $hyoo_crowd_unit_bin | null;
679
- constructor(land: $mol_int62_string, auth: $mol_int62_string, head: $mol_int62_string, self: $mol_int62_string, next: $mol_int62_string, prev: $mol_int62_string, time: number, data: unknown, bin: $hyoo_crowd_unit_bin | null);
680
- kind(): $hyoo_crowd_unit_kind;
681
- group(): $hyoo_crowd_unit_group;
682
- level(): $hyoo_crowd_peer_level;
683
- [Symbol.toPrimitive](): string;
684
- }
685
- class $hyoo_crowd_unit_bin extends DataView {
686
- static from_buffer(buffer: Int16Array): $hyoo_crowd_unit_bin;
687
- static from_unit(unit: $hyoo_crowd_unit): $hyoo_crowd_unit_bin;
688
- sign(next?: Uint8Array): Uint8Array;
689
- size(): number;
690
- sens(): Uint8Array;
691
- unit(): $hyoo_crowd_unit;
691
+ class $mol_memo extends $mol_wrapper {
692
+ static wrap<This extends object, Value>(task: (this: This, next?: Value) => Value): (this: This, next?: Value) => Value | undefined;
692
693
  }
693
- function $hyoo_crowd_unit_compare(left: $hyoo_crowd_unit, right: $hyoo_crowd_unit): number;
694
694
  }
695
695
 
696
696
  declare namespace $ {
@@ -715,8 +715,9 @@ declare namespace $ {
715
715
  tick(peer: $mol_int62_string): number;
716
716
  }
717
717
  class $hyoo_crowd_clock_bin extends DataView {
718
- static from(land_id: $mol_int62_string, clocks: readonly [$hyoo_crowd_clock, $hyoo_crowd_clock]): $hyoo_crowd_clock_bin;
718
+ static from(land_id: $mol_int62_string, clocks: readonly [$hyoo_crowd_clock, $hyoo_crowd_clock], count: number): $hyoo_crowd_clock_bin;
719
719
  land(): `${string}_${string}`;
720
+ count(): number;
720
721
  }
721
722
  }
722
723
 
@@ -919,6 +920,7 @@ declare namespace $ {
919
920
 
920
921
  declare namespace $ {
921
922
  class $hyoo_sync_yard<Line> extends $mol_object2 {
923
+ db_unit_persisted: WeakSet<$hyoo_crowd_unit>;
922
924
  log_pack(data: any): any;
923
925
  peer(): $hyoo_crowd_peer;
924
926
  world(): $hyoo_crowd_world;