@jay-js/system
Version:
A powerful and flexible TypeScript library for UI, state management, lazy loading, routing and managing draggable elements in modern web applications.
18 lines (17 loc) • 684 B
TypeScript
import type { TState } from "../types.js";
export interface ISubscriptionRecord {
subscriptionId: string;
state: TState<any>;
cleanupFn: () => void;
}
declare class SubscriptionRegistry {
private subscriptionsByElement;
private elementBySubscriptionId;
registerSubscription(element: HTMLElement, subscriptionId: string, state: TState<any>, cleanupFn: () => void): void;
cleanupElement(element: HTMLElement): void;
getSubscriptionCount(element: HTMLElement): number;
hasSubscriptions(element: HTMLElement): boolean;
cleanupSubscription(subscriptionId: string): void;
}
export declare const subscriptionRegistry: SubscriptionRegistry;
export {};