import type { DocumentLocation } from '../model/malloy_types'; export type ZoneData = Record; type EntryStatus = 'present' | 'reference' | 'error'; interface AllEntries { status: EntryStatus; firstReference?: DocumentLocation; } interface EntryPresent extends AllEntries { status: 'present'; value: T; } interface ReferenceEntry { status: 'reference'; firstReference: DocumentLocation; } interface EntryErrored extends AllEntries { status: 'error'; message: string; } export type ZoneEntry = EntryPresent | ReferenceEntry | EntryErrored; /** * A Zone is a symbol table which may contain references to symbols * which are not yet defined. This is used by the parser to track * references to objects which it will have to request values from * before the translation can be complete. The API is struictured to * build the repsonse-style interfaces that the translator uses. */ export declare class Zone { zone: Map>; location: Record; constructor(); get(str: string): TValue | undefined; getEntry(str: string): ZoneEntry; /** * Add a symbol and it's definition to the symbol table. * @param str * @param val */ define(str: string, val: TValue): void; /** * Add a symbol to the symbol table. * @param str The symbol * @param loc The location of the reference */ reference(str: string, loc: DocumentLocation): void; /** * @return A list of all symbols which have references but not definitions */ getUndefined(): string[] | undefined; /** * Provide values for symbols * @param updateData Symbols and their values * @param errorData Pass on errors encountered during fetch */ updateFrom(updateData: ZoneData | undefined, errorData: Record | undefined): void; } export {};