refactor(core): add debug ranges to LViewDebug with matchers (#38359)

This change provides better typing for the `LView.debug` property which
is intended to be used by humans while debugging the application with
`ngDevMode` turned on.

In addition this chang also adds jasmine matchers for better asserting
that `LView` is in the correct state.

PR Close #38359
This commit is contained in:
Misko Hevery
2020-08-05 19:16:20 -07:00
committed by Andrew Kushnir
parent df7f3b04b5
commit 702958e968
15 changed files with 937 additions and 77 deletions

View File

@ -7,14 +7,11 @@
*/
import {KeyValueArray} from '../../util/array_utils';
import {TStylingRange} from '../interfaces/styling';
import {DirectiveDef} from './definition';
import {CssSelector} from './projection';
import {RNode} from './renderer';
import {LView, TView} from './view';
/**
* TNodeType corresponds to the {@link TNode} `type` property.
*/
@ -45,6 +42,20 @@ export const enum TNodeType {
IcuContainer = 5,
}
/**
* Converts `TNodeType` into human readable text.
* Make sure this matches with `TNodeType`
*/
export const TNodeTypeAsString = [
'Container', // 0
'Projection', // 1
'View', // 2
'Element', // 3
'ElementContainer', // 4
'IcuContainer' // 5
] as const;
/**
* Corresponds to the TNode.flags property.
*/