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 +443 -441
- package/node.deps.json +1 -1
- package/node.js +2111 -2102
- package/node.js.map +1 -1
- package/node.mjs +2111 -2102
- package/node.mjs.map +1 -1
- package/node.test.js +2340 -2331
- package/node.test.js.map +1 -1
- package/package.json +38 -38
- package/web.d.ts +204 -202
- package/web.deps.json +1 -1
- package/web.js +1834 -1825
- package/web.js.map +1 -1
- package/web.mjs +1834 -1825
- package/web.mjs.map +1 -1
- package/web.test.js +257 -257
- package/web.test.js.map +1 -1
package/node.d.ts
CHANGED
|
@@ -69,628 +69,628 @@ declare namespace $ {
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
|
|
73
|
-
|
|
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
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
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
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
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
|
-
|
|
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
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
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 $
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
constructor(
|
|
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
|
-
|
|
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 $
|
|
176
|
+
function $mol_tree2_from_json(json: any, span?: $mol_span): $mol_tree2;
|
|
186
177
|
}
|
|
187
178
|
|
|
188
179
|
declare namespace $ {
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
static
|
|
193
|
-
static
|
|
194
|
-
static
|
|
195
|
-
static
|
|
196
|
-
static
|
|
197
|
-
static
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
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 $
|
|
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 $
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
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
|
-
|
|
258
|
-
|
|
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 $
|
|
250
|
+
type $mol_data_value<Input = any, Output = any> = (val: Input) => Output;
|
|
263
251
|
}
|
|
264
252
|
|
|
265
253
|
declare namespace $ {
|
|
266
|
-
function $
|
|
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 $
|
|
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 $
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
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
|
-
|
|
293
|
-
|
|
294
|
-
export {};
|
|
276
|
+
class $mol_data_error extends $mol_error_mix {
|
|
277
|
+
}
|
|
295
278
|
}
|
|
296
279
|
|
|
297
280
|
declare namespace $ {
|
|
298
|
-
function $
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
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
|
-
|
|
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 $
|
|
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
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
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
|
-
|
|
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
|
-
|
|
332
|
-
|
|
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
|
-
|
|
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
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
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
|
-
|
|
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
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
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
|
-
|
|
417
|
-
|
|
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
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
static
|
|
447
|
-
static
|
|
448
|
-
static
|
|
449
|
-
static
|
|
450
|
-
static
|
|
451
|
-
static
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
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 $
|
|
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
|
-
|
|
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 $
|
|
487
|
-
static
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
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 $
|
|
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 $
|
|
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
|
-
|
|
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 $
|
|
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
|
-
|
|
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
|
-
|
|
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 $
|
|
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
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
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
|
-
|
|
604
|
-
|
|
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
|
-
|
|
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
|
-
|
|
614
|
-
|
|
615
|
-
|
|
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
|
-
|
|
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 $
|
|
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 $
|
|
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
|
-
|
|
676
|
+
function $mol_wire_solid(): void;
|
|
651
677
|
}
|
|
652
678
|
|
|
653
679
|
declare namespace $ {
|
|
654
|
-
|
|
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
|
-
|
|
659
|
-
|
|
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;
|