export interface Json4Schema { type: string | string[]; required?: string[]; properties?: object; additionalProperties?: boolean; minLength?: number; minItems?: number; maxItems?: number; format?: "date-time" | "uuid"; pattern?: string; items?: Json4Schema; minimum?: number; maximum?: number; anyOf?: Json4Schema[]; } interface AnyOfJson4Schema { anyOf: Json4Schema[]; } /** * Assert that a value matches a JSON schema. Prints out errors if mismatches found. * @param {Object} value The JSON object or value (string, boolean etc.) to test. * @param {Object} schema The JSON schema to test the object against. */ export declare const expectToMatchSchema: (value: any, schema: Json4Schema) => void; /** * Asserts that the object contains all the properties specified - additional properties are not allowed. * @param {Object} properties Asserts for any key on the object that the property exists. Example: `{propOne: stringType, propTwo: numberType}` * @param {Object} [options] Accepts a property `optionalProps` which can be a list of optional properties that don't need to be present. */ export declare const strictObject: (properties: object, options?: { optionalProps?: string[]; }) => Json4Schema; /** * Asserts that the object contains all the properties specified - additional properties are allowed. * @param {Object} properties Asserts for any key on the object that the property exists. Example: `{propOne: stringType, propTwo: numberType}` */ export declare const objectWithRequiredProps: (properties: object, options?: { optionalProps?: string[]; }) => Json4Schema; /** * Assert a JSON schema against each array item. * @param itemSchema * @param {Object} options Accepts an option property `minItems` which can be used to check that the array contains at least x amount of items. */ export declare const arrayOfItems: (itemSchema: Json4Schema, options?: { minItems?: number; }) => Json4Schema; /** * Assert that the property is one of the provided JSON schemas. * @param itemSchemas */ export declare const anyOf: (itemSchemas: Json4Schema[]) => AnyOfJson4Schema; /** * Asserts that the property is an object. */ export declare const objectType: Json4Schema; /** * Asserts that the property is a string. The string is not allowed to be empty - use stringTypeCanBeEmpty instead if emptiness is needed. */ export declare const stringType: Json4Schema; /** * Asserts that the property is a string. Allows the string to be empty. */ export declare const stringTypeCanBeEmpty: Json4Schema; /** * Asserts that the property is a string matching the regular expression provided. * @param {RegExp} regex */ export declare const stringTypeMatching: (regex: string) => Json4Schema; /** * Asserts that the property is a string looking like an URL. */ export declare const urlType: Json4Schema; /** * Asserts that the property is a string in date-time format. */ export declare const dateTime: Json4Schema; /** * Asserts that the property is a string looking like a UUID. */ export declare const uuidType: Json4Schema; /** * Asserts that the property is exactly the string as specified. * @param {String} expStr */ export declare const stringTypeExact: (expStr: string) => Json4Schema; /** * Asserts that the property is a string looking like a UNIX path. */ export declare const stringTypePath: Json4Schema; /** * Asserts that the property is a number. */ export declare const numberType: Json4Schema; /** * Asserts that the property is a number greater than the given number. * @param {Number} minimum */ export declare const numberTypeGreaterThan: (minimum: number) => Json4Schema; /** * Asserts that the property is a number less than the given number. * @param {Number} maximum */ export declare const numberTypeLessThan: (maximum: number) => Json4Schema; /** * Asserts that the property holds the value `null`. */ export declare const nullType: Json4Schema; /** * Asserts that the property is a boolean. */ export declare const booleanType: Json4Schema; /** * Asserts that the property received is one of the values given in the array. * @param {Array} valuesExpected */ export declare const oneOf: (valuesExpected: any[]) => { enum: any[]; }; /** * Asserts that the property is an array. */ export declare const arrayType: Json4Schema; /** * Asserts that the property is an array of the exactly specified length. * @param {Number} length */ export declare const arrayTypeOfLength: (length: number) => Json4Schema; /** * Asserts that the property is exactly the value as specified. Can be anything - an object, an array, a string, a boolean, ... * @param {any} valueExpected */ export declare const exactly: (valueExpected: any) => { enum: any[]; }; /** * Loosely asserts that the property is an array of objects. */ export declare const arrayOfObjectsType: Json4Schema; declare type IJsonSchemaOrObject = Json4Schema | object; /** * Helper function to check whether the passed in object is a JSON schema or a plain object. * @param {Object} toBeDetermined */ export declare const isJsonSchema: (toBeDetermined: IJsonSchemaOrObject) => toBeDetermined is Json4Schema; export { setup } from "./setup";