status-lib/status/browser.nim

25 lines
724 B
Nim
Raw Permalink Normal View History

2021-09-08 18:05:39 +00:00
import libstatus/browser as status_browser
import ../eventemitter
import ./types/[bookmark]
type
BrowserModel* = ref object
events*: EventEmitter
proc newBrowserModel*(events: EventEmitter): BrowserModel =
result = BrowserModel()
result.events = events
proc storeBookmark*(self: BrowserModel, url: string, name: string): Bookmark =
result = status_browser.storeBookmark(url, name)
proc updateBookmark*(self: BrowserModel, ogUrl: string, url: string, name: string) =
status_browser.updateBookmark(ogUrl, url, name)
proc getBookmarks*(self: BrowserModel): string =
result = status_browser.getBookmarks()
proc deleteBookmark*(self: BrowserModel, url: string) =
status_browser.deleteBookmark(url)