/** Core */
import { Generic, HostViewComponent, HostElementComponent } from "cmf.core/src/core";
/** Angular */
import * as ng from "@angular/core";
import { LayoutModel, OnExtendedLayoutInternal, InternalLayoutBaseDef } from "./layoutDef";
/**
* The Layout directive.
* This directive can be added to any component for layout handling (save/load).
* When added to a common DOM node, a new node will be created on layout model: use
* this to group template layouts by custom nodes (e.g. a div with 2 components).
* Components that can save/load layouts MUST implement {@link OnLayout} (or {@link OnExtendedLayout}) interface in order to work with this directive.
*
** For example:
* - The first grid will save/load layouts within a UI page, since it has "cmf-core-controls-layout" directive
* and {@link BusinessDataGrid} implements {@link OnLayout}.
* - The second grid will NOT save/load layouts, since the directive is not on it.
* - The customized component, can save/load layouts, because it has the directive
* "cmf-core-controls-layout" and it implements {@link OnLayout}.
*
*
*
*
*
*
*
*
*
*
*
*
*/
export declare class Layout extends Generic implements OnExtendedLayoutInternal, ng.OnDestroy, ng.AfterViewInit {
private _parentComponent;
private _selfComponent;
parentModel: LayoutModel;
childModel: LayoutModel;
/**
* Symbol inserted on each LayoutModel after layout is being called for load
* (Avoid unnecessary re-loads)
*/
private static _markNodeLayoutAsReadSymbol;
private _onSaveLayoutAction;
private _onLoadLayoutAction;
private _onSaveExtendedLayoutAction;
private _onLoadExtendedLayoutAction;
private _component;
private _layoutId;
/**
* Get root node and level distance from node
* @param node Node inside model tree
* @param levelCount Level count (used in recursion)
*/
private static getRootNode;
/**
* Get matched layout from "layout", which is in the last level of levelPath and matches layoutId
* @param layout Global layout tree to be visited
* @param levelPath Node levels (reversed order)
* @param layoutId Layout id to match
*/
private static getLayout;
layoutId: string;
constructor(_parentComponent: HostViewComponent, _selfComponent: HostElementComponent, parentModel: LayoutModel, childModel: LayoutModel);
/**
* Load layout of a newly node if available
*/
private callLoadLayoutIfAvailable;
/**
* Get default layout object for current Layout
*/
getDefaultLayout(): InternalLayoutBaseDef;
/**
* Get onLoadLayout Promise for current component or call onLoadInternalLayout if available (override).
* @param layoutDef Layout to load
*/
onLoadExtendedLayout(layoutDef: InternalLayoutBaseDef): Promise;
/**
* Get onSaveLayout Promise for current component or call onSaveInternalLayout if available (override).
*/
onSaveExtendedLayout(): Promise;
/**
* True if component where directive is implements OnExtendedLayout
*/
componentImplementsOnExtendedLayout(): boolean;
/**
* ng.ngAfterViewInit
*/
ngAfterViewInit(): void;
/**
* ng.OnDestroy
* Remove node from Layout Model tree
*/
ngOnDestroy(): void;
}
export declare class LayoutModule {
}