hyoo_sync_client 0.0.1
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/.nojekyll +0 -0
- package/README.md +28 -0
- package/node.audit.js +1 -0
- package/node.d.ts +1093 -0
- package/node.deps.json +1 -0
- package/node.js +4412 -0
- package/node.js.map +1 -0
- package/node.meta.tree +67 -0
- package/node.mjs +4413 -0
- package/node.mjs.map +1 -0
- package/node.test.js +8804 -0
- package/node.test.js.map +1 -0
- package/package.json +134 -0
- package/test.html +11 -0
- package/web.audit.js +1 -0
- package/web.css +1 -0
- package/web.css.map +1 -0
- package/web.d.ts +1025 -0
- package/web.deps.json +1 -0
- package/web.js +4099 -0
- package/web.js.map +1 -0
- package/web.meta.tree +67 -0
- package/web.mjs +4100 -0
- package/web.mjs.map +1 -0
- package/web.test.js +4087 -0
- package/web.test.js.map +1 -0
package/web.d.ts
ADDED
|
@@ -0,0 +1,1025 @@
|
|
|
1
|
+
declare let _$_: {
|
|
2
|
+
new (): {};
|
|
3
|
+
} & typeof globalThis;
|
|
4
|
+
declare class $ extends _$_ {
|
|
5
|
+
}
|
|
6
|
+
declare namespace $ {
|
|
7
|
+
export type $ = typeof $$;
|
|
8
|
+
export class $$ extends $ {
|
|
9
|
+
}
|
|
10
|
+
namespace $$ {
|
|
11
|
+
type $$ = $;
|
|
12
|
+
}
|
|
13
|
+
export {};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
declare let $hyoo_sync_revision: string;
|
|
17
|
+
|
|
18
|
+
declare namespace $ {
|
|
19
|
+
const $mol_ambient_ref: unique symbol;
|
|
20
|
+
type $mol_ambient_context = $;
|
|
21
|
+
function $mol_ambient(this: $ | void, overrides: Partial<$>): $;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
declare namespace $ {
|
|
25
|
+
function $mol_delegate<Value extends object>(proto: Value, target: () => Value): Value;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
declare namespace $ {
|
|
29
|
+
const $mol_owning_map: WeakMap<any, any>;
|
|
30
|
+
function $mol_owning_allow<Having>(having: Having): having is Having & {
|
|
31
|
+
destructor(): void;
|
|
32
|
+
};
|
|
33
|
+
function $mol_owning_get<Having, Owner extends object>(having: Having, Owner?: {
|
|
34
|
+
new (): Owner;
|
|
35
|
+
}): Owner | null;
|
|
36
|
+
function $mol_owning_check<Owner, Having>(owner: Owner, having: Having): having is Having & {
|
|
37
|
+
destructor(): void;
|
|
38
|
+
};
|
|
39
|
+
function $mol_owning_catch<Owner, Having>(owner: Owner, having: Having): boolean;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
declare namespace $ {
|
|
43
|
+
function $mol_fail(error: any): never;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
declare namespace $ {
|
|
47
|
+
function $mol_fail_hidden(error: any): never;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
declare namespace $ {
|
|
51
|
+
type $mol_type_writable<T> = {
|
|
52
|
+
-readonly [P in keyof T]: T[P];
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
declare namespace $ {
|
|
57
|
+
class $mol_object2 {
|
|
58
|
+
static $: typeof $$;
|
|
59
|
+
[Symbol.toStringTag]: string;
|
|
60
|
+
[$mol_ambient_ref]: typeof $$;
|
|
61
|
+
get $(): $;
|
|
62
|
+
set $(next: $);
|
|
63
|
+
static create<Instance>(this: new (init?: (instance: any) => void) => Instance, init?: (instance: $mol_type_writable<Instance>) => void): Instance;
|
|
64
|
+
static [Symbol.toPrimitive](): string;
|
|
65
|
+
static toString(): string;
|
|
66
|
+
destructor(): void;
|
|
67
|
+
toString(): string;
|
|
68
|
+
toJSON(): any;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
declare namespace $ {
|
|
73
|
+
enum $mol_wire_cursor {
|
|
74
|
+
stale = -1,
|
|
75
|
+
doubt = -2,
|
|
76
|
+
fresh = -3,
|
|
77
|
+
final = -4
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
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
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
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;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
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[];
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
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;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
declare namespace $ {
|
|
168
|
+
class $mol_after_frame extends $mol_object2 {
|
|
169
|
+
task: () => void;
|
|
170
|
+
static _promise: Promise<void> | null;
|
|
171
|
+
static get promise(): Promise<void>;
|
|
172
|
+
cancelled: boolean;
|
|
173
|
+
promise: Promise<void>;
|
|
174
|
+
constructor(task: () => void);
|
|
175
|
+
destructor(): void;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
declare namespace $ {
|
|
180
|
+
function $mol_promise_like(val: any): val is Promise<any>;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
declare namespace $ {
|
|
184
|
+
abstract class $mol_wire_fiber<Host, Args extends readonly unknown[], Result> extends $mol_wire_pub_sub {
|
|
185
|
+
readonly task: (this: Host, ...args: Args) => Result;
|
|
186
|
+
readonly host?: Host | undefined;
|
|
187
|
+
static warm: boolean;
|
|
188
|
+
static planning: Set<$mol_wire_fiber<any, any, any>>;
|
|
189
|
+
static reaping: Set<$mol_wire_fiber<any, any, any>>;
|
|
190
|
+
static plan_task: $mol_after_frame | null;
|
|
191
|
+
static plan(): void;
|
|
192
|
+
static sync(): void;
|
|
193
|
+
[Symbol.toStringTag]: string;
|
|
194
|
+
cache: Result | Error | Promise<Result | Error>;
|
|
195
|
+
get args(): Args;
|
|
196
|
+
result(): Result | undefined;
|
|
197
|
+
field(): string;
|
|
198
|
+
constructor(id: string, task: (this: Host, ...args: Args) => Result, host?: Host | undefined, args?: Args);
|
|
199
|
+
plan(): void;
|
|
200
|
+
reap(): void;
|
|
201
|
+
toString(): string;
|
|
202
|
+
toJSON(): string;
|
|
203
|
+
get $(): any;
|
|
204
|
+
emit(quant?: $mol_wire_cursor): void;
|
|
205
|
+
fresh(): void;
|
|
206
|
+
refresh(): void;
|
|
207
|
+
abstract put(next: Result | Error | Promise<Result | Error>): Result | Error | Promise<Result | Error>;
|
|
208
|
+
sync(): Awaited<Result>;
|
|
209
|
+
async(): Promise<Result>;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
declare namespace $ {
|
|
214
|
+
function $mol_func_name(this: $, func: Function): string;
|
|
215
|
+
function $mol_func_name_from<Target extends Function>(target: Target, source: Function): Target;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
declare namespace $ {
|
|
219
|
+
function $mol_guid(length?: number, exists?: (id: string) => boolean): string;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
declare namespace $ {
|
|
223
|
+
const $mol_key_store: WeakMap<object, string>;
|
|
224
|
+
function $mol_key<Value>(value: Value): string;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
declare namespace $ {
|
|
228
|
+
let $mol_compare_deep_cache: WeakMap<any, WeakMap<any, boolean>>;
|
|
229
|
+
function $mol_compare_deep<Value>(left: Value, right: Value): boolean;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
declare namespace $ {
|
|
233
|
+
class $mol_wire_task<Host, Args extends readonly unknown[], Result> extends $mol_wire_fiber<Host, Args, Result> {
|
|
234
|
+
static getter<Host, Args extends readonly unknown[], Result>(task: (this: Host, ...args: Args) => Result): (host: Host, args: Args) => $mol_wire_task<Host, Args, Result>;
|
|
235
|
+
get temp(): boolean;
|
|
236
|
+
complete(): void;
|
|
237
|
+
put(next: Result | Error | Promise<Result | Error>): Error | Result | Promise<Error | Result>;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
declare namespace $ {
|
|
242
|
+
function $mol_wire_method<Host extends object, Args extends readonly any[]>(host: Host, field: PropertyKey, descr?: TypedPropertyDescriptor<(...args: Args) => any>): {
|
|
243
|
+
value: (this: Host, ...args: Args) => any;
|
|
244
|
+
enumerable?: boolean | undefined;
|
|
245
|
+
configurable?: boolean | undefined;
|
|
246
|
+
writable?: boolean | undefined;
|
|
247
|
+
get?: (() => (...args: Args) => any) | undefined;
|
|
248
|
+
set?: ((value: (...args: Args) => any) => void) | undefined;
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
declare namespace $ {
|
|
253
|
+
type $mol_type_tail<Tuple extends readonly any[]> = ((...tail: Tuple) => any) extends ((head: any, ...tail: infer Tail) => any) ? Tail : never;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
declare namespace $ {
|
|
257
|
+
type $mol_type_foot<Tuple extends readonly any[]> = Tuple['length'] extends 0 ? never : Tuple[$mol_type_tail<Tuple>['length']];
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
declare namespace $ {
|
|
261
|
+
function $mol_fail_catch(error: unknown): boolean;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
declare namespace $ {
|
|
265
|
+
function $mol_fail_log(error: unknown): boolean;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
declare namespace $ {
|
|
269
|
+
class $mol_wire_atom<Host, Args extends readonly unknown[], Result> extends $mol_wire_fiber<Host, Args, Result> {
|
|
270
|
+
static solo<Host, Args extends readonly unknown[], Result>(host: Host, task: (this: Host, ...args: Args) => Result): $mol_wire_atom<Host, Args, Result>;
|
|
271
|
+
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>;
|
|
272
|
+
static watching: Set<$mol_wire_atom<any, any, any>>;
|
|
273
|
+
static watcher: $mol_after_frame | null;
|
|
274
|
+
static watch(): void;
|
|
275
|
+
watch(): void;
|
|
276
|
+
resync(args: Args): Error | Result | Promise<Error | Result>;
|
|
277
|
+
once(): Awaited<Result>;
|
|
278
|
+
channel(): ((next?: $mol_type_foot<Args>) => Awaited<Result>) & {
|
|
279
|
+
atom: $mol_wire_atom<Host, Args, Result>;
|
|
280
|
+
};
|
|
281
|
+
destructor(): void;
|
|
282
|
+
put(next: Result | Error | Promise<Result | Error>): Error | Result | Promise<Error | Result>;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
declare namespace $ {
|
|
287
|
+
export function $mol_wire_solo<Args extends any[]>(host: object, field: string, descr?: TypedPropertyDescriptor<(...args: Args) => any>): TypedPropertyDescriptor<(...args: First_optional<Args>) => any>;
|
|
288
|
+
type First_optional<Args extends any[]> = Args extends [] ? [] : [Args[0] | undefined, ...$mol_type_tail<Args>];
|
|
289
|
+
export {};
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
declare namespace $ {
|
|
293
|
+
function $mol_wire_plex<Args extends [any, ...any[]]>(host: object, field: string, descr?: TypedPropertyDescriptor<(...args: Args) => any>): {
|
|
294
|
+
value: (this: typeof host, ...args: Args) => any;
|
|
295
|
+
enumerable?: boolean | undefined;
|
|
296
|
+
configurable?: boolean | undefined;
|
|
297
|
+
writable?: boolean | undefined;
|
|
298
|
+
get?: (() => (...args: Args) => any) | undefined;
|
|
299
|
+
set?: ((value: (...args: Args) => any) => void) | undefined;
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
declare namespace $ {
|
|
304
|
+
let $mol_mem: typeof $mol_wire_solo;
|
|
305
|
+
let $mol_mem_key: typeof $mol_wire_plex;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
declare namespace $ {
|
|
309
|
+
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]; };
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
declare namespace $ {
|
|
313
|
+
var $mol_dom_context: typeof globalThis;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
declare namespace $ {
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
declare namespace $ {
|
|
320
|
+
function $mol_dom_render_children(el: Element | DocumentFragment, childNodes: NodeList | Array<Node | string | null>): void;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
declare namespace $ {
|
|
324
|
+
type $mol_type_partial_deep<Val> = {
|
|
325
|
+
[field in keyof Val]?: $mol_type_partial_deep<Val[field]>;
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
declare namespace $ {
|
|
330
|
+
let $mol_jsx_prefix: string;
|
|
331
|
+
let $mol_jsx_crumbs: string;
|
|
332
|
+
let $mol_jsx_booked: Set<string> | null;
|
|
333
|
+
let $mol_jsx_document: $mol_jsx.JSX.ElementClass['ownerDocument'];
|
|
334
|
+
const $mol_jsx_frag = "";
|
|
335
|
+
function $mol_jsx<Props extends $mol_jsx.JSX.IntrinsicAttributes, Children extends Array<Node | string>>(Elem: string | ((props: Props, ...children: Children) => Element), props: Props, ...childNodes: Children): Element | DocumentFragment;
|
|
336
|
+
namespace $mol_jsx.JSX {
|
|
337
|
+
interface Element extends HTMLElement {
|
|
338
|
+
class?: string;
|
|
339
|
+
}
|
|
340
|
+
interface ElementClass {
|
|
341
|
+
attributes: {};
|
|
342
|
+
ownerDocument: Pick<Document, 'getElementById' | 'createElementNS' | 'createDocumentFragment'>;
|
|
343
|
+
childNodes: Array<Node | string>;
|
|
344
|
+
valueOf(): Element;
|
|
345
|
+
}
|
|
346
|
+
type OrString<Dict> = {
|
|
347
|
+
[key in keyof Dict]: Dict[key] | string;
|
|
348
|
+
};
|
|
349
|
+
type IntrinsicElements = {
|
|
350
|
+
[key in keyof ElementTagNameMap]?: $.$mol_type_partial_deep<OrString<Element & IntrinsicAttributes & ElementTagNameMap[key]>>;
|
|
351
|
+
};
|
|
352
|
+
interface IntrinsicAttributes {
|
|
353
|
+
id?: string;
|
|
354
|
+
xmlns?: string;
|
|
355
|
+
}
|
|
356
|
+
interface ElementAttributesProperty {
|
|
357
|
+
attributes: {};
|
|
358
|
+
}
|
|
359
|
+
interface ElementChildrenAttribute {
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
declare namespace $ {
|
|
365
|
+
namespace $$ { }
|
|
366
|
+
const $mol_object_field: unique symbol;
|
|
367
|
+
class $mol_object extends $mol_object2 {
|
|
368
|
+
static make<Instance>(this: {
|
|
369
|
+
new (): Instance;
|
|
370
|
+
}, config: Partial<Instance>): Instance;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
declare namespace $ {
|
|
375
|
+
class $mol_state_local<Value> extends $mol_object {
|
|
376
|
+
static 'native()': Pick<Storage, 'getItem' | 'setItem' | 'removeItem'>;
|
|
377
|
+
static native(): Storage | {
|
|
378
|
+
getItem(key: string): any;
|
|
379
|
+
setItem(key: string, value: string): void;
|
|
380
|
+
removeItem(key: string): void;
|
|
381
|
+
};
|
|
382
|
+
static changes(next?: StorageEvent): StorageEvent | undefined;
|
|
383
|
+
static value<Value>(key: string, next?: Value | null): Value | null;
|
|
384
|
+
prefix(): string;
|
|
385
|
+
value(key: string, next?: Value): Value | null;
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
declare namespace $ {
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
declare var $node: any;
|
|
393
|
+
|
|
394
|
+
declare namespace $ {
|
|
395
|
+
function $mol_charset_encode(value: string): Uint8Array;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
declare namespace $ {
|
|
399
|
+
type $mol_int62_string = `${string}_${string}`;
|
|
400
|
+
function $mol_int62_string_ensure(str: unknown): `${string}_${string}` | null;
|
|
401
|
+
type $mol_int62_pair = {
|
|
402
|
+
readonly lo: number;
|
|
403
|
+
readonly hi: number;
|
|
404
|
+
};
|
|
405
|
+
const $mol_int62_max: number;
|
|
406
|
+
const $mol_int62_min: number;
|
|
407
|
+
const $mol_int62_range: number;
|
|
408
|
+
function $mol_int62_to_string({ lo, hi }: $mol_int62_pair): `${string}_${string}`;
|
|
409
|
+
function $mol_int62_from_string(str: string): null | $mol_int62_pair;
|
|
410
|
+
function $mol_int62_compare(left_lo: number, left_hi: number, right_lo: number, right_hi: number): number;
|
|
411
|
+
function $mol_int62_inc(lo: number, hi: number, max?: number): $mol_int62_pair;
|
|
412
|
+
function $mol_int62_random(): $mol_int62_pair;
|
|
413
|
+
function $mol_int62_hash_string(str: string): `${string}_${string}`;
|
|
414
|
+
function $mol_int62_hash_buffer(buf: Uint8Array, seed?: {
|
|
415
|
+
lo: number;
|
|
416
|
+
hi: number;
|
|
417
|
+
}): $mol_int62_pair;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
declare namespace $ {
|
|
421
|
+
var $mol_crypto_native: Crypto;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
declare namespace $ {
|
|
425
|
+
function $mol_crypto_auditor_pair(this: $): Promise<{
|
|
426
|
+
public: $mol_crypto_auditor_public;
|
|
427
|
+
private: $mol_crypto_auditor_private;
|
|
428
|
+
}>;
|
|
429
|
+
class $mol_crypto_auditor_public extends Object {
|
|
430
|
+
readonly native: CryptoKey & {
|
|
431
|
+
type: 'public';
|
|
432
|
+
};
|
|
433
|
+
static size: number;
|
|
434
|
+
constructor(native: CryptoKey & {
|
|
435
|
+
type: 'public';
|
|
436
|
+
});
|
|
437
|
+
static from(serial: string): Promise<$mol_crypto_auditor_public>;
|
|
438
|
+
serial(): Promise<string>;
|
|
439
|
+
verify(data: BufferSource, sign: BufferSource): Promise<boolean>;
|
|
440
|
+
}
|
|
441
|
+
class $mol_crypto_auditor_private extends Object {
|
|
442
|
+
readonly native: CryptoKey & {
|
|
443
|
+
type: 'private';
|
|
444
|
+
};
|
|
445
|
+
static size: number;
|
|
446
|
+
constructor(native: CryptoKey & {
|
|
447
|
+
type: 'private';
|
|
448
|
+
});
|
|
449
|
+
static from(serial: string): Promise<$mol_crypto_auditor_private>;
|
|
450
|
+
serial(): Promise<string>;
|
|
451
|
+
sign(data: BufferSource): Promise<ArrayBuffer>;
|
|
452
|
+
public(): Promise<$mol_crypto_auditor_public>;
|
|
453
|
+
}
|
|
454
|
+
const $mol_crypto_auditor_sign_size = 64;
|
|
455
|
+
function $mol_crypto_auditor_private_to_public(serial: string): string;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
declare namespace $ {
|
|
459
|
+
enum $hyoo_crowd_peer_level {
|
|
460
|
+
get = 0,
|
|
461
|
+
add = 1,
|
|
462
|
+
mod = 2,
|
|
463
|
+
law = 3
|
|
464
|
+
}
|
|
465
|
+
class $hyoo_crowd_peer extends Object {
|
|
466
|
+
readonly key_public: $mol_crypto_auditor_public;
|
|
467
|
+
readonly key_public_serial: string;
|
|
468
|
+
readonly key_private: $mol_crypto_auditor_private;
|
|
469
|
+
readonly key_private_serial: string;
|
|
470
|
+
id: $mol_int62_string;
|
|
471
|
+
constructor(key_public: $mol_crypto_auditor_public, key_public_serial: string, key_private: $mol_crypto_auditor_private, key_private_serial: string);
|
|
472
|
+
static generate(): Promise<$hyoo_crowd_peer>;
|
|
473
|
+
static restore(serial: string): Promise<$hyoo_crowd_peer>;
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
declare namespace $ {
|
|
478
|
+
function $hyoo_sync_peer(path: string): Promise<$hyoo_crowd_peer>;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
declare namespace $ {
|
|
482
|
+
function $mol_wire_solid(): void;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
declare namespace $ {
|
|
486
|
+
class $mol_wrapper extends $mol_object2 {
|
|
487
|
+
static wrap: (task: (...ags: any[]) => any) => (...ags: any[]) => any;
|
|
488
|
+
static run<Result>(task: () => Result): Result;
|
|
489
|
+
static func<Args extends any[], Result, Host = void>(func: (this: Host, ...args: Args) => Result): (this: Host, ...args: Args) => Result;
|
|
490
|
+
static get class(): <Class extends new (...args: any[]) => any>(Class: Class) => Class;
|
|
491
|
+
static get method(): (obj: object, name: PropertyKey, descr: PropertyDescriptor) => PropertyDescriptor;
|
|
492
|
+
static get field(): <Host, Field extends keyof Host, Args extends any[], Result>(obj: Host, name: Field, descr: TypedPropertyDescriptor<Result>) => TypedPropertyDescriptor<Result>;
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
declare namespace $ {
|
|
497
|
+
class $mol_memo extends $mol_wrapper {
|
|
498
|
+
static wrap<This extends object, Value>(task: (this: This, next?: Value) => Value): (this: This, next?: Value) => Value | undefined;
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
declare namespace $ {
|
|
503
|
+
type $mol_data_value<Input = any, Output = any> = (val: Input) => Output;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
declare namespace $ {
|
|
507
|
+
function $mol_data_setup<Value extends $mol_data_value, Config = never>(value: Value, config: Config): Value & {
|
|
508
|
+
config: Config;
|
|
509
|
+
Value: ReturnType<Value>;
|
|
510
|
+
};
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
declare namespace $ {
|
|
514
|
+
function $mol_diff_path<Item>(...paths: Item[][]): {
|
|
515
|
+
prefix: Item[];
|
|
516
|
+
suffix: Item[][];
|
|
517
|
+
};
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
declare namespace $ {
|
|
521
|
+
class $mol_error_mix extends Error {
|
|
522
|
+
errors: Error[];
|
|
523
|
+
constructor(message: string, ...errors: Error[]);
|
|
524
|
+
toJSON(): string;
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
declare namespace $ {
|
|
529
|
+
class $mol_data_error extends $mol_error_mix {
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
declare namespace $ {
|
|
534
|
+
function $mol_data_enum<Dict extends Record<number | string, number | string>>(name: string, dict: Dict): ((value: Dict[keyof Dict]) => Dict[keyof Dict]) & {
|
|
535
|
+
config: {
|
|
536
|
+
name: string;
|
|
537
|
+
dict: Dict;
|
|
538
|
+
};
|
|
539
|
+
Value: Dict[keyof Dict];
|
|
540
|
+
};
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
declare namespace $ {
|
|
544
|
+
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';
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
declare namespace $ {
|
|
548
|
+
function $mol_charset_decode(buffer: BufferSource, encoding?: $mol_charset_encoding): string;
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
declare namespace $ {
|
|
552
|
+
type $hyoo_crowd_unit_id = `${$mol_int62_string}!${$mol_int62_string}`;
|
|
553
|
+
enum $hyoo_crowd_unit_kind {
|
|
554
|
+
grab = 0,
|
|
555
|
+
join = 1,
|
|
556
|
+
give = 2,
|
|
557
|
+
data = 3
|
|
558
|
+
}
|
|
559
|
+
enum $hyoo_crowd_unit_group {
|
|
560
|
+
auth = 0,
|
|
561
|
+
data = 1
|
|
562
|
+
}
|
|
563
|
+
class $hyoo_crowd_unit extends Object {
|
|
564
|
+
readonly land: $mol_int62_string;
|
|
565
|
+
readonly auth: $mol_int62_string;
|
|
566
|
+
readonly head: $mol_int62_string;
|
|
567
|
+
readonly self: $mol_int62_string;
|
|
568
|
+
readonly next: $mol_int62_string;
|
|
569
|
+
readonly prev: $mol_int62_string;
|
|
570
|
+
readonly time: number;
|
|
571
|
+
readonly data: unknown;
|
|
572
|
+
bin: $hyoo_crowd_unit_bin | null;
|
|
573
|
+
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);
|
|
574
|
+
kind(): $hyoo_crowd_unit_kind;
|
|
575
|
+
group(): $hyoo_crowd_unit_group;
|
|
576
|
+
level(): $hyoo_crowd_peer_level;
|
|
577
|
+
[Symbol.toPrimitive](): string;
|
|
578
|
+
}
|
|
579
|
+
class $hyoo_crowd_unit_bin extends DataView {
|
|
580
|
+
static from_buffer(buffer: Int16Array): $hyoo_crowd_unit_bin;
|
|
581
|
+
static from_unit(unit: $hyoo_crowd_unit): $hyoo_crowd_unit_bin;
|
|
582
|
+
sign(next?: Uint8Array): Uint8Array;
|
|
583
|
+
size(): number;
|
|
584
|
+
sens(): Uint8Array;
|
|
585
|
+
unit(): $hyoo_crowd_unit;
|
|
586
|
+
}
|
|
587
|
+
function $hyoo_crowd_unit_compare(left: $hyoo_crowd_unit, right: $hyoo_crowd_unit): number;
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
declare namespace $ {
|
|
591
|
+
function $hyoo_crowd_time_now(): number;
|
|
592
|
+
function $hyoo_crowd_time_stamp(time: number): number;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
declare namespace $ {
|
|
596
|
+
class $hyoo_crowd_clock extends Map<$mol_int62_string, number> {
|
|
597
|
+
static begin: number;
|
|
598
|
+
last_time: number;
|
|
599
|
+
constructor(entries?: Iterable<readonly [$mol_int62_string, number]>);
|
|
600
|
+
sync(right: $hyoo_crowd_clock): void;
|
|
601
|
+
see_time(time: number): void;
|
|
602
|
+
see_peer(peer: $mol_int62_string, time: number): void;
|
|
603
|
+
see_bin(bin: $hyoo_crowd_clock_bin, group: $hyoo_crowd_unit_group): void;
|
|
604
|
+
fresh(peer: $mol_int62_string, time: number): boolean;
|
|
605
|
+
ahead(clock: $hyoo_crowd_clock): boolean;
|
|
606
|
+
time(peer: $mol_int62_string): number;
|
|
607
|
+
now(): number;
|
|
608
|
+
last_stamp(): number;
|
|
609
|
+
tick(peer: $mol_int62_string): number;
|
|
610
|
+
}
|
|
611
|
+
class $hyoo_crowd_clock_bin extends DataView {
|
|
612
|
+
static from(land_id: $mol_int62_string, clocks: readonly [$hyoo_crowd_clock, $hyoo_crowd_clock]): $hyoo_crowd_clock_bin;
|
|
613
|
+
land(): `${string}_${string}`;
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
declare namespace $ {
|
|
618
|
+
class $hyoo_crowd_node extends $mol_object2 {
|
|
619
|
+
readonly land: $hyoo_crowd_land;
|
|
620
|
+
readonly head: $mol_int62_string;
|
|
621
|
+
constructor(land?: $hyoo_crowd_land, head?: $mol_int62_string);
|
|
622
|
+
static for<Node extends typeof $hyoo_crowd_node>(this: Node, land: $hyoo_crowd_land, head: $mol_int62_string): InstanceType<Node>;
|
|
623
|
+
static toJSON(): string;
|
|
624
|
+
id(): `${string}_${string}`;
|
|
625
|
+
world(): $hyoo_crowd_world | null;
|
|
626
|
+
as<Node extends typeof $hyoo_crowd_node>(Node: Node): InstanceType<Node>;
|
|
627
|
+
units(): readonly $hyoo_crowd_unit[];
|
|
628
|
+
nodes<Node extends typeof $hyoo_crowd_node>(Node: Node): InstanceType<Node>[];
|
|
629
|
+
virgin(): boolean;
|
|
630
|
+
[Symbol.toPrimitive](): string;
|
|
631
|
+
toJSON(): `${string}_${string}`;
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
declare namespace $ {
|
|
636
|
+
class $hyoo_crowd_reg extends $hyoo_crowd_node {
|
|
637
|
+
value(next?: unknown): {} | null;
|
|
638
|
+
str(next?: string): string;
|
|
639
|
+
numb(next?: number): number;
|
|
640
|
+
bool(next?: boolean): boolean;
|
|
641
|
+
yoke(law?: readonly ("" | `${string}_${string}`)[], mod?: readonly ("" | `${string}_${string}`)[], add?: readonly ("" | `${string}_${string}`)[]): $hyoo_crowd_land | null;
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
declare namespace $ {
|
|
646
|
+
class $hyoo_crowd_struct extends $hyoo_crowd_node {
|
|
647
|
+
sub<Node extends typeof $hyoo_crowd_node>(key: string, Node: Node): InstanceType<Node>;
|
|
648
|
+
yoke<Node extends typeof $hyoo_crowd_node>(key: string, Node: Node, law?: readonly ("" | `${string}_${string}`)[], mod?: readonly ("" | `${string}_${string}`)[], add?: readonly ("" | `${string}_${string}`)[]): InstanceType<Node> | null;
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
declare namespace $ {
|
|
653
|
+
function $mol_const<Value>(value: Value): {
|
|
654
|
+
(): Value;
|
|
655
|
+
'()': Value;
|
|
656
|
+
};
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
declare namespace $ {
|
|
660
|
+
class $hyoo_crowd_land extends $mol_object {
|
|
661
|
+
id(): `${string}_${string}`;
|
|
662
|
+
toJSON(): `${string}_${string}`;
|
|
663
|
+
peer(): $hyoo_crowd_peer;
|
|
664
|
+
peer_id(): `${string}_${string}`;
|
|
665
|
+
world(): $hyoo_crowd_world | null;
|
|
666
|
+
get clock_auth(): $hyoo_crowd_clock;
|
|
667
|
+
get clock_data(): $hyoo_crowd_clock;
|
|
668
|
+
get clocks(): readonly [$hyoo_crowd_clock, $hyoo_crowd_clock];
|
|
669
|
+
readonly pub: $mol_wire_pub;
|
|
670
|
+
readonly _clocks: readonly [$hyoo_crowd_clock, $hyoo_crowd_clock];
|
|
671
|
+
_unit_all: Map<`${string}_${string}!${string}_${string}`, $hyoo_crowd_unit>;
|
|
672
|
+
unit(head: $mol_int62_string, self: $mol_int62_string): $hyoo_crowd_unit | undefined;
|
|
673
|
+
_unit_lists: Map<`${string}_${string}`, ($hyoo_crowd_unit[] & {
|
|
674
|
+
dirty: boolean;
|
|
675
|
+
}) | undefined>;
|
|
676
|
+
_unit_alives: Map<`${string}_${string}`, $hyoo_crowd_unit[] | undefined>;
|
|
677
|
+
size(): number;
|
|
678
|
+
unit_list(head: $mol_int62_string): $hyoo_crowd_unit[] & {
|
|
679
|
+
dirty: boolean;
|
|
680
|
+
};
|
|
681
|
+
unit_alives(head: $mol_int62_string): readonly $hyoo_crowd_unit[];
|
|
682
|
+
node<Node extends typeof $hyoo_crowd_node>(head: $mol_int62_string, Node: Node): InstanceType<Node>;
|
|
683
|
+
chief: $hyoo_crowd_struct;
|
|
684
|
+
id_new(): $mol_int62_string;
|
|
685
|
+
fork(auth: $hyoo_crowd_peer): $hyoo_crowd_land;
|
|
686
|
+
delta(clocks?: readonly [$hyoo_crowd_clock, $hyoo_crowd_clock]): readonly $hyoo_crowd_unit[];
|
|
687
|
+
resort(head: $mol_int62_string): $hyoo_crowd_unit[] & {
|
|
688
|
+
dirty: boolean;
|
|
689
|
+
};
|
|
690
|
+
apply(delta: readonly $hyoo_crowd_unit[]): this;
|
|
691
|
+
_joined: boolean;
|
|
692
|
+
join(): true | undefined;
|
|
693
|
+
leave(): false | undefined;
|
|
694
|
+
allowed_add(peer?: `${string}_${string}`): boolean;
|
|
695
|
+
allowed_mod(peer?: `${string}_${string}`): boolean;
|
|
696
|
+
allowed_law(peer?: `${string}_${string}`): boolean;
|
|
697
|
+
level_base(next?: $hyoo_crowd_peer_level): void;
|
|
698
|
+
level(peer: $mol_int62_string | '', next?: $hyoo_crowd_peer_level): $hyoo_crowd_peer_level;
|
|
699
|
+
grabbed(): boolean;
|
|
700
|
+
peers(): readonly `${string}_${string}`[];
|
|
701
|
+
residents(): readonly `${string}_${string}`[];
|
|
702
|
+
authors(): Set<`${string}_${string}`>;
|
|
703
|
+
steal_rights(donor: $hyoo_crowd_land): void;
|
|
704
|
+
first_stamp(): number | null;
|
|
705
|
+
last_stamp(): number;
|
|
706
|
+
selection(peer: $mol_int62_string): $hyoo_crowd_reg;
|
|
707
|
+
put(head: $mol_int62_string, self: $mol_int62_string, prev: $mol_int62_string, data: unknown): $hyoo_crowd_unit;
|
|
708
|
+
wipe(unit: $hyoo_crowd_unit): $hyoo_crowd_unit;
|
|
709
|
+
move(unit: $hyoo_crowd_unit, head: $mol_int62_string, prev: $mol_int62_string): void;
|
|
710
|
+
insert(unit: $hyoo_crowd_unit, head: $mol_int62_string, seat: number): void;
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
declare namespace $ {
|
|
715
|
+
let $mol_action: typeof $mol_wire_method;
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
declare namespace $ {
|
|
719
|
+
class $hyoo_crowd_fund<Node extends typeof $hyoo_crowd_node> extends $mol_object {
|
|
720
|
+
world: $hyoo_crowd_world;
|
|
721
|
+
Node: Node;
|
|
722
|
+
constructor(world: $hyoo_crowd_world, Node: Node);
|
|
723
|
+
Item(id: $mol_int62_string | `${$mol_int62_string}!${$mol_int62_string}`): InstanceType<Node>;
|
|
724
|
+
make(law?: readonly ("" | `${string}_${string}`)[], mod?: readonly ("" | `${string}_${string}`)[], add?: readonly ("" | `${string}_${string}`)[]): InstanceType<Node>;
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
declare namespace $ {
|
|
729
|
+
let $mol_dict_key: typeof $mol_key;
|
|
730
|
+
class $mol_dict<Key, Value> extends Map<Key, Value> {
|
|
731
|
+
get(key: Key): Value | undefined;
|
|
732
|
+
has(key: Key): boolean;
|
|
733
|
+
set(key: Key, value: Value): this;
|
|
734
|
+
delete(key: Key): boolean;
|
|
735
|
+
forEach(back: (value: Value, key: Key, dict: Map<Key, Value>) => void, context?: any): void;
|
|
736
|
+
keys(): {
|
|
737
|
+
[Symbol.iterator](): any;
|
|
738
|
+
next(): IteratorReturnResult<any> | IteratorYieldResult<Key>;
|
|
739
|
+
};
|
|
740
|
+
entries(): {
|
|
741
|
+
[Symbol.iterator](): any;
|
|
742
|
+
next(): IteratorReturnResult<any> | IteratorYieldResult<[Key, Value]>;
|
|
743
|
+
};
|
|
744
|
+
[Symbol.iterator](): {
|
|
745
|
+
[Symbol.iterator](): any;
|
|
746
|
+
next(): IteratorReturnResult<any> | IteratorYieldResult<[Key, Value]>;
|
|
747
|
+
};
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
declare namespace $ {
|
|
752
|
+
class $hyoo_crowd_world extends $mol_object {
|
|
753
|
+
readonly peer?: $hyoo_crowd_peer | undefined;
|
|
754
|
+
constructor(peer?: $hyoo_crowd_peer | undefined);
|
|
755
|
+
readonly lands_pub: $mol_wire_pub;
|
|
756
|
+
_lands: Map<`${string}_${string}`, $hyoo_crowd_land>;
|
|
757
|
+
get lands(): Map<`${string}_${string}`, $hyoo_crowd_land>;
|
|
758
|
+
land_init(id: $hyoo_crowd_land): void;
|
|
759
|
+
land(id: $mol_int62_string): $hyoo_crowd_land;
|
|
760
|
+
land_sync(id: $mol_int62_string): $hyoo_crowd_land;
|
|
761
|
+
Fund<Item extends typeof $hyoo_crowd_node>(Item: Item): $hyoo_crowd_fund<Item>;
|
|
762
|
+
home(): $hyoo_crowd_land;
|
|
763
|
+
_knights: $mol_dict<`${string}_${string}`, $hyoo_crowd_peer>;
|
|
764
|
+
_signs: WeakMap<$hyoo_crowd_unit, Uint8Array>;
|
|
765
|
+
grab(law?: readonly ("" | `${string}_${string}`)[], mod?: readonly ("" | `${string}_${string}`)[], add?: readonly ("" | `${string}_${string}`)[]): Promise<$hyoo_crowd_land>;
|
|
766
|
+
sign_units(units: readonly $hyoo_crowd_unit[]): Promise<$hyoo_crowd_unit[]>;
|
|
767
|
+
delta_land(land: $hyoo_crowd_land, clocks?: readonly [$hyoo_crowd_clock, $hyoo_crowd_clock]): Promise<$hyoo_crowd_unit[]>;
|
|
768
|
+
delta_batch(land: $hyoo_crowd_land, clocks?: readonly [$hyoo_crowd_clock, $hyoo_crowd_clock]): Promise<Uint8Array>;
|
|
769
|
+
delta(clocks?: Map<`${string}_${string}`, readonly [$hyoo_crowd_clock, $hyoo_crowd_clock]>): AsyncGenerator<Uint8Array, void, unknown>;
|
|
770
|
+
merge(donor: $hyoo_crowd_world): Promise<void>;
|
|
771
|
+
apply(delta: Uint8Array): Promise<{
|
|
772
|
+
allow: $hyoo_crowd_unit[];
|
|
773
|
+
forbid: Map<$hyoo_crowd_unit, string>;
|
|
774
|
+
}>;
|
|
775
|
+
audit_delta(land: $hyoo_crowd_land, delta: $hyoo_crowd_unit[]): Promise<{
|
|
776
|
+
allow: $hyoo_crowd_unit[];
|
|
777
|
+
forbid: Map<$hyoo_crowd_unit, string>;
|
|
778
|
+
}>;
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
declare namespace $ {
|
|
783
|
+
function $mol_promise<Result = void>(): Promise<Result> & {
|
|
784
|
+
done: (res: Result | PromiseLike<Result>) => void;
|
|
785
|
+
fail: (error?: any) => void;
|
|
786
|
+
};
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
declare namespace $ {
|
|
790
|
+
class $mol_after_timeout extends $mol_object2 {
|
|
791
|
+
delay: number;
|
|
792
|
+
task: () => void;
|
|
793
|
+
id: any;
|
|
794
|
+
constructor(delay: number, task: () => void);
|
|
795
|
+
destructor(): void;
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
declare namespace $ {
|
|
800
|
+
function $mol_wait_timeout_async(this: $, timeout: number): Promise<void> & {
|
|
801
|
+
done: (res: void | PromiseLike<void>) => void;
|
|
802
|
+
fail: (error?: any) => void;
|
|
803
|
+
} & {
|
|
804
|
+
destructor: () => void;
|
|
805
|
+
};
|
|
806
|
+
function $mol_wait_timeout(this: $, timeout: number): void;
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
declare namespace $ {
|
|
810
|
+
function $mol_wire_race<Tasks extends ((...args: any) => any)[]>(...tasks: Tasks): {
|
|
811
|
+
[index in keyof Tasks]: index extends number ? ReturnType<Tasks[index]> : Tasks[index];
|
|
812
|
+
};
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
declare namespace $ {
|
|
816
|
+
type $mol_log3_event<Fields> = {
|
|
817
|
+
[key in string]: unknown;
|
|
818
|
+
} & {
|
|
819
|
+
time?: string;
|
|
820
|
+
place: unknown;
|
|
821
|
+
message: string;
|
|
822
|
+
} & Fields;
|
|
823
|
+
type $mol_log3_logger<Fields, Res = void> = (this: $, event: $mol_log3_event<Fields>) => Res;
|
|
824
|
+
let $mol_log3_come: $mol_log3_logger<{}>;
|
|
825
|
+
let $mol_log3_done: $mol_log3_logger<{}>;
|
|
826
|
+
let $mol_log3_fail: $mol_log3_logger<{}>;
|
|
827
|
+
let $mol_log3_warn: $mol_log3_logger<{
|
|
828
|
+
hint: string;
|
|
829
|
+
}>;
|
|
830
|
+
let $mol_log3_rise: $mol_log3_logger<{}>;
|
|
831
|
+
let $mol_log3_area: $mol_log3_logger<{}, () => void>;
|
|
832
|
+
function $mol_log3_area_lazy(this: $, event: $mol_log3_event<{}>): () => void;
|
|
833
|
+
let $mol_log3_stack: (() => void)[];
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
declare namespace $ {
|
|
837
|
+
type $mol_type_keys_extract<Input, Upper> = {
|
|
838
|
+
[Field in keyof Input]: unknown extends Input[Field] ? never : Input[Field] extends never ? never : Input[Field] extends Upper ? Field : never;
|
|
839
|
+
}[keyof Input];
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
declare namespace $ {
|
|
843
|
+
function $mol_log3_web_make(level: $mol_type_keys_extract<Console, Function>, color: string): (this: $, event: $mol_log3_event<{}>) => () => void;
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
declare namespace $ {
|
|
847
|
+
let $hyoo_sync_masters: string[];
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
declare namespace $ {
|
|
851
|
+
function $mol_wire_async<Host extends object>(obj: Host): (Host extends (...args: infer Args) => infer Res ? Res extends Promise<any> ? Host : (...args: Args) => Promise<Res> : {}) & { [key in keyof Host]: Host[key] extends (...args: infer Args_1) => infer Res_1 ? Res_1 extends Promise<any> ? Host[key] : (...args: Args_1) => Promise<Res_1> : Host[key]; };
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
declare namespace $ {
|
|
855
|
+
class $hyoo_sync_yard<Line> extends $mol_object2 {
|
|
856
|
+
log_pack(data: any): any;
|
|
857
|
+
peer(): $hyoo_crowd_peer;
|
|
858
|
+
world(): $hyoo_crowd_world;
|
|
859
|
+
land_init(land: $hyoo_crowd_land): void;
|
|
860
|
+
land(id: $mol_int62_string): $hyoo_crowd_land;
|
|
861
|
+
land_grab(law?: readonly ("" | `${string}_${string}`)[], mod?: readonly ("" | `${string}_${string}`)[], add?: readonly ("" | `${string}_${string}`)[]): $hyoo_crowd_land;
|
|
862
|
+
home(): $hyoo_crowd_land;
|
|
863
|
+
land_search(query: string): `${string}_${string}`[];
|
|
864
|
+
sync(): void;
|
|
865
|
+
land_sync(land: $hyoo_crowd_land): void;
|
|
866
|
+
db_land_clocks(land: $mol_int62_string, next?: readonly [$hyoo_crowd_clock, $hyoo_crowd_clock]): readonly [$hyoo_crowd_clock, $hyoo_crowd_clock] | undefined;
|
|
867
|
+
db_land_sync(land: $hyoo_crowd_land): void;
|
|
868
|
+
db_land_init(land: $hyoo_crowd_land): void;
|
|
869
|
+
db_land_load(land: $hyoo_crowd_land): Promise<$hyoo_crowd_unit[]>;
|
|
870
|
+
db_land_search(from: string | number, to?: string | number): Promise<Set<`${string}_${string}`>>;
|
|
871
|
+
db_land_save(land: $hyoo_crowd_land, units: readonly $hyoo_crowd_unit[]): Promise<void>;
|
|
872
|
+
master_cursor(next?: number): number;
|
|
873
|
+
master_link(): string;
|
|
874
|
+
master(): any;
|
|
875
|
+
server(): any;
|
|
876
|
+
slaves(next?: readonly Line[]): readonly Line[];
|
|
877
|
+
line_lands(line: Line, next?: $hyoo_crowd_land[]): $hyoo_crowd_land[];
|
|
878
|
+
line_land_clocks({ line, land }: {
|
|
879
|
+
line: Line;
|
|
880
|
+
land: $hyoo_crowd_land;
|
|
881
|
+
}, next?: readonly [$hyoo_crowd_clock, $hyoo_crowd_clock]): readonly [$hyoo_crowd_clock, $hyoo_crowd_clock] | undefined;
|
|
882
|
+
line_sync(line: Line): void;
|
|
883
|
+
line_land_sync({ line, land }: {
|
|
884
|
+
line: Line;
|
|
885
|
+
land: $hyoo_crowd_land;
|
|
886
|
+
}): void;
|
|
887
|
+
line_land_init({ line, land }: {
|
|
888
|
+
line: Line;
|
|
889
|
+
land: $hyoo_crowd_land;
|
|
890
|
+
}): void;
|
|
891
|
+
line_land_neck({ line, land }: {
|
|
892
|
+
line: Line;
|
|
893
|
+
land: $mol_int62_string;
|
|
894
|
+
}, next?: Promise<any>[]): Promise<any>[];
|
|
895
|
+
line_receive(line: Line, message: Uint8Array): Promise<void>;
|
|
896
|
+
line_send_clocks(line: Line, land: $hyoo_crowd_land): void;
|
|
897
|
+
line_send_units(line: Line, units: readonly $hyoo_crowd_unit[]): Promise<void>;
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
declare namespace $ {
|
|
902
|
+
function $mol_db_response<Result>(request: IDBRequest<Result>): Promise<Result>;
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
declare namespace $ {
|
|
906
|
+
class $mol_db_store<Schema extends $mol_db_store_schema> {
|
|
907
|
+
readonly native: IDBObjectStore;
|
|
908
|
+
constructor(native: IDBObjectStore);
|
|
909
|
+
get name(): string;
|
|
910
|
+
get path(): string | string[];
|
|
911
|
+
get incremental(): boolean;
|
|
912
|
+
get indexes(): Schema["Indexes"] extends infer T ? { [Name in keyof T]: $mol_db_index<{
|
|
913
|
+
Key: Schema["Indexes"][Name];
|
|
914
|
+
Doc: Schema['Doc'];
|
|
915
|
+
}>; } : never;
|
|
916
|
+
index_make(name: string, path?: string[], unique?: boolean, multiEntry?: boolean): IDBIndex;
|
|
917
|
+
index_drop(name: string): this;
|
|
918
|
+
get transaction(): $mol_db_transaction<$mol_db_schema>;
|
|
919
|
+
get db(): $mol_db_database<$mol_db_schema>;
|
|
920
|
+
clear(): Promise<undefined>;
|
|
921
|
+
count(keys?: Schema['Key'] | IDBKeyRange): Promise<number>;
|
|
922
|
+
put(doc: Schema['Doc'], key?: Schema['Key']): Promise<IDBValidKey>;
|
|
923
|
+
get(key: Schema['Key']): Promise<Schema["Doc"] | undefined>;
|
|
924
|
+
select(key?: Schema['Key'] | IDBKeyRange | null, count?: number): Promise<Schema["Doc"][]>;
|
|
925
|
+
drop(keys: Schema['Key'] | IDBKeyRange): Promise<undefined>;
|
|
926
|
+
}
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
declare namespace $ {
|
|
930
|
+
type $mol_db_store_schema = {
|
|
931
|
+
Key: IDBValidKey;
|
|
932
|
+
Doc: unknown;
|
|
933
|
+
Indexes: Record<string, IDBValidKey[]>;
|
|
934
|
+
};
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
declare namespace $ {
|
|
938
|
+
class $mol_db_index<Schema extends $mol_db_index_schema> {
|
|
939
|
+
readonly native: IDBIndex;
|
|
940
|
+
constructor(native: IDBIndex);
|
|
941
|
+
get name(): string;
|
|
942
|
+
get paths(): string[];
|
|
943
|
+
get unique(): boolean;
|
|
944
|
+
get multiple(): boolean;
|
|
945
|
+
get store(): $mol_db_store<$mol_db_store_schema>;
|
|
946
|
+
get transaction(): $mol_db_transaction<$mol_db_schema>;
|
|
947
|
+
get db(): $mol_db_database<$mol_db_schema>;
|
|
948
|
+
count(keys?: Schema['Key'] | IDBKeyRange): Promise<number>;
|
|
949
|
+
get(key: Schema['Key']): Promise<Schema["Doc"] | undefined>;
|
|
950
|
+
select(key?: Schema['Key'] | IDBKeyRange | null, count?: number): Promise<Schema["Doc"][]>;
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
declare namespace $ {
|
|
955
|
+
type $mol_db_index_schema = {
|
|
956
|
+
Key: IDBValidKey[];
|
|
957
|
+
Doc: unknown;
|
|
958
|
+
};
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
declare namespace $ {
|
|
962
|
+
function $mol_db<Schema extends $mol_db_schema>(this: $, name: string, ...migrations: ((transaction: $mol_db_transaction<$mol_db_schema>) => void)[]): Promise<$mol_db_database<Schema>>;
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
declare namespace $ {
|
|
966
|
+
type $mol_db_schema = Record<string, $mol_db_store_schema>;
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
declare namespace $ {
|
|
970
|
+
function $mol_wire_probe<Value>(task: () => Value, next?: Value): Value | undefined;
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
declare namespace $ {
|
|
974
|
+
class $mol_db_database<Schema extends $mol_db_schema> {
|
|
975
|
+
readonly native: IDBDatabase;
|
|
976
|
+
constructor(native: IDBDatabase);
|
|
977
|
+
get name(): string;
|
|
978
|
+
get version(): number;
|
|
979
|
+
get stores(): (keyof Schema)[];
|
|
980
|
+
read<Names extends Exclude<keyof Schema, symbol | number>>(...names: Names[]): Pick<Schema, Names> extends infer T extends $mol_db_schema ? { [Name in keyof T]: $mol_db_store<Pick<Schema, Names>[Name]>; } : never;
|
|
981
|
+
change<Names extends Exclude<keyof Schema, symbol | number>>(...names: Names[]): $mol_db_transaction<Pick<Schema, Names>>;
|
|
982
|
+
kill(): Promise<IDBDatabase>;
|
|
983
|
+
destructor(): void;
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
interface IDBTransaction {
|
|
988
|
+
commit(): void;
|
|
989
|
+
}
|
|
990
|
+
declare namespace $ {
|
|
991
|
+
class $mol_db_transaction<Schema extends $mol_db_schema> {
|
|
992
|
+
readonly native: IDBTransaction;
|
|
993
|
+
constructor(native: IDBTransaction);
|
|
994
|
+
get stores(): { [Name in keyof Schema]: $mol_db_store<Schema[Name]>; };
|
|
995
|
+
store_make(name: string): IDBObjectStore;
|
|
996
|
+
store_drop(name: string): this;
|
|
997
|
+
abort(): void;
|
|
998
|
+
commit(): Promise<void>;
|
|
999
|
+
get db(): $mol_db_database<$mol_db_schema>;
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
declare namespace $ {
|
|
1004
|
+
class $hyoo_sync_client extends $hyoo_sync_yard<WebSocket | Window> {
|
|
1005
|
+
db(): Promise<$mol_db_database<{
|
|
1006
|
+
Unit: {
|
|
1007
|
+
Key: [$mol_int62_string, $mol_int62_string, $mol_int62_string];
|
|
1008
|
+
Doc: $hyoo_crowd_unit;
|
|
1009
|
+
Indexes: {
|
|
1010
|
+
Land: [$mol_int62_string];
|
|
1011
|
+
Data: [$mol_int62_string];
|
|
1012
|
+
};
|
|
1013
|
+
};
|
|
1014
|
+
}>>;
|
|
1015
|
+
db_land_load(land: $hyoo_crowd_land): Promise<$hyoo_crowd_unit[]>;
|
|
1016
|
+
db_land_search(from: string, to?: string): Promise<Set<`${string}_${string}`>>;
|
|
1017
|
+
db_land_save(land: $hyoo_crowd_land, units: readonly $hyoo_crowd_unit[]): Promise<void>;
|
|
1018
|
+
reconnects(reset?: null): number;
|
|
1019
|
+
master(): WebSocket;
|
|
1020
|
+
line_send_clocks(line: WebSocket | Window, land: $hyoo_crowd_land): void;
|
|
1021
|
+
line_send_units(line: WebSocket | Window, units: readonly $hyoo_crowd_unit[]): Promise<void>;
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
1024
|
+
|
|
1025
|
+
export = $;
|