igniteui-webcomponents
Version:
Ignite UI for Web Components is a complete library of UI components, giving you the ability to build modern web applications using encapsulation and the concept of reusable components in a dependency-free approach.
39 lines (38 loc) • 1.58 kB
TypeScript
import type { BroadcastIconsChangeMessage, IconMeta, IconsCollection, SvgIcon } from './registry/types.js';
type IconBroadcastEvent = MessageEvent<BroadcastIconsChangeMessage> | PageTransitionEvent;
/**
* Manages cross-context synchronization of icon state using the BroadcastChannel API.
*
* @remarks
* This class enables icon registry state to be shared between different browsing contexts
* (e.g., iframes, tabs) within the same origin. It specifically handles synchronization
* with Angular elements that may be running in separate contexts.
*
* The broadcast channel is automatically created on page show and disposed on page hide
* to properly handle bfcache (back/forward cache) scenarios.
*/
export declare class IconsStateBroadcast {
private static readonly _origin;
private readonly _iconsCollection;
private readonly _iconReferences;
private _channel;
/**
* Creates an instance of IconsStateBroadcast.
*
* @param iconsCollection - The collection of registered SVG icons.
* @param iconReferences - The collection of icon references/aliases.
*/
constructor(iconsCollection: IconsCollection<SvgIcon>, iconReferences: IconsCollection<IconMeta>);
/**
* Sends a message to other browsing contexts via the broadcast channel.
*/
send(data: BroadcastIconsChangeMessage): void;
/** @internal */
handleEvent(event: IconBroadcastEvent): void;
private _syncState;
private _create;
private _dispose;
private _getUserRefsCollection;
private _getUserSetCollection;
}
export {};