declare let _$_: { new (): {}; } & typeof globalThis; declare class $ extends _$_ { } declare namespace $ { export type $ = typeof $$; export class $$ extends $ { static $: $; } namespace $$ { type $$ = $; } export {}; } declare namespace $ { const $mol_ambient_ref: unique symbol; /** @deprecated use $ instead */ type $mol_ambient_context = $; function $mol_ambient(this: $ | void, overrides: Partial<$>): $; } declare namespace $ { /** * Proxy that delegates all to lazy returned target. * * $mol_delegate( Array.prototype , ()=> fetch_array() ) */ function $mol_delegate(proto: Value, target: () => Value): Value; } declare namespace $ { const $mol_owning_map: WeakMap; function $mol_owning_allow(having: Having): having is Having & { destructor(): void; }; function $mol_owning_get(having: Having, Owner?: { new (): Owner; }): Owner | null; function $mol_owning_check(owner: Owner, having: Having): having is Having & { destructor(): void; }; function $mol_owning_catch(owner: Owner, having: Having): boolean; } declare namespace $ { function $mol_fail(error: any): never; } declare namespace $ { function $mol_fail_hidden(error: any): never; } declare namespace $ { type $mol_type_writable = { -readonly [P in keyof T]: T[P]; }; } declare namespace $ { function $mol_func_name(this: $, func: Function): string; function $mol_func_name_from(target: Target, source: Function): Target; } declare namespace $ { const $mol_key_handle: unique symbol; const $mol_key_store: WeakMap; } declare namespace $ { class $mol_object2 { static $: $; [Symbol.toStringTag]: string; [$mol_ambient_ref]: $; get $(): $; set $(next: $); static create(this: new (init?: (instance: any) => void) => Instance, init?: (instance: $mol_type_writable) => void): Instance; static [Symbol.toPrimitive](): any; static toString(): any; static toJSON(): any; static [$mol_key_handle](): any; destructor(): void; static destructor(): void; [Symbol.dispose](): void; toString(): string; } } declare namespace $ { namespace $$ { } const $mol_object_field: unique symbol; class $mol_object extends $mol_object2 { static make(this: This, config: Partial>): InstanceType; } } declare namespace $ { /** Generates unique identifier. */ function $mol_guid(length?: number, exists?: (id: string) => boolean): string; } declare namespace $ { /** Special status statuses. */ enum $mol_wire_cursor { /** Update required. */ stale = -1, /** Some of (transitive) pub update required. */ doubt = -2, /** Actual state but may be dropped. */ fresh = -3, /** State will never be changed. */ final = -4 } } declare namespace $ { /** * Collects subscribers in compact array. 28B */ class $mol_wire_pub extends Object { constructor(id?: string); [Symbol.toStringTag]: string; data: unknown[]; static get [Symbol.species](): ArrayConstructor; /** * Index of first subscriber. */ protected sub_from: number; /** * All current subscribers. */ get sub_list(): readonly $mol_wire_sub[]; /** * Has any subscribers or not. */ get sub_empty(): boolean; /** * Subscribe subscriber to this publisher events and return position of subscriber that required to unsubscribe. */ sub_on(sub: $mol_wire_pub, pub_pos: number): number; /** * Unsubscribe subscriber from this publisher events by subscriber position provided by `on(pub)`. */ sub_off(sub_pos: number): void; /** * Called when last sub was unsubscribed. **/ reap(): void; /** * Autowire this publisher with current subscriber. **/ promote(): void; /** * Enforce actualization. Should not throw errors. */ fresh(): void; /** * Allow to put data to caches in the subtree. */ complete(): void; get incompleted(): boolean; /** * Notify subscribers about self changes. */ emit(quant?: $mol_wire_cursor): void; /** * Moves peer from one position to another. Doesn't clear data at old position! */ peer_move(from_pos: number, to_pos: number): void; /** * Updates self position in the peer. */ peer_repos(peer_pos: number, self_pos: number): void; } } declare namespace $ { /** Generic subscriber interface */ interface $mol_wire_sub extends $mol_wire_pub { temp: boolean; pub_list: $mol_wire_pub[]; /** * Begin auto wire to publishers. * Returns previous auto subscriber that must me transfer to the `end`. */ track_on(): $mol_wire_sub | null; /** * Returns next auto wired publisher. It can be easely repormoted. * Or promotes next publisher to auto wire its togeter. * Must be used only between `track_on` and `track_off`. */ track_next(pub?: $mol_wire_pub): $mol_wire_pub | null; pub_off(pub_pos: number): void; /** * Unsubscribes from unpromoted publishers. */ track_cut(sub: $mol_wire_pub | null): void; /** * Ends auto wire to publishers. */ track_off(sub: $mol_wire_pub | null): void; /** * Receive notification about publisher changes. */ absorb(quant: $mol_wire_cursor, pos: number): void; /** * Unsubscribes from all publishers. */ destructor(): void; } } declare namespace $ { let $mol_wire_auto_sub: $mol_wire_sub | null; /** * When fulfilled, all publishers are promoted to this subscriber on access to its. */ function $mol_wire_auto(next?: $mol_wire_sub | null): $mol_wire_sub | null; /** * Affection queue. Used to prevent accidental stack overflow on emit. */ const $mol_wire_affected: ($mol_wire_sub | number)[]; } declare namespace $ { function $mol_dev_format_register(config: { header: (val: any, config: any) => any; hasBody: (val: any, config: any) => false; } | { header: (val: any, config: any) => any; hasBody: (val: any, config: any) => boolean; body: (val: any, config: any) => any; }): void; const $mol_dev_format_head: unique symbol; const $mol_dev_format_body: unique symbol; function $mol_dev_format_native(obj: any): any[]; function $mol_dev_format_auto(obj: any): any[]; function $mol_dev_format_element(element: string, style: object, ...content: any[]): any[]; let $mol_dev_format_span: (style: object, ...content: any[]) => any[]; let $mol_dev_format_div: (style: object, ...content: any[]) => any[]; let $mol_dev_format_ol: (style: object, ...content: any[]) => any[]; let $mol_dev_format_li: (style: object, ...content: any[]) => any[]; let $mol_dev_format_table: (style: object, ...content: any[]) => any[]; let $mol_dev_format_tr: (style: object, ...content: any[]) => any[]; let $mol_dev_format_td: (style: object, ...content: any[]) => any[]; let $mol_dev_format_accent: (...args: any[]) => any[]; let $mol_dev_format_strong: (...args: any[]) => any[]; let $mol_dev_format_string: (...args: any[]) => any[]; let $mol_dev_format_shade: (...args: any[]) => any[]; let $mol_dev_format_indent: (...args: any[]) => any[]; } declare namespace $ { /** * Publisher that can auto collect other publishers. 32B * * P1 P2 P3 P4 S1 S2 S3 * ^ ^ * pubs_from subs_from */ class $mol_wire_pub_sub extends $mol_wire_pub implements $mol_wire_sub { protected pub_from: number; protected cursor: $mol_wire_cursor; get temp(): boolean; get pub_list(): $mol_wire_pub[]; track_on(): $mol_wire_sub | null; promote(): void; track_next(pub?: $mol_wire_pub): $mol_wire_pub | null; track_off(sub: $mol_wire_sub | null): void; pub_off(sub_pos: number): void; destructor(): void; track_cut(): void; complete(): void; complete_pubs(): void; absorb(quant?: $mol_wire_cursor, pos?: number): void; [$mol_dev_format_head](): any[]; /** * Is subscribed to any publisher or not. */ get pub_empty(): boolean; } } declare namespace $ { class $mol_after_tick extends $mol_object2 { task: () => void; static promise: Promise | null; cancelled: boolean; constructor(task: () => void); destructor(): void; } } declare namespace $ { function $mol_promise_like(val: any): val is Promise; } declare namespace $ { /** * Suspendable task with support both sync/async api. * * A1 A2 A3 A4 P1 P2 P3 P4 S1 S2 S3 * ^ ^ ^ * args_from pubs_from subs_from **/ abstract class $mol_wire_fiber extends $mol_wire_pub_sub { readonly task: (this: Host, ...args: Args) => Result; readonly host?: Host | undefined; static warm: boolean; static planning: Set<$mol_wire_fiber>; static reaping: Set<$mol_wire_fiber>; static plan_task: $mol_after_tick | null; static plan(): void; static sync(): void; cache: Result | Error | Promise; get args(): Args; result(): Result | undefined; get incompleted(): boolean; field(): string; constructor(id: string, task: (this: Host, ...args: Args) => Result, host?: Host | undefined, args?: Args); plan(): this; reap(): void; toString(): string; toJSON(): string; [$mol_dev_format_head](): any[]; [$mol_dev_format_body](): null; get $(): any; emit(quant?: $mol_wire_cursor): void; fresh(): this | undefined; refresh(): void; abstract put(next: Result | Error | Promise): Result | Error | Promise; /** * Synchronous execution. Throws Promise when waits async task (SuspenseAPI provider). * Should be called inside SuspenseAPI consumer (ie fiber). */ sync(): Awaited; /** * Asynchronous execution. * It's SuspenseAPI consumer. So SuspenseAPI providers can be called inside. */ async_raw(): Promise; async(): Promise & { destructor(): void; }; step(): Promise; destructor(): void; } } declare namespace $ { let $mol_compare_deep_cache: WeakMap>; /** * Deeply compares two values. Returns true if equal. * Define `Symbol.toPrimitive` to customize. */ function $mol_compare_deep(left: Value, right: Value): boolean; } declare namespace $ { /** Logger event data */ type $mol_log3_event = { [key in string]: unknown; } & { /** Time of event creation */ time?: string; /** Place of event creation */ place: unknown; /** Short description of event */ message: string; } & Fields; /** Logger function */ type $mol_log3_logger = (this: $, event: $mol_log3_event) => Res; /** Log begin of some task */ let $mol_log3_come: $mol_log3_logger<{}>; /** Log end of some task */ let $mol_log3_done: $mol_log3_logger<{}>; /** Log error */ let $mol_log3_fail: $mol_log3_logger<{}>; /** Log warning message */ let $mol_log3_warn: $mol_log3_logger<{ hint: string; }>; /** Log some generic event */ let $mol_log3_rise: $mol_log3_logger<{}>; /** Log begin of log group, returns func to close group */ let $mol_log3_area: $mol_log3_logger<{}, () => void>; /** Log begin of collapsed group only when some logged inside, returns func to close group */ function $mol_log3_area_lazy(this: $, event: $mol_log3_event<{}>): () => void; let $mol_log3_stack: (() => void)[]; } declare namespace $ { /** Position in any resource. */ class $mol_span extends $mol_object2 { readonly uri: string; readonly source: string; readonly row: number; readonly col: number; readonly length: number; constructor(uri: string, source: string, row: number, col: number, length: number); /** Span for begin of unknown resource */ static unknown: $mol_span; /** Makes new span for begin of resource. */ static begin(uri: string, source?: string): $mol_span; /** Makes new span for end of resource. */ static end(uri: string, source: string): $mol_span; /** Makes new span for entire resource. */ static entire(uri: string, source: string): $mol_span; toString(): string; toJSON(): { uri: string; row: number; col: number; length: number; }; /** Makes new error for this span. */ error(message: string, Class?: ErrorConstructor): Error; /** Makes new span for same uri. */ span(row: number, col: number, length: number): $mol_span; /** Makes new span after end of this. */ after(length?: number): $mol_span; /** Makes new span between begin and end. */ slice(begin: number, end?: number): $mol_span; } } declare namespace $ { /** Serializes tree to string in tree format. */ function $mol_tree2_to_string(this: $, tree: $mol_tree2): string; } declare namespace $ { function $mol_maybe(value: Value | null | undefined): Value[]; } declare namespace $ { /** Path by types in tree. */ type $mol_tree2_path = Array; /** Hask tool for processing node. */ type $mol_tree2_hack = (input: $mol_tree2, belt: $mol_tree2_belt, context: Context) => readonly $mol_tree2[]; /** Collection of hask tools for processing tree. */ type $mol_tree2_belt = Record>; /** * Abstract Syntax Tree with human readable serialization. * Avoid direct instantiation. Use static factories instead. * @see https://github.com/nin-jin/tree.d */ class $mol_tree2 extends Object { /** Type of structural node, `value` should be empty */ readonly type: string; /** Content of data node, `type` should be empty */ readonly value: string; /** Child nodes */ readonly kids: readonly $mol_tree2[]; /** Position in most far source resource */ readonly span: $mol_span; constructor( /** Type of structural node, `value` should be empty */ type: string, /** Content of data node, `type` should be empty */ value: string, /** Child nodes */ kids: readonly $mol_tree2[], /** Position in most far source resource */ span: $mol_span); /** Makes collection node. */ static list(kids: readonly $mol_tree2[], span?: $mol_span): $mol_tree2; /** Makes new derived collection node. */ list(kids: readonly $mol_tree2[]): $mol_tree2; /** Makes data node for any string. */ static data(value: string, kids?: readonly $mol_tree2[], span?: $mol_span): $mol_tree2; /** Makes new derived data node. */ data(value: string, kids?: readonly $mol_tree2[]): $mol_tree2; /** Makes struct node. */ static struct(type: string, kids?: readonly $mol_tree2[], span?: $mol_span): $mol_tree2; /** Makes new derived structural node. */ struct(type: string, kids?: readonly $mol_tree2[]): $mol_tree2; /** Makes new derived node with different kids id defined. */ clone(kids: readonly $mol_tree2[], span?: $mol_span): $mol_tree2; /** Returns multiline text content. */ text(): string; /** Parses tree format. */ /** @deprecated Use $mol_tree2_from_string */ static fromString(str: string, uri?: string): $mol_tree2; /** Serializes to tree format. */ toString(): string; /** Makes new tree with node overrided by path. */ insert(value: $mol_tree2 | null, ...path: $mol_tree2_path): $mol_tree2; /** Makes new tree with node overrided by path. */ update(value: readonly $mol_tree2[], ...path: $mol_tree2_path): readonly $mol_tree2[]; /** Query nodes by path. */ select(...path: $mol_tree2_path): $mol_tree2; /** Filter kids by path or value. */ filter(path: string[], value?: string): $mol_tree2; hack_self(belt: $mol_tree2_belt, context?: Context): readonly $mol_tree2[]; /** Transform tree through context with transformers */ hack(belt: $mol_tree2_belt, context?: Context): $mol_tree2[]; /** Makes Error with node coordinates. */ error(message: string, Class?: ErrorConstructor): Error; } class $mol_tree2_empty extends $mol_tree2 { constructor(); } } declare namespace $ { /** Syntax error with cordinates and source line snippet. */ class $mol_error_syntax extends SyntaxError { reason: string; line: string; span: $mol_span; constructor(reason: string, line: string, span: $mol_span); } } declare namespace $ { /** Parses tree format from string. */ function $mol_tree2_from_string(this: $, str: string, uri?: string): $mol_tree2; } declare namespace $ { function $mol_array_chunks(array: readonly Item[], rule: number | ((item: Item, index: number) => boolean)): Item[][]; } declare namespace $ { function $mol_tree2_from_json(json: any, span?: $mol_span): $mol_tree2; } declare namespace $ { /** Module for working with terminal. Text coloring when output in terminal */ class $mol_term_color { static reset: (str: string) => string; static bold: (str: string) => string; static italic: (str: string) => string; static underline: (str: string) => string; static inverse: (str: string) => string; static hidden: (str: string) => string; static strike: (str: string) => string; static gray: (str: string) => string; static red: (str: string) => string; static green: (str: string) => string; static yellow: (str: string) => string; static blue: (str: string) => string; static magenta: (str: string) => string; static cyan: (str: string) => string; static Gray: (str: string) => string; static Red: (str: string) => string; static Green: (str: string) => string; static Yellow: (str: string) => string; static Blue: (str: string) => string; static Magenta: (str: string) => string; static Cyan: (str: string) => string; static ansi(open: number, close: number): (str: string) => string; } } declare namespace $ { function $mol_log3_node_make(level: keyof Console, output: 'stdout' | 'stderr', type: string, color: (str: string) => string): (this: $, event: $mol_log3_event<{}>) => () => void; } declare namespace $ { /** One-shot fiber */ class $mol_wire_task extends $mol_wire_fiber { static getter(task: (this: Host, ...args: Args) => Result): (host: Host, args: Args) => $mol_wire_task; get temp(): boolean; complete(): void; put(next: Result | Error | Promise): Error | Result | Promise; destructor(): void; } } declare namespace $ { /** Convert a pseudo-synchronous (Suspense API) API to an explicit asynchronous one (for integrating with external systems). */ export function $mol_wire_async(obj: Host): ObjectOrFunctionResultPromisify; type FunctionResultPromisify = Some extends (...args: infer Args) => infer Res ? Res extends PromiseLike ? Some : (...args: Args) => Promise : Some; type MethodsResultPromisify = { [K in keyof Host]: FunctionResultPromisify; }; type ObjectOrFunctionResultPromisify = (Some extends (...args: any) => unknown ? FunctionResultPromisify : {}) & (Some extends Object ? MethodsResultPromisify : Some); export {}; } declare namespace $ { function $mol_fail_catch(error: unknown): boolean; } declare namespace $ { function $mol_try(handler: () => Result): Result | Error; } declare namespace $ { function $mol_fail_log(error: unknown): boolean; } declare namespace $ { /** Returns string key for any value. */ function $mol_key(value: Value): string; } declare namespace $ { class $mol_after_timeout extends $mol_object2 { delay: number; task: () => void; id: any; constructor(delay: number, task: () => void); destructor(): void; } } declare namespace $ { class $mol_after_frame extends $mol_after_timeout { task: () => void; constructor(task: () => void); } } declare namespace $ { /** * Decorates method to fiber to ensure it is executed only once inside other fiber. */ function $mol_wire_method(host: Host, field: PropertyKey, descr?: TypedPropertyDescriptor<(...args: Args) => any>): { value: (this: Host, ...args: Args) => any; enumerable?: boolean; configurable?: boolean; writable?: boolean; get?: (() => (...args: Args) => any) | undefined; set?: ((value: (...args: Args) => any) => void) | undefined; }; } declare namespace $ { /** * Returns `Tuple` without first element. * * $mol_type_tail<[ 1 , 2 , 3 ]> // [ 2, 3 ] */ type $mol_type_tail = ((...tail: Tuple) => any) extends ((head: any, ...tail: infer Tail) => any) ? Tail : never; } declare namespace $ { /** * Returns last element of `Tuple`. * * $mol_type_tail<[ 1 , 2 , 3 ]> // 3 */ type $mol_type_foot = Tuple['length'] extends 0 ? never : Tuple[$mol_type_tail['length']]; } declare namespace $ { /** Long-living fiber. */ class $mol_wire_atom extends $mol_wire_fiber { static solo(host: Host, task: (this: Host, ...args: Args) => Result): $mol_wire_atom; static plex(host: Host, task: (this: Host, ...args: Args) => Result, key: Args[0]): $mol_wire_atom; static watching: Set<$mol_wire_atom>; static watcher: $mol_after_frame | null; static watch(): void; watch(): void; /** * Update atom value through another temp fiber. */ resync(args: Args): Error | Result | Promise; once(): Awaited; channel(): ((next?: $mol_type_foot) => Awaited) & { atom: $mol_wire_atom; }; destructor(): void; put(next: Result | Error | Promise): Error | Result | Promise; } } declare namespace $ { /** Decorates solo object channel to [mol_wire_atom](../atom/atom.ts). */ export function $mol_wire_solo(host: object, field: string, descr?: TypedPropertyDescriptor<(...args: Args) => any>): TypedPropertyDescriptor<(...args: First_optional) => any>; type First_optional = Args extends [] ? [] : [Args[0] | undefined, ...$mol_type_tail]; export {}; } declare namespace $ { /** Reactive memoizing multiplexed property decorator. */ function $mol_wire_plex(host: object, field: string, descr?: TypedPropertyDescriptor<(...args: Args) => any>): { value: (this: typeof host, ...args: Args) => any; enumerable?: boolean; configurable?: boolean; writable?: boolean; get?: (() => (...args: Args) => any) | undefined; set?: ((value: (...args: Args) => any) => void) | undefined; }; } declare namespace $ { /** * Reactive memoizing solo property decorator from [mol_wire](../wire/README.md) * @example * '@' $mol_mem * name(next?: string) { * return next ?? 'default' * } * @see https://mol.hyoo.ru/#!section=docs/=qxmh6t_sinbmb */ let $mol_mem: typeof $mol_wire_solo; /** * Reactive memoizing multiplexed property decorator [mol_wire](../wire/README.md) * @example * '@' $mol_mem_key * name(id: number, next?: string) { * return next ?? 'default' * } * @see https://mol.hyoo.ru/#!section=docs/=qxmh6t_sinbmb */ let $mol_mem_key: typeof $mol_wire_plex; } declare namespace $ { /** * Convert asynchronous (promise-based) API to synchronous by wrapping function and method calls in a fiber. * @see https://mol.hyoo.ru/#!section=docs/=1fcpsq_1wh0h2 */ export function $mol_wire_sync(obj: Host): ObjectOrFunctionResultAwaited; type FunctionResultAwaited = Some extends (...args: infer Args) => infer Res ? (...args: Args) => Awaited : Some; type ConstructorResultAwaited = Some extends new (...args: infer Args) => infer Res ? new (...args: Args) => Res : {}; type MethodsResultAwaited = { [K in keyof Host]: FunctionResultAwaited; }; type ObjectOrFunctionResultAwaited = (Some extends (...args: any) => unknown ? FunctionResultAwaited : {}) & (Some extends Object ? MethodsResultAwaited & ConstructorResultAwaited : Some); export {}; } declare namespace $ { type $mol_rpc_handlers = Record; type $mol_rpc_methods = { [Key in keyof Obj]: Obj[Key] extends Function ? Obj[Key] : never; }; type $mol_rpc_payload = [name: string, args: readonly unknown[], sender: MessagePort]; class $mol_rpc extends $mol_object { handlers(): Record; handle_async(payload: $mol_rpc_payload): Promise; handle([name, args, sender]: $mol_rpc_payload): void; protected target(): { send(payload: $mol_rpc_payload): void; }; protected fail_callbacks: ((e: unknown) => void)[]; error(next?: [Error]): [Error] | null; call_async(method: string, args: readonly unknown[]): Promise; protected call(method: string, args: readonly unknown[]): unknown; remote(): Remote_handlers; } } declare namespace $ { function $node_internal_check(name: string): boolean; } declare namespace $ { function $node_autoinstall(this: typeof $, name: string): void; } interface $node { [key: string]: any; } declare var $node: $node; declare namespace $ { /** Run code without state changes */ function $mol_wire_probe(task: () => Value, def?: Value): Value | undefined; } declare namespace $ { class $mol_error_mix extends AggregateError { readonly cause: Cause; name: string; constructor(message: string, cause?: Cause, ...errors: readonly Error[]); static [Symbol.toPrimitive](): string; static toString(): string; static make(...params: ConstructorParameters): $mol_error_mix<{}>; } } declare namespace $ { function $mol_env(): Record; } declare namespace $ { } declare namespace $ { type $mol_run_error_context = { pid?: number; stdout: Buffer | string; stderr: Buffer | string; }; class $mol_run_error extends $mol_error_mix<{ timeout_kill?: boolean; pid?: number; signal?: NodeJS.Signals | null; status?: number | null; command: string; dir: string; }> { } const $mol_run_spawn: (...args: Parameters<(typeof $node)["child_process"]["spawn"]>) => import("node:child_process").ChildProcess; const $mol_run_spawn_sync: (...args: Parameters<(typeof $node)["child_process"]["spawnSync"]>) => import("node:child_process").SpawnSyncReturns; type $mol_run_options = { command: readonly string[] | string; dir: string; timeout?: number; env?: Record; }; class $mol_run extends $mol_object { static async_enabled(): boolean; static spawn(options: $mol_run_options): import("node:child_process").SpawnSyncReturns | $mol_run_error_context; static spawn_async({ dir, sync, timeout, command, env }: $mol_run_options & { sync?: boolean; }): import("node:child_process").SpawnSyncReturns | (Promise<$mol_run_error_context> & { destructor: () => void; }); static error_message(res?: $mol_run_error_context): string; } } declare namespace $ { class $mol_rpc_worker extends $mol_rpc { static is_main(): boolean; static threads(): typeof import("node:worker_threads"); threads(): typeof import("node:worker_threads"); uri(): string; options(): import("node:worker_threads").WorkerOptions; worker_data(): unknown; worker(): Promise void; }>; restarts(next?: null): number; protected target(): { send: (payload: $mol_rpc_payload) => void; destructor: () => void; }; toString(): string; receive(data: unknown): void; } } declare namespace $ { /** * Decorates method to fiber to ensure it is executed only once inside other fiber from [mol_wire](../wire/README.md) * @see https://mol.hyoo.ru/#!section=docs/=1fcpsq_1wh0h2 */ let $mol_action: typeof $mol_wire_method; } declare namespace $ { function $mol_error_fence(task: () => Data, fallback: (parent: Error) => Error | Data | PromiseLike, loading?: (parent: PromiseLike) => Error | Data | PromiseLike): Data; } declare namespace $ { type $mol_build_checker_status = 'ready' | 'watching'; type $mol_build_checker_shared = { recheck(): $mol_build_checker_changes | null; }; type $mol_build_checker_remote = { changes(rec: $mol_build_checker_changes): void; status(next: $mol_build_checker_status): void; }; type $mol_build_checker_changes = { writes: [path: string, data: string][]; errors: [path: string, error: string][]; }; type $mol_build_checker_worker_data = { paths: readonly string[]; root: string; options: ReturnType; }; class $mol_build_checker extends $mol_object { paths(): readonly string[]; root(): string; options(): import("typescript").CompilerOptions; protected rpc(): $mol_rpc_worker<$mol_build_checker_remote>; protected worker_data(): Partial<$mol_build_checker_worker_data>; protected remote(): $mol_build_checker_remote; start(): void; protected run(): void; protected versions: Record; protected watchers: Map void>; protected writes: [path: string, data: string][]; protected errors: [filename: string, error: string][]; protected changes_tick: null | undefined | $mol_after_tick; protected changes_cut(): $mol_build_checker_changes | null; changes_flush(): void; protected changes_schedule(): void; protected write_add(path: string, data: string): void; protected error_add(filename: string, error: string): void; protected recheck_internal(): null | undefined; recheck(): $mol_build_checker_changes | null; protected watching(next?: boolean): boolean; protected host(): { destructor: () => void; } | null; } } declare namespace $ { type Constructor = new (...args: any) => any; export const factory_caches: WeakMap>; export let $mol_static: typeof $ & ((constructor: Value) => Value); export {}; } declare namespace $ { type Instances = { [K in keyof Obj]: Obj[K] extends new (...args: any) => infer Instance ? Instance : Obj[K]; }; export let $mol_one: Instances<$> & ((constructor: new (...args: any) => Instance) => Instance); export {}; } declare namespace $ { /** * Returns closure that returns constant value. * @example * const rnd = $mol_const( Math.random() ) */ function $mol_const(value: Value): { (): Value; '()': Value; }; } declare namespace $ { class $mol_lock extends $mol_object { protected promise: null | Promise; wait(): Promise<() => void>; grab(): () => void; } } declare namespace $ { let $mol_mem_cached: typeof $mol_wire_probe; } declare namespace $ { function $mol_compare_array>(a: Value, b: Value): boolean; } declare namespace $ { 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'; } declare namespace $ { function $mol_charset_decode(buffer: AllowSharedBufferSource, encoding?: $mol_charset_encoding): string; } declare namespace $ { /** Temporary buffer. Recursive usage isn't supported. */ function $mol_charset_buffer(size: number): Uint8Array; } declare namespace $ { function $mol_charset_encode(str: string): Uint8Array; function $mol_charset_encode_to(str: string, buf: Uint8Array, from?: number): number; function $mol_charset_encode_size(str: string): number; } declare namespace $ { type $mol_file_transaction_mode = 'create' | 'exists_truncate' | 'exists_fail' | 'read_only' | 'write_only' | 'read_write' | 'append'; type $mol_file_transaction_buffer = ArrayBufferView; class $mol_file_transaction extends $mol_object { path(): string; modes(): readonly $mol_file_transaction_mode[]; write(options: { buffer: ArrayBufferView | string | readonly ArrayBufferView[]; offset?: number | null; length?: number | null; position?: number | null; }): number; read(): Uint8Array; truncate(size: number): void; flush(): void; close(): void; destructor(): void; } } declare namespace $ { /** * Disable reaping of current subscriber */ function $mol_wire_solid(): void; } declare namespace $ { class $mol_file_transaction_node extends $mol_file_transaction { protected descr(): number; write({ buffer, offset, length, position }: { buffer: ArrayBufferView | string | readonly ArrayBufferView[]; offset?: number | null; length?: number | null; position?: number | null; }): number; truncate(size: number): void; read(): Uint8Array; flush(): void; close(): void; } } declare namespace $ { class $mol_file_base extends $mol_object { static absolute(this: This, path: string): InstanceType; static relative(this: This, path: string): InstanceType; static base: string; path(): string; parent(): this; exists_cut(): boolean; protected root(): boolean; protected stat(next?: $mol_file_stat | null, virt?: 'virt'): $mol_file_stat | null; protected static changed: Set<$mol_file_base>; protected static frame: null | $mol_after_timeout; protected static changed_add(type: 'change' | 'rename', path: string): void; /** * Должно быть больше, чем время между событиями от вотчера при записи внешним процессом. * Иначе запуск ресетов паралельно с изменением может привести к неконсистентности. */ static watch_debounce(): number; static flush(): void; protected static watching: boolean; protected static lock: $mol_lock; protected static watch_off(path: string): void; static unwatched(side_effect: () => Result, affected_dir: string): Result; reset(): void; modified(): Date | null; version(): string; protected info(path: string): null | $mol_file_stat; protected ensure(): void; protected drop(): void; protected copy(to: string): void; protected read(): Uint8Array; protected write(buffer: Uint8Array): void; protected kids(): readonly this[]; readable(opts: { start?: number; end?: number; }): ReadableStream>; writable(opts: { start?: number; }): WritableStream>; buffer(next?: Uint8Array): Uint8Array; stat_make(size: number): { readonly type: "file"; readonly size: number; readonly atime: Date; readonly mtime: Date; readonly ctime: Date; }; clone(to: string): this | null; watcher(): { destructor(): void; }; exists(next?: boolean): boolean; type(): "" | $mol_file_type; name(): string; ext(): string; text(next?: string, virt?: 'virt'): string; text_int(next?: string, virt?: 'virt'): string; sub(reset?: null): this[]; resolve(path: string): this; relate(base?: $mol_file_base): string; find(include?: RegExp, exclude?: RegExp): this[]; size(): number; toJSON(): string; open(...modes: readonly $mol_file_transaction_mode[]): $mol_file_transaction; } } declare namespace $ { type $mol_file_type = 'file' | 'dir' | 'link'; interface $mol_file_stat { type: $mol_file_type; size: number; atime: Date; mtime: Date; ctime: Date; } class $mol_file extends $mol_file_base { } } declare namespace $ { function $mol_file_node_buffer_normalize(buf: Buffer): Uint8Array; class $mol_file_node extends $mol_file { static relative(this: This, path: string): InstanceType; watcher(reset?: null): { destructor(): void; }; protected info(path: string): $mol_file_stat | null; protected ensure(): null | undefined; protected copy(to: string): void; protected drop(): void; protected read(): Uint8Array; protected write(buffer: Uint8Array): undefined; protected kids(): this[]; resolve(path: string): this; relate(base?: $mol_file): string; readable(opts: { start?: number; end?: number; }): ReadableStream>; writable(opts?: { start?: number; }): WritableStream>; } } declare namespace $ { function $mol_tree2_js_is_number(type: string): boolean | RegExpMatchArray; } declare namespace $ { function $mol_tree2_js_to_text(this: $, js: $mol_tree2): $mol_tree2; } declare namespace $ { class $mol_view_tree2_error extends Error { readonly spans: readonly $mol_span[]; constructor(message: string, spans: readonly $mol_span[]); toJSON(): { message: string; spans: readonly $mol_span[]; }; } class $mol_view_tree2_error_suggestions { readonly suggestions: readonly string[]; constructor(suggestions: readonly string[]); toString(): string; toJSON(): readonly string[]; } function $mol_view_tree2_error_str(strings: readonly string[], ...parts: readonly ($mol_span | readonly $mol_span[] | string | number | $mol_view_tree2_error_suggestions)[]): $mol_view_tree2_error; } declare namespace $ { function $mol_view_tree2_child(this: $, tree: $mol_tree2): $mol_tree2; } declare namespace $ { function $mol_view_tree2_classes(defs: $mol_tree2): $mol_tree2; } declare namespace $ { function $mol_view_tree2_normalize(this: $, defs: $mol_tree2): $mol_tree2; } declare namespace $ { /** * Return `unknown` when `A` and `B` are the same type. `never` otherwise. * * $mol_type_equals< unknown , any > & number // true * $mol_type_equals< never , never > & number // false */ type $mol_type_equals = (() => X extends A ? 1 : 2) extends (() => X extends B ? 1 : 2) ? true : false; } declare namespace $ { /** * Reqursive converts intersection of records to record of intersections * * // { a : { x : 1 , y : 2 } } * $mol_type_merge< { a : { x : 1 } }&{ a : { y : 2 } } > */ type $mol_type_merge = Intersection extends (...a: any[]) => any ? Intersection : Intersection extends new (...a: any[]) => any ? Intersection : Intersection extends object ? $mol_type_merge_object extends Intersection ? true extends $mol_type_equals<{ [Key in keyof Intersection]: Intersection[Key]; }, Intersection> ? Intersection : { [Key in keyof Intersection]: $mol_type_merge; } : Intersection : Intersection; /** * Flat converts intersection of records to record of intersections * * // { a: 1, b: 2 } * $mol_type_merge< { a: 1 } & { b: 2 } > */ type $mol_type_merge_object = { [Key in keyof Intersection]: Intersection[Key]; }; } declare namespace $ { /** * Converts union of types to intersection of same types * * $mol_type_intersect< number | string > // number & string */ type $mol_type_intersect = (Union extends any ? (_: Union) => void : never) extends ((_: infer Intersection) => void) ? Intersection : never; } declare namespace $ { /** Replaces properties of `Base` record by properties from `Over`. */ type $mol_type_override = Omit & Over; } declare namespace $ { type $mol_unicode_category = [$mol_unicode_category_binary] | ['General_Category', $mol_char_category_general] | ['Script', $mol_unicode_category_script] | ['Script_Extensions', $mol_unicode_category_script]; type $mol_unicode_category_binary = 'ASCII' | 'ASCII_Hex_Digit' | 'Alphabetic' | 'Any' | 'Assigned' | 'Bidi_Control' | 'Bidi_Mirrored' | 'Case_Ignorable' | 'Cased' | 'Changes_When_Casefolded' | 'Changes_When_Casemapped' | 'Changes_When_Lowercased' | 'Changes_When_NFKC_Casefolded' | 'Changes_When_Titlecased' | 'Changes_When_Uppercased' | 'Dash' | 'Default_Ignorable_Code_Point' | 'Deprecated' | 'Diacritic' | 'Emoji' | 'Emoji_Component' | 'Emoji_Modifier' | 'Emoji_Modifier_Base' | 'Emoji_Presentation' | 'Extended_Pictographic' | 'Extender' | 'Grapheme_Base' | 'Grapheme_Extend' | 'Hex_Digit' | 'IDS_Binary_Operator' | 'IDS_Trinary_Operator' | 'ID_Continue' | 'ID_Start' | 'Ideographic' | 'Join_Control' | 'Logical_Order_Exception' | 'Lowercase' | 'Math' | 'Noncharacter_Code_Point' | 'Pattern_Syntax' | 'Pattern_White_Space' | 'Quotation_Mark' | 'Radical' | 'Regional_Indicator' | 'Sentence_Terminal' | 'Soft_Dotted' | 'Terminal_Punctuation' | 'Unified_Ideograph' | 'Uppercase' | 'Variation_Selector' | 'White_Space' | 'XID_Continue' | 'XID_Start'; type $mol_char_category_general = 'Cased_Letter' | 'Close_Punctuation' | 'Connector_Punctuation' | 'Control' | 'Currency_Symbol' | 'Dash_Punctuation' | 'Decimal_Number' | 'Enclosing_Mark' | 'Final_Punctuation' | 'Format' | 'Initial_Punctuation' | 'Letter' | 'Letter_Number' | 'Line_Separator' | 'Lowercase_Letter' | 'Mark' | 'Math_Symbol' | 'Modifier_Letter' | 'Modifier_Symbol' | 'Nonspacing_Mark' | 'Number' | 'Open_Punctuation' | 'Other' | 'Other_Letter' | 'Other_Number' | 'Other_Punctuation' | 'Other_Symbol' | 'Paragraph_Separator' | 'Private_Use' | 'Punctuation' | 'Separator' | 'Space_Separator' | 'Spacing_Mark' | 'Surrogate' | 'Symbol' | 'Titlecase_Letter' | 'Unassigned' | 'Uppercase_Letter'; type $mol_unicode_category_script = 'Adlam' | 'Ahom' | 'Anatolian_Hieroglyphs' | 'Arabic' | 'Armenian' | 'Avestan' | 'Balinese' | 'Bamum' | 'Bassa_Vah' | 'Batak' | 'Bengali' | 'Bhaiksuki' | 'Bopomofo' | 'Brahmi' | 'Braille' | 'Buginese' | 'Buhid' | 'Canadian_Aboriginal' | 'Carian' | 'Caucasian_Albanian' | 'Chakma' | 'Cham' | 'Chorasmian' | 'Cherokee' | 'Common' | 'Coptic' | 'Cuneiform' | 'Cypriot' | 'Cyrillic' | 'Deseret' | 'Devanagari' | 'Dives_Akuru' | 'Dogra' | 'Duployan' | 'Egyptian_Hieroglyphs' | 'Elbasan' | 'Elymaic' | 'Ethiopic' | 'Georgian' | 'Glagolitic' | 'Gothic' | 'Grantha' | 'Greek' | 'Gujarati' | 'Gunjala_Gondi' | 'Gurmukhi' | 'Han' | 'Hangul' | 'Hanifi_Rohingya' | 'Hanunoo' | 'Hatran' | 'Hebrew' | 'Hiragana' | 'Imperial_Aramaic' | 'Inherited' | 'Inscriptional_Pahlavi' | 'Inscriptional_Parthian' | 'Javanese' | 'Kaithi' | 'Kannada' | 'Katakana' | 'Kayah_Li' | 'Kharoshthi' | 'Khitan_Small_Script' | 'Khmer' | 'Khojki' | 'Khudawadi' | 'Lao' | 'Latin' | 'Lepcha' | 'Limbu' | 'Linear_A' | 'Linear_B' | 'Lisu' | 'Lycian' | 'Lydian' | 'Mahajani' | 'Makasar' | 'Malayalam' | 'Mandaic' | 'Manichaean' | 'Marchen' | 'Medefaidrin' | 'Masaram_Gondi' | 'Meetei_Mayek' | 'Mende_Kikakui' | 'Meroitic_Cursive' | 'Meroitic_Hieroglyphs' | 'Miao' | 'Modi' | 'Mongolian' | 'Mro' | 'Multani' | 'Myanmar' | 'Nabataean' | 'Nandinagari' | 'New_Tai_Lue' | 'Newa' | 'Nko' | 'Nushu' | 'Nyiakeng_Puachue_Hmong' | 'Ogham' | 'Ol_Chiki' | 'Old_Hungarian' | 'Old_Italic' | 'Old_North_Arabian' | 'Old_Permic' | 'Old_Persian' | 'Old_Sogdian' | 'Old_South_Arabian' | 'Old_Turkic' | 'Oriya' | 'Osage' | 'Osmanya' | 'Pahawh_Hmong' | 'Palmyrene' | 'Pau_Cin_Hau' | 'Phags_Pa' | 'Phoenician' | 'Psalter_Pahlavi' | 'Rejang' | 'Runic' | 'Samaritan' | 'Saurashtra' | 'Sharada' | 'Shavian' | 'Siddham' | 'SignWriting' | 'Sinhala' | 'Sogdian' | 'Sora_Sompeng' | 'Soyombo' | 'Sundanese' | 'Syloti_Nagri' | 'Syriac' | 'Tagalog' | 'Tagbanwa' | 'Tai_Le' | 'Tai_Tham' | 'Tai_Viet' | 'Takri' | 'Tamil' | 'Tangut' | 'Telugu' | 'Thaana' | 'Thai' | 'Tibetan' | 'Tifinagh' | 'Tirhuta' | 'Ugaritic' | 'Vai' | 'Wancho' | 'Warang_Citi' | 'Yezidi' | 'Yi' | 'Zanabazar_Square'; } interface String { match(regexp: RE): ReturnType; matchAll(regexp: RE): ReturnType; } declare namespace $ { type Groups_to_params = { [P in keyof T]?: T[P] | boolean | undefined; }; export type $mol_regexp_source = number | string | RegExp | { [key in string]: $mol_regexp_source; } | readonly [$mol_regexp_source, ...$mol_regexp_source[]]; export type $mol_regexp_groups = Source extends number ? {} : Source extends string ? {} : Source extends $mol_regexp_source[] ? $mol_type_merge<$mol_type_intersect<{ [key in Extract]: $mol_regexp_groups; }[Extract]>> : Source extends RegExp ? Record extends NonNullable>['groups']> ? {} : NonNullable>['groups']> : Source extends { readonly [key in string]: $mol_regexp_source; } ? $mol_type_merge<$mol_type_intersect<{ [key in keyof Source]: $mol_type_merge<$mol_type_override<{ readonly [k in Extract]: string; }, { readonly [k in key]: Source[key] extends string ? Source[key] : string; }> & $mol_regexp_groups>; }[keyof Source]>> : never; /** Type safe reguar expression builder */ export class $mol_regexp> extends RegExp { readonly groups: (Extract)[]; /** Prefer to use $mol_regexp.from */ constructor(source: string, flags?: string, groups?: (Extract)[]); [Symbol.matchAll](str: string): RegExpStringIterator>; /** Parses input and returns found capture groups or null */ [Symbol.match](str: string): null | RegExpMatchArray; /** Splits string by regexp edges */ [Symbol.split](str: string): string[]; test(str: string): boolean; exec(str: string): RegExpExecArray & $mol_type_override | null; generate(params: Groups_to_params): string | null; get native(): RegExp; /** Makes regexp that greedy repeats this pattern with delimiter */ static separated(chunk: Chunk, sep: Sep): $mol_regexp<[$mol_regexp<[[Chunk], Sep] extends infer T ? T extends [[Chunk], Sep] ? T extends $mol_regexp_source[] ? $mol_type_merge<$mol_type_intersect<{ [key in Extract]: $mol_regexp_groups; }[Extract]>> : T extends RegExp ? Record extends NonNullable>["groups"]> ? {} : NonNullable>["groups"]> : T extends { readonly [x: string]: $mol_regexp_source; } ? $mol_type_merge<$mol_type_intersect<{ [key_1 in keyof T]: $mol_type_merge]: string; }, key_1> & { readonly [k_1 in key_1]: T[key_1] extends string ? T[key_1] : string; } & $mol_regexp_groups>; }[keyof T]>> : never : never : never>, Chunk] extends infer T_1 ? T_1 extends [$mol_regexp<[[Chunk], Sep] extends infer T_2 ? T_2 extends [[Chunk], Sep] ? T_2 extends $mol_regexp_source[] ? $mol_type_merge<$mol_type_intersect<{ [key_4 in Extract]: $mol_regexp_groups; }[Extract]>> : T_2 extends RegExp ? Record extends NonNullable>["groups"]> ? {} : NonNullable>["groups"]> : T_2 extends { readonly [x: string]: $mol_regexp_source; } ? $mol_type_merge<$mol_type_intersect<{ [key_5 in keyof T_2]: $mol_type_merge]: string; }, key_5> & { readonly [k_1 in key_5]: T_2[key_5] extends string ? T_2[key_5] : string; } & $mol_regexp_groups>; }[keyof T_2]>> : never : never : never>, Chunk] ? T_1 extends $mol_regexp_source[] ? $mol_type_merge<$mol_type_intersect<{ [key_2 in Extract]: $mol_regexp_groups; }[Extract]>> : T_1 extends RegExp ? Record extends NonNullable>["groups"]> ? {} : NonNullable>["groups"]> : T_1 extends { readonly [x: string]: $mol_regexp_source; } ? $mol_type_merge<$mol_type_intersect<{ [key_3 in keyof T_1]: $mol_type_merge]: string; }, key_3> & { readonly [k_1 in key_3]: T_1[key_3] extends string ? T_1[key_3] : string; } & $mol_regexp_groups>; }[keyof T_1]>> : never : never : never>; /** Makes regexp that non-greedy repeats this pattern from min to max count */ static repeat(source: Source, min?: number, max?: number): $mol_regexp<$mol_regexp_groups>; /** Makes regexp that greedy repeats this pattern from min to max count */ static repeat_greedy(source: Source, min?: number, max?: number): $mol_regexp<$mol_regexp_groups>; /** Makes regexp that match any of options */ static vary(sources: Sources, flags?: string): $mol_regexp<$mol_regexp_groups>; /** Makes regexp that allow absent of this pattern */ static optional(source: Source): $mol_regexp<$mol_regexp_groups>; /** Makes regexp that look ahead for pattern */ static force_after(source: $mol_regexp_source): $mol_regexp>; /** Makes regexp that look ahead for pattern */ static forbid_after(source: $mol_regexp_source): $mol_regexp>; /** Converts some js values to regexp */ static from(source: Source, { ignoreCase, multiline }?: Partial>): $mol_regexp<$mol_regexp_groups>; /** Makes regexp which includes only unicode category */ static unicode_only(...category: $mol_unicode_category): $mol_regexp>; /** Makes regexp which excludes unicode category */ static unicode_except(...category: $mol_unicode_category): $mol_regexp>; static char_range(from: number, to: number): $mol_regexp<{}>; static char_only(...allowed: readonly [$mol_regexp_source, ...$mol_regexp_source[]]): $mol_regexp<{}>; static char_except(...forbidden: readonly [$mol_regexp_source, ...$mol_regexp_source[]]): $mol_regexp<{}>; static decimal_only: $mol_regexp<{}>; static decimal_except: $mol_regexp<{}>; static latin_only: $mol_regexp<{}>; static latin_except: $mol_regexp<{}>; static space_only: $mol_regexp<{}>; static space_except: $mol_regexp<{}>; static word_break_only: $mol_regexp<{}>; static word_break_except: $mol_regexp<{}>; static tab: $mol_regexp<{}>; static slash_back: $mol_regexp<{}>; static nul: $mol_regexp<{}>; static char_any: $mol_regexp<{}>; static begin: $mol_regexp<{}>; static end: $mol_regexp<{}>; static or: $mol_regexp<{}>; static line_end: $mol_regexp<{ readonly win_end: string; readonly mac_end: string; }>; } export {}; } declare namespace $ { let $mol_view_tree2_prop_signature: $mol_regexp<{ readonly name: string; readonly key: string; readonly next: string; }>; } declare namespace $ { function $mol_view_tree2_prop_parts(this: $, prop: $mol_tree2): { name: string; key: string; next: string; }; } declare namespace $ { function $mol_view_tree2_prop_quote(name: $mol_tree2): $mol_tree2; } declare namespace $ { function $mol_view_tree2_class_match(klass?: $mol_tree2): boolean; } declare namespace $ { function $mol_view_tree2_class_super(this: $, klass: $mol_tree2): $mol_tree2; } declare namespace $ { function $mol_view_tree2_class_props(this: $, klass: $mol_tree2): $mol_tree2[]; } declare namespace $ { var $mol_dom_context: typeof globalThis; } declare namespace $ { } declare namespace $ { let $mol_mem_persist: typeof $mol_wire_solid; } declare namespace $ { var $mol_dom: typeof globalThis; } declare namespace $ { function $mol_wait_user_async(this: $): Promise; function $mol_wait_user(this: $): unknown; } declare namespace $ { class $mol_storage extends $mol_object2 { static native(): StorageManager; static persisted(next?: boolean, cache?: 'cache'): boolean; static estimate(): StorageEstimate; static dir(): FileSystemDirectoryHandle; } } declare namespace $ { class $mol_state_local extends $mol_object { static 'native()': Pick; static native(): Storage | { getItem(key: string): any; setItem(key: string, value: string): void; removeItem(key: string): void; }; static changes(next?: StorageEvent): StorageEvent | undefined; static value(key: string, next?: Value | null): Value | null; prefix(): string; value(key: string, next?: Value): Value | null; } } declare namespace $ { class $mol_state_local_node extends $mol_state_local { static dir(): $mol_file; static value(key: string, next?: Value | null): Value | null; } } declare namespace $ { interface $mol_locale_dict { [key: string]: string; } /** * Localisation in $mol framework * @see https://mol.hyoo.ru/#!section=docs/=s5aqnb_odub8l */ class $mol_locale extends $mol_object { static lang_default(): string; static lang(next?: string): string; static source(lang: string): any; static texts(lang: string, next?: $mol_locale_dict): $mol_locale_dict; static text(key: string): string; static warn(key: string): null; } } declare namespace $ { function $mol_guard_defined(value: T): value is NonNullable; } declare namespace $ { function $mol_view_tree2_to_js(this: $, descr: $mol_tree2): $mol_tree2; } declare namespace $ { /** * Fails if `Actual` type is not subtype of `Expected`. */ type $mol_type_enforce = Actual; } declare namespace $ { function $mol_view_tree2_to_dts(this: $, tree: $mol_tree2): $mol_tree2; } declare namespace $ { function $mol_view_tree2_to_locale(this: $, module: $mol_tree2): Record; } declare namespace $ { function $mol_tree2_text_to_string(this: $, text: $mol_tree2): string; } declare namespace $ { function $mol_vlq_encode(val: number): string; } declare namespace $ { type $mol_sourcemap_segment = [number] | [number, number, number, number] | [number, number, number, number, number]; type $mol_sourcemap_line = $mol_sourcemap_segment[]; type $mol_sourcemap_mappings = $mol_sourcemap_line[]; interface $mol_sourcemap_raw { version: number; sources: string[]; names?: string[]; sourceRoot?: string; sourcesContent?: (string | null)[]; mappings: string | $mol_sourcemap_line[]; file?: string; } } declare namespace $ { function $mol_tree2_text_to_sourcemap(this: $, tree: $mol_tree2): $mol_sourcemap_raw; } declare namespace $ { /** * # Generic Graph model * - Supports any type of Nodes and Edges. * - All links are ordered, but this may be ignored. * - Multigraph supported using arrays of Edges. * - Hypergraph supported by reusing same Edge on set of links. * - Ubergraph supported using Edges as Nodes to. **/ class $mol_graph { /** All registered Nodes */ nodes: Set; /** Edges for Nodes pairs (from-to-edge) */ edges_out: Map>; /** Edges for Nodes pairs (to-from-edge) */ edges_in: Map>; /** Full connect two Nodes */ link(from: Node, to: Node, edge: Edge): void; /** Full disconnect two Nodes */ unlink(from: Node, to: Node): void; /** Forward connect two Nodes */ link_out(from: Node, to: Node, edge: Edge): void; /** Backward connect two Nodes */ link_in(to: Node, from: Node, edge: Edge): void; /** Return any Edge for two Nodes or null */ edge(from: Node, to: Node): NonNullable | null; /** Return output Edge for two Nodes or null */ edge_out(from: Node, to: Node): NonNullable | null; /** Return input Edge for two Nodes or null */ edge_in(to: Node, from: Node): NonNullable | null; /** Cut cycles at lowest priority of Edges */ acyclic(get_weight: (edge: Edge) => number): void; /** Topoligical ordered set of all Nodes for acyclic graph */ get sorted(): Set; /** All Nodes which don't have input Edges */ get roots(): Node[]; /** * Nodes depth statistics for acyclic graph * @example * graph.depth_stat( Math.min ) * graph.depth_stat( Math.max ) **/ nodes_depth(select: (left: number, right: number) => number): Map; /** * Depth's Nodes statistics for acyclic graph * @example * graph.depth_nodes( Math.min ) * graph.depth_nodes( Math.max ) **/ depth_nodes(select: (left: number, right: number) => number): Node[][]; } } declare namespace $ { function $mol_sourcemap_strip(this: $, data: string): string; } declare namespace $ { function $mol_sourcemap_url(this: $, uri: string, type?: "js" | "css"): string; } declare namespace $ { function $mol_sourcemap_dataurl_decode(this: $, data: string): $mol_sourcemap_raw | undefined; function $mol_sourcemap_dataurl_encode(this: $, map: $mol_sourcemap_raw, type?: "js" | "css"): string; } declare namespace $ { function $mol_sourcemap_from_file(this: $, src: $mol_file): $mol_sourcemap_raw | undefined; } declare namespace $ { function $mol_base64_encode(src: Uint8Array): string; } declare namespace $ { function $mol_base64_encode_node(str: Uint8Array): string; } declare namespace $ { interface $mol_build_ensure_plugin { ensure(path: string): boolean; } class $mol_build_ensure extends $mol_object { root(): $mol_file; interactive(): boolean; pull_timeout(): number; meta(path: string): $mol_tree2 | null; ensurer_git(): $mol_build_ensure_plugin; ensurer_fallback(): $mol_build_ensure_plugin; ensurers(): readonly ($mol_build_ensure_plugin | null)[]; ensure(path: string): boolean; } } declare namespace $ { class $mol_build_graph extends $mol_object { root(): $mol_file; mod_ensure(path: string): boolean; dependencies(path: string): Record; path(): string; protected added: Set; graph(reset?: null): $mol_graph; path_added(path: string): boolean; protected add_module(path: string): $mol_graph; path_resolved(target: string): $mol_file; protected check_dep([path, target]: [path: string, target: string]): null; protected out(): $mol_graph; get sorted(): Set; get nodes(): Set; get edges_out(): Map>; get edges_in(): Map>; } } declare namespace $ { class $mol_sourcemap_builder { readonly separator: string; readonly file?: string | undefined; version: number; protected sourceRoot: string; protected separator_count: number; constructor(dir: string, separator?: string, file?: string | undefined); protected chunks: string[]; protected segment_lines: $mol_sourcemap_line[]; protected sources: string[]; protected source_indexes: Map; protected names: string[]; protected name_indexes: Map; protected sourceContent: (null | string)[]; get content(): string; get sourcemap(): $mol_sourcemap_raw; toJSON(): $mol_sourcemap_raw; toString(): string; protected add_chunk(content: string): void; protected add_content(content: string, file?: string): void; add(content: string, file?: string, raw?: $mol_sourcemap_raw | string): void; } } declare namespace $ { function $mol_html_encode(text: string): string; } declare namespace $ { function $mol_tree2_xml_to_text(xml: $mol_tree2): $mol_tree2; } declare namespace $ { class $mol_build_ensure_vcs extends $mol_object implements $mol_build_ensure_plugin { root(): $mol_file; interactive(): boolean; pull_timeout(): number; root_repo(): null | string; vcs_type(): null | string; protected inited(path: string): boolean; protected init_existing(path: string): null; protected update(path: string): boolean; protected init(path: string): null; meta(path: string): $mol_tree2 | null; protected repo(path: string): { url: string; branch: null | string; } | null; protected update_disabled: boolean; protected update_safe(dir: string): boolean; protected pull_disabled(): boolean; ensure(path: string): boolean; } } declare namespace $ { function $mol_compare_text(item?: (item: Item) => string): (a: Item, b: Item) => number; } declare namespace $ { class $mol_build_ensure_git extends $mol_build_ensure_vcs { vcs_type(): string; root_repo(): string; protected version(): string; protected deepen_supported(): boolean; protected update(dir: string): boolean; protected is_git(path: string): boolean; protected submodule_dirs(opts: { dir: string; recursive?: boolean; }): $mol_file[]; protected root_is_submodule(): boolean; protected submodules(): Set; protected inited(path: string): boolean; protected repo_ensured(dir: string): { url: string; branch: null | string; }; protected branch_remote(dir: string): string; protected init_existing(dir: string): null; protected init(path: string): null; } } declare namespace $ { class $mol_build_ensure_npm extends $mol_object implements $mol_build_ensure_plugin { root(): $mol_file; ensure(path: string): boolean; } } declare namespace $ { class $mol_build extends $mol_object { static root([root, paths]: [root: string, paths: readonly string[]]): $mol_build; static relative(root: string, paths: readonly string[]): $mol_build; checker_changes_add({ writes, errors }: $mol_build_checker_changes): void; checker_rpc({ path, exclude, bundle }: { path: string; bundle: string; exclude: readonly string[]; }): $mol_rpc_worker<$mol_build_checker_shared> | null; checker_max_mem(): number; checker(params: { path: string; bundle: string; exclude: readonly string[]; }): $mol_build_checker_shared | null; server(): $mol_build_server; root(): $mol_file; paths(): readonly string[]; static start(paths: readonly string[]): void; metaTreeTranspile(path: string): $mol_file[]; view_tree_text(path: string): { js: $mol_tree2; dts: $mol_tree2; locale: string; }; viewTreeTranspile(path: string): $mol_file[]; cssTranspile(path: string): $mol_file[]; glslTranspile(path: string): $mol_file[]; sorted_sub(path: string): $mol_file[]; mods([path, exclude]: [path: string, exclude?: readonly string[]]): $mol_file[]; sources([path, exclude]: [path: string, exclude?: readonly string[]]): $mol_file[]; sourcesSorted([path, exclude]: [path: string, exclude?: readonly string[]]): $mol_file[]; sourcesAll([path, exclude]: [path: string, exclude?: readonly string[]]): $mol_file[]; tsOptions(): import("typescript").CompilerOptions; tsPaths({ path, exclude, bundle }: { path: string; bundle: string; exclude: readonly string[]; }): string[]; tsService({ path, exclude, bundle }: { path: string; bundle: string; exclude: readonly string[]; }): { recheck: () => void; destructor: () => void; } | null; js_error(path: string, next?: null | string): string | null; js_content(path: string): { text: string; map: $mol_sourcemap_raw | undefined; }; sources_js([path, exclude]: [path: string, exclude: readonly string[]]): $mol_file[]; sourcesDTS([path, exclude]: [path: string, exclude?: readonly string[]]): $mol_file[]; sourcesCSS([path, exclude]: [path: string, exclude?: readonly string[]]): $mol_file[]; static dependors: { [index: string]: undefined | ((source: $mol_file) => { [index: string]: number; }); }; srcDeps(path: string): { [index: string]: number; }; modDeps([path, exclude]: [path: string, exclude?: readonly string[]]): { [index: string]: number; }; dependencies([path, exclude]: [path: string, exclude?: readonly string[]]): { [index: string]: number; }; watching(): boolean; interactive(): boolean; pull_timeout(): number; ensurer(): $mol_build_ensure; modEnsure(path: string): boolean; modMeta(path: string): $mol_tree2 | null; graph([path, exclude]: [path: string, exclude?: readonly string[]]): $mol_build_graph; bundleAllWeb(path: string): null; bundleAllWebAudit(path: string): void; bundleAllNode(path: string): null; bundleAllNodeAudit(path: string): void; bundleAll(path: string): null; bundle([path, bundle]: [path: string, bundle?: string]): $mol_file[]; logBundle(target: $mol_file, duration: number): void; protected now(): number; bundleJS({ path, exclude, bundle }: { path: string; exclude: readonly string[]; bundle: string; }): $mol_file[]; bundleMJS({ path, exclude, bundle }: { path: string; exclude: readonly string[]; bundle: string; }): $mol_file[]; checker_synced(): boolean; bundleAuditJS({ path, exclude, bundle }: { path: string; exclude: readonly string[]; bundle: string; }): $mol_file[]; bundle_test_js([path, exclude, bundle]: [path: string, exclude: readonly string[], bundle: string]): { js: $mol_file; map: $mol_file; } | null; bundleAndRunTestJS({ path, exclude, bundle }: { path: string; exclude: readonly string[]; bundle: string; }): $mol_file[]; bundleTestHtml(path: string): $mol_file[]; bundleDTS({ path, exclude, bundle }: { path: string; exclude?: readonly string[]; bundle: string; }): $mol_file[]; bundleViewTree({ path, exclude, bundle }: { path: string; exclude?: readonly string[]; bundle: string; }): $mol_file[]; bundleBaza({ path, exclude, bundle }: { path: string; exclude?: readonly string[]; bundle: string; }): $mol_file[]; bundleMetaTree({ path, exclude, bundle }: { path: string; exclude?: readonly string[]; bundle: string; }): $mol_file[]; nodeDeps([path, exclude]: [path: string, exclude: readonly string[]]): Map; bundleReadmeMd([path, exclude]: [path: string, exclude: readonly string[]]): $mol_file[]; bundlePackageJSON([path, exclude]: [path: string, exclude: readonly string[]]): $mol_file[]; bundleManifestJSON([path, exclude]: [path: string, exclude?: readonly string[]]): $mol_file[]; bundleIndexHtml([path, exclude]: [path: string, exclude?: readonly string[]]): $mol_file[]; bundleFiles([path, exclude]: [path: string, exclude?: readonly string[]]): $mol_file[]; bundleCordova([path, exclude]: [path: string, exclude?: readonly string[]]): $mol_file[]; bundleCSS({ path, exclude, bundle }: { path: string; exclude?: readonly string[]; bundle: string; }): $mol_file[]; bundleLocale({ path, exclude, bundle }: { path: string; exclude?: readonly string[]; bundle: string; }): $mol_file[]; bundleDepsJSON({ path, exclude, bundle }: { path: string; exclude?: readonly string[]; bundle: string; }): $mol_file[]; } } declare namespace $ { type $mol_server_middleware = (req: typeof $node.express.request, res: typeof $node.express.response, next: (error?: unknown) => void) => void | Promise; class $mol_server extends $mol_object { express(): import("express-serve-static-core").Express; internal_ip(): string; http(): import("node:http").Server; connections: Set; socket(): import("ws").Server; expressHandlers(): readonly $mol_server_middleware[]; expressCompressor(): $mol_server_middleware; expressCors(): $mol_server_middleware; expressBodier(): import("connect").NextHandleFunction; expressFiler(): import("serve-static").RequestHandler>>; expressDirector(): import("express").Handler; expressIndex(): (req: typeof $node.express.request, res: typeof $node.express.response, next: () => void) => void; expressGenerator(): (req: typeof $node.express.request, res: typeof $node.express.response, next: () => void) => void; bodyLimit(): string; cacheTime(): number; port(): number; rootPublic(): string; } } declare namespace $ { class $mol_build_server extends $mol_server { static trace: boolean; sync_middleware(mdl: (req: typeof $node.express.request, res: typeof $node.express.response) => void | boolean): (req: typeof $node.express.request, res: typeof $node.express.response, next: (err?: unknown) => any) => Promise; expressGenerator(): (req: typeof $node.express.request, res: typeof $node.express.response, next: (err?: unknown) => any) => Promise; handleRequest(req: typeof $node.express.request, res: typeof $node.express.response): boolean | undefined; build(): $mol_build; generate(url: string): $mol_file[] | null; expressIndex(): (req: typeof $node.express.request, res: typeof $node.express.response, next: (err?: unknown) => any) => Promise; protected ensure(path: string): void; expressIndexRequest(req: typeof $node.express.request, res: typeof $node.express.response): true | undefined; port(): number; lines(next?: Map): Map; socket(): import("ws").Server; start(): import("ws").Server; protected bundles_count(reset?: null): number; /** * Держать в памяти собранные бандлы плохо, т.к. gc их может долго не утилизировать и node сожрет память и упадет. * Логичнее удалять отложенно, после того как reload-сокет отписался от пути и повторно не подписался. */ protected bundles_keep(): void; protected path_bundles: Record>; protected path_doubted: Set; path_add(path: string, bundle: string): void; protected path_doubt_timeout: null | $mol_after_timeout; path_doubt(path: string): void; path_doubted_remove(): void; bundle_changed_at(path: string): Date; notify([line, path]: [InstanceType<$node['ws']['WebSocket']>, string]): boolean; slave_commands(next?: string[]): string[]; slave_servers(): ((import("node:child_process").ChildProcessByStdio & { destructor: () => void; }) | null)[]; slave_server(cmd: string): (import("node:child_process").ChildProcessByStdio & { destructor: () => void; }) | null; repl(): import("node:readline").Interface; } } export = $; //# sourceMappingURL=node.d.ts.map