UNPKG

1.3 kBTypeScriptView Raw
1/**
2 * Helper class that closes previously opened components.
3 *
4 * [[IClosable]]
5 */
6export declare class Closer {
7 /**
8 * Closes specific component.
9 *
10 * To be closed components must implement [[ICloseable]] interface.
11 * If they don't the call to this method has no effect.
12 *
13 * @param correlationId (optional) transaction id to trace execution through call chain.
14 * @param component the component that is to be closed.
15 * @param callback callback function that receives error or null no errors occured.
16 *
17 * @see [[IClosable]]
18 */
19 static closeOne(correlationId: string, component: any, callback?: (err: any) => void): void;
20 /**
21 * Closes multiple components.
22 *
23 * To be closed components must implement [[ICloseable]] interface.
24 * If they don't the call to this method has no effect.
25 *
26 * @param correlationId (optional) transaction id to trace execution through call chain.
27 * @param components the list of components that are to be closed.
28 * @param callback callback function that receives error or null no errors occured.
29 *
30 * @see [[closeOne]]
31 * @see [[IClosable]]
32 */
33 static close(correlationId: string, components: any[], callback?: (err: any) => void): void;
34}