/** @packageDocumentation
 * @module UiProvider
 */
import type { MarkRequired } from "@itwin/core-bentley";
import { BeUiEvent } from "@itwin/core-bentley";
import type { BackstageItem } from "../backstage/BackstageItem.js";
import type { StagePanelLocation } from "../stagepanels/StagePanelLocation.js";
import type { StagePanelSection } from "../stagepanels/StagePanelSection.js";
import type { StatusBarItem } from "../statusbar/StatusBarItem.js";
import type { ToolbarItem } from "../toolbar/ToolbarItem.js";
import type { ToolbarOrientation, ToolbarUsage } from "../toolbar/ToolbarItem.js";
import type { Widget } from "../widgets/Widget.js";
import type { ProviderItem } from "./ProviderItem.js";
import type { UiItemsProvider } from "./UiItemsProvider.js";
/** UiItemsProvider register event args.
 * @public
 * @deprecated in 4.13.0. Event args are inferred from a listener. If explicit type is needed use a type helper.
 */
export interface UiItemsProviderRegisteredEventArgs {
    providerId: string;
}
/** UiItemsProvider overrides allows the application that registers a provider to limit when it is allowed to provide items
 * @public
 */
export interface AllowedUiItemsProviderOverrides {
    /** allows providerId to be overridden in the items manager for cases where the same provider needs to provide different content to different stages */
    providerId?: string;
    /** if specified then the current stage's Usage will be compared before allowing any items to be provided */
    stageUsages?: string[];
    /** if specified then the current stage's Id will be compared before allowing any items to be provided */
    stageIds?: string[];
}
/** Allowed overrides applied to a UiItemsProvider the application that registers a provider to limit when it is allowed to provide items.
 * Note that if an override `providerId` is specified then either `stageIds` or `stageUsages` must be defined to limit when the provider's
 * items are allowed.
 * @public
 */
export type UiItemsProviderOverrides = MarkRequired<AllowedUiItemsProviderOverrides, "providerId" | "stageUsages"> | MarkRequired<AllowedUiItemsProviderOverrides, "providerId" | "stageIds"> | MarkRequired<AllowedUiItemsProviderOverrides, "stageIds"> | MarkRequired<AllowedUiItemsProviderOverrides, "stageUsages"> | MarkRequired<AllowedUiItemsProviderOverrides, "providerId" | "stageUsages" | "stageIds">;
/** Controls registering of UiItemsProviders and calls the provider's methods when populating different parts of the User Interface.
 * @public
 */
export declare class UiItemsManager {
    private static _registeredUiItemsProviders;
    private static _onUiProviderRegisteredEvent;
    private static _abstractAdapter;
    /** For use in unit testing
     * @internal
     */
    static useAbstractAdapter(useAbstractAdapter: boolean): void;
    /** For use in unit testing
     * @internal */
    static clearAllProviders(): void;
    /** Event raised any time a UiProvider is registered or unregistered. */
    static get onUiProviderRegisteredEvent(): BeUiEvent<UiItemsProviderRegisteredEventArgs>;
    /** Return number of registered UiProvider. */
    static get registeredProviderIds(): string[];
    /** Return true if there is any registered UiProvider. */
    static get hasRegisteredProviders(): boolean;
    /**
     * Retrieves a previously loaded UiItemsProvider.
     * @param providerId id of the UiItemsProvider to get
     */
    static getUiItemsProvider(providerId: string): UiItemsProvider | undefined;
    private static sendRegisteredEvent;
    /**
     * Registers an {@link UiItemsProvider}.
     * Optional overrides can be specified to limit when the provider is allowed to provide items.
     */
    static register(uiProvider: UiItemsProvider, overrides?: UiItemsProviderOverrides): void;
    /** Unregisters a specific {@link UiItemsProvider}. */
    static unregister(providerId: string): void;
    private static allowItemsFromProvider;
    /** Returns registered toolbar items configured for the standard layout that match the specified frontstage id and usage.
     * @note Items registered in `UiItemsManager` of `@itwin/appui-abstract` are returned by this method.
     * @note Items returned by {@link UiItemsProvider.provideToolbarItems} are returned by this method.
     */
    static getToolbarButtonItems(stageId: string, stageUsage: string, usage: ToolbarUsage, orientation: ToolbarOrientation): ReadonlyArray<ProviderItem<ToolbarItem>>;
    /** Returns registered toolbar items that match the specified frontstage id and usage.
     * @note Items registered in `UiItemsManager` of `@itwin/appui-abstract` are not returned by this method.
     * @note Items returned by {@link UiItemsProvider.provideToolbarItems} are not returned by this method.
     */
    static getToolbarItems(stageId: string, stageUsage: string): ReadonlyArray<ProviderItem<ToolbarItem>>;
    /** Returns registered status bar items that match the specified frontstage id and usage.
     * @note Items registered in `UiItemsManager` of `@itwin/appui-abstract` are returned by this method.
     * @note Items returned by {@link UiItemsProvider.provideStatusBarItems} are returned by this method.
     */
    static getStatusBarItems(stageId: string, stageUsage: string): ReadonlyArray<ProviderItem<StatusBarItem>>;
    /** Returns registered backstage items.
     * @note Items registered in `UiItemsManager` of `@itwin/appui-abstract` are returned by this method.
     * @note Items returned by {@link UiItemsProvider.provideBackstageItems} are returned by this method.
     */
    static getBackstageItems(): ReadonlyArray<ProviderItem<BackstageItem>>;
    /** Returns registered widgets that match the specified frontstage id and usage.
     * @note Items registered in `UiItemsManager` of `@itwin/appui-abstract` are not returned by this method.
     * @note Items returned by {@link UiItemsProvider.provideWidgets} are not returned by this method.
     */
    static getWidgets(stageId: string, stageUsage: string): ReadonlyArray<ProviderItem<Widget>>;
    /** Returns registered widgets configured for the standard layout that match the specified frontstage id and usage.
     * @note Items registered in `UiItemsManager` of `@itwin/appui-abstract` are returned by this method.
     * @note Items returned by {@link UiItemsProvider.provideWidgets} are returned by this method.
     */
    static getWidgets(stageId: string, stageUsage: string, location: StagePanelLocation, section?: StagePanelSection): ReadonlyArray<ProviderItem<Widget>>;
}
//# sourceMappingURL=UiItemsManager.d.ts.map