refactor(core): split up interface files in render3 (#21433)
PR Close #21433
This commit is contained in:

committed by
Alex Eagle

parent
a33ff2c68f
commit
6be9c0466c
73
packages/core/src/render3/interfaces/container.ts
Normal file
73
packages/core/src/render3/interfaces/container.ts
Normal file
@ -0,0 +1,73 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {ComponentTemplate} from './definition';
|
||||
import {LElementNode, LViewNode} from './node';
|
||||
import {LView} from './view';
|
||||
|
||||
|
||||
/** The state associated with an LContainer */
|
||||
export interface LContainer {
|
||||
/**
|
||||
* The next active index in the views array to read or write to. This helps us
|
||||
* keep track of where we are in the views array.
|
||||
*/
|
||||
nextIndex: number;
|
||||
|
||||
/**
|
||||
* This allows us to jump from a container to a sibling container or
|
||||
* component view with the same parent, so we can remove listeners efficiently.
|
||||
*/
|
||||
next: LView|LContainer|null;
|
||||
|
||||
/**
|
||||
* Access to the parent view is necessary so we can propagate back
|
||||
* up from inside a container to parent.next.
|
||||
*/
|
||||
parent: LView|null;
|
||||
|
||||
/**
|
||||
* A list of the container's currently active child views. Views will be inserted
|
||||
* here as they are added and spliced from here when they are removed. We need
|
||||
* to keep a record of current views so we know which views are already in the DOM
|
||||
* (and don't need to be re-added) and so we can remove views from the DOM when they
|
||||
* are no longer required.
|
||||
*/
|
||||
readonly views: LViewNode[];
|
||||
|
||||
/**
|
||||
* Parent Element which will contain the location where all of the Views will be
|
||||
* inserted into to.
|
||||
*
|
||||
* If `renderParent` is `null` it is headless. This means that it is contained
|
||||
* in another `LViewNode` which in turn is contained in another `LContainerNode` and
|
||||
* therefore it does not yet have its own parent.
|
||||
*
|
||||
* If `renderParent` is not `null` then it may be:
|
||||
* - same as `LContainerNode.parent` in which case it is just a normal container.
|
||||
* - different from `LContainerNode.parent` in which case it has been re-projected.
|
||||
* In other words `LContainerNode.parent` is logical parent where as
|
||||
* `LContainer.projectedParent` is render parent.
|
||||
*
|
||||
* When views are inserted into `LContainerNode` then `renderParent` is:
|
||||
* - `null`, we are in `LViewNode` keep going up a hierarchy until actual
|
||||
* `renderParent` is found.
|
||||
* - not `null`, then use the `projectedParent.native` as the `RElement` to insert
|
||||
* `LViewNode`s into.
|
||||
*/
|
||||
renderParent: LElementNode|null;
|
||||
|
||||
/**
|
||||
* The template extracted from the location of the Container.
|
||||
*/
|
||||
readonly template: ComponentTemplate<any>|null;
|
||||
}
|
||||
|
||||
// Note: This hack is necessary so we don't erroneously get a circular dependency
|
||||
// failure based on types.
|
||||
export const unusedValueExportToPlacateAjd = 1;
|
Reference in New Issue
Block a user