File size: 540 Bytes
4450790
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import type { Bookmark } from "../bookmark.js";

import { app } from "scripts/app.js";
import { NodeTypesString } from "../constants.js";

class BookmarksService {
  /**

   * Gets a list of the current bookmarks within the current workflow.

   */
  getCurrentBookmarks() {
    return app.graph._nodes
      .filter((n): n is Bookmark => n.type === NodeTypesString.BOOKMARK)
      .sort((a, b) => a.title.localeCompare(b.title));
  }
}

/** The BookmarksService singleton. */
export const SERVICE = new BookmarksService();