export { RawValue, RawEAV, RawEAVC } from "../runtime/runtime"; import { ID, RawValue, RawEAV, Change, ExportHandler } from "../runtime/runtime"; export { Program } from "../runtime/dsl2"; import { Program } from "../runtime/dsl2"; export declare class Watcher { protected _program: Program; protected static _registry: { [id: string]: typeof Watcher; }; static register(id: string, watcher: typeof Watcher): void; static unregister(id: string): void; static get(id: string): typeof Watcher | undefined; get program(): Program; constructor(_program: Program); setup(): void; } export interface Map { [key: number]: V; } export interface RawMap { [key: string]: V; [key: number]: V; } export interface RawRecord extends RawMap { } export interface Diffs { adds: V; removes: V; } export interface EAVDiffs extends Diffs { } export interface ObjectDiffs extends Diffs> { } export type DiffConsumer = (diffs: EAVDiffs) => void; export type ObjectConsumer = (diffs: ObjectDiffs) => void; export declare class Exporter { protected _diffTriggers: Map; protected _objectTriggers: Map[]>; protected _blocks: ID[]; triggerOnDiffs(blockId: ID, handler: DiffConsumer): void; triggerOnObjects(blockId: ID, handler: ObjectConsumer): void; accumulateChangesAs(changes: Change[]): { adds: RawMap; removes: RawMap; }; handle: ExportHandler; } export declare function _isId(value?: RawValue): boolean; export declare function maybeIntern(value?: RawValue): ID | RawValue | undefined; export declare function asJS(value?: RawValue): number | string | boolean | undefined; export declare function forwardDiffs(destination: Program, name?: string, debug?: boolean): (diffs: EAVDiffs) => void; export declare function createId(): string; export declare function isRawValue(x: any): x is RawValue; export declare function isRawValueArray(x: any): x is RawValue[]; export declare function isRawEAVArray(x: any): x is RawEAV[]; export declare function isRawEAVArraySet(x: any): x is RawEAV[][]; export declare function isRecord(x: any): x is Attrs; export declare function isRecordSet(x: any): x is Attrs[]; export interface Attrs extends RawMap { } export declare function appendAsEAVs(eavs: any[], record: Attrs, id?: string): any[];