import { ValidationException } from './ValidationException'; export type JSONType = string | number | boolean | null | JSONType[] | { [key: string]: JSONType; }; /** * Is the value a valid JSON value? * See: https://www.ecma-international.org/publications-and-standards/standards/ecma-404/ * * @example * ```ts * isJSON({ 'foo': 'bar' }) // true * isJSON(new Map()) // false * ``` * * @param value the value to check * @returns a boolean indicating whether the value is the expected type */ export declare const isJSON: (value: unknown) => value is JSONType; /** * Validate that the value is a valid JSON value. * See: https://www.ecma-international.org/publications-and-standards/standards/ecma-404/ * * @example * ```ts * validateJSON({ 'foo': 'bar' }) // null * validateJSON(new Map()) // ValidationException * ``` * * @param value the value to check * @returns `null` if the value is the expected type or a `ValidationException` * if not */ export declare const validateJSON: (value: unknown) => ValidationException | null; /** * Assert that the value is a valid JSON value. * See: https://www.ecma-international.org/publications-and-standards/standards/ecma-404/ * * @example * ```ts * assertJSON({ 'foo': 'bar' }) // void * assertJSON(new Map()) // throws AssertionException * ``` * * @param value the value to check * @throws an `AssertionException` if the value is not the expected type */ export declare const assertJSON: (value: unknown) => asserts value is JSONType;