@mocanvas/mocanvas · type

CreateBookmarkResult

type CreateBookmarkResult = {
    ok: true;
    value: BookmarkShape;
} | {
    ok: false;
    error: string;
}

Either the shape that was created, or why it was not.

A result rather than a throw because failing to unfurl a link is an ordinary outcome — an offline machine, a page that blocks scrapers — and the caller usually wants to show a toast, not unwind.

SEMANTICS-ASSUMED: the documented return type is Result<TLBookmarkShape, string> from tldraw's utils package, which is outside the six packages mocanvas reimplements. This is the same two-case shape under a local name.

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.