UNPKG

1.59 kBTypeScriptView Raw
1import { ComponentRef } from '@angular/core';
2import { Observable, ReplaySubject, Subject } from 'rxjs';
3import { NbWindowComponent } from './window.component';
4import { NbWindowConfig, NbWindowState, NbWindowStateChange } from './window.options';
5/**
6 * The `NbWindowRef` helps to manipulate window after it was created.
7 * The window can be dismissed by using `close` method of the windowRef.
8 * You can access rendered component as `componentRef` property of the windowRef.
9 * Property `contentInstance` contains the instance of the component opened in the window.
10 */
11export declare class NbWindowRef<T = any, R = any> {
12 config: NbWindowConfig;
13 componentRef: ComponentRef<NbWindowComponent>;
14 componentInstance: T;
15 protected prevStateValue: NbWindowState;
16 protected stateValue: NbWindowState;
17 /**
18 * Current window state.
19 */
20 get state(): NbWindowState;
21 set state(newState: NbWindowState);
22 protected stateChange$: ReplaySubject<NbWindowStateChange>;
23 /**
24 * Emits when window state change.
25 */
26 get stateChange(): Observable<NbWindowStateChange>;
27 protected _closed: boolean;
28 protected closed$: Subject<R>;
29 /**
30 * Emits when window was closed.
31 */
32 get onClose(): Observable<R>;
33 constructor(config: NbWindowConfig);
34 /**
35 * Minimize window.
36 */
37 minimize(): void;
38 /**
39 * Maximize window.
40 */
41 maximize(): void;
42 /**
43 * Set window on top.
44 */
45 fullScreen(): void;
46 toPreviousState(): void;
47 /**
48 * Closes window.
49 * */
50 close(res?: R): void;
51}