rmapi-js
    Preparing search index...

    Namespace blocks

    the blocks of a version 6 page as the file stores them, and what they resolve to

    BlocksPage.read keeps every block of a file in order, and BlocksPage.resolve gives the Scene they show. A CrdtId names an item in every copy of a page. To edit a page, use a Page, which Page.fromBlocks makes of blocks.

    Every value here is a plain object: an id's counter is a bigint, bytes are a Uint8Array, a pen, color or paragraph style is its code, and a choice of forms is an object of a type and a value.

    const page = blocks.BlocksPage.read(Page.blank("RM110").toBytes());
    const scene = page.resolve();
    console.log(scene.layers().length);
    BlocksPage
    Scene
    Anchor
    AuthorId
    Block
    CrdtId
    FloatPoint
    LwwValue
    MigrationInfo
    PackedPoint
    PageInfo
    Paragraph
    RootText
    SceneInfo
    SceneItem
    SceneNode
    SceneText
    SceneTree
    SequenceItem
    Stroke
    StyleValue
    TextRun
    TextStyle
    TreeNode
    Unparsed
    UnparsedItem
    WireHighlight
    WireString
    BlockBody
    NodeItem
    Points
    Sequence
    END
    HEADER_LENGTH
    ROOT
    authorId
    authorInstall
    blockType
    sameId