import { StandardJSONSchemaV1 } from "./types.mjs"; //#region ../@warlock.js/seal/src/standard-schema/json-schema.d.ts /** * Supported JSON Schema generation targets. */ type JsonSchemaTarget = StandardJSONSchemaV1.Target; /** * The result shape for a generated JSON Schema. */ type JsonSchemaResult = Record; /** * Apply nullable to a JSON Schema object based on the target dialect. * * - draft-2020-12 : `type` becomes an array: `["string", "null"]` * - openai-strict : same as draft-2020-12 (type array form) * - draft-07 : wraps in `oneOf: [{ ...schema }, { type: "null" }]` * - openapi-3.0 : adds `nullable: true` alongside the existing type * * Mutates the schema in-place. * * @example * ```ts * const schema = { type: "string" }; * applyNullable(schema, "draft-2020-12"); * // → { type: ["string", "null"] } * ``` */ declare function applyNullable(schema: JsonSchemaResult, target: JsonSchemaTarget): void; /** * Wrap a field schema as nullable for OpenAI strict mode. * * OpenAI strict requires optional fields to be expressed as a nullable type * rather than being omitted from the `required` array. This helper wraps a * given schema into its nullable equivalent using the type-array form. * * Unlike `applyNullable()` (which mutates in-place), this returns a new * schema object to avoid side effects when wrapping child schemas. * * @example * ```ts * wrapNullableStrict({ type: "string", minLength: 3 }) * // → { type: ["string", "null"], minLength: 3 } * * wrapNullableStrict({ type: "object", properties: {...} }) * // → { type: ["object", "null"], properties: {...} } * * wrapNullableStrict({ oneOf: [...] }) * // → { oneOf: [..., { type: "null" }] } * ``` */ declare function wrapNullableStrict(schema: JsonSchemaResult): JsonSchemaResult; /** * Find the first rule matching the given name in a rules array, * and return its options bag. */ declare function getRuleOptions(rules: Array<{ name: string; context: { options: Record; }; }>, ruleName: string): Record | undefined; //#endregion export { JsonSchemaResult, JsonSchemaTarget, applyNullable, getRuleOptions, wrapNullableStrict }; //# sourceMappingURL=json-schema.d.mts.map