mirror of
https://github.com/status-im/status-lib.git
synced 2025-01-12 13:35:00 +00:00
24 lines
731 B
Nim
24 lines
731 B
Nim
import statusgo_backend/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, bookmark: Bookmark): Bookmark =
|
|
return status_browser.storeBookmark(bookmark)
|
|
|
|
proc updateBookmark*(self: BrowserModel, originalUrl: string, bookmark: Bookmark) =
|
|
status_browser.updateBookmark(originalUrl, bookmark)
|
|
|
|
proc getBookmarks*(self: BrowserModel): seq[Bookmark] =
|
|
result = status_browser.getBookmarks()
|
|
|
|
proc deleteBookmark*(self: BrowserModel, url: string) =
|
|
status_browser.deleteBookmark(url)
|