export type DestructorFn = () => void | Promise | Promise; export type Destructors = Array; export type DestructionErrorReporter = (error: unknown) => void; export declare function setDestructionErrorReporter(reporter: DestructionErrorReporter | null): void; export declare function reportDestructionError(error: unknown): void; export declare function destroySync(ctx: object): void; export declare function destroy(ctx: object, promises?: Array>): void; export declare function registerDestructor(ctx: object, ...fn: Destructors): void; /** * Same as registerDestructor but takes a destructor array directly, * avoiding the rest-parameter `arguments` collection allocation per call. * Used on hot per-element paths in `_DOM` where we already have the * destructors pre-built in an array. */ export declare function registerDestructorBatch(ctx: object, fns: Destructors): void; export declare function isDestroyed(ctx: object): boolean; export declare function isDestructionStarted(ctx: object): boolean; export declare function markAsDestroyed(ctx: object): void; export declare function associateDestroyableChild(parent: object, child: object): void;