@mocanvas/editor · function

createCustomRecordId

declare function createCustomRecordId<Type extends string>(type: Type, id?: string): TLCustomRecordId<Type>

Mint an id for a custom record of type.

The type is part of the id rather than only of the record, so that an id on its own is enough to tell what it refers to — the same reason shape: ids are prefixed. {@link isCustomRecordId}(id, "review") can then answer without a store lookup.

Mentioned here

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.