UNPKG

@ngx-ext/schematics-api

Version:

Set of tools wrapping Angular Schematics.

44 lines (43 loc) 2.21 kB
import { ProjectType, WorkspaceProject, WorkspaceSchema, WorkspaceTargets } from '@schematics/angular/utility/workspace-models'; import * as ts from '@schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript'; import { findNodes, getSourceNodes } from '@schematics/angular/utility/ast-utils'; import { Tree } from '@angular-devkit/schematics'; import { Host } from '@schematics/angular/utility/change'; import { RootModule } from './root-module'; export declare class AngularApp { protected readonly tree: Tree; protected static _instance: AngularApp; /** * Find all nodes from the AST in the subtree of node of SyntaxKind kind. * Params: * max – The maximum number of items to return. * recursive – Continue looking for nodes of kind recursive until end the last child even when node of kind has been found. * Returns: * all nodes of kind, or [] if none is found */ findNodes: typeof findNodes; /** * Get all the nodes from a source. * @param sourceFile The source file object. * @returns {Array<ts.Node>} An array of all the nodes in the source. */ getNodesFromSource: typeof getSourceNodes; static getInstance(tree: Tree): AngularApp; protected constructor(tree: Tree); getRootModule(): RootModule; getWorkspace(): WorkspaceSchema; getDefaultProject(): WorkspaceProject<ProjectType>; getAllProjects(): { [key: string]: WorkspaceProject<ProjectType>; }; getDefaultProjectRootModulePath(): string; getRootModulePath(project: WorkspaceProject<ProjectType>): string; getDefaultProjectMainFilePath(): string; /** Looks for the main TypeScript file in the given project and returns its path. */ getProjectMainFilePath(project: WorkspaceProject): string; /** Resolves the architect options for the build target of the given project. */ getProjectTargetOptions<BuildTarget extends keyof WorkspaceTargets>(project: WorkspaceProject, buildTarget: BuildTarget): WorkspaceTargets[BuildTarget]['options']; /** Reads file given path and returns TypeScript source file. */ getSourceFile(path: string): ts.SourceFile; createHost(): Host; }