@mocanvas/editor · function

createCustomRecordValidator

declare function createCustomRecordValidator<Type extends string>(type: Type, props: PropsMap, meta?: PropsMap): Validator<TLCustomRecord<Type>>

The validator for a custom record type, from its props.

Note the id: a custom record's id carries its type (custom:review:…), so the validator checks the whole prefix rather than just custom:. An id from one custom type must not validate as another's.

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.