/// import type { IPropertyPaneConsumer } from '../propertyPaneConsumer/IPropertyPaneConsumer'; import type { PropertyPaneAction } from '../propertyPaneDefinitions/PropertyPaneAction'; /** * Class which manages all the interactions between configurable options and the configurable options consumers, such as web parts. * * @internal */ export interface IConfigurableOptionsController { /** * Get the currently configured consumer's instance Id */ currentlyConfiguredConsumerId: string | undefined; /** * Adds a specified callback for configurable options field changed events. * @param instanceId - the specified instanceId * @param callback - the specified callback function * @returns returns a function to unregister the callback function */ registerOnPropertyPaneFieldChangedListener(instanceId: string, callback: () => void): () => void; /** * Registers a consumer with the configurable options controller. * * @param instanceId - Instance id of the consumer. * @param consumer - Property pane consume to be registered. */ registerConsumer(instanceId: string, consumer: IPropertyPaneConsumer): void; /** * Returns true if the passed in instance Id, is a registered consumer. * @param instanceId - Instance id of the consumer. */ isConsumerRegistered(instanceId: string): boolean; /** * API to request an action to be performed on the configurable options pane. This helps in configuring a SharePoint component. * The inbuilt configurable options pane is used for the configuration, with the below conditions: * * - propertyPaneAction is Open and then open the property pane. * - propertyPaneAction is Close and then close the property pane. * - propertyPaneAction is Toggle and the property pane is closed: in this case we open the property pane and * start the configuration process. * Example - This happens when web part configure button is clicked. * - propertyPaneAction is Toggle and the property pane is open: in this case, if the incoming consumer id * is different than the one being currently configured, we keep the property pane open * and change the active consumer being configured. * - propertyPaneAction is Default and the property pane is closed: do nothing * - propertyPaneAction is Default and the property pane is opened: change the property pane to display the * settings of the newly selected consumer. * Example - This happens when the user navigates between property pane consumers (ex: web parts). * * @param toBeConfiguredConsumerId - instance id of the consumer. * @param propertyPaneAction - indicates in what state the property pane should be. * @param renderedByWebPart - is the property pane rendered by a web part and not by Canvas or any other source. * @param context - additional data passed by the consumer, to be sent back to the same webpart */ requestAction(toBeConfiguredConsumerId: string, propertyPaneAction?: PropertyPaneAction, renderedByWebPart?: boolean, context?: unknown): void; /** * Returns true if the configurable options is rendered by a consumer,example web part, RTE etc., * and not by the host, example canvas. * A component becomes consumer if it implements IPropertyPaneConsumer. */ isRenderedByConsumer(): boolean; /** * Returns true if configurable options is open. */ isOpen(): boolean; /** * Returns true if the Content Panel is open and the specified instanceId is supported in the content panel. OR * Returns true if the Property panel is open and the specified instanceId is supported in the properties pane. * @deprecated temporary solution until PropertyPane goes away. */ isOpen(instanceId?: string): boolean; /** * Returns true if the Content Panel is open, regardless if the content panel is rendering the property pane. */ isContentPanelOpen?(): boolean; /** * Empty out the configurable options when the web part being configured is deleted from the page. * * @param id - Instance id of the consumer. */ onConsumerDelete(id: string): void; /** * Allows the configurable options title to be overridden. * * @param topControl - React element to be rendered at the top of the configurable options. * @param title - Title of the configurable options. * * @internal */ _setAppPagePropertyPaneTopData(topControl: React.ReactElement, title: string): void; /** * Causes the configurable options to be rendered narrowly (320px vs 340px). * * @internal */ _setPropertyPaneToNarrowRender(narrow: boolean): void; } //# sourceMappingURL=IConfigurableOptionsController.d.ts.map