import { type LiveTreeRuntime } from "../runtime/livetree-runtime.js"; import type { HsonNode } from "../../../core/types.js"; export type LifecycleResourceKind = "binding" | "listener" | "tree-event" | "resize-observer" | "other"; export type LifecycleResourceCounts = Readonly<{ total: number; binding: number; listener: number; treeEvent: number; resizeObserver: number; other: number; }>; export declare const TERMINAL_DISPOSABLE_DRAIN_LIMIT = 64; export type DisposableDrainResult = Readonly<{ passes: number; callbacks: number; bounded: boolean; }>; type LifecycleOwner = HsonNode; export declare function disposables_count_for_owner(ownerQuid: string, runtime?: LiveTreeRuntime): number; export declare function disposables_count_for_subject(owner: LifecycleOwner, runtime?: LiveTreeRuntime): number; export declare function lifecycle_resource_counts_for_owner(ownerQuid: string, runtime?: LiveTreeRuntime): LifecycleResourceCounts; export declare function lifecycle_resource_counts_for_subject(owner: LifecycleOwner, runtime?: LiveTreeRuntime): LifecycleResourceCounts; export declare function disposable_add_for_owner(ownerQuid: string, off: () => void, kind?: LifecycleResourceKind, runtime?: LiveTreeRuntime): void; export declare function disposable_add_for_subject(owner: LifecycleOwner, off: () => void, kind?: LifecycleResourceKind, runtime?: LiveTreeRuntime): void; export declare function disposable_remove_for_owner(ownerQuid: string, off: () => void, runtime?: LiveTreeRuntime): void; export declare function disposable_remove_for_subject(owner: LifecycleOwner, off: () => void, runtime?: LiveTreeRuntime): void; /** * Register one idempotent resource disposer under a LiveTree owner. * Manual disposal first unregisters ownership, then releases the resource. */ export declare function own_disposable_for_owner(ownerQuid: string, dispose: () => void, kind?: LifecycleResourceKind, runtime?: LiveTreeRuntime): () => void; /** Browser-local cleanup follows one exact active realization, without QUID demand. */ export declare function own_disposable_for_subject(owner: LifecycleOwner, dispose: () => void, kind?: LifecycleResourceKind, runtime?: LiveTreeRuntime): () => void; export declare function disposables_off_for_owner(ownerQuid: string, runtime?: LiveTreeRuntime): void; export declare function disposables_off_for_subject(owner: LifecycleOwner, runtime?: LiveTreeRuntime): void; /** * Drain disposables for a fixed owner set, including callbacks registered * reentrantly during teardown. A pathological owner that continuously * re-registers is bounded; remaining callbacks are discarded without running. */ export declare function disposables_drain_for_subjects(ownersInput: readonly LifecycleOwner[], passLimit?: number, runtime?: LiveTreeRuntime): DisposableDrainResult; export {}; //# sourceMappingURL=lifecycle-registry.d.ts.map