UNPKG

office-ui-fabric-react

Version:

Reusable React components for building experiences for Microsoft 365.

56 lines (55 loc) 2.19 kB
import { ILayerHost } from './LayerHost.types'; /** * Register a layer for a given host id * @param hostId - Id of the layer host * @param layer - Layer instance */ export declare function registerLayer(hostId: string, callback: () => void): void; /** * Unregister a layer for a given host id * @param hostId - Id of the layer host * @param layer - Layer instance */ export declare function unregisterLayer(hostId: string, callback: () => void): void; /** * Gets the number of layers currently registered with a host id. * @param hostId - Id of the layer host. * @returns The number of layers currently registered with the host. */ export declare function getLayerCount(hostId: string): number; /** * Gets the Layer Host instance associated with a hostId, if applicable. * @param hostId - Id of the layer host. * @returns A component ref for the associated layer host. */ export declare function getLayerHost(hostId: string): ILayerHost | undefined; /** * Registers a Layer Host with an associated hostId. * @param hostId - Id of the layer host * @param layerHost - layer host instance */ export declare function registerLayerHost(hostId: string, layerHost: ILayerHost): void; /** * Unregisters a Layer Host from the associated hostId. * @param hostId - Id of the layer host * @param layerHost - layer host instance */ export declare function unregisterLayerHost(hostId: string, layerHost: ILayerHost): void; /** * Used for notifying applicable Layers that a host is available/unavailable and to re-evaluate Layers that * care about the specific host. */ export declare function notifyHostChanged(id: string): void; /** * Sets the default target selector to use when determining the host in which * Layered content will be injected into. If not provided, an element will be * created at the end of the document body. * * Passing in a falsey value will clear the default target and reset back to * using a created element at the end of document body. */ export declare function setDefaultTarget(selector?: string): void; /** * Get the default target selector when determining a host */ export declare function getDefaultTarget(): string | undefined;