UNPKG

@eclipse-scout/core

Version:
36 lines 1.59 kB
/// <reference types="jquery" /> import { BookmarkDo, Session } from '../index'; /** * Global storage service for {@link BookmarkDo bookmarks}. * * An implementation can be provided by registering an object factory for this type. */ export declare class BookmarkStore { protected static _INSTANCES: Map<Session, BookmarkStore>; /** * Returns an instance of {@link BookmarkStore} for the given {@link Session}. If no instance is associated * with the session yet, a new instance is created. * * @param session Optional session object. If this is omitted, the first session of the app is used. * If the app does not have any active sessions (e.g. during unit testing), this argument is mandatory. */ static get(session?: Session): BookmarkStore; /** * Saves a bookmark to this bookmark store. The previous version (if any) is overwritten. The stored * bookmark is returned afterward (may have been altered while being persisted, e.g. assigned an ID). */ storeBookmark(bookmark: BookmarkDo): JQuery.Promise<BookmarkDo>; /** * Returns the bookmark for the given ID, or `null` if the bookmark could not be found. */ loadBookmark(bookmarkId: string): JQuery.Promise<BookmarkDo>; /** * Returns a sorted list of all bookmarks in this store. */ loadAllBookmarks(): JQuery.Promise<BookmarkDo[]>; /** * Replaces all bookmarks in this store with the given list. */ storeAllBookmarks(allBookmarks: BookmarkDo[]): JQuery.Promise<void>; } //# sourceMappingURL=BookmarkStore.d.ts.map