/** * A type alias for a JSON primitive. */ export declare type JSONPrimitive = boolean | number | string | null; /** * A type alias for a JSON value. */ export declare type JSONValue = JSONPrimitive | JSONObject | JSONArray; /** * A type definition for a JSON object. */ export interface JSONObject { [key: string]: JSONValue; } /** * A type definition for a JSON array. */ export interface JSONArray extends Array { } /** * A type definition for a readonly JSON object. */ export interface ReadonlyJSONObject { readonly [key: string]: ReadonlyJSONValue; } /** * A type definition for a readonly JSON array. */ export interface ReadonlyJSONArray extends ReadonlyArray { } /** * A type alias for a readonly JSON value. */ export declare type ReadonlyJSONValue = JSONPrimitive | ReadonlyJSONObject | ReadonlyJSONArray; /** * A type alias for a partial JSON value. * * Note: Partial here means that JSON object attributes can be `undefined`. */ export declare type PartialJSONValue = JSONPrimitive | PartialJSONObject | PartialJSONArray; /** * A type definition for a partial JSON object. * * Note: Partial here means that the JSON object attributes can be `undefined`. */ export interface PartialJSONObject { [key: string]: PartialJSONValue | undefined; } /** * A type definition for a partial JSON array. * * Note: Partial here means that JSON object attributes can be `undefined`. */ export interface PartialJSONArray extends Array { } /** * A type definition for a readonly partial JSON object. * * Note: Partial here means that JSON object attributes can be `undefined`. */ export interface ReadonlyPartialJSONObject { readonly [key: string]: ReadonlyPartialJSONValue | undefined; } /** * A type definition for a readonly partial JSON array. * * Note: Partial here means that JSON object attributes can be `undefined`. */ export interface ReadonlyPartialJSONArray extends ReadonlyArray { } /** * A type alias for a readonly partial JSON value. * * Note: Partial here means that JSON object attributes can be `undefined`. */ export declare type ReadonlyPartialJSONValue = JSONPrimitive | ReadonlyPartialJSONObject | ReadonlyPartialJSONArray; /** * The namespace for JSON-specific functions. */ export declare namespace JSONExt { /** * A shared frozen empty JSONObject */ const emptyObject: ReadonlyJSONObject; /** * A shared frozen empty JSONArray */ const emptyArray: ReadonlyJSONArray; /** * Test whether a JSON value is a primitive. * * @param value - The JSON value of interest. * * @returns `true` if the value is a primitive,`false` otherwise. */ function isPrimitive(value: ReadonlyPartialJSONValue): value is JSONPrimitive; /** * Test whether a JSON value is an array. * * @param value - The JSON value of interest. * * @returns `true` if the value is a an array, `false` otherwise. */ function isArray(value: JSONValue): value is JSONArray; function isArray(value: ReadonlyJSONValue): value is ReadonlyJSONArray; function isArray(value: PartialJSONValue): value is PartialJSONArray; function isArray(value: ReadonlyPartialJSONValue): value is ReadonlyPartialJSONArray; /** * Test whether a JSON value is an object. * * @param value - The JSON value of interest. * * @returns `true` if the value is a an object, `false` otherwise. */ function isObject(value: JSONValue): value is JSONObject; function isObject(value: ReadonlyJSONValue): value is ReadonlyJSONObject; function isObject(value: PartialJSONValue): value is PartialJSONObject; function isObject(value: ReadonlyPartialJSONValue): value is ReadonlyPartialJSONObject; /** * Compare two JSON values for deep equality. * * @param first - The first JSON value of interest. * * @param second - The second JSON value of interest. * * @returns `true` if the values are equivalent, `false` otherwise. */ function deepEqual(first: ReadonlyPartialJSONValue, second: ReadonlyPartialJSONValue): boolean; /** * Create a deep copy of a JSON value. * * @param value - The JSON value to copy. * * @returns A deep copy of the given JSON value. */ function deepCopy(value: T): T; } //# sourceMappingURL=json.d.ts.map