import type { ReactElement } from 'react'; import { SPPagesContentPanelProviderContext } from '@msinternal/sp-pages-content-panel-context'; import type { IPropertyPaneConsumer } from '../propertyPaneConsumer/IPropertyPaneConsumer'; import type { PropertyPaneAction } from '../propertyPaneDefinitions/PropertyPaneAction'; import type { IContentPanelController } from './IContentPanelController'; /** * @internal */ export declare class ContentPanelController implements IContentPanelController { /** * WARNING: DO NOT USE DIRECTLY! * * For setting the currently configured consumer, use `_setCurrentlyConfiguredConsumerId`. * * For reading the currently configured consumer, use `currentlyConfiguredConsumerId`. */ private _currentlyConfiguredConsumerId; /** * Used to track consumers that requested background refresh before they were registered. */ private _unregistredBackgroundRefreshConsumerId; private _paneWidthMode?; private _topControl?; private _title?; private _isPaneRenderedByWebPart?; private _propertyPaneChangeListeners; /** * Dictionary of all the registered property pane consumers. */ private _consumers; /** * Tracks the currently configured consumer id for each supported panel. */ private readonly _currentlyConfiguredConsumerIdByPivot; get currentlyConfiguredConsumerId(): string | undefined; /** * Configuration completion timeout */ private _configurationCompletionTimeout; /** * Determines if the Content Panel is supported in the current environment. */ static isContentPanelSupported(): boolean; /** * Determines if the Pivot that renders the toBeConfiguredConsumerId is the * current active pivot for content panel. * * Ex: The close action triggered by page details pane should not close the configuration tools pane. */ private static _isConsumerPivotTheActivePivot; constructor(); addOnUpdateListener: SPPagesContentPanelProviderContext['addOnUpdateListener']; registerOnPropertyPaneFieldChangedListener(instanceId: string, callback: () => void): () => void; registerConsumer(instanceId: string, consumer: IPropertyPaneConsumer): void; isConsumerRegistered(instanceId: string): boolean; requestAction(toBeConfiguredConsumerId: string, propertyPaneAction?: PropertyPaneAction, renderedByWebPart?: boolean | undefined, context?: unknown): void; isRenderedByConsumer(): boolean; /** * Determines if configuration tools or page details is open in the content panel. * * Warning: This returns false if other panels are open. */ isOpen(): boolean; isAnyContentPanelOpen(): boolean; forceClose(): void; onConsumerDelete(id: string): void; _setAppPagePropertyPaneTopData(topControl: ReactElement, title: string): void; _setPropertyPaneToNarrowRender(narrow: boolean): void; /** * Determines if the specified component can be rendered in the Content Panel */ isComponentSupported(instanceId: string, consumer?: IPropertyPaneConsumer | undefined): boolean; /** * Determines if the specified component is the currently configured consumer for the pivot that renders it. * @param componentId - Id of the consumer to be checked. */ private _isCurrentlyConfiguredConsumerForPivot; /** * Sets the currently configured consumer id and syncs it with the configured consumer id for each respective panel. * @param consumerId - Id of the consumer to be set as currently configured consumer. */ private _setCurrentlyConfiguredConsumerId; /** * Callback to handle the configuration events that originate in the property pane. * * @example * PropertyPaneClosed, PropertyPaneApplyClicked etc., */ private _onConfigurationEvent; /** * Property pane field change event handler. * * @param propertyName - Name of the property pane field changed. * @param newValue - New value. * This value could be undefined/empty in the case of custom field. */ private _onPropertyPaneFieldChanged; /** * Method to fire the configuration event to the host and the consumer. * * @param componentId - Id of the consumer to which the event needs to be sent. * @param configurationEvent - Kind of configuration event to fire. */ private _fireConfigurationEvent; /** * Reset configuration completion timeout. */ private _resetConfigurationCompleteTimeout; /** * Clear configuration completion timeout. */ private _clearConfigurationCompleteTimeout; /** * Opens the supported panel in the content panel for the specified componentId. * Content Panel may support different consumer panels and this will handle the logic for each consumer * and render them in their respective panel. */ private _openContentPanel; /** * Function that updates the data in the content panel */ private _updateContentPanelData; /** * Resets the currently configured consumer and resets the data hosted * in the respective panel's. * * Note this does not close the content panel */ private _resetCurrentlyConfiguredConsumer; /** * Resets the data loader for the pivot that renders the specified consumerId. */ private _resetLoader; /** * Closes the content panel if the current open panel is a panel supported by this component. */ private _closeContentPanel; /** * Manages updates to content panel. * * Eg: when active pivot changes, we change currently configured consumer */ private _onContentPanelUpdated; /** * Register command listeners on mount. * Note this is called multiple times throughout this component's lifespan as a user navigates to different pages. */ private _onContentPanelMount; } //# sourceMappingURL=ContentPanelController.d.ts.map