import { $ as SchemaEnvelopeOf, A as JsonSchemaNullable, B as JsonSchemaSchemaSource, C as JsonSchemaLiteral, D as JsonSchemaNativeEnum, E as JsonSchemaMetadataKeywords, F as JsonSchemaPrimitiveType, G as JsonSchemaType, H as JsonSchemaString, I as JsonSchemaPrimitiveUnion, J as JsonSchemaUnknown, K as JsonSchemaUndefined, L as JsonSchemaRecord, M as JsonSchemaNumberFormat, N as JsonSchemaObject, O as JsonSchemaNever, P as JsonSchemaOf, Q as SchemaEnvelope, R as JsonSchemaRecordPropertyNames, S as JsonSchemaLike, T as JsonSchemaMap, U as JsonSchemaStringFormat, V as JsonSchemaSet, W as JsonSchemaTuple, X as SchemaConfig, Y as ReflectionSchemaSource, Z as SchemaConfigVariant, _ as JsonSchemaFunction, _t as SCHEMA_ARRAY_CONCAT_KEYWORDS, a as JsonSchema, at as UntypedConfigObject, b as JsonSchemaIntegerFormat, c as JsonSchemaAnyOf, ct as ValibotSchema, d as JsonSchemaBoolean, dt as JSON_SCHEMA_ANY, et as SchemaSource, f as JsonSchemaConditionalKeywords, ft as JSON_SCHEMA_CONSTRUCTOR_KEY, g as JsonSchemaEnum, gt as JsonSchemaTypeNames, h as JsonSchemaDecimalFormat, ht as JSON_SCHEMA_TYPES, i as InferExtractOptions, it as StandardSchemaSchemaSource, j as JsonSchemaNumber, k as JsonSchemaNull, l as JsonSchemaArray, lt as ValibotSchemaSource, m as JsonSchemaDecimal, mt as JSON_SCHEMA_PRIMITIVE_TYPES, n as BaseSchemaSource, nt as SchemaSourceVariant, o as JsonSchemaAllOf, ot as UntypedSchema, p as JsonSchemaDate, pt as JSON_SCHEMA_METADATA_KEYS, q as JsonSchemaUnion, r as ExtractedSchemaEnvelope, rt as SpecOf, s as JsonSchemaAny, st as UntypedSchemaSource, t as BaseExtractOptions, tt as SchemaSourceConfig, u as JsonSchemaBigint, ut as Zod3SchemaSource, v as JsonSchemaFunctionParameter, vt as SCHEMA_RECORD_KEYWORDS, w as JsonSchemaLogicKeywords, x as JsonSchemaKeywords, y as JsonSchemaInteger, yt as SCHEMA_SINGLE_KEYWORDS, z as JsonSchemaRef } from "./types-CjEY63CD.mjs"; import { n as createStoragePromises, r as normalizeKey, t as mapStorageToFileSystem } from "./index-C7q4X7Bo.mjs"; import { Type } from "@deepkit/type"; import { Plugin } from "esbuild"; import { BaseSchema } from "valibot"; import { StandardSchemaV1 } from "@standard-schema/spec"; import { InferLoadOptions } from "@stryke/resolve/types"; import { InputObject, Schema } from "untyped"; import { FileReferenceInput, FileSystemInterface } from "@stryke/types"; import { FileReference } from "@stryke/types/configuration"; //#region src/compatibility.d.ts /** * Finds structural contradictions between two JSON Schema fragments. * * @remarks * Metadata-only keywords are ignored. Either schema may be unconstrained * (`JsonSchemaAny`, empty object, or missing structural keywords) without * producing contradictions. * * @param base - The base JSON Schema fragment. * @param override - The JSON Schema fragment to compare against the base. * @param path - Optional dot-separated path used in issue messages. * @returns A list of human-readable contradiction descriptions. */ declare function findSchemaContradictions(base: JsonSchema, override: JsonSchema, path?: string): string[]; /** * Asserts that two JSON Schema fragments do not structurally contradict each other. * * @param base - The base JSON Schema fragment. * @param override - The JSON Schema fragment to compare against the base. * @param label - A label used in the thrown error message. * @throws Will throw an Error when one or more structural contradictions are found. */ declare function assertSchemasDoNotContradict(base: JsonSchema, override: JsonSchema, label?: string): void; //#endregion //#region src/extract.d.ts /** * Bundles all external references in a JSON Schema into a single schema document by collecting all reference targets and rewriting the references to point to the bundled definitions. This ensures that the resulting schema is self-contained and can be used independently without relying on external documents. * * @param schema - The JSON Schema to bundle references for. * @returns A new JSON Schema with all references bundled and rewritten to point to the bundled definitions. */ declare function bundleReferences(schema: JsonSchema): JsonSchema; /** * Creates a hash string for a given schema definition input. */ declare function extractHash(variant: SchemaConfigVariant, input: SchemaConfig): string; /** * Converts a reflected Deepkit {@link Type} into a JSON Schema (draft-2020-12) representation. */ declare function extractReflection(reflection: Type): JsonSchema | undefined; /** * Extracts a JSON Schema from Zod, Standard Schema, Valibot, untyped, or JSON Schema inputs. * * @param schema - The schema input to extract a JSON Schema from. * @returns The extracted JSON Schema, or `undefined` if the input is not a supported schema type. */ declare function extractJsonSchema(schema: unknown): JsonSchema | undefined; /** * Resolves the concrete source variant for a schema source input. * * @param input - The schema source input to inspect. * @returns The resolved schema source variant. * @throws Will throw an error when the input cannot be mapped to a supported source variant. */ declare function extractResolvedVariant(input: SchemaSourceConfig): SchemaSourceVariant; /** * Determines the top-level input variant for schema extraction. * * @param input - The schema input to classify. * @returns The resolved schema input variant. */ declare function extractVariant(input: SchemaConfig): SchemaConfigVariant; /** * Extracts and normalizes a JSON Schema from a concrete schema source input. * * @param input - The schema source input to extract from. * @param variant - Optional source variant override. When omitted, the variant is inferred from the input. * @returns A promise that resolves to a bundled JSON Schema. * @throws Will throw an error if no valid JSON Schema can be extracted from the input. */ declare function extractSchema(input: SchemaSourceConfig, variant?: SchemaConfigVariant): Promise; /** * Builds source metadata for a schema input using a known source variant. * * @param variant - The schema source variant associated with the input. * @param input - The schema source input to wrap. * @returns The normalized schema source payload, including the source hash and variant. * @throws Will throw an error if the provided variant is unsupported. */ declare function extractSource(variant: SchemaSourceVariant, input: SchemaSourceConfig): SchemaSource; /** * Creates an [esbuild](https://esbuild.github.io) plugin that uses the Deepkit Type reflection to transpile TypeScript code into JSON Schema. * * @see https://deepkit.io/en/documentation/runtime-types/reflection * @see https://www.typescriptlang.org/docs/handbook/2/types-from-types.html * @see https://github.com/esbuild/esbuild * @see https://github.com/esbuild/esbuild/blob/main/docs/plugins.md * * @param options - The options for the plugin. * @returns The esbuild plugin. */ declare function createDeepkitPlugin(options: BaseExtractOptions & { fs?: FileSystemInterface; }): Plugin; /** * Resolves a type definition to a JSON Schema. Bundles the TypeScript module * graph with esbuild using `@deepkit/type-compiler` reflection transformers, * then converts the reflected Deepkit {@link Type} via {@link reflectionToJsonSchema}. * * @param input - The type definition to compile. This can be either a string or a {@link FileReference} object. * @param options - Optional overrides for reflection and file resolution. * @returns A promise that resolves to the generated JSON Schema. * @see https://deepkit.io/en/documentation/runtime-types/reflection */ declare function extractTSType(input: FileReferenceInput, options?: InferLoadOptions & BaseExtractOptions): Promise; /** * Extracts a JSON Schema from a given schema definition input, which can be a Zod schema, a Valibot schema, any Standard JSON Schema type, a plain JSON Schema object, an untyped schema, a Deepkit Type object, or a {@link FileReferenceInput} to an exported TypeScript type definition or any of the previous options. If the input is a {@link FileReferenceInput} (e.g. a file path with an export), the source code will be bundled with [esbuild](https://esbuild.github.io) using [\@deepkit/type-compiler](https://deepkit.io/en/documentation/runtime-types/getting-started) reflection to obtain the actual schema definition before extraction. * * @example * ```ts * Resolve a schema definition from a JSON schema file * const schema1 = await extract(context, "./schemas/my-json-schema.json"); * // Resolve a schema definition from a TypeScript module export * const schema2 = await extract(context, "./schemas.ts#MySchema"); * // Resolve a schema definition from a JSON Schema object * const schema3 = await extract(context, schemaObject); * // Resolve a schema definition from a Zod schema * const schema4 = await extract(context, zodSchema); * // Resolve a schema definition from a Valibot schema * const schema5 = await extract(context, valibotSchema); * // Resolve a schema definition from a reflected Deepkit Type object * const schema6 = await extract(context, reflectionType); * ``` * * @see https://zod.dev/ * @see https://valibot.dev/ * @see https://standardschema.dev/json-schema#what-schema-libraries-support-this-spec * @see https://json-schema.org/ * @see https://ajv.js.org/json-type-definition.html * @see https://deepkit.io/en/documentation/runtime-types/reflection * @see https://github.com/unjs/untyped * @see https://www.typescriptlang.org/docs/handbook/2/types-from-types.html * * @param input - The schema definition input to extract, which can be a Zod schema, a Valibot schema, any Standard JSON Schema type, a plain JSON Schema object, an untyped schema, or a {@link FileReferenceInput} to an exported TypeScript type definition or any of the previous options. * @param options - Optional overrides for the configuration used during extraction. * @returns A promise that resolves to the extracted and normalized schema as a JSON Schema object. * @throws Will throw an error if the input is not a valid schema definition or if the extraction process fails to produce a valid schema. */ declare function extractSchemaWithSource(input: SchemaConfig, options?: InferExtractOptions): Promise>; /** * Extracts a JSON Schema from a given schema definition input, which can be a Zod schema, a Valibot schema, any Standard JSON Schema type, a plain JSON Schema object, an untyped schema, a Deepkit Type object, or a {@link FileReferenceInput} to an exported TypeScript type definition or any of the previous options. If the input is a {@link FileReferenceInput} (e.g. a file path with an export), the source code will be bundled with [esbuild](https://esbuild.github.io) using [\@deepkit/type-compiler](https://deepkit.io/en/documentation/runtime-types/getting-started) reflection to obtain the actual schema definition before extraction. * * @example * ```ts * Resolve a schema definition from a JSON schema file * const schema1 = await extract(context, "./schemas/my-json-schema.json"); * // Resolve a schema definition from a TypeScript module export * const schema2 = await extract(context, "./schemas.ts#MySchema"); * // Resolve a schema definition from a JSON Schema object * const schema3 = await extract(context, schemaObject); * // Resolve a schema definition from a Zod schema * const schema4 = await extract(context, zodSchema); * // Resolve a schema definition from a Valibot schema * const schema5 = await extract(context, valibotSchema); * // Resolve a schema definition from a reflected Deepkit Type object * const schema6 = await extract(context, reflectionType); * ``` * * @see https://zod.dev/ * @see https://valibot.dev/ * @see https://standardschema.dev/json-schema#what-schema-libraries-support-this-spec * @see https://json-schema.org/ * @see https://ajv.js.org/json-type-definition.html * @see https://deepkit.io/en/documentation/runtime-types/reflection * @see https://github.com/unjs/untyped * @see https://www.typescriptlang.org/docs/handbook/2/types-from-types.html * * @param input - The schema definition input to extract, which can be a Zod schema, a Valibot schema, any Standard JSON Schema type, a plain JSON Schema object, an untyped schema, or a {@link FileReferenceInput} to an exported TypeScript type definition or any of the previous options. * @param options - Optional overrides for the configuration used during extraction. * @returns A promise that resolves to the extracted and normalized schema as a JSON Schema object. * @throws Will throw an error if the input is not a valid schema definition or if the extraction process fails to produce a valid schema. */ declare function extract(input: SchemaConfig, options?: InferExtractOptions): Promise>; //#endregion //#region src/helpers.d.ts type GetPropertyResult = JsonSchema & { name: string; required: boolean; default?: unknown; }; /** * Retrieves the JSON Schema from a Schema wrapper or returns the input if it's already a JSON Schema. * * @remarks * This function checks if the input is a Schema wrapper (an object with a `schema` property) and returns the `schema` if it is. If the input is already a JSON Schema, it returns it directly. This allows for flexibility in handling both raw JSON Schema objects and wrapped schemas without needing to check the type at every usage point. * * @param input - The input which can be either a Schema wrapper or a JSON Schema object. * @returns The JSON Schema object. * @throws Will throw a TypeError if the input is neither a valid Schema wrapper nor a valid JSON Schema object. */ declare function getJsonSchema(input: SchemaEnvelope | JsonSchema): JsonSchema; /** * Retrieves the JSON Schema in Object form from a Schema wrapper or returns the input if it's already a JSON Schema. * * @remarks * This function checks if the input is a Schema wrapper (an object with a `schema` property) and returns the `schema` if it is. If the input is already a JSON Schema object, it returns it directly. This allows for flexibility in handling both raw JSON Schema objects and wrapped schemas without needing to check the type at every usage point. * * @param input - The input which can be either a Schema wrapper or a JSON Schema object. * @returns The JSON Schema object. * @throws Will throw a TypeError if the input is neither a valid Schema wrapper nor a valid JSON Schema object. */ declare function getJsonSchemaObject(input: SchemaEnvelope | JsonSchema): JsonSchemaObject; /** * Extracts object properties from a JSON Schema object form. * * @remarks * This function returns an empty object if the schema is not an object form or if it has no properties. * * @param obj - The JSON Schema object form or a Schema wrapper to extract properties from. * @returns An object mapping property names to their corresponding JSON Schema fragments, including metadata. */ declare function getProperties(obj: SchemaEnvelope | JsonSchemaObject): Record; /** * Returns object properties as an array. * * @remarks * This is a convenience function that extracts properties using `getProperties` and returns them as an array. * * @param obj - The JSON Schema object form or a Schema wrapper to extract properties from. * @returns An array of JSON Schema fragments representing the properties, each including metadata. */ declare function getPropertiesList(obj: SchemaEnvelope | JsonSchemaObject): GetPropertyResult[]; /** * Extracts object properties from a JSON Schema object form. * * @remarks * This function returns an empty object if the schema is not an object form or if it has no properties. * * @param obj - The JSON Schema object form or a Schema wrapper to extract properties from. * @returns An object mapping property names to their corresponding JSON Schema fragments, including metadata. */ declare function getProperty(obj: SchemaEnvelope | TSchema, name: keyof TSchema["properties"] & string): GetPropertyResult; /** * Adds a property to a JSON Schema object form. * * @remarks * This function modifies the provided schema in place by adding a new property with the specified name and schema. It also updates the `required` array based on the `optional` flag of the property. If the property is marked as optional, it will be removed from the `required` array; otherwise, it will be added to it. * * @param obj - The JSON Schema object form or a Schema wrapper to which the property should be added. * @param name - The name of the property to add. * @param property - The JSON Schema fragment representing the property's schema, including metadata. * @throws Will throw an error if the provided schema is not an object form. */ declare function addProperty(obj: SchemaEnvelope | JsonSchemaObject, name: string, property: JsonSchema): void; /** * Merges multiple JSON Schemas into one. * * @remarks * This function takes multiple JSON Schemas or Schema wrappers and merges them * into a single JSON Schema object. Later schemas in the argument list take * precedence over earlier ones for scalar conflicts. * * Structured keywords are merged recursively: * - Named child schemas (`properties`, `$defs`, etc.) are merged * per-property via recursive calls to `merge`. * - Composition arrays (`allOf`, `anyOf`, `oneOf`) are concatenated. * - Single-schema keywords (`if`, `then`, `else`, `not`, `items`, etc.) * are merged recursively when both sides define them. * - `required` arrays are union'ed and deduplicated. * * @param schemas - An array of JSON Schemas or Schema wrappers to merge. * @returns A new JSON Schema that is the result of merging all input schemas. */ declare function merge(...schemas: (JsonSchema | SchemaEnvelope)[]): JsonSchema; /** * Merges metadata into a JSON Schema fragment. * * @remarks * This function takes a JSON Schema fragment and a metadata object, and merges the metadata into the schema. Only the keys defined in {@link JSON_SCHEMA_METADATA_KEYS} are considered for merging. The resulting schema will include the original schema properties along with the provided metadata. * * @param schema - The JSON Schema fragment to merge metadata into. * @param metadata - The metadata to merge into the schema. * @returns A new JSON Schema fragment that includes the merged metadata. */ declare function mergeMetadata(schema: JsonSchemaOf, metadata: JsonSchemaMetadataKeywords): JsonSchemaOf; /** * Returns whether a JSON Schema fragment accepts `null`. * * @remarks * This is true if the schema has `nullable: true` or if its `type` includes `"null"`. * * @param schema - The JSON Schema fragment to check. * @returns `true` if the schema accepts `null`, otherwise `false`. */ declare function isSchemaNullable(schema?: JsonSchema): boolean; /** * Returns whether an object property is optional (not listed in `required`). * * @remarks * In JSON Schema, object properties are optional by default unless they are listed in the `required` array of the parent schema. This function checks whether a given property name is not included in the `required` array of its parent schema, indicating that it is optional. * * @param parent - The parent JSON Schema object containing the property. * @param propertyName - The name of the property to check for optionality. * @returns `true` if the property is optional, otherwise `false`. */ declare function isPropertyOptional(parent: JsonSchemaObject, propertyName: string): boolean; /** * Checks if a given file name has a valid schema input file extension. * * @param fileName - The file name to check for a valid schema input extension. * @returns `true` if the file name has a valid schema input extension, otherwise `false`. */ declare function isValidSchemaConfigFile(fileName: string): boolean; /** @deprecated Use {@link isValidSchemaConfigFile} */ declare const isValidSchemaInputFile: typeof isValidSchemaConfigFile; /** * Traverses a JSON Schema and applies a callback function to each schema fragment. * * @remarks * This function recursively traverses a JSON Schema, including nested schemas in properties, composition keywords (`allOf`, `anyOf`, `oneOf`), and other schema keywords. The provided callback function is invoked for each schema fragment encountered during the traversal. The results of the callback are collected and returned as an array. * * @param schema - The JSON Schema to traverse. * @param callback - The callback function to apply to each schema fragment. * @returns An array of results returned by the callback function. */ declare function traverseSchema(schema: JsonSchema, callback: (schema: JsonSchema) => T | void): T[]; //#endregion //#region src/metadata.d.ts /** * Applies Powerlines schema metadata onto a JSON Schema fragment. * * @param schema - The JSON Schema fragment to apply metadata to. * @param metadata - The Powerlines schema metadata to apply. * @returns A new JSON Schema fragment with the metadata applied. */ declare function applyJsonSchemaMetadata(schema: JsonSchema, metadata: JsonSchemaMetadataKeywords | undefined): JsonSchema; /** * Normalizes the JSON Schema `type` keyword to a string array. * * @remarks * This function ensures that the `type` keyword of a JSON Schema fragment is always represented as an array of strings, even if it was originally defined as a single string. This normalization simplifies type checking and processing of JSON Schemas by providing a consistent format for the `type` information. * * @param schema - The JSON Schema fragment to read types from. * @returns An array of JSON Schema primitive type names defined in the `type` keyword, or an empty array if no valid types are found. */ declare function readSchemaTypes(schema?: JsonSchema): JsonSchemaPrimitiveType[]; /** * Returns the primary non-null JSON Schema type name for a fragment. * * @param schema - The JSON Schema fragment to check. * @returns The primary non-null JSON Schema type name, or `undefined` if none is found. */ declare function getPrimarySchemaType(schema?: JsonSchema): JsonSchemaPrimitiveType | undefined; //#endregion //#region src/type-checks.d.ts /** * Checks if the provided entry is a file reference. * * @param entry - The entry to check. * @returns True if the entry is a file reference, false otherwise. */ declare function isFileReference(entry: any): entry is FileReference; /** * A helper type guard to check if a value is a JSON Schema primitive type. * * @param value - The value to check. * @returns True if the value is a JSON Schema primitive type, false otherwise. */ declare function isJsonSchemaPrimitiveType(value: unknown): value is JsonSchemaPrimitiveType; /** * A helper type guard to check if a value is a JSON Schema type. * * @param value - The value to check. * @returns True if the value is a JSON Schema type, false otherwise. */ declare function isJsonSchemaType(value: unknown): value is JsonSchemaType; /** * Type guard for shared JSON Schema keyword groups. * * @param input - The value to check. * @returns True if the input is a JSON Schema keyword group, false otherwise. */ declare function isJsonSchemaKeywords(input: unknown): input is JsonSchemaKeywords; /** * Type guard for generic JSON Schema objects with optional `$ref`. * * @param input - The value to check. * @returns True if the input is a generic JSON Schema object, false otherwise. */ declare function isJsonSchemaAny(input: unknown): input is JsonSchemaAny; /** * Type guard for JSON Schema array types. * * @param input - The value to check. * @returns True if the input is a JSON Schema array schema, false otherwise. */ declare function isJsonSchemaArray(input: unknown): input is JsonSchemaArray; /** * Type guard for bigint-backed integer schemas. * * @param input - The value to check. * @returns True if the input is a bigint-backed integer schema, false otherwise. */ declare function isJsonSchemaBigint(input: unknown): input is JsonSchemaBigint; /** * Type guard for boolean schemas. * * @param input - The value to check. * @returns True if the input is a boolean schema, false otherwise. */ declare function isJsonSchemaBoolean(input: unknown): input is JsonSchemaBoolean; /** * Type guard for date/time schemas. * * @param input - The value to check. * @returns True if the input is a date or time schema, false otherwise. */ declare function isJsonSchemaDate(input: unknown): input is JsonSchemaDate; /** * Type guard for enum-constrained schemas. * * @param input - The value to check. * @returns True if the input is an enum-constrained schema, false otherwise. */ declare function isJsonSchemaEnum(input: unknown): input is JsonSchemaEnum; /** * Type guard for `allOf` composition schemas. * * @param input - The value to check. * @returns True if the input is an `allOf` schema, false otherwise. */ declare function isJsonSchemaAllOf(input: unknown): input is JsonSchemaAllOf; /** * Type guard for literal-value schemas. * * @param input - The value to check. * @returns True if the input is a literal-value schema, false otherwise. */ declare function isJsonSchemaLiteral(input: unknown): input is JsonSchemaLiteral; /** * Type guard for map tuple-array schemas. * * @param input - The value to check. * @returns True if the input is a map tuple-array schema, false otherwise. */ declare function isJsonSchemaMap(input: unknown): input is JsonSchemaMap; /** * Type guard for native enum schemas. * * @param input - The value to check. * @returns True if the input is a native enum schema, false otherwise. */ declare function isJsonSchemaNativeEnum(input: unknown): input is JsonSchemaNativeEnum; /** * Type guard for impossible/never schemas. * * @param input - The value to check. * @returns True if the input is a never schema, false otherwise. */ declare function isJsonSchemaNever(input: unknown): input is JsonSchemaNever; /** * Type guard for `null` schemas. * * @param input - The value to check. * @returns True if the input is a null schema, false otherwise. */ declare function isJsonSchemaNull(input: unknown): input is JsonSchemaNull; /** * Type guard for nullable schema unions. * * @param input - The value to check. * @returns True if the input is a nullable schema union, false otherwise. */ declare function isJsonSchemaNullable(input: unknown): input is JsonSchemaNullable; /** * Type guard for numeric schemas. * * @param input - The value to check. * @returns True if the input is a numeric schema, false otherwise. */ declare function isJsonSchemaNumber(input: unknown): input is JsonSchemaNumber; /** * Type guard for integer schemas. * * @param input - The value to check. * @returns True if the input is an integer schema, false otherwise. */ declare function isJsonSchemaInteger(input: unknown): input is JsonSchemaInteger; /** * Type guard for decimal schemas. * * @param input - The value to check. * @returns True if the input is a decimal schema, false otherwise. */ declare function isJsonSchemaDecimal(input: unknown): input is JsonSchemaDecimal; /** * Type guard for object schemas. * * @param input - The value to check. * @returns True if the input is an object schema, false otherwise. */ declare function isJsonSchemaObject(input: unknown): input is JsonSchemaObject; /** * Type guard for string schemas. * * @param input - The value to check. * @returns True if the input is a string schema, false otherwise. */ declare function isJsonSchemaString(input: unknown): input is JsonSchemaString; /** * Type guard for set-like array schemas. * * @param input - The value to check. * @returns True if the input is a set-like array schema, false otherwise. */ declare function isJsonSchemaSet(input: unknown): input is JsonSchemaSet; /** * Type guard for record schemas. * * @param input - The value to check. * @returns True if the input is a record schema, false otherwise. */ declare function isJsonSchemaRecord(input: unknown): input is JsonSchemaRecord; /** * Type guard for tuple schemas. * * @param input - The value to check. * @returns True if the input is a tuple schema, false otherwise. */ declare function isJsonSchemaTuple(input: unknown): input is JsonSchemaTuple; /** * Type guard for undefined-representing schemas. * * @param input - The value to check. * @returns True if the input is an undefined-representing schema, false otherwise. */ declare function isJsonSchemaUndefined(input: unknown): input is JsonSchemaUndefined; /** * Type guard for primitive-union schema variants. * * @param input - The value to check. * @returns True if the input is a primitive-union schema variant, false otherwise. */ declare function isJsonSchemaPrimitiveUnion(input: unknown): input is JsonSchemaPrimitiveUnion; /** * Type guard for union schemas. * * @param input - The value to check. * @returns True if the input is a union schema, false otherwise. */ declare function isJsonSchemaUnion(input: unknown): input is JsonSchemaUnion; /** * Type guard for permissive unknown schemas. * * @param input - The value to check. * @returns True if the input is a permissive unknown schema, false otherwise. */ declare function isJsonSchemaUnknown(input: unknown): input is JsonSchemaUnknown; /** * Type guard for `anyOf` composition schemas. * * @param input - The value to check. * @returns True if the input is an `anyOf` schema, false otherwise. */ declare function isJsonSchemaAnyOf(input: unknown): input is JsonSchemaAnyOf; /** * Type guard for reference schemas. * * @param input - The value to check. * @returns True if the input is a reference schema, false otherwise. */ declare function isJsonSchemaRef(input: unknown): input is JsonSchemaRef; /** * Type guard for Standard Schema V1 objects. * * @param input - The value to check. * @returns True if the input is a Standard Schema V1 object, false otherwise. */ declare function isStandardSchema(input: unknown): input is StandardSchemaV1; /** * Type guard for Valibot BaseSchema objects. * * @param input - The value to check. * @returns True if the input is a Valibot BaseSchema, false otherwise. */ declare function isValibotSchema(input: unknown): input is BaseSchema; /** * Returns true when `input` is a function schema that represents a constructor. * * @remarks * Uses `Object.hasOwn` on {@link JSON_SCHEMA_CONSTRUCTOR_KEY}. Do not read * `schema.constructor` — that returns `Object.prototype.constructor`. * * @param input - A JSON Schema (or unknown value) to inspect. * @returns True when the schema has an own `"constructor": true` flag. */ declare function hasJsonSchemaConstructorFlag(input: unknown): boolean; /** * Type guard for JSON Schema types. * * @remarks * This function checks if the input is a JSON Schema type, which is defined as having a `type` property or a `$ref` property. This is used to determine if a given input conforms to the structure of a JSON Schema definition that includes type information. * * @param input - The value to check. * @returns True if the input is a JSON Schema type, false otherwise. */ declare function isJsonSchema(input: unknown): input is JsonSchema; /** * Type guard for JSON Schemas that only accept `null`. * * @remarks * This function checks if the input is a JSON Schema that exclusively accepts the `null` type. It verifies that the input is a valid JSON Schema and that its `type` property is set to "null". This is useful for identifying schemas that are specifically designed to allow only `null` values. * * @param input - The value to check. * @returns True if the input is a JSON Schema that only accepts `null`, false otherwise. */ declare function isNullOnlyJsonSchema(input: unknown): input is JsonSchemaNull; /** * Type guard for untyped schema objects. * * @remarks * This function checks if the input is an untyped schema object, which is defined as having certain properties that are commonly found in untyped schema definitions. This includes properties such as `id`, `title`, `description`, `$schema`, `tsType`, `markdownType`, `type`, `required`, `tags`, `args`, `properties`, and `resolve`. The function verifies that these properties, if present, conform to the expected types (e.g., strings for certain properties, arrays for others). This type guard is used to determine if a given input can be treated as an untyped schema object within the context of the Powerlines schema system. * * @param input - The value to check. * @returns True if the input is an untyped schema object, false otherwise. */ declare function isUntypedSchema(input: unknown): input is Schema; /** * Strict type guard for untyped schema objects. * * @remarks * This guard narrows values to the Untyped schema model while explicitly * rejecting values that are also valid JSON Schema instances. * * @param input - The value to check. * @returns True if the input is an untyped schema and not a JSON Schema. */ declare function isUntypedSchemaStrict(input: unknown): input is Schema; /** * Type guard for untyped input objects. * * @remarks * This function checks if the input is an untyped input object, which is defined as having certain properties that are commonly found in untyped input definitions. This includes properties such as `$schema` and `$resolve`. The function verifies that these properties, if present, conform to the expected types (e.g., objects for `$schema`, functions for `$resolve`). This type guard is used to determine if a given input can be treated as an untyped input object within the context of the Powerlines schema system. * * @param input - The value to check. * @returns True if the input is an untyped input object, false otherwise. */ /** @deprecated Use {@link isUntypedConfig} */ declare const isUntypedInput: typeof isUntypedConfig; declare function isUntypedConfig(input: unknown): input is InputObject; /** * Strict type guard for untyped input objects. * * @remarks * This guard narrows values to the Untyped input-object model while * explicitly rejecting values that are valid JSON Schema objects. * * @param input - The value to check. * @returns True if the input is an untyped input object and not JSON Schema. */ /** @deprecated Use {@link isUntypedConfigStrict} */ declare const isUntypedInputStrict: typeof isUntypedConfigStrict; declare function isUntypedConfigStrict(input: unknown): input is InputObject; /** * Type guard for Powerlines Schema objects. * * @param input - The value to check. * @returns True if the input is a Powerlines Schema object, false otherwise. */ declare function isSchema(input: unknown): input is SchemaEnvelope; /** * Type guard for Powerlines Schema objects with a specific type specification. * * @param input - The value to check. * @returns True if the input is a Powerlines Schema object with the specified type specification, false otherwise. */ declare function isSchemaOf(input: unknown): input is SchemaEnvelopeOf; /** * Type guard for extracted schema objects that include source information. * * @param input - The value to check. * @returns True if the input is a SchemaWithSource object, false otherwise. */ declare function isSchemaWithSource(input: unknown): input is ExtractedSchemaEnvelope; /** * Type guard for Powerlines Schemas that are in Object form. * * @param input - The value to check. * @returns True if the input is a Powerlines Schema object in Object form, false otherwise. */ declare function isSchemaObject(input: unknown): input is SchemaEnvelope; //#endregion export { type BaseExtractOptions, type BaseSchemaSource, type ExtractedSchemaEnvelope, GetPropertyResult, type InferExtractOptions, JSON_SCHEMA_ANY, JSON_SCHEMA_CONSTRUCTOR_KEY, JSON_SCHEMA_METADATA_KEYS, JSON_SCHEMA_PRIMITIVE_TYPES, JSON_SCHEMA_TYPES, type JsonSchema, type JsonSchemaAllOf, type JsonSchemaAny, type JsonSchemaAnyOf, type JsonSchemaArray, type JsonSchemaBigint, type JsonSchemaBoolean, type JsonSchemaConditionalKeywords, type JsonSchemaDate, type JsonSchemaDecimal, type JsonSchemaDecimalFormat, type JsonSchemaEnum, type JsonSchemaFunction, type JsonSchemaFunctionParameter, type JsonSchemaInteger, type JsonSchemaIntegerFormat, type JsonSchemaKeywords, type JsonSchemaLike, type JsonSchemaLiteral, type JsonSchemaLogicKeywords, type JsonSchemaMap, type JsonSchemaMetadataKeywords, type JsonSchemaNativeEnum, type JsonSchemaNever, type JsonSchemaNull, type JsonSchemaNullable, type JsonSchemaNumber, type JsonSchemaNumberFormat, type JsonSchemaObject, type JsonSchemaOf, type JsonSchemaPrimitiveType, type JsonSchemaPrimitiveUnion, type JsonSchemaRecord, type JsonSchemaRecordPropertyNames, type JsonSchemaRef, type JsonSchemaSchemaSource, type JsonSchemaSet, type JsonSchemaString, type JsonSchemaStringFormat, type JsonSchemaTuple, type JsonSchemaType, JsonSchemaTypeNames, type JsonSchemaUndefined, type JsonSchemaUnion, type JsonSchemaUnknown, type ReflectionSchemaSource, SCHEMA_ARRAY_CONCAT_KEYWORDS, SCHEMA_RECORD_KEYWORDS, SCHEMA_SINGLE_KEYWORDS, type SchemaConfig, type SchemaConfigVariant, type SchemaEnvelope, type SchemaEnvelopeOf, type SchemaSource, type SchemaSourceConfig, type SchemaSourceVariant, type SpecOf, type StandardSchemaSchemaSource, type UntypedConfigObject, type UntypedSchema, type UntypedSchemaSource, type ValibotSchema, type ValibotSchemaSource, type Zod3SchemaSource, addProperty, applyJsonSchemaMetadata, assertSchemasDoNotContradict, bundleReferences, createDeepkitPlugin, createStoragePromises, extract, extractHash, extractJsonSchema, extractReflection, extractResolvedVariant, extractSchema, extractSchemaWithSource, extractSource, extractTSType, extractVariant, findSchemaContradictions, getJsonSchema, getJsonSchemaObject, getPrimarySchemaType, getProperties, getPropertiesList, getProperty, hasJsonSchemaConstructorFlag, isFileReference, isJsonSchema, isJsonSchemaAllOf, isJsonSchemaAny, isJsonSchemaAnyOf, isJsonSchemaArray, isJsonSchemaBigint, isJsonSchemaBoolean, isJsonSchemaDate, isJsonSchemaDecimal, isJsonSchemaEnum, isJsonSchemaInteger, isJsonSchemaKeywords, isJsonSchemaLiteral, isJsonSchemaMap, isJsonSchemaNativeEnum, isJsonSchemaNever, isJsonSchemaNull, isJsonSchemaNullable, isJsonSchemaNumber, isJsonSchemaObject, isJsonSchemaPrimitiveType, isJsonSchemaPrimitiveUnion, isJsonSchemaRecord, isJsonSchemaRef, isJsonSchemaSet, isJsonSchemaString, isJsonSchemaTuple, isJsonSchemaType, isJsonSchemaUndefined, isJsonSchemaUnion, isJsonSchemaUnknown, isNullOnlyJsonSchema, isPropertyOptional, isSchema, isSchemaNullable, isSchemaObject, isSchemaOf, isSchemaWithSource, isStandardSchema, isUntypedConfig, isUntypedConfigStrict, isUntypedInput, isUntypedInputStrict, isUntypedSchema, isUntypedSchemaStrict, isValibotSchema, isValidSchemaConfigFile, isValidSchemaInputFile, mapStorageToFileSystem, merge, mergeMetadata, normalizeKey, readSchemaTypes, traverseSchema }; //# sourceMappingURL=index.d.mts.map