shell-module
Import
Section titled “Import”import * as api from "@fungi.computer/nacre/shell-module";Exports
Section titled “Exports”| Kind | Export | Description |
|---|---|---|
| class | ShellModuleError | The picked shell’s module could not be loaded or does not fit the contract. |
| type alias | ShellMountInput | What a host hands the shell a Team picked. The host composes that shell into its
own top-level document, so it runs with the host’s escalated permissions: the
workbench mounts each child App in its sandboxed frame, and storage/methods
are the shell installation’s own desktop data. |
| type alias | MountShell | Render the shell into root; resolves once it is mounted, with the function
that removes it again. The shell loads its own code and styles. |
| type alias | ShellPlatformControls | Settings a shell renders for a host that has none of its own, such as a
standalone Oyster: the shell draws them into root, and the host hands
controls to its workbench so Apps and the dashboard can open them. |
| type alias | RequestShellAppAccess | A host’s App-access flow. The host owns admission, current grants and saving; the shell renders the prompt and navigates its own Settings. |
| type alias | MountPlatformControls | Render the shell’s own Settings using the embedding host’s access authority. |
| type alias | ShellModule | What a host gets from a picked shell Release’s module. |
| function | importShellModule() | Import the picked shell Release’s module from the host’s own origin and check
that it exports mountShell, and mountPlatformControls when it offers its own
Settings. The host never bundles a shell. |
ShellModuleErrorclass
Section titled “ShellModuleError”The picked shell’s module could not be loaded or does not fit the contract.
Extends
Section titled “Extends”Error
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ShellModuleError(message?): ShellModuleError;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
message? |
string |
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”Error.constructor;Constructor
Section titled “Constructor”new ShellModuleError(message?, options?): ShellModuleError;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
message? |
string |
options? |
ErrorOptions |
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”Error.constructor;Properties
Section titled “Properties”readonly name: "ShellModuleError" = "ShellModuleError";Always ShellModuleError.
Overrides
Section titled “Overrides”Error.name;ShellMountInputtype alias
Section titled “ShellMountInput”type ShellMountInput = Readonly<{ workbench: TeamWorkbenchHostHandle; storage: AppStorage; methods: Readonly<{ call: Promise<WhistleJsonValue>; }>;}>;What a host hands the shell a Team picked. The host composes that shell into its
own top-level document, so it runs with the host’s escalated permissions: the
workbench mounts each child App in its sandboxed frame, and storage/methods
are the shell installation’s own desktop data.
MountShelltype alias
Section titled “MountShell”type MountShell = (root, input) => Promise<() => void>;Render the shell into root; resolves once it is mounted, with the function
that removes it again. The shell loads its own code and styles.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
root |
HTMLElement |
input |
ShellMountInput |
Returns
Section titled “Returns”Promise<() => void>
ShellPlatformControlstype alias
Section titled “ShellPlatformControls”type ShellPlatformControls = Readonly<{ controls: WorkbenchHostControls; suggestDesktopSettings: void; dispose: void;}>;Settings a shell renders for a host that has none of its own, such as a
standalone Oyster: the shell draws them into root, and the host hands
controls to its workbench so Apps and the dashboard can open them.
RequestShellAppAccesstype alias
Section titled “RequestShellAppAccess”type RequestShellAppAccess = ( target, request, dialog,) => Promise<AppPermissionOutcome>;A host’s App-access flow. The host owns admission, current grants and saving; the shell renders the prompt and navigates its own Settings.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
target |
Parameters<WorkbenchHostControls["requestAppAccess"]>[0] |
request |
AppPermissionRequest |
dialog |
Readonly<{ ask: Promise<AppPermissionOutcome>; customize: "customize"; }> |
Returns
Section titled “Returns”Promise<AppPermissionOutcome>
MountPlatformControlstype alias
Section titled “MountPlatformControls”type MountPlatformControls = (root, input) => Promise<ShellPlatformControls>;Render the shell’s own Settings using the embedding host’s access authority.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
root |
HTMLElement |
input |
Readonly<{ teamId: string; keysWire: Pick<KeyWire<string>, "issue" | "revoke" | "summary">; requestAppAccess: RequestShellAppAccess; }> |
Returns
Section titled “Returns”Promise<ShellPlatformControls>
ShellModuletype alias
Section titled “ShellModule”type ShellModule = Readonly<{ mountShell: MountShell; mountPlatformControls: MountPlatformControls | null;}>;What a host gets from a picked shell Release’s module.
importShellModule()function
Section titled “importShellModule()”function importShellModule( moduleUrl, hostOrigin,): Promise< Readonly<{ mountShell: MountShell; mountPlatformControls: MountPlatformControls | null; }>>;Import the picked shell Release’s module from the host’s own origin and check
that it exports mountShell, and mountPlatformControls when it offers its own
Settings. The host never bundles a shell.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
moduleUrl |
URL |
hostOrigin |
string |
Returns
Section titled “Returns”Promise<Readonly<{ mountShell: MountShell;
mountPlatformControls: MountPlatformControls |
null; }>>