@mocanvas/editor · class

DictValidator

declare class DictValidator<Key extends string, Value> extends Validator<Record<Key, Value>>

A validator for an object used as a lookup table: any key the key validator accepts, every value matching the value validator.

Both validators are kept as properties so a caller can ask what a dict is made of — which is how a shape's static props map can be walked and described without re-declaring the same shape twice.


Methods · 1

constructor(keyValidator: Validatable<Key>, valueValidator: Validatable<Value>)

Properties · 2

readonly keyValidator: Validatable<Key>
readonly valueValidator: Validatable<Value>

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.