import { AsyncServerValue } from './types';
interface IndexAssignment {
    t: 'index';
    s: string;
    k: undefined;
    v: string;
}
interface MapAssignment {
    t: 'map';
    s: string;
    k: string;
    v: string;
}
interface SetAssignment {
    t: 'set';
    s: string;
    k: undefined;
    v: string;
}
export type Assignment = IndexAssignment | MapAssignment | SetAssignment;
export interface ParserContext {
    refs: Map<unknown, number>;
    markedRefs: Set<number>;
    features: number;
}
export interface SerializationContext {
    stack: number[];
    validRefs: number[];
    refSize: number;
    markedRefs: Set<number>;
    vars: string[];
    assignments: Assignment[];
    features: number;
    valueMap: Map<number, AsyncServerValue>;
}
export interface Options {
    disabledFeatures: number;
}
export declare function createParserContext(options?: Partial<Options>): ParserContext;
export interface SerializationOptions {
    markedRefs: number[] | Set<number>;
    features: number;
}
export declare function createSerializationContext(options: SerializationOptions): SerializationContext;
/**
 * Increments the number of references the referenced value has
 */
export declare function markRef(ctx: ParserContext | SerializationContext, current: number): void;
/**
 * Creates the reference param (identifier) from the given reference ID
 * Calling this function means the value has been referenced somewhere
 */
export declare function getRefParam(ctx: SerializationContext, index: number): string;
export declare function getRootID(ctx: ParserContext, current: AsyncServerValue): number;
export declare function createRef(ctx: ParserContext, current: AsyncServerValue): number;
export {};
