UNPKG

1.33 kBTypeScriptView Raw
1/**
2 * Helper class that cleans stored object state.
3 *
4 * @see [[ICleanable]]
5 */
6export declare class Cleaner {
7 /**
8 * Clears state of specific component.
9 *
10 * To be cleaned state components must implement [[ICleanable]] 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 cleaned.
15 * @param callback callback function that returns error or null no errors occured.
16 *
17 * @see [[ICleanable]]
18 */
19 static clearOne(correlationId: string, component: any, callback?: (err: any) => void): void;
20 /**
21 * Clears state of multiple components.
22 *
23 * To be cleaned state components must implement [[ICleanable]] 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 cleaned.
28 * @param callback callback function that returns error or null no errors occured.
29 *
30 * @see [[clearOne]]
31 * @see [[ICleanable]]
32 */
33 static clear(correlationId: string, components: any[], callback?: (err: any) => void): void;
34}