@mocanvas/mocanvas · type

ResolvedTextProps

type ResolvedTextProps = Omit<TextShapeProps, "textAlign"> & {
    text: string;
    richText: RichText;
    /**
     * Narrowed to the three alignments that mean something for a paragraph: a
     * stored `-legacy` value reads as `start`, which is what those spellings
     * aligned a label box to.
     */
    textAlign: DefaultTextAlignStyle;
}

TextShapeProps with the *derived* label filled in as well.

props.text is optional on the record — a v5 writer only sets richText — but a util that has run it through readTextProps always has both, so everything downstream can take a plain string.

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.