@mocanvas/editor · function

createAssetValidator

declare function createAssetValidator<Type extends string, Props extends object>(type: Type, props: PropsMap, meta?: PropsMap): Validator<BaseAsset<Type, Props>>

The validator for an asset type, from its props.

Assets have no geometry and no parent — they are the bytes a shape points at — so this is the smallest of the four.

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.