Implements

Constructors

  • Create a BookmarkPanel instance.

    Parameters

    • Optionaloptions: Options

      The options to create a BookmarkPanel instance. use create to create an instance.

    Returns BookmarkPanel

    Create a BookmarkPanel instance with the specified options

    const bookmarkPanel = await BookmarkPanel.create();
    

Properties

options: Options

Methods

  • Insert a bookmark node. left and parent are optional.

    • If left is empty and the parent node is not empty, the bookmark will be inserted into the first child node of the parent node.
    • If parent is empty and left is not empty, the bookmark is inserted before the left node.
    • If left and parent are both empty, the bookmark is inserted into the first child node under the root node.
    • If both left and parent are not empty, then left has the highest priority, parent is invalid, and the bookmark is inserted before the left node.

    Parameters

    • doc: DocType

      The document.

    • title: string

      The title of the bookmark.

    • left: null | BookmarkType

      The left bookmark node.

    • parent: null | BookmarkType

      The parent bookmark node.

    Returns Promise<null | BookmarkType>

    • The bookmark node.
  • move a bookmark node.

    • If left is empty and the parent node is not empty, the bookmark will move to the first child node of the parent node.
    • If parent is empty and left is not empty, the bookmark moves to the front of the left node.
    • If both left and parent are empty, the bookmark moves to the first child node under the root node.
    • If both left and parent are not empty, then left has the highest priority, parent is invalid, and the bookmark is moved to the front of the left node.

    Parameters

    Returns Promise<boolean>

    • Whether the operation is successful.
  • Create a BookmarkPanel instance. Instead of creating an instance in new mode, use create to create an instance.

    Parameters

    • Optionaloptions: Options

      The options to create a BookmarkPanel instance.

    Returns Promise<BookmarkPanel>

    Create a BookmarkPanel instance with the specified options

     const bookmarkPanel = await BookmarkPanel.create();