@mocanvas/editor · class

ObjectValidator

declare class ObjectValidator<Shape extends object> extends Validator<Shape>

A validator for a plain object with a known set of properties.


Methods · 2

allowUnknownProperties(): ObjectValidator<Shape>

The same object, but properties the config does not mention are kept instead of rejected.

constructor(config: {

Properties · 2

readonly config: {
extend<Extension extends Record<string, Validatable<unknown>>>(extension: Extension): ObjectValidator<Shape & ObjectValidatorType<Extension>>

A new object validator with more properties.

mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.