UNPKG

2.17 kBTypeScriptView Raw
1/**
2 * Helper class that opens components.
3 *
4 * [[IOpenable]]
5 */
6export declare class Opener {
7 /**
8 * Checks if specified component is opened.
9 *
10 * To be checked components must implement [[IOpenable]] interface.
11 * If they don't the call to this method returns true.
12 *
13 * @param component the component that is to be checked.
14 * @returns true if component is opened and false otherwise.
15 *
16 * @see [[IOpenable]]
17 */
18 static isOpenOne(component: any): boolean;
19 /**
20 * Checks if all components are opened.
21 *
22 * To be checked components must implement [[IOpenable]] interface.
23 * If they don't the call to this method returns true.
24 *
25 * @param components a list of components that are to be checked.
26 * @returns true if all components are opened and false if at least one component is closed.
27 *
28 * @see [[isOpenOne]]
29 * @see [[IOpenable]]
30 */
31 static isOpen(components: any[]): boolean;
32 /**
33 * Opens specific component.
34 *
35 * To be opened components must implement [[IOpenable]] interface.
36 * If they don't the call to this method has no effect.
37 *
38 * @param correlationId (optional) transaction id to trace execution through call chain.
39 * @param component the component that is to be opened.
40 * @param callback callback function that returns error or null no errors occured.
41 *
42 * @see [[IOpenable]]
43 */
44 static openOne(correlationId: string, component: any, callback?: (err: any) => void): void;
45 /**
46 * Opens multiple components.
47 *
48 * To be opened components must implement [[IOpenable]] interface.
49 * If they don't the call to this method has no effect.
50 *
51 * @param correlationId (optional) transaction id to trace execution through call chain.
52 * @param components the list of components that are to be closed.
53 * @param callback callback function that returns error or null no errors occured.
54 *
55 * @see [[openOne]]
56 * @see [[IOpenable]]
57 */
58 static open(correlationId: string, components: any[], callback?: (err: any) => void): void;
59}