window-manager
Import
Section titled “Import”import * as api from "@fungi.computer/nacre/window-manager";Exports
Section titled “Exports”| Kind | Export | Description |
|---|---|---|
| type alias | WindowLaunch | Minimum identity required to own a window across mount generations. |
| type alias | WindowStatus | Current presentation state of a managed window. |
| type alias | WindowHost | Mount operations supplied by the embedding host; selection and authority stay with it. |
| type alias | WindowEvents | What a mounted App tells its window while it lives. |
| type alias | WindowProjection | Immutable snapshot of one window and its mount generation. |
| type alias | WindowsProjection | Current ordered collection of managed window snapshots. |
| type alias | WindowMount | Create a host-owned mount in a container, observing cancellation and navigation. |
| type alias | WindowManager | Own window lifetimes, visibility and serialized host mutations. |
| type alias | WindowManagerOptions | Host adapters used to create, attach and validate window mounts. |
| function | hasVisibleWindows() | Whether any projected App window is still visible in the workspace. |
| function | createWindowManager() | Owns App-window generations while leaving selection and App authority to the caller. A stale mount is always disposed when it eventually resolves. |
WindowLaunchtype alias
Section titled “WindowLaunch”type WindowLaunch = Readonly<{ windowId: string;}>;Minimum identity required to own a window across mount generations.
WindowStatustype alias
Section titled “WindowStatus”type WindowStatus = "loading" | "ready" | "minimized" | "error";Current presentation state of a managed window.
WindowHosttype alias
Section titled “WindowHost”type WindowHost<Launch> = Readonly<{ setVisibility: (visibility) => void | Promise<void>; reconfigure: (launch, signal?) => void | Promise<void>; requestClose?: () => boolean | Promise<boolean>; requestBack?: () => boolean | Promise<boolean>; activateNavigation?: (activation) => boolean | Promise<boolean>; activateStatus?: (action) => boolean | Promise<boolean>; dispose: () => void | Promise<void>;}>;Mount operations supplied by the embedding host; selection and authority stay with it.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
Launch extends WindowLaunch |
WindowEventstype alias
Section titled “WindowEvents”type WindowEvents = Readonly<{ onComputerChoice: () => Promise<void>; onNavigationState: (state) => void; onStatusItems: (items) => void;}>;What a mounted App tells its window while it lives.
WindowProjectiontype alias
Section titled “WindowProjection”type WindowProjection<Launch, Container> = Readonly<{ windowId: string; launch: Launch; container: Container; status: WindowStatus; generation: number; error?: unknown; cleanupError?: unknown; navigation: AppNavigationState | null; statusItems: readonly AppStatusItem[];}>;Immutable snapshot of one window and its mount generation.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
Launch extends WindowLaunch |
Container |
WindowsProjectiontype alias
Section titled “WindowsProjection”type WindowsProjection<Launch, Container> = Readonly<{ windows: readonly WindowProjection<Launch, Container>[];}>;Current ordered collection of managed window snapshots.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
Launch extends WindowLaunch |
Container |
WindowMounttype alias
Section titled “WindowMount”type WindowMount<Launch, Container> = ( container, launch, signal, events,) => WindowHost<Launch> | Promise<WindowHost<Launch>>;Create a host-owned mount in a container, observing cancellation and navigation.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
Launch extends WindowLaunch |
Container |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
container |
Container |
launch |
Launch |
signal |
AbortSignal |
events |
WindowEvents |
Returns
Section titled “Returns”| WindowHost<Launch> |
Promise<WindowHost<Launch>>
WindowManagertype alias
Section titled “WindowManager”type WindowManager<Launch, Container> = Readonly<{ open: (launch) => Promise<void>; attach: (windowId) => void; minimize: (windowId) => Promise<void>; restore: (windowId) => Promise<void>; hideAll: () => Promise<void>; restoreHidden: () => Promise<void>; close: (windowId) => Promise<void>; reconfigure: (windowId, launch) => Promise<void>; update: (windowId, derive) => Promise<void>; replace: (windowId, launch) => Promise<void>; back: (windowId) => Promise<boolean>; activateNavigation: (windowId, activation) => Promise<boolean>; activateStatus: (windowId, action) => Promise<boolean>; registerComputerChoice: (windowId, handler) => () => void; dispose: () => Promise<void>; read: () => WindowsProjection<Launch, Container>; subscribe: (listener) => () => void;}>;Own window lifetimes, visibility and serialized host mutations.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
Launch extends WindowLaunch |
Container |
WindowManagerOptionstype alias
Section titled “WindowManagerOptions”type WindowManagerOptions<Launch, Container> = Readonly<{ mount: WindowMount<Launch, Container>; createContainer: (launch) => Container; waitForAttachment?: boolean; onFailure?: (failure) => void; isAttached?: (container) => boolean; validateReconfiguration?: (current, next) => void; isChromeOnlyChange?: (current, next) => boolean;}>;Host adapters used to create, attach and validate window mounts.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
Launch extends WindowLaunch |
Container |
hasVisibleWindows()function
Section titled “hasVisibleWindows()”function hasVisibleWindows<Launch, Container>(projection): boolean;Whether any projected App window is still visible in the workspace.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
Launch extends Readonly<{ windowId: string; }> |
Container |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
projection |
WindowsProjection<Launch, Container> |
Returns
Section titled “Returns”boolean
createWindowManager()function
Section titled “createWindowManager()”function createWindowManager<Launch, Container>( options,): WindowManager<Launch, Container>;Owns App-window generations while leaving selection and App authority to the caller. A stale mount is always disposed when it eventually resolves.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
Launch extends Readonly<{ windowId: string; }> |
Container |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options |
WindowManagerOptions<Launch, Container> |
Returns
Section titled “Returns”WindowManager<Launch, Container>