json-machete
Version:
11 lines (10 loc) • 524 B
text/typescript
import type { JSONSchema, JSONSchemaObject } from './types.cjs';
export interface JSONSchemaVisitorContext {
visitedSubschemaResultMap: WeakMap<JSONSchemaObject, any>;
path: string;
}
export type JSONSchemaVisitor = (subSchema: any, context: JSONSchemaVisitorContext) => Promise<any> | any;
export declare function visitJSONSchema(schema: JSONSchema, { enter, leave, }: {
enter?: JSONSchemaVisitor;
leave?: JSONSchemaVisitor;
}, { visitedSubschemaResultMap, path }?: JSONSchemaVisitorContext): Promise<any>;