//#region ../@warlock.js/seal/src/standard-schema/types.d.ts /** * Standard Schema Spec Types * * Copied from @standard-schema/spec to avoid a runtime dependency. * Source: https://standardschema.dev * * Implements: * - StandardSchemaV1 — for validation interop (OpenAI, LangGraph, TanStack Form, Conform, etc.) * - StandardJSONSchemaV1 — for JSON Schema generation (OpenAPI, draft-07, draft-2020-12) */ /** The Standard Schema interface. */ interface StandardSchemaV1 { readonly "~standard": StandardSchemaV1.Props; } declare namespace StandardSchemaV1 { /** The Standard Schema properties interface. */ interface Props { /** The version number of the standard. */ readonly version: 1; /** The vendor name of the schema library. */ readonly vendor: string; /** Inferred types associated with the schema. */ readonly types?: Types | undefined; /** Validates unknown input values. */ readonly validate: (value: unknown, options?: Options | undefined) => Result | Promise>; } /** Success result. */ interface SuccessResult { readonly value: Output; readonly issues?: undefined; } /** Options passed to validate. */ interface Options { readonly libraryOptions?: Record | undefined; } /** Failure result. */ interface FailureResult { readonly issues: ReadonlyArray; } type Result = SuccessResult | FailureResult; /** Issue in a failed result. */ interface Issue { readonly message: string; readonly path?: ReadonlyArray | undefined; } /** A single segment in an issue path. */ interface PathSegment { readonly key: PropertyKey; } /** The Standard types interface. */ interface Types { readonly input: Input; readonly output: Output; } /** Infer the input type of a Standard Schema. */ type InferInput = NonNullable["input"]; /** Infer the output type of a Standard Schema. */ type InferOutput = NonNullable["output"]; } /** The Standard JSON Schema interface. */ interface StandardJSONSchemaV1 { readonly "~standard": StandardJSONSchemaV1.Props; } declare namespace StandardJSONSchemaV1 { interface Props extends Omit, never> { readonly jsonSchema: Converter; } /** Methods for generating JSON Schema. */ interface Converter { /** Converts the input type to JSON Schema. */ readonly input: (options: Options) => Record; /** Converts the output type to JSON Schema. */ readonly output: (options: Options) => Record; } /** * Supported JSON Schema targets. * Libraries should throw if a target is not supported. * * - `draft-2020-12` — JSON Schema 2020-12 (default, recommended) * - `draft-07` — JSON Schema draft-07 (Swagger 2.0, older tooling) * - `openapi-3.0` — OpenAPI 3.0 extensions (nullable: true) * - `openai-strict` — OpenAI Structured Outputs strict mode. * All fields listed in required; optional fields * expressed as `{ type: ["T", "null"] }` instead * of being omitted from required. */ type Target = "draft-2020-12" | "draft-07" | "openapi-3.0" | "openai-strict" | ({} & string); interface Options { readonly target: Target; readonly libraryOptions?: Record | undefined; } } //#endregion export { StandardJSONSchemaV1, StandardSchemaV1 }; //# sourceMappingURL=types.d.mts.map