ngast
Version:
Parsing tools for Angular. The project is an abstraction over the Angular compiler which provides friendly interface.
45 lines (44 loc) • 2.36 kB
TypeScript
import { Symbol } from './symbol';
import type { DeclarationSymbol } from './find-symbol';
import type { ComponentSymbol } from './component.symbol';
export declare class NgModuleSymbol extends Symbol<'NgModule'> {
readonly annotation = "NgModule";
get metadata(): import("@angular/compiler").R3NgModuleMetadata | undefined;
get scope(): import("@angular/compiler-cli/src/ngtsc/scope").LocalModuleScope | null;
/** Return dependencies injected in the constructor of the module */
getDependencies(): (import("./injectable.symbol").InjectableSymbol | NgModuleSymbol | import("./directive.symbol").DirectiveSymbol | ComponentSymbol | import("./pipe.symbol").PipeSymbol | import("./provider").Provider)[];
/** Get the providers of the module as InjectableSymbol */
getProviders(): (import("./injectable.symbol").InjectableSymbol | import("./provider").Provider)[];
/**
* Get all declaration class of the module as `ComponentSymbol | PipeSymbol | DirectiveSymbol`
* You can filter them using `declaration.isSymbol(name)` method:
* @example
* ```typescript
* const declarations = module.getDeclarations()
* const components = declarations.filter(declaration => declaration.isSymbol('Component'))
* ```
*/
getDeclarations(): DeclarationSymbol[] | undefined;
/**
* Get all modules imported by the current module.
* You can filter them using `imported.isDts()`
* @example
* ```typescript
* const imported = module.getImports();
* const externalImports = imported.filter(import => import.isDts());
* ```
*/
getImports(): NgModuleSymbol[] | undefined;
/**
* Get all declaration class of the module as `ComponentSymbol | PipeSymbol | DirectiveSymbol`
* You can filter them using `exported.isSymbol(name)` method:
* @example
* ```typescript
* const exported = module.getExports()
* const components = exported.filter(export => export.isSymbol('Component'))
* ```
*/
getExports(): (import("./injectable.symbol").InjectableSymbol | NgModuleSymbol | import("./directive.symbol").DirectiveSymbol | ComponentSymbol | import("./pipe.symbol").PipeSymbol | undefined)[] | undefined;
/** Get the list of components bootstraped by the module if any */
getBootstap(): ComponentSymbol[] | undefined;
}