import { VNode } from 'snabbdom/vnode'; import { Subject, Observable, BehaviorSubject } from 'rxjs'; import { Renderable, ConfiguredRenderable } from '../dom'; import { ViewContainer } from './ViewContainer'; import { ViewConfig, ResolverStrategy, CacheStrategy } from './common'; import { ViewManager } from './ViewManager'; import { ViewFactory } from './ViewFactory'; import { SizeChanges } from './hooks'; /** * A renderable that renders a component. * @export * @class View * @extends {Renderable} */ export declare class View extends Renderable { protected _viewContainer: ViewContainer; protected _element: HTMLElement | null; protected _visibilityChanges: BehaviorSubject; protected _sizeChanges: BehaviorSubject; protected _viewContainerCreated: Subject<{ fromCache: boolean; container: ViewContainer; }>; protected _windowChanges: BehaviorSubject; protected _initialCreate: boolean; protected _container: Renderable; protected _configuration: ViewConfig; protected _viewManager: ViewManager; protected _viewFactory: ViewFactory; protected _document: Document; /** * Notifies when the visibility of this view changes. * @type {Observable} */ readonly windowChanges: Observable; /** * Notifies when the visibility of this view changes. * @type {Observable} */ readonly visibilityChanges: Observable; /** * Notifies when the dimensions of this view changes. * @type {Observable<{ width: number, height: number }>} */ readonly sizeChanges: Observable; /** * Notifies when the view container is resolved. * @type {Observable>} */ viewContainerCreated: Observable<{ fromCache: boolean; container: ViewContainer; }>; readonly width: number; readonly height: number; /** * Whether this view is configured to be lazy. * @readonly * @type {(boolean|null)} */ readonly lazy: boolean | null; readonly caching: CacheStrategy | null; /** * The 'ref' string this view is configured with. * @readonly * @type {(string|null)} */ readonly ref: string | null; /** * The resolution strategy this view is configured with. * @readonly * @type {(ResolverStrategy|null)} */ readonly resolution: ResolverStrategy | null; /** * The token this view is using for registration. * @readonly * @type {(any|null)} */ readonly token: any | null; readonly configuration: ViewConfig; readonly viewComponentConfig: any | null; readonly element: HTMLElement | null; initialize(): void; render(): VNode; /** * Closes this view. * @emits {BeforeDestroyEvent} Fired when not silent. * @param {{ silent?: boolean }} [args={}] */ close(args?: { silent?: boolean; }): void; /** * Makes this view visible. * @emits {MakeVisibileCommand} */ makeVisible(): void; /** * Minimizes this view if applicable. * @emits {MinimizeCommand} */ minimize(isMinimized?: boolean): void; /** * Resolves a views config property. Checks the configuration given to the * view renderable first then checks the component metadata. * @template T The return type. * @param {string} path * @returns {(T|null)} */ resolveConfigProperty(path: string): T | null; /** * Invoked on every render cycle. * @private */ private _postRender; /** * Invoked when snabbdom has created the HTML element for this view. * @private * @param {HTMLElement} element */ private _onCreate; /** * Configures a view. * @static * @param {ViewConfig} config * @returns {ConfiguredRenderable} */ static configure(config: ViewConfig): ConfiguredRenderable; }