import { IJsonSchemaApplication, IJsonSchemaCollection, IJsonSchemaUnit, IValidation, Primitive } from "@typia/interface"; import { TypeGuardError } from "./TypeGuardError"; /** * Generates JSON schema for type `T`. * * @danger You must configure the generic argument `Type` */ export declare function schema(): never; /** * Generates JSON schema for type `T`. * * Creates {@link IJsonSchemaUnit} containing a main schema and shared * components. Named types are stored in `components` for `$ref` referencing. * * Specify OpenAPI version via `Version` generic (`"3.0"` or `"3.1"`). Default * is `"3.1"`. Key difference: `"3.1"` supports tuple types. * * @template Type Target type * @template Version OpenAPI version (`"3.0"` | `"3.1"`). Default `"3.1"` * @returns JSON schema unit */ export declare function schema(): IJsonSchemaUnit; /** * Generates JSON schemas for multiple types. * * @danger You must configure the generic argument `Types` */ export declare function schemas(): never; /** * Generates JSON schemas for multiple types. * * Creates {@link IJsonSchemaCollection} containing schemas for all types in the * tuple. Named types are stored in `components` for `$ref` referencing. * * Specify OpenAPI version via `Version` generic (`"3.0"` or `"3.1"`). Default * is `"3.1"`. Key difference: `"3.1"` supports tuple types. * * @template Types Tuple of target types * @template Version OpenAPI version (`"3.0"` | `"3.1"`). Default `"3.1"` * @returns JSON schema collection */ export declare function schemas(): IJsonSchemaCollection; /** * Generates JSON function schema application. * * @danger You must configure the generic argument `Class` */ export declare function application(): never; /** * Generates JSON function schema application from class/interface. * * Creates {@link IJsonSchemaApplication} from a TypeScript class or interface, * generating JSON schemas for all methods, parameters, and return types. * Designed for building custom LLM function calling schemas. * * The returned object contains: * * - `functions`: Array of function metadata with parameter/return schemas * - `components`: Shared schema components for `$ref` referencing * * Use cases: * * - Custom LLM function calling schema formats * - API documentation or code generation tools * - Alternative LLM integrations beyond built-in providers * * For standard LLM function calling, use {@link llm.application} instead, which * provides provider-specific schemas (ChatGPT, Claude, Gemini, etc.). * * @template Class Target class or interface type * @template Version OpenAPI version (`"3.0"` | `"3.1"`). Default `"3.1"` * @returns JSON function schema application */ export declare function application(): IJsonSchemaApplication; /** * Parses JSON string with assertion. * * @danger You must configure the generic argument `T` */ export declare function assertParse(input: string, errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error)): never; /** * Parses JSON string with assertion. * * Combines `JSON.parse()` with {@link assert}. Throws {@link TypeGuardError} when * parsed value doesn't match type `T`. * * Related functions: * * - {@link isParse} — Returns `null` instead of throwing * - {@link validateParse} — Returns detailed validation errors * * @template T Target type for parsed value * @param input JSON string to parse * @param errorFactory Custom error factory receiving * {@link TypeGuardError.IProps} * @returns Parsed value of type `T` * @throws {TypeGuardError} When parsed value doesn't conform to type `T` */ export declare function assertParse(input: string, errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error)): Primitive; /** * Parses JSON string with type checking. * * @danger You must configure the generic argument `T` */ export declare function isParse(input: string): never; /** * Parses JSON string with type checking. * * Combines `JSON.parse()` with {@link is}. Returns `null` when parsed value * doesn't match type `T`. * * Related functions: * * - {@link assertParse} — Throws instead of returning `null` * - {@link validateParse} — Returns detailed validation errors * * @template T Target type for parsed value * @param input JSON string to parse * @returns Parsed value of type `T`, or `null` if invalid */ export declare function isParse(input: string): Primitive | null; /** * Parses JSON string with validation. * * @danger You must configure the generic argument `T` */ export declare function validateParse(input: string): never; /** * Parses JSON string with validation. * * Combines `JSON.parse()` with {@link validate}. Returns * {@link IValidation.IFailure} with all errors on mismatch, or * {@link IValidation.ISuccess} with parsed value. * * Related functions: * * - {@link assertParse} — Throws on first error * - {@link isParse} — Returns `null` instead of error details * * @template T Target type for parsed value * @param input JSON string to parse * @returns Validation result containing parsed value or errors */ export declare function validateParse(input: string): IValidation>; /** * Converts value to JSON string (8x faster). * * Generates optimized JSON conversion code specific to type `T`, achieving ~8x * faster performance than native `JSON.stringify()`. * * Does not validate the input. For validation, use: * * - {@link assertStringify} — Throws on type mismatch * - {@link isStringify} — Returns `null` on type mismatch * - {@link validateStringify} — Returns detailed validation errors * * @template T Type of input value * @param input Value to stringify * @returns JSON string */ export declare function stringify(input: T): string; /** * Converts value to JSON string with assertion (5x faster). * * Combines {@link assert} with {@link stringify}. Throws {@link TypeGuardError} * when input doesn't match type `T`. Achieves ~5x faster performance than * native `JSON.stringify()`. * * Related functions: * * - {@link stringify} — No validation * - {@link isStringify} — Returns `null` instead of throwing * - {@link validateStringify} — Returns detailed validation errors * * @template T Type of input value * @param input Value to assert and stringify * @param errorFactory Custom error factory receiving * {@link TypeGuardError.IProps} * @returns JSON string * @throws {TypeGuardError} When input doesn't conform to type `T` */ export declare function assertStringify(input: T, errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error)): string; /** * Converts value to JSON string with assertion (5x faster). * * Combines {@link assert} with {@link stringify}. Throws {@link TypeGuardError} * when input doesn't match type `T`. Achieves ~5x faster performance than * native `JSON.stringify()`. * * Related functions: * * - {@link stringify} — No validation * - {@link isStringify} — Returns `null` instead of throwing * - {@link validateStringify} — Returns detailed validation errors * * @template T Type of input value * @param input Value to assert and stringify * @param errorFactory Custom error factory receiving * {@link TypeGuardError.IProps} * @returns JSON string * @throws {TypeGuardError} When input doesn't conform to type `T` */ export declare function assertStringify(input: T, errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error)): unknown; /** * Converts value to JSON string with type checking (7x faster). * * Combines {@link is} with {@link stringify}. Returns `null` when input doesn't * match type `T`. Achieves ~7x faster performance than native * `JSON.stringify()`. * * Related functions: * * - {@link stringify} — No validation * - {@link assertStringify} — Throws instead of returning `null` * - {@link validateStringify} — Returns detailed validation errors * * @template T Type of input value * @param input Value to check and stringify * @returns JSON string, or `null` if type check fails */ export declare function isStringify(input: T): string | null; /** * Converts value to JSON string with type checking (7x faster). * * Combines {@link is} with {@link stringify}. Returns `null` when input doesn't * match type `T`. Achieves ~7x faster performance than native * `JSON.stringify()`. * * Related functions: * * - {@link stringify} — No validation * - {@link assertStringify} — Throws instead of returning `null` * - {@link validateStringify} — Returns detailed validation errors * * @template T Type of input value * @param input Value to check and stringify * @returns JSON string, or `null` if type check fails */ export declare function isStringify(input: unknown): string | null; /** * Converts value to JSON string with validation (5x faster). * * Combines {@link validate} with {@link stringify}. Returns * {@link IValidation.IFailure} with all errors on mismatch, or * {@link IValidation.ISuccess} with JSON string. Achieves ~5x faster performance * than native `JSON.stringify()`. * * Related functions: * * - {@link stringify} — No validation * - {@link assertStringify} — Throws on first error * - {@link isStringify} — Returns `null` instead of error details * * @template T Type of input value * @param input Value to validate and stringify * @returns Validation result containing JSON string or errors */ export declare function validateStringify(input: T): IValidation; /** * Converts value to JSON string with validation (5x faster). * * Combines {@link validate} with {@link stringify}. Returns * {@link IValidation.IFailure} with all errors on mismatch, or * {@link IValidation.ISuccess} with JSON string. Achieves ~5x faster performance * than native `JSON.stringify()`. * * Related functions: * * - {@link stringify} — No validation * - {@link assertStringify} — Throws on first error * - {@link isStringify} — Returns `null` instead of error details * * @template T Type of input value * @param input Value to validate and stringify * @returns Validation result containing JSON string or errors */ export declare function validateStringify(input: unknown): IValidation; /** * Creates reusable {@link isParse} function. * * @danger You must configure the generic argument `T` */ export declare function createIsParse(): never; /** * Creates reusable {@link isParse} function. * * @template T Target type for parsed value * @returns Reusable parser function */ export declare function createIsParse(): (input: string) => Primitive | null; /** * Creates reusable {@link assertParse} function. * * @danger You must configure the generic argument `T` */ export declare function createAssertParse(errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error)): never; /** * Creates reusable {@link assertParse} function. * * @template T Target type for parsed value * @param errorFactory Custom error factory receiving * {@link TypeGuardError.IProps} * @returns Reusable parser function */ export declare function createAssertParse(errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error)): (input: string) => Primitive; /** * Creates reusable {@link validateParse} function. * * @danger You must configure the generic argument `T` */ export declare function createValidateParse(): never; /** * Creates reusable {@link validateParse} function. * * @template T Target type for parsed value * @returns Reusable parser function */ export declare function createValidateParse(): (input: string) => IValidation>; /** * Creates reusable {@link stringify} function. * * @danger You must configure the generic argument `T` */ export declare function createStringify(): never; /** * Creates reusable {@link stringify} function. * * @template T Type of input value * @returns Reusable stringify function */ export declare function createStringify(): (input: T) => string; /** * Creates reusable {@link assertStringify} function. * * @danger You must configure the generic argument `T` */ export declare function createAssertStringify(errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error)): never; /** * Creates reusable {@link assertStringify} function. * * @template T Type of input value * @param errorFactory Custom error factory receiving * {@link TypeGuardError.IProps} * @returns Reusable stringify function */ export declare function createAssertStringify(errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error)): (input: unknown) => string; /** * Creates reusable {@link isStringify} function. * * @danger You must configure the generic argument `T` */ export declare function createIsStringify(): never; /** * Creates reusable {@link isStringify} function. * * @template T Type of input value * @returns Reusable stringify function */ export declare function createIsStringify(): (input: unknown) => string | null; /** * Creates reusable {@link validateStringify} function. * * @danger You must configure the generic argument `T` */ export declare function createValidateStringify(): never; /** * Creates reusable {@link validateStringify} function. * * @template T Type of input value * @returns Reusable stringify function */ export declare function createValidateStringify(): (input: unknown) => IValidation;