import type { ComponentType } from 'react'; import type { SlotRegistry } from '@teambit/harmony'; import type { UiUI } from '@teambit/ui'; import type { PubsubUI } from '@teambit/pubsub'; import type { ResultsComponentProps } from '@teambit/explorer.ui.command-bar'; import type { SearchProvider } from './searchers'; import type { Keybinding, CommandHandler, CommandId } from './types'; type SearcherSlot = SlotRegistry; type CommandSlot = SlotRegistry; export type CommandBarConfig = { debounce?: number; }; export type CommandEntry = { id: CommandId; action: CommandHandler; keybinding?: Keybinding; displayName: string; }; /** Quick launch actions. Use the `addSearcher` slot to extend the available actions */ export declare class CommandBarUI { private searcherSlot; private commandSlot; private config; private mousetrap; private commandSearcher; /** Opens the command bar */ open: () => boolean; /** Closes the command bar */ close: () => void; /** Add and autocomplete provider. To support keyboard navigation, each result should have a props `active: boolean`, and `exectue: () => any` */ addSearcher(...commandSearcher: SearchProvider[]): this; /** * registers a command */ addCommand(...originalCommands: CommandEntry[]): ((next: CommandHandler) => void)[]; /** * executes command by name, if exists. * @param commandId */ run(commandId: CommandId): any; /** * executes a keyboard shortcut manually */ trigger: (key: string) => void; private search; private getCommand; private updateCommandsSearcher; private addKeybinding; /** * Opens and closes the command bar UI. */ setVisibility?: (visible: boolean) => void; /** * generate the ui for command bar */ CommandBar: ({ ResultComponent, onEnter, }: { ResultComponent?: ComponentType; onEnter?: (value: string) => void; }) => import("react/jsx-runtime").JSX.Element; CommandBarButton: () => import("react/jsx-runtime").JSX.Element; constructor(searcherSlot: SearcherSlot, commandSlot: CommandSlot, config: CommandBarConfig); static dependencies: import("@teambit/harmony").Aspect[]; static slots: (((registerFn: () => string) => SlotRegistry) | ((registerFn: () => string) => SlotRegistry))[]; static defaultConfig: CommandBarConfig; static runtime: import("@teambit/harmony").RuntimeDefinition; static provider([uiUi, pubsubUI]: [UiUI | undefined, PubsubUI | undefined], config: CommandBarConfig, [searcherSlot, commandSlots]: [SearcherSlot, CommandSlot]): Promise; } export {};