@mocanvas/editor · function

createCustomRecord

declare function createCustomRecord<Type extends string>(info: CustomRecordInfo<Type>, props: TLCustomRecord<Type>["props"], options?: {
    id?: string;
    meta?: Record<string, never>;
}): TLCustomRecord<Type>

Create a record of a declared custom type, with its defaults filled in.

``ts const review = createCustomRecord(reviewInfo, { status: "open", assignee: null }) editor.store.put([review]) ``

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.