/** * Create a `compileTypeTest` hook for `compileJsonQuery` (see * `@jarenjs/json/query`), backed by a `JarenValidator`. * * The hook compiles each schema literal with the validator and returns * its boolean-mode validation function - errors off, the fast path of * this package's architecture. Schema compile failures (an invalid * schema literal, an unresolvable `$ref`) propagate as plain errors; the * query engine wraps them into `JsonQueryCompileError` `JQ0009` with the * operator's document pointer. * * @param {object | (() => object)} [validator] - a `JarenValidator` * instance to compile with, or a zero-argument factory producing one. * Supply an instance with registered schemas (`addSchema`) so `$ref`s * in query schema literals resolve against them. Omitted, a fresh * default (boolean-mode) instance is created. * @returns {(schemaJson: any, docPath: string) => ((value: any) => boolean)} * a hook suitable for `compileJsonQuery(doc, { compileTypeTest })` * @example * import { compileJsonQuery } from '@jarenjs/json/query'; * import { createTypeTestCompiler } from '@jarenjs/validate/query'; * * const query = compileJsonQuery({ * "$for": { "b": "$.store.book[*]" }, * "$as": { "b": { "type": "object", "required": ["price"] } }, * "$return": "$b.title" * }, { compileTypeTest: createTypeTestCompiler() }); */ export declare function createTypeTestCompiler(validator?: object | (() => object)): (schemaJson: any, docPath: string) => ((value: any) => boolean);