UNPKG

@sassoftware/vi-api

Version:
47 lines (46 loc) 2.01 kB
import { PageModeEvent } from "../control/page"; /** * This API provides the functionality related to tabs. * * Accessed from the window at `window.sas.vi.tab`. * * @example window.sas.vi.tab.openTab("objectName", "objectId"); * @category API */ export interface TabApi { /** * @method * @description Opens the tab of a specified object. * @param objectType {string} Type of the object to be opened. * @param objectId {string} ID of the object to be opened. * @param [suppressNavigation = false] {boolean} Allows the tab to be opened without navigating to it. * @param [mode = PageModeEvent.OPEN] {PageModeEvent} Mode to open the tab in. * @return A Promise that resolves when the tab is opened. */ openTab(objectType: string, objectId: string, suppressNavigation?: boolean, mode?: PageModeEvent): Promise<void>; /** * @method * @description Close the tab of a specified object. * @param objectType {string} Type of the object to be closed. * @param objectId {string} ID of the object to be closed. * @return A Promise resolving once the tab has been successfully removed (resolves to true) * or once the tab could not be removed or found (resolving to false). */ closeTab(objectType: string, objectId: string): Promise<boolean>; /** * @method * @description Checks to see if an open tab is dirty. * @param objectType {string} Tab's object type. * @param objectId {string} An open tab's object ID. * @return true/false if the tab is dirty/not. */ isOpenTabDirty(objectType: string, objectId: string): boolean; /** * @method * @description Sets the dirty state of an open tab. * @param objectType {string} Open tab's object type. * @param objectId {string} Open tab's object ID. * @param dirtyState {boolean} Sets the tab's dirty state. */ setOpenTabDirty(objectType: string, objectId: string, dirtyState: boolean): Promise<void>; }