@mocanvas/editor · constant

userPreferencesValidator

declare const userPreferencesValidator: Validator<UserPreferencesState>

Validates a stored preferences object.

Applied on *read*, not only on write, because the value comes from disk: a build that shipped a bad preference, a hand-edited storage entry or a half-written record must not be able to make the editor unopenable. A failed read falls back to fresh preferences.

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.