import * as Collection from "../collection"; import type { Set as ISet, Map as IMap, List as IList } from "../collection"; import { XorShift } from "../utils/xorshift"; import { CrochetPackage, CrochetType, CrochetValue, Location, Machine, NSApply, NSAwait, NSCurrentActivation, NSCurrentUniverse, NSInvoke, NSMakeClosure, NSTranscriptWrite, Tag, Universe } from "../vm"; export type { Machine, CrochetValue }; export type { ISet, IList, IMap }; export declare class ForeignInterface { #private; constructor(universe: Universe, pkg: CrochetPackage, filename: string); defun(name: string, fn: (...args: CrochetValue[]) => CrochetValue): void; defmachine(name: string, fn: (...args: CrochetValue[]) => Machine): void; integer(x: bigint): CrochetValue; float(x: number): CrochetValue; boolean(x: boolean): CrochetValue; text(x: string): CrochetValue; untrusted_text(x: string): CrochetValue; box(x: unknown): CrochetValue; static_text(x: string): CrochetValue; list(x: CrochetValue[]): CrochetValue; record(x: Map): CrochetValue; interpolation(xs: CrochetValue[]): CrochetValue; concat_interpolation(x: CrochetValue, y: CrochetValue): CrochetValue; cell(x: CrochetValue): CrochetValue; get nothing(): CrochetValue; get true(): CrochetValue; get false(): CrochetValue; make_closure(arity: number, fn: (...args: CrochetValue[]) => Machine): NSMakeClosure; invoke(name: string, args: CrochetValue[]): NSInvoke; apply(fn: CrochetValue, args: CrochetValue[]): NSApply; await(value: Promise): NSAwait; run_synchronous(fn: () => Machine): CrochetValue; run_asynchronously(fn: () => Machine): Promise>; integer_to_bigint(x: CrochetValue): bigint; float_to_number(x: CrochetValue): number; to_js_boolean(x: CrochetValue): boolean; text_to_string(x: CrochetValue): string; list_to_array(x: CrochetValue): CrochetValue[]; interpolation_to_parts(x: CrochetValue): (string | CrochetValue)[]; normalise_interpolation(x: CrochetValue): CrochetValue; deref_cell(x: CrochetValue): CrochetValue; update_cell(x: CrochetValue, old_value: CrochetValue, value: CrochetValue): boolean; record_to_map(x: CrochetValue): Map>; action_choice(x: CrochetValue): { score: number; action: CrochetValue; }; unbox(x: CrochetValue): unknown; intrinsic_equals(x: CrochetValue, y: CrochetValue): boolean; panic_untraced(tag: string, message: string): void; panic(tag: string, message: string): void; is_crochet_value(x: any): x is CrochetValue; is_interpolation(x: CrochetValue): boolean; is_list(x: CrochetValue): boolean; is_thunk_forced(x: CrochetValue): boolean; to_plain_native(x: CrochetValue): unknown; from_plain_native(x: unknown, trusted: boolean): CrochetValue; type_name(x: CrochetValue): string; to_debug_string(x: CrochetValue): string; lookup_type(name: string): CrochetType | null; lookup_type_namespaced(namespace: string, name: string): CrochetType | null; instantiate(type: CrochetType, args: CrochetValue[]): CrochetValue; action_fired(action: CrochetValue, value: CrochetValue): boolean; get collection(): typeof Collection; xorshift(seed: number, inc: number): XorShift; xorshift_random(): XorShift; push_transcript(tag: string, x: CrochetValue | string): NSTranscriptWrite; uuid4(): string; current_activation(): NSCurrentActivation; current_universe(): NSCurrentUniverse; get formatter(): typeof Location; }