/** * SharePoint Framework support for building and extending client-side applications. * * @packagedocumentation */ import { BaseComponent } from '@microsoft/sp-component-base'; import { BaseComponentContext } from '@microsoft/sp-component-base'; import { BaseExtension } from '@microsoft/sp-extension-base'; import { ExtensionContext } from '@microsoft/sp-extension-base'; import { Guid } from '@microsoft/sp-core-library'; import { IDisposable } from '@microsoft/sp-core-library'; import { default as _IODSPThemeData } from '@ms/odsp-utilities/lib/theming/IThemeData'; import { default as _ODSPThemeProvider } from '@ms/odsp-utilities/lib/theming/ThemeProvider'; import { Promise as Promise_2 } from '@ms/odsp-utilities-bundle'; import { ServiceKey } from '@microsoft/sp-core-library'; import { ServiceScope } from '@microsoft/sp-core-library'; import { SPEvent } from '@microsoft/sp-core-library'; import { SPEventArgs } from '@microsoft/sp-core-library'; /** * Provides access to the client-side application that is currently running. * * @remarks * The client-side application determines the user experience for an entire web page. * (It is a client-side component with a manifest; however, the SharePoint Framework * does not enable third parties to create their own client-side applications at this time.) * Within a web page, at most one client-side application will be running at a time. * Certain in-place navigation transitions can cause the application to be unloaded * and replaced by a different application. * * The ApplicationAccessor class enables extensibility components such as extensions * and web parts to interact with the currently running application. It acts as * a proxy for the real application object (the BaseApplication subclass), to ensure * that extensibility components only rely on interactions that would be portable * across all applications. * * @public */ export declare class ApplicationAccessor { private _navigatedEvent; private _privateLayoutChangedEvent; /** * Constructs a new instance of the {@link ApplicationAccessor} class. * @remarks * Third parties should not call this constructor. Instead, use the ApplicationAccessor * instance from the component context, for example {@link BaseApplicationCustomizer.context}. */ constructor(serviceScope: ServiceScope); /** * An event that is fired when the application's top-level page context navigates * to a new page. * @remarks * This event fires after the top-level {@link @microsoft/sp-page-context#PageContext} has navigated * to a new page. * @eventproperty */ readonly navigatedEvent: SPEvent; /* Excluded from this release type: _layoutChangedEvent */ } /** * The component context for {@link BaseApplicationCustomizer}. * * @public */ export declare class ApplicationCustomizerContext extends ExtensionContext { private _placeholderProvider; private _applicationAccessor; /* Excluded from this release type: __constructor */ /** * Exposes a collection of content placeholders for use by third parties. */ readonly placeholderProvider: PlaceholderProvider; /** * Provides access to the client-side application that is currently running. */ readonly application: ApplicationAccessor; /** * @override */ dispose(): void; } /* Excluded from this release type: _ApplicationLoadType */ /* Excluded from this release type: _ApplicationManager */ /* Excluded from this release type: BaseApplication */ /* Excluded from this release type: BaseApplicationContext */ /** * This is the base class that third parties should extend when implementing * a client-side extension that runs when an application is first starting. * * @remarks * In the component manifest, the "extensionType" should be set to "ApplicationCustomizer". * * Example usage scenarios for an application customizer might include: rendering custom * UI elements inside a SharePoint content placeholder, tracking page load statistics, * or automatically logging the user out after a certain time period. * * @public */ export declare abstract class BaseApplicationCustomizer extends BaseExtension { /** * {@inheritDoc @microsoft/sp-extension-base#BaseExtension.context} */ protected readonly context: ApplicationCustomizerContext; private _placeholdersChangedCallback?; /* Excluded from this release type: _initializeExtensionType */ /** * {@inheritDoc @microsoft/sp-component-base#BaseComponent.dispose} */ dispose(): void; /** * This event method is called when the placeholders of the host application change, come into * existence, or disappear. */ protected onPlaceholdersChanged(placeholderProvider: PlaceholderProvider): void; } /* Excluded from this release type: _DialogManagerConfiguration */ /* Excluded from this release type: _IApplicationContextParameters */ /* Excluded from this release type: _IApplicationCustomizerContextParameters */ /* Excluded from this release type: IBrowserCompatibility */ /* Excluded from this release type: IColorPalette */ /* Excluded from this release type: _IComponentContextParameters */ /* Excluded from this release type: _IExtensionContextParameters */ /* Excluded from this release type: _INavigationProperties */ /* Excluded from this release type: _INavigationResult */ export { _IODSPThemeData } /* Excluded from this release type: _IPlaceholderContentParameters */ /** * Options for the {@link PlaceholderProvider.tryCreateContent} method. * * @public */ export declare interface IPlaceholderCreateContentOptions { /** * An optional callback that will be invoked when the PlaceholderContent object * is disposed. * * @remarks * To avoid a resource leak, use this callback to free any resources that were allocated * when the placeholder content was rendered. For example, if ReactDOM.render() was * used to mount a React component, then the onDispose handler might call * ReactDOM.unmountComponentAtNode() to unmount it. */ onDispose?: (placeholderContent: PlaceholderContent) => void; } /* Excluded from this release type: _IPlaceholderDefinition */ /* Excluded from this release type: _IPlaceholderEntry */ /* Excluded from this release type: _IPreloadedData */ /* Excluded from this release type: _ISPPageChrome */ /* Excluded from this release type: ISuiteNavConfigurationData */ /* Excluded from this release type: ISuiteNavManager */ /* Excluded from this release type: ISuiteNavManagerConfiguration */ /* Excluded from this release type: _NavigationOperation */ /* Excluded from this release type: _Navigator */ export { _ODSPThemeProvider } /* Excluded from this release type: _Placeholder */ /** * Represents custom content that is rendered inside a placeholder on a SharePoint page. * * @remarks * This object is returned by {@link PlaceholderProvider.tryCreateContent}. * It provides access to a Document Object Model (DOM) element where the owner can render * its custom content. * * @public */ export declare class PlaceholderContent implements IDisposable { private static _logSource; private _domElement; private _placeholder; private _disposeHandler; private _isDisposed; /* Excluded from this release type: __constructor */ /** * Identifies the placeholder that this content was added to. * * @remarks * Example: PlaceholderName.Top */ readonly name: PlaceholderName; /** * The Document Object Model (DOM) element where the owner should render its custom content. * * @remarks * If the caller needs to be notified when the DOM element is disposed, use * the {@link IPlaceholderCreateContentOptions.onDispose} callback. */ readonly domElement: HTMLDivElement; /* Excluded from this release type: _setPlaceholder */ /** * Disposes the PlaceholderContent object and removes its attached DOM element from the page. * * @remarks * This method can be called to immediately dispose the attached DOM element. Otherwise, it * will be disposed by the application when the containing placeholder is disposed. Calling dispose() * invokes the {@link IPlaceholderCreateContentOptions.onDispose} callback, removes the associated * DOM element from the page, and disposes the PlaceholderContent object. */ dispose(): void; readonly isDisposed: boolean; /** * Return true if this PlacholderContent object is visible. If you create a placeholder * and the host page isn't displaying it, this will return false. */ readonly isVisible: boolean; } /* Excluded from this release type: _PlaceholderManager */ /** * The identifier for a content placeholder, which is a region on the * page where third-party extensibility components can render custom content. * * @remarks * For more information about placeholders, see {@link PlaceholderProvider}. * * @public */ export declare enum PlaceholderName { /** * A region at the top of the page. * @privateRemarks * Used by Modern pages and Lists and libraries */ Top = 1, /** * A region at the bottom of the page. * @privateRemarks * Used by Modern pages and Lists and libraries */ Bottom = 2 } /** * Allows third-party components to discover and use SharePoint placeholders. Placeholders * enable third-party components to render custom content into designated regions on the page. * * @remarks * Placeholders are designated regions on the page, identified by one of the predefined * {@link PlaceholderName} constants. Different applications and pages might support different * placeholder names. Placeholders can appear and disappear as the user interacts with the page, * for example via in-place navigation. Third-party components should not assume that a given placeholder * will always be available. * * Use {@link PlaceholderProvider.tryCreateContent} to test whether a placeholder is * available and add content to it. Use the {@link PlaceholderProvider.changedEvent} event * to discover when new placeholders appear. * * @public */ export declare class PlaceholderProvider implements IDisposable { private static _logSource; private _sequence; private _placeholderManager; private _placeholderContents; private _isDisposed; /* Excluded from this release type: __constructor */ dispose(): void; readonly isDisposed: boolean; /** * Tests whether the page contains the specified placeholder. If so, a new PlaceholderContent * object is created, which allows the caller to render custom content inside the placeholder. * * @param name - The requested placeholder * @param options - Additional options, for example to detect when the placeholder is disposed. * @returns A new PlaceholderContent object, or undefined if the requested placeholder does not exist. * * @remarks * * The host application makes no guarantees about the availability of a given placeholder. * In situations where an expected placeholder is not available, the third-party extension * must handle it gracefully, e.g. by not rendering anything, or by choosing an alternative * placeholder. */ tryCreateContent(name: PlaceholderName, options?: IPlaceholderCreateContentOptions): PlaceholderContent | undefined; /** * Returns the names of the currently available placeholders. */ readonly placeholderNames: ReadonlyArray; /** * This event is raised when the list of currently available placeholders is changed. * * @remarks * The application can change its list of available placeholders at any time. This means that the existing * placeholders may get disposed or new placeholders may be added. Use this event to discover new * placeholders when they appear. * * @eventproperty */ readonly changedEvent: SPEvent; } /* Excluded from this release type: _PrefetchedDataEventArgs */ /* Excluded from this release type: _SPThemeProvider */ export { }