import { MutableStringMap, StringMap } from "./string-map"; export interface JsonObjectInterface extends StringMap { } export declare type JsonObject = (JsonObjectInterface & object) | {}; export interface JsonArrayInterface extends ReadonlyArray { } export declare type JsonArray = JsonArrayInterface & object; export declare type JsonArrayOf = readonly T[] & object; export declare type JsonPrimitive = null | boolean | string | number; export declare type JsonRef = JsonObject | JsonArray; export declare type Json = JsonPrimitive | JsonRef; export declare type MutableJsonObject = MutableStringMap & object; export declare type MutableJsonArray = Json[]; export declare type MutableJsonRef = MutableJsonObject | MutableJsonArray; export interface Visitor { /** * null */ readonly asNull: () => T; /** * boolean */ readonly asBoolean: (value: boolean) => T; /** * string */ readonly asString: (value: string) => T; /** * number */ readonly asNumber: (value: number) => T; /** * Json[] */ readonly asArray: (value: JsonArray) => T; /** * JsonObject */ readonly asObject: (value: JsonObject) => T; } export declare const visit: (value: Json, visitor: Visitor) => T; export declare const parse: (str: string) => Json; export declare const stringify: (json: Json) => string; export declare const isPrimitive: (value: Json) => value is JsonPrimitive; export declare const isObject: (value: Json) => value is JsonObject; export declare type JsonType = "null" | "boolean" | "string" | "number" | "object" | "array"; export declare const typeOf: (value: Json) => JsonType; export declare type EmptyObject = { readonly [k in never]?: never; }; //# sourceMappingURL=json.d.ts.map