@o3r/schematics
Version:
Schematics module of the Otter framework
73 lines • 2.86 kB
TypeScript
import { SchematicContext, Tree, UpdateRecorder } from '@angular-devkit/schematics';
import * as ts from 'typescript';
/**
* Get the path to the `app.module.ts`
* In case of standalone application, get the path to the `app.config.ts` instead
* @param tree File tree
* @param context Context of the rule
* @param projectName The name of the project where to search for an app module file
*/
export declare function getAppModuleFilePath(tree: Tree, context: SchematicContext, projectName?: string | null): string | undefined;
/**
* Get the path to the main.ts
* @param tree File tree
* @param context Context of the rule
* @param projectName
*/
export declare function getMainFilePath(tree: Tree, context: SchematicContext, projectName?: string): string | undefined;
/**
* Returns true if the project is an application and contains a TS file that imports the angular RouterModule in
* one of its modules.
* @param tree
* @param options @see RuleFactory.options
* @param options.projectName
*/
export declare function isApplicationThatUsesRouterModule(tree: Tree, options: {
projectName?: string | undefined;
}): boolean | "" | undefined;
/**
* Add import to the main module
* @param name
* @param file
* @param sourceFile
* @param sourceFileContent
* @param context
* @param recorder
* @param moduleFilePath
* @param moduleIndex
* @param moduleFunction
* @param override
*/
export declare function addImportToModuleFile(name: string, file: string, sourceFile: ts.SourceFile, sourceFileContent: string, context: SchematicContext, recorder: UpdateRecorder, moduleFilePath: string, moduleIndex: number, moduleFunction?: string, override?: boolean): UpdateRecorder;
/**
* Insert import on top of the main module file
* @param name
* @param file
* @param sourceFile
* @param recorder
* @param moduleFilePath
* @param isDefault
*/
export declare function insertImportToModuleFile(name: string, file: string, sourceFile: ts.SourceFile, recorder: UpdateRecorder, moduleFilePath: string, isDefault?: boolean): UpdateRecorder;
/**
* Add providers to the main module
* @param name
* @param file
* @param sourceFile
* @param sourceFileContent
* @param context
* @param recorder
* @param moduleFilePath
* @param moduleIndex
* @param customProvider
*/
export declare function addProviderToModuleFile(name: string, file: string, sourceFile: ts.SourceFile, sourceFileContent: string, context: SchematicContext, recorder: UpdateRecorder, moduleFilePath: string, moduleIndex: number, customProvider?: string): UpdateRecorder;
/**
* Add custom code before the module definition
* @param line
* @param file
* @param recorder
* @param moduleIndex
*/
export declare function insertBeforeModule(line: string, file: string, recorder: UpdateRecorder, moduleIndex: number): UpdateRecorder;
//# sourceMappingURL=modules.d.ts.map