import { WrapletDependencies } from "../../Wraplet/types/WrapletDependencies"; import { MultipleDependencyKeys, SingleDependencyKeys, WrapletDependencyMap } from "../../Wraplet/types/WrapletDependencyMap"; import { DependencyLifecycleAsyncListener } from "./DependencyLifecycleAsyncListener"; import { DependencyLifecycleListener } from "./DependencyLifecycleListener"; import { DependencyInstance } from "../../Wraplet/types/DependencyInstance"; export declare const DependencyManagerSymbol: unique symbol; /** * Dependency manager interface that defines the public API for managing wraplet relationships * and lifecycles. */ export interface DependencyManager { [DependencyManagerSymbol]: true; /** * The node that the manager is managing. */ node: N; /** * Instantiate dependencies based on the map and the current node. */ instantiateDependencies(): void; /** * Initialize dependencies. */ initializeDependencies(): Promise; /** * Synchronizes dependencies in the DOM. * * When new nodes were added to the DOM, you might want to * synchronize the DependencyManager to inject new dependencies * that might be available. * * Dependencies that are no longer part of the descendant DOM tree * will be destroyed unless they are marked "destructable: false" * or have no "selector" property on the map. * * This is an experimental feature. * * @experimental */ syncDependencies(): Promise; /** * Destroy all dependencies. */ destroyDependencies(): Promise; /** * Add a listener that will be called when a dependency is initialized. */ addDependencyInitializedListener(id: K, callback: DependencyLifecycleAsyncListener): void; /** * Add a listener that will be called when a dependency is destroyed. */ addDependencyDestroyedListener(id: K, callback: DependencyLifecycleAsyncListener): void; /** * Add a listener that will be called when a dependency is instantiated. */ addDependencyInstantiatedListener(id: K, callback: DependencyLifecycleListener): void; /** * This method allows you to set an existing dependency instance. */ setExistingInstance & Extract>(id: K, wraplet: DependencyInstance): void; /** * This method allows you to add an existing dependency instance * to a wraplet set. */ addExistingInstance & Extract>(id: K, wraplet: DependencyInstance): void; /** * Get the available dependencies. */ readonly dependencies: WrapletDependencies; } export declare function isDependencyManager(object: unknown): object is DependencyManager;