import type { ISPEventObserver, SPEvent, SPEventArgs } from '@microsoft/sp-core-library'; import type { IDynamicDataSource } from './IDynamicDataSource'; /** * Required apis for any DynamicData manager. * * @internal */ export interface IDynamicDataManager { /** * Event that gets raised when the list of Dynamic Data Sources gets updated. * @eventproperty */ readonly sourcesChangedEvent: SPEvent; /** * Raises an event to all listeners when a Dynamic Data Source has been updated. * @param sourceId - Id of the Dynamic Data Source that is being updated. */ notifySourceChanged: (sourceId: string) => void; /** * Raises an event to all listeners when a property in a Dynamic Data Source has been updated. * @param sourceId - Id of the Dynamic Data Source whose property is being updated. * @param propertyId - Id of the property that is being updated. */ notifyPropertyChanged: (sourceId: string, propertyId: string) => void; /** * Registers a listener for updates on a Dynamic Data Source. */ registerSourceChanged: (sourceId: string, observer: ISPEventObserver, callback: () => void) => void; /** * Unregisters a listener for updates on a Dynamic Data Source. */ unregisterSourceChanged: (sourceId: string, observer: ISPEventObserver, callback: () => void) => void; /** * Registers a listener for updates on a Dynamic Data Source. */ registerPropertyChanged: (sourceId: string, propertyId: string, observer: ISPEventObserver, callback: () => void) => void; /** * Unregisters a listener for updates on a Dynamic Data Source. */ unregisterPropertyChanged: (sourceId: string, propertyId: string, observer: ISPEventObserver, callback: () => void) => void; /** * Returns a read-only array with all the existing Dynamic Data Sources. */ getSources: () => ReadonlyArray; /** * Returns a Dynamic Data Source based on its id. * Returns undefined if the source doesn't exist. * @param sourceId - Id of the Dynamic Data Source. */ tryGetSource: (sourceId: string) => IDynamicDataSource | undefined; /** * Adds a new Dynamic Data Source to be managed. * Throws an error if the source can't be added. * * @param source - Dynamic Data Source to add. */ addSource: (source: IDynamicDataSource) => void; /** * Removes an existing Dynamic Data Source from the manager. * @param id - Id of the Dynamic Data Source. */ removeSource: (sourceId: string) => void; } //# sourceMappingURL=IDynamicDataManager.d.ts.map