refineCanvasAttr

Refines one attribute's text as its declared type, for a reader editing an element that was authored in chalk.

@internote/canvas-sdkFunction
On this page
import { refineCanvasAttr } from '@internote/canvas-sdk';

The element itself came through the compiler and its other values are already refined; only the one the reader touched needs putting through the same type. A keyframe chain is refused, since a keyframe anchors to the narrative's steps and the reader is not writing the narrative.

#Signature

(identifier: string, name: string, text: string): {
    ok: true;
    value: unknown;
} | {
    ok: false;
    error: string;
}

#Parameters

identifier
The element's identifier, such as point.
name
The attribute's name, canonical or an alias.
text
What the reader typed.

#Returns

The refined value, or the message to show the reader.

Declared in packages/canvas-sdk/src/refine/authored-elements.ts:39.

Last updated