@jsonhero/schema-infer
Version:
Infers JSON Schemas from example JSON
12 lines (11 loc) • 396 B
TypeScript
import { InferredSchema } from "./inferredSchema";
import { Schema } from "@jsonhero/json-schema-fns";
export default class SchemaInferrer {
inferredSchema: InferredSchema;
constructor(snapshot?: InferredSchema);
infer(value: unknown, inference?: SchemaInferrer): void;
toJSONSchema(options?: {
includeSchema?: boolean;
}): Schema;
toSnapshot(): InferredSchema;
}