/** * @license * Copyright 2022-2026 Matter.js Authors * SPDX-License-Identifier: Apache-2.0 */ import { Environment } from "./Environment.js"; import { Environmental } from "./Environmental.js"; import { SharedEnvironmentServices } from "./SharedEnvironmentServices.js"; /** * Centralized manager for shared service lifecycle tracking. * * This internal service is automatically created at the root environment when the first * shared service instance is requested. It tracks all shared service instances created * anywhere in the environment hierarchy and provides type-based lookup to determine if * any consumer is using a particular service. */ export declare class SharedServicesManager { #private; /** Installs the manager at the root environment. */ static [Environmental.create](environment: Environment): SharedServicesManager; /** * Register a shared service instance for lifecycle tracking. * * Called automatically when a shared service instance is created via {@link Environment.asDependent}. */ add(dependent: SharedEnvironmentServices): void; /** * Unregister a shared service instance from lifecycle tracking. Called when the instance is closed. */ delete(dependent: SharedEnvironmentServices): void; /** * Check if any consumer is currently using a specific service type. * * Used by the environment's delete and close operations to determine if a service * can be safely removed. Returns true if at least one consumer has accessed the * service and has not yet released it. */ has(type: Environmental.ServiceType): boolean; } //# sourceMappingURL=SharedServicesManager.d.ts.map