Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface WorkspacePlatformProvider

Hierarchy

  • PlatformProvider
    • WorkspacePlatformProvider

Index

Methods

applySnapshot

  • applySnapshot(payload: ApplySnapshotPayload, identity?: Identity): Promise<void>
  • Handles requests to apply a snapshot to the current Platform.

    Parameters

    • payload: ApplySnapshotPayload

      Payload containing the snapshot to be applied, as well as any options.

    • Optional identity: Identity

    Returns Promise<void>

closeView

  • closeView(payload: CloseViewPayload, identity?: Identity): Promise<any>
  • Closes a view

    Parameters

    • payload: CloseViewPayload

      Specifies the target view to be closed.

    • Optional identity: Identity

      Identity of the entity that called {@link Platform#closeView Platform.closeView}.

    Returns Promise<any>

createSavedPage

  • Implementation for creating a saved page in persistent storage.

    Parameters

    Returns Promise<void>

createSavedWorkspace

  • Implementation for creating a saved workspace in persistent storage.

    Parameters

    Returns Promise<void>

createView

  • createView(payload: CreateViewPayload, identity: Identity): Promise<View>
  • Creates a new view and attaches it to a specified target window.

    Parameters

    • payload: CreateViewPayload

      Creation options for the new view.

    • identity: Identity

      Identity of the entity that called {@link Platform#createView Platform.createView}.

    Returns Promise<View>

createWindow

  • createWindow(options: PlatformWindowCreationOptions, identity?: Identity): Promise<_Window>
  • Handles requests to create a window in the current platform.

    Parameters

    • options: PlatformWindowCreationOptions
    • Optional identity: Identity

    Returns Promise<_Window>

deleteSavedPage

  • deleteSavedPage(id: string): Promise<void>
  • Implementation for deleting a saved page in persistent storage.

    Parameters

    • id: string

      of the id of the page to delete.

    Returns Promise<void>

deleteSavedWorkspace

  • deleteSavedWorkspace(id: string): Promise<void>
  • Implementation for deleting a saved workspace in persistent storage.

    Parameters

    • id: string

      of the id of the workspace to delete.

    Returns Promise<void>

fetchManifest

  • fetchManifest(payload: FetchManifestPayload, callerIdentity: Identity): Promise<any>
  • Handles requests to fetch manifests in the current platform.

    Parameters

    • payload: FetchManifestPayload

      Payload containing the manifestUrl to be fetched.

    • callerIdentity: Identity

      If {@link Platform#fetchManifest Platform.fetchManifest} was called, the identity of the caller will be here. If fetchManifest was called internally, callerIdentity will be the provider's identity.

    Returns Promise<any>

getSavedPage

  • getSavedPage(id: string): Promise<Page>
  • Implementation for getting a single page in persistent storage.

    Parameters

    • id: string

    Returns Promise<Page>

getSavedPages

  • getSavedPages(query?: string): Promise<Page[]>
  • Implementation for getting a list of saved pages from persistent storage.

    Parameters

    • Optional query: string

      an optional query.

    Returns Promise<Page[]>

getSavedWorkspace

  • getSavedWorkspace(id: string): Promise<Workspace>
  • Implementation for getting a single workspace in persistent storage.

    Parameters

    • id: string

    Returns Promise<Workspace>

getSavedWorkspaces

  • getSavedWorkspaces(query?: string): Promise<Workspace[]>
  • Implementation for getting a list of saved workspaces from persistent storage.

    Parameters

    • Optional query: string

      an optional query.

    Returns Promise<Workspace[]>

getSnapshot

  • getSnapshot(payload: undefined, identity: Identity): Promise<Snapshot>
  • Gets the current state of windows and their views and returns a snapshot object containing that info.

    Parameters

    • payload: undefined

      Undefined unless you've defined a custom getSnapshot protocol.

    • identity: Identity

      Identity of the entity that called {@link Platform#getSnapshot Platform.getSnapshot}.

    Returns Promise<Snapshot>

    Snapshot of current platform state.

getWindowContext

  • getWindowContext(payload: GetWindowContextPayload, identity?: Identity): Promise<any>
  • Handles requests to get a window's context. target may be a window or a view. If it is a window, that window's customContext will be returned. If it is a view, the customContext of that view's current host window will be returned.

    Parameters

    • payload: GetWindowContextPayload

      Object containing the requested context update, the target's identity, and the target's entityType.

    • Optional identity: Identity

    Returns Promise<any>

    The new context.

launchIntoPlatform

  • launchIntoPlatform(payload: LaunchIntoPlatformPayload): Promise<void>
  • Parameters

    • payload: LaunchIntoPlatformPayload

    Returns Promise<void>

onWindowContextUpdated

  • onWindowContextUpdated(payload: WindowOptionsChangedEvent<"window", "options-changed">): Promise<HostContextChangedPayload>
  • Called when a window's customContext is updated. Responsible for raising the host-context-updated event on that window's child views.

    Parameters

    • payload: WindowOptionsChangedEvent<"window", "options-changed">

      The event payload for the window whose context has changed. The new context will be contained as payload.diff.customContext.newVal.

    Returns Promise<HostContextChangedPayload>

    The event that it raised.

openGlobalContextMenu

  • Implementation for showing a global context menu given a menu template, handler callback, and screen coordinates. For an example of overriding, see BrowserOverrideCallback.

    Parameters

    • req: OpenGlobalContextMenuPayload

      the payload received by the provider call

    • callerIdentity: Identity

      OF identity of the entity from which the request originated

    Returns any

openPageTabContextMenu

  • Implementation for showing a page tab context menu given a menu template, handler callback, and screen coordinates. For an example of overriding, see BrowserOverrideCallback.

    Parameters

    • req: OpenPageTabContextMenuPayload

      the payload received by the provider call

    • callerIdentity: Identity

      OF identity of the entity from which the request originated

    Returns any

openSaveButtonContextMenu

  • Implementation for showing a context menu for save button given a menu template, handler callback, and screen coordinates. For an example of overriding, see BrowserOverrideCallback.

    Parameters

    • req: OpenSaveButtonContextMenuPayload

      the payload received by the provider call

    • callerIdentity: Identity

      OF identity of the entity from which the request originated

    Returns any

openViewTabContextMenu

  • Implementation for showing a view tab context menu given a menu template, handler callback, and screen coordinates. For an example of overriding, see BrowserOverrideCallback.

    Parameters

    • req: OpenViewTabContextMenuPayload

      the payload received by the provider call

    • callerIdentity: Identity

      OF identity of the entity from which the request originated

    Returns any

positionOutOfBoundsWindows

  • positionOutOfBoundsWindows(snapshot: Snapshot, outOfBoundsWindows: WindowCreationOptions[]): Promise<WindowCreationOptions[]>
  • Called when a snapshot is being applied and some windows in that snapshot would be fully or partially off-screen. Returns an array of windows with modified positions, such that any off-screen windows are positioned in the top left corner of the main monitor.

    Parameters

    • snapshot: Snapshot

      The snapshot to be applied.

    • outOfBoundsWindows: WindowCreationOptions[]

      An array of WindowOptions for any windows that would be off-screen.

    Returns Promise<WindowCreationOptions[]>

    An array of WindowOptions with their position modified to fit on screen.

quit

  • quit(payload: undefined, identity: Identity): Promise<void>
  • Closes the current Platform and all child windows and views.

    Parameters

    • payload: undefined

      Undefined unless you have implemented a custom quite protocol.

    • identity: Identity

      Identity of the entity that called {@link Platform#quit Platform.quit}.

    Returns Promise<void>

replaceLayout

  • replaceLayout(payload: ReplaceLayoutPayload, identity?: Identity): Promise<void>
  • Replaces a Platform window's layout with a new layout. Any views that were in the old layout but not the new layout will be destroyed.

    Parameters

    • payload: ReplaceLayoutPayload

      Contains the target window and an opts object with a layout property to apply.

    • Optional identity: Identity

    Returns Promise<void>

replaceView

  • replaceView(payload: ReplaceViewPayload, identity?: Identity): Promise<void>
  • Parameters

    • payload: ReplaceViewPayload
    • Optional identity: Identity

    Returns Promise<void>

setWindowContext

  • setWindowContext(payload: SetWindowContextPayload, identity?: Identity): Promise<any>
  • Handles requests to set a window's context. target may be a window or a view. If it is a window, that window's customContext will be updated. If it is a view, the customContext of that view's current host window will be updated.

    Parameters

    • payload: SetWindowContextPayload

      Object containing the requested context update, the target's identity, and the target's entityType.

    • Optional identity: Identity

    Returns Promise<any>

    The new context.

updateSavedPage

  • Implementation for updating a saved page in persistent storage.

    Parameters

    Returns Promise<void>

updateSavedWorkspace

  • Implementation for updating a saved workspace in persistent storage.

    Parameters

    Returns Promise<void>

Generated using TypeDoc