SchemaClass comments

This commit is contained in:
Julien Valverdé
2023-12-30 23:51:03 +01:00
parent caa8f9d2be
commit 5704fd817d

View File

@@ -2,6 +2,18 @@ import { Class } from "type-fest"
import { z } from "zod"
/**
* Represents a schema class with generic parameters for defining validation schemas.
*
* @template Values - The type of values expected by the schema.
* @template Input - The type of input data expected by the schema.
* @template SchemaT - The type of the raw shape of the schema.
* @template SchemaUnknownKeys - The type of unknown keys parameter for the schema.
* @template SchemaCatchall - The type of catchall parameter for the schema.
* @template SchemaWithDefaultValuesT - The type of the raw shape for default values schema.
* @template SchemaWithDefaultValuesUnknownKeys - The type of unknown keys parameter for default values schema.
* @template SchemaWithDefaultValuesCatchall - The type of catchall parameter for default values schema.
*/
export type SchemaClass<
Values extends {} = {},
Input extends {} = {},
@@ -48,6 +60,11 @@ export type SchemaClass<
}
)
/**
* Represents the constructor parameters for a schema class.
*
* @template Values - The type of values expected by the schema.
*/
export type SchemaClassConstructorParams<
Values extends {} = {}
> = (
@@ -56,6 +73,18 @@ export type SchemaClassConstructorParams<
>
)
/**
* Represents a schema object with generic parameters for defining validation schemas.
*
* @template Values - The type of values expected by the schema.
* @template Input - The type of input data expected by the schema.
* @template SchemaT - The type of the raw shape of the schema.
* @template SchemaUnknownKeys - The type of unknown keys parameter for the schema.
* @template SchemaCatchall - The type of catchall parameter for the schema.
* @template SchemaWithDefaultValuesT - The type of the raw shape for default values schema.
* @template SchemaWithDefaultValuesUnknownKeys - The type of unknown keys parameter for default values schema.
* @template SchemaWithDefaultValuesCatchall - The type of catchall parameter for default values schema.
*/
export type SchemaObject<
Values extends {} = {},
Input extends {} = {},