Constructor
new BookmarksDocument()
- Source:
Example
import { BookmarksDocument } from "@thoughtsunificator/bookmarks-document"
Members
documentElement :BookmarkFolder
- Description:
The root BookmarkFolder
- Source:
The root BookmarkFolder
Type:
- BookmarkFolder
Methods
createLink(title, icon, url, createdAt, updatedAt) → {BookmarkLink}
- Description:
Create a bookmark link The ownerDocument property is automatically set
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
title |
string | |
icon |
string | |
url |
string | |
createdAt |
Date | |
updatedAt |
Date |
Returns:
- Type
- BookmarkLink
createFolder(title, createdAt, updatedAt) → {BookmarkFolder}
- Description:
Create a bookmark folder The ownerDocument property is automatically set
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
title |
string | |
createdAt |
Date | |
updatedAt |
Date |
Returns:
- Type
- BookmarkFolder
createVirtualFolder() → {VirtualBookmarkFolder}
- Description:
Create a virtual bookmark folder
- Source:
Returns:
- Type
- VirtualBookmarkFolder
createTreeWalker(bookmarkFolder) → {TreeWalker}
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
bookmarkFolder |
BookmarkFolder |
Returns:
- Type
- TreeWalker
serialize() → {Array.<Bookmark>}
- Description:
Return a list of bookmark removing any unwanted properties in the process
- Source:
Returns:
- Type
- Array.<Bookmark>
getBookmarksCount() → {number}
- Description:
Returns the number of bookmarks present in this BookmarksDocument (excluding) the root folder
- Source:
Returns:
- Type
- number