@netgrif/components
Version:
Netgrif Application Engine frontend Angular components
25 lines (24 loc) • 1.65 kB
TypeScript
import * as ts from '@schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript';
import { Change } from '@schematics/angular/utility/change';
/**
* copied from original at @schematics/angular/utility/ast-utils
* our version allows for more freedom by adding the `insertedText` parameter
*/
export declare function addProviderToModule(source: ts.SourceFile, modulePath: string, classifiedName: string, importPath: string, providerText?: string): Change[];
/**
* copied from original method `addSymbolToNgModuleMetadata` at @schematics/angular/utility/ast-utils
*
* Changes in our version in comparison to the lib version:
* - `editedFilePath` parameter - renamed from the original `ngModulePath` to better reflect it's use
* - `metadataField` parameter - allows for more diverse uses such as editing component source files
* - `insertedText` parameter - allows for more freedom and flexibility when adding more complicated providers
*
* @param source modified file
* @param editedFilePath path to edited file
* @param decoratorName name of the decorator, that should have a property added
* @param metadataField name of the array, where the symbol is added
* @param symbolName name of the symbol eg. class name
* @param insertedText the exact text that should be included in the array. If none is provided `symbolName` is used instead
* @param importPath path for the import
*/
export declare function addSymbolToDecoratorMetadata(source: ts.SourceFile, editedFilePath: string, decoratorName: string, metadataField: string, symbolName: string, insertedText?: string, importPath?: string | null): Change[];