import { RawObjectSchema } from "../schema-raw"; /** * Javascript object schema interface (any) */ export interface ObjectSchemaI { /** * Gets the raw schema, as object type */ getRawSchema(): RawObjectSchema; /** * Tests the schema against an object * @param object The object to test * @returns true if it matches the schema, false if it does not match */ test(object: any): boolean; /** * Provides the reason test() returned false, if any * @param object The object to test * @returns The provided error */ provideTestError(object: any): Error; /** * Sanitizes an object. * @param object The object to test * @returns The sanitized object */ sanitize(object: any): any; } /** * Abstract schema, for inheritance */ export declare class AbstractObjectSchema implements ObjectSchemaI { private raw; /** * Constructor * @param raw Raw schema */ constructor(raw: RawObjectSchema); /** * Gets the raw schema, as object type */ getRawSchema(): RawObjectSchema; /** * Tests the schema against an object * @param object The object to test * @returns true if it matches the schema, false if it does not match */ test(object: any): boolean; /** * Provides the reason test() returned false, if any * @param object The object to test * @returns The provided error */ provideTestError(object: any): Error; /** * Sanitizes an object. * @param object The object to test * @returns The sanitized object */ sanitize(object: any): any; }