import { Class } from "./util/Core"; import { Ord } from "./util/Ord"; import { ValueDelta } from "./Delta"; export declare const _: any; export declare type DataValueTag = "Viewport" | "Circle" | "Group" | "Line" | "Marker" | "Orient" | "Polyline" | "Polymarkers" | "Scale" | "Translate" | "Text" | "Transform" | "Circle" | "Arrowhead" | "Bool" | "Closure" | "DataExpl" | "Elim" | "Match" | "Env" | "Expl" | "Expl.Def" | "Expl.RecDef" | "ExplValue" | "Expr" | "Expr.Def" | "List" | "Option" | "Ordering" | "Pair" | "Plug" | "Point" | "Expr.RecDef" | "Rect" | "Tree" | "Token"; export declare type LexemeTag = "Whitespace" | "SingleLineComment" | "Operator"; export declare type PrimOpTag = "UnaryOp" | "BinaryOp"; export declare type ValueTag = DataValueTag | LexemeTag | PrimOpTag | "Id" | "Num" | "Str"; export declare class Value { readonly __tag: Tag; __child(k: keyof this): Persistent; readonly __children: Persistent[]; } export declare abstract class Id extends Value<"Id"> { tag(tag: Tag): TaggedId; } declare class FunctionId extends Id { f: Function; } export declare class ApplicationId extends Id { k: MemoId; v: Persistent; } export declare type MemoId = FunctionId | ApplicationId; export declare class TaggedId extends Id { k: Id; prop: Tag; } export declare function memoId(f: Function, v̅: Iterable): MemoId; export declare type Persistent = Value | boolean | string | number | Function; export declare type PrimValue = Num | Str; export declare function isPrim(v: Value): boolean; export declare class Num extends Value<"Num"> { val: number; toString(): string; } export declare class Str extends Value<"Str"> implements Ord { val: string; toString(): string; leq(str: Str): boolean; eq(str: Str): boolean; geq(str: Str): boolean; } export declare function mergeInto(tgt: ValueDelta, src: ValueDelta): void; export declare type MemoTable = Map>; export interface Memoisable { key: Persistent; call(args: Persistent[]): T; } export declare function memoCall(memo: MemoTable, f: Memoisable, v̅: Persistent[]): T; export declare function make(C: Class, ...v̅: Persistent[]): T; export declare function construct(compare: boolean, tgt: T, v̅: Persistent[]): ValueDelta | null; export declare function isField(prop: string): boolean; export declare function fields(v: T): (keyof T)[]; export declare function metadataFields(v: Value): string[]; export {};