import { ReactElement } from 'react'; import type { RenderData } from '@storybook/router'; import { ModuleFn } from '../index'; import { Options } from '../store'; export declare type ViewMode = 'story' | 'info' | 'settings' | 'page' | undefined | string; export declare enum types { TAB = "tab", PANEL = "panel", TOOL = "tool", PREVIEW = "preview", NOTES_ELEMENT = "notes-element" } export declare type Types = types | string; export interface RenderOptions { active: boolean; key: string; } export interface RouteOptions { storyId: string; viewMode: ViewMode; location: RenderData['location']; path: string; } export interface MatchOptions { storyId: string; viewMode: ViewMode; location: RenderData['location']; path: string; } export interface Addon { title: string; type?: Types; id?: string; route?: (routeOptions: RouteOptions) => string; match?: (matchOptions: MatchOptions) => boolean; render: (renderOptions: RenderOptions) => ReactElement; paramKey?: string; disabled?: boolean; hidden?: boolean; } export interface Collection { [key: string]: T; } declare type Panels = Collection; declare type StateMerger = (input: S) => S; export interface SubAPI { getElements: (type: Types) => Collection; getPanels: () => Panels; getStoryPanels: () => Panels; getSelectedPanel: () => string; setSelectedPanel: (panelName: string) => void; setAddonState(addonId: string, newStateOrMerger: S | StateMerger, options?: Options): Promise; getAddonState(addonId: string): S; } export declare function ensurePanel(panels: Panels, selectedPanel?: string, currentPanel?: string): string; export declare const init: ModuleFn; export {};