@mocanvas/editor · function

createUserRecordType

declare function createUserRecordType<U extends User = User>(defaults: () => Omit<U, "id" | "typeName">): RecordType<U, "id" | "typeName">

A user record type carrying the app's own fields.

The built-in {@link ./userRecord.UserRecordType} has the four properties the canvas itself needs. An app that wants people to carry more — a team, a role, a handle to render an avatar from — declares them here rather than stuffing them into meta, so its own code gets them typed.

The record stays in the presence scope: identities are shared with collaborators but never written to a file, because who was in the room is not part of the document.

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.