mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-26 19:07:17 +00:00
19 lines
595 B
TypeScript
19 lines
595 B
TypeScript
type CloseablePluginViewSessions = {
|
|
closeView(viewId: string): void;
|
|
};
|
|
|
|
let loadedSessions: CloseablePluginViewSessions | null = null;
|
|
|
|
/**
|
|
* Registers the live PluginViewSessions singleton once the lazy host-drawn
|
|
* plugin view bundle loads, so startup lifecycle hooks can close views without
|
|
* statically importing css-tree / @remote-dom/core.
|
|
*/
|
|
export function registerLoadedPluginViewSessions(sessions: CloseablePluginViewSessions): void {
|
|
loadedSessions = sessions;
|
|
}
|
|
|
|
export function closePluginViewSessionIfLoaded(viewId: string): void {
|
|
loadedSessions?.closeView(viewId);
|
|
}
|