|
7 | 7 | */
|
8 | 8 | import * as ts from 'typescript';
|
9 | 9 |
|
10 |
| -import {ClassDeclaration, ConcreteDeclaration, Decorator, ReflectionHost} from '../../../src/ngtsc/reflection'; |
| 10 | +import {ClassDeclaration, ConcreteDeclaration, Declaration, Decorator, ReflectionHost} from '../../../src/ngtsc/reflection'; |
11 | 11 |
|
12 | 12 | export const PRE_R3_MARKER = '__PRE_R3__';
|
13 | 13 | export const POST_R3_MARKER = '__POST_R3__';
|
14 | 14 |
|
15 |
| -export type SwitchableVariableDeclaration = ts.VariableDeclaration & {initializer: ts.Identifier}; |
| 15 | +export type SwitchableVariableDeclaration = ts.VariableDeclaration&{initializer: ts.Identifier}; |
16 | 16 | export function isSwitchableVariableDeclaration(node: ts.Node):
|
17 | 17 | node is SwitchableVariableDeclaration {
|
18 | 18 | return ts.isVariableDeclaration(node) && !!node.initializer &&
|
@@ -47,7 +47,7 @@ export interface ModuleWithProvidersFunction {
|
47 | 47 | * The symbol corresponding to a "class" declaration. I.e. a `ts.Symbol` whose `valueDeclaration` is
|
48 | 48 | * a `ClassDeclaration`.
|
49 | 49 | */
|
50 |
| -export type ClassSymbol = ts.Symbol & {valueDeclaration: ClassDeclaration}; |
| 50 | +export type ClassSymbol = ts.Symbol&{valueDeclaration: ClassDeclaration}; |
51 | 51 |
|
52 | 52 | /**
|
53 | 53 | * A representation of a class that accounts for the potential existence of two `ClassSymbol`s for a
|
@@ -128,4 +128,13 @@ export interface NgccReflectionHost extends ReflectionHost {
|
128 | 128 | * @param classSymbol The class whose statements we want.
|
129 | 129 | */
|
130 | 130 | getEndOfClass(classSymbol: NgccClassSymbol): ts.Node;
|
| 131 | + |
| 132 | + /** |
| 133 | + * Check whether a `Declaration` corresponds with a known declaration and set its `known` property |
| 134 | + * to the appropriate `KnownDeclaration`. |
| 135 | + * |
| 136 | + * @param decl The `Declaration` to check or `null` if there is no declaration. |
| 137 | + * @return The passed in `Declaration` (potentially enhanced with a `KnownDeclaration`). |
| 138 | + */ |
| 139 | + detectKnownDeclaration<T extends Declaration>(decl: T|null): T|null; |
131 | 140 | }
|
0 commit comments