import { default as React } from 'react'; export type ComponentConstructor = React.ComponentType; /** Options for {@link ComponentRegistry.alias}. */ export interface ComponentAliasOptions { /** * Retitle tabs that are rewritten from the old id. Omit to keep whatever * title the saved tab had. */ title?: string; } export declare class ComponentRegistry { private components; private aliases; /** * Register a component with a unique ID. * This ID is what you use in your FlexLayout models. */ register(id: string, component: ComponentConstructor): void; /** Remove every component and alias. For tests; see `resetShell`. */ clear(): void; /** Remove a registration. Aliases pointing at it are left in place. */ unregister(id: string): void; /** * Declare that `from` is an old name for `to`. * * Layouts are persisted by component id, so renaming a component strands * every saved tab under the old one. An alias resolves the old id wherever * the shell looks one up — rendering, `addTab`, `workspace.find` — and the * shell rewrites saved tabs to the new id when it mounts, so the old name * eventually disappears from storage rather than being registered forever. * * @example * ```ts * componentRegistry.register('desk', Desk); * componentRegistry.alias('mail', 'desk', { title: 'Desk' }); * ``` */ alias(from: string, to: string, options?: ComponentAliasOptions): void; /** * Follow aliases from `id` to the id it now names. Returns `id` itself when * it is not an alias. Cycles stop at the first repeat. */ resolve(id: string): string; /** The alias record for `id`, if it is one. */ getAlias(id: string): { to: string; title?: string; } | undefined; /** * Retrieve a registered component by its ID, following aliases. */ get(id: string): ComponentConstructor | undefined; /** Whether `id`, or what it aliases, is registered. */ has(id: string): boolean; /** * Get all registered component IDs. */ getRegisteredIds(): string[]; } export declare const componentRegistry: ComponentRegistry;