import { ICommand } from './registry/CommandRegistry'; import { IMenuItemConfig } from './registry/MenuRegistry'; import { ISlashCommandConfig } from './services/ChatService'; import { IPanel } from './services/PaneService'; import { IStatusBarWidgetConfig } from './services/StatusBarService'; export interface InitializeShellOptions { /** * Sidebar panels to register. Each becomes an icon in the activity bar and * renders its `component` in the sidebar when selected. */ panels?: IPanel[]; /** Menus keyed by top-level name. Items dispatch through their `commandId`. */ menus?: Record; /** Commands available to the palette, menus and keybindings. */ commands?: ICommand[]; /** Items for the status bar, grouped by their `alignment`. */ statusBar?: IStatusBarWidgetConfig[]; /** Slash commands offered in the chat pane. */ slashCommands?: ISlashCommandConfig[]; /** * Register the built-in view and theme commands listed in * {@link DEFAULT_COMMAND_IDS}. Defaults to `true`. Turn it off if your app * wants to own every command id. */ defaultCommands?: boolean; /** * Register a default **View** menu exposing the built-in commands. Defaults * to `true`, and is ignored when `defaultCommands` is `false`. */ defaultMenus?: boolean; } /** The command ids `initializeShell` registers unless told not to. */ export declare const DEFAULT_COMMAND_IDS: readonly ["view.toggleTerminal", "view.toggleChat", "view.toggleSidebar", ...string[]]; /** * Toggle a panel wherever it happens to be registered. * * Chat and terminal are no longer nailed to one edge, so a command that toggled * a fixed slot would be wrong the moment you moved them. This looks the id up * in the left rail, then the right, and finally opens it as a tab — which is * also what makes `Control+\`` keep working when the terminal is a tab. * * Returns `false` when the id is registered nowhere, so a caller can tell the * difference between "toggled" and "nothing to toggle". */ export declare const togglePanel: (id: string) => boolean; /** * Boot the shell: register commands, menus, panels and status bar items into * the shell registries and stores. * * This is the usual first call in a Nexus Shell application. `ShellLayout` can * take the same configuration as props, but doing it here has two advantages: * it runs once rather than on every render, and it happens outside React, so * plugins and other non-component code can contribute in exactly the same way. * * Call it once, before rendering. It is safe to call again — the registries * warn on duplicate ids rather than throwing — but it is not a reset: nothing * previously registered is removed. * * @example * ```ts * // main.tsx * import { initializeShell, componentRegistry } from 'nexus-shell'; * import 'nexus-shell/style.css'; * * componentRegistry.register('editor', Editor); * * initializeShell({ * panels: [ * { id: 'files', label: 'Explorer', icon: Files, component: FileTree }, * chatPanel({ side: 'right' }), * ], * commands: [{ id: 'file.save', label: 'File: Save', keybinding: 'Control+s', execute: save }], * menus: { File: [{ id: 'save', label: 'Save', commandId: 'file.save' }] }, * statusBar: [{ id: 'branch', label: 'main', alignment: 'left' }], * }); * * createRoot(el).render(} />); * ``` */ export declare const initializeShell: (options?: InitializeShellOptions) => void;