@lifeart/gxt
Version:
<img align="right" width="95" height="95" alt="Philosopher’s stone, logo of PostCSS" src="./public/logo.png">
17 lines (16 loc) • 964 B
TypeScript
export type DestructorFn = () => void | Promise<void> | Promise<void[]>;
export type Destructors = Array<DestructorFn>;
export declare function destroySync(ctx: object): void;
export declare function destroy(ctx: object, promises?: Array<Promise<void>>): 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;