UNPKG

@langchain/core

Version:
1 lines 1.94 kB
{"version":3,"file":"json_schema.d.ts","names":["toJSONSchema","InteropZodType","JsonSchema7Type","JSONSchema","deepCompareStrict","Validator","ToJSONSchemaParams","Parameters","NonNullable","toJsonSchema","validatesOnlyStrings","JsonSchema7ArrayType","JsonSchema7ObjectType","JsonSchema7StringType","JsonSchema7NumberType","JsonSchema7NullableType"],"sources":["../../src/utils/json_schema.d.ts"],"sourcesContent":["import { toJSONSchema } from \"zod/v4/core\";\nimport { InteropZodType } from \"./types/zod.js\";\nimport { type JsonSchema7Type as JSONSchema } from \"./zod-to-json-schema/index.js\";\nexport { deepCompareStrict, Validator } from \"@cfworker/json-schema\";\nexport type ToJSONSchemaParams = NonNullable<Parameters<typeof toJSONSchema>[1]>;\n/**\n * Converts a Zod schema or JSON schema to a JSON schema.\n * @param schema - The schema to convert.\n * @param params - The parameters to pass to the toJSONSchema function.\n * @returns The converted schema.\n */\nexport declare function toJsonSchema(schema: InteropZodType | JSONSchema, params?: ToJSONSchemaParams): JSONSchema;\n/**\n * Validates if a JSON schema validates only strings. May return false negatives in some edge cases\n * (like recursive or unresolvable refs).\n *\n * @param schema - The schema to validate.\n * @returns `true` if the schema validates only strings, `false` otherwise.\n */\nexport declare function validatesOnlyStrings(schema: unknown): boolean;\nexport { type JsonSchema7Type, type JsonSchema7Type as JSONSchema, type JsonSchema7ArrayType, type JsonSchema7ObjectType, type JsonSchema7StringType, type JsonSchema7NumberType, type JsonSchema7NullableType, } from \"./zod-to-json-schema/index.js\";\n//# sourceMappingURL=json_schema.d.ts.map"],"mappings":";;;;;;;;;;;;KAIYM,kBAAAA,GAAqBE,YAAYD,kBAAkBP;;;;;;;iBAOvCS,YAAAA,SAAqBR,iBAAiBE,0BAAqBG,qBAAqBH;AAPxG;;;;AAA4C;AAO5C;;AAA8DA,iBAQtCO,oBAAAA,CARsCP,MAAAA,EAAAA,OAAAA,CAAAA,EAAAA,OAAAA"}