## API Report File for "@tldraw/validate" > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts import { IndexKey } from '@tldraw/utils'; import { JsonValue } from '@tldraw/utils'; // @public const any: Validator; // @public const array: Validator; // @public function arrayOf(itemValidator: Validatable): ArrayOfValidator; // @public (undocumented) export class ArrayOfValidator extends Validator { constructor(itemValidator: Validatable); // (undocumented) readonly itemValidator: Validatable; // (undocumented) lengthGreaterThan1(): Validator; // (undocumented) nonEmpty(): Validator; } // @public const bigint: Validator; // @public const boolean: Validator; // @public function dict(keyValidator: Validatable, valueValidator: Validatable): DictValidator; // @public (undocumented) export class DictValidator extends Validator> { constructor(keyValidator: Validatable, valueValidator: Validatable); // (undocumented) readonly keyValidator: Validatable; // (undocumented) readonly valueValidator: Validatable; } // @public const indexKey: Validator; // @public const integer: Validator; // @public function jsonDict(): DictValidator; // @public const jsonValue: Validator; // @public const linkUrl: Validator; // @public function literal(expectedValue: T): Validator; // @public (undocumented) function literalEnum(...values: Values): Validator; // @public function model(name: string, validator: Validatable): Validator; // @public const nonZeroInteger: Validator; // @public const nonZeroNumber: Validator; // @public (undocumented) function nullable(validator: Validatable): Validator; // @public const number: Validator; // @public function object(config: { readonly [K in keyof Shape]: Validatable; }): ObjectValidator; // @public (undocumented) export class ObjectValidator extends Validator { constructor(config: { readonly [K in keyof Shape]: Validatable; }, shouldAllowUnknownProperties?: boolean); // (undocumented) allowUnknownProperties(): ObjectValidator; // (undocumented) readonly config: { readonly [K in keyof Shape]: Validatable; }; extend>(extension: { readonly [K in keyof Extension]: Validatable; }): ObjectValidator; } // @public (undocumented) function optional(validator: Validatable): Validator; // @public const positiveInteger: Validator; // @public const positiveNumber: Validator; // @public (undocumented) function setEnum(values: ReadonlySet): Validator; // @public const srcUrl: Validator; // @public const string: Validator; declare namespace T { export { literal, arrayOf, object, jsonDict, dict, union, model, setEnum, optional, nullable, literalEnum, ValidatorFn, Validatable, ValidationError, TypeOf, Validator, ArrayOfValidator, ObjectValidator, UnionValidator, DictValidator, unknown, any, string, number, positiveNumber, nonZeroNumber, integer, positiveInteger, nonZeroInteger, boolean, bigint, array, unknownObject, jsonValue, linkUrl, srcUrl, indexKey } } export { T } // @public (undocumented) type TypeOf> = V extends Validatable ? T : never; // @public function union>(key: Key, config: Config): UnionValidator; // @public (undocumented) export class UnionValidator, UnknownValue = never> extends Validator | UnknownValue> { constructor(key: Key, config: Config, unknownValueValidation: (value: object, variant: string) => UnknownValue); // (undocumented) validateUnknownVariants(unknownValueValidation: (value: object, variant: string) => Unknown): UnionValidator; } // @public const unknown: Validator; // @public (undocumented) const unknownObject: Validator>; // @public (undocumented) type Validatable = { validate: (value: unknown) => T; }; // @public (undocumented) class ValidationError extends Error { constructor(rawMessage: string, path?: ReadonlyArray); // (undocumented) name: string; // (undocumented) readonly path: ReadonlyArray; // (undocumented) readonly rawMessage: string; } // @public (undocumented) export class Validator implements Validatable { constructor(validationFn: ValidatorFn); check(name: string, checkFn: (value: T) => void): Validator; // (undocumented) check(checkFn: (value: T) => void): Validator; isValid(value: unknown): value is T; nullable(): Validator; optional(): Validator; refine(otherValidationFn: (value: T) => U): Validator; validate(value: unknown): T; // (undocumented) readonly validationFn: ValidatorFn; } // @public (undocumented) type ValidatorFn = (value: unknown) => T; // (No @packageDocumentation comment for this package) ```