/** * Some utils taken from various parts of Nx: * https://github.com/nrwl/nx * * Thanks, Nrwl folks! */ import { Path } from '@angular-devkit/core'; import { Rule, SchematicContext, Tree } from '@angular-devkit/schematics'; /** * This method is specifically for reading JSON files in a Tree * @param host The host tree * @param path The path to the JSON file * @returns The JSON data in the file. */ export declare function readJsonInTree(host: Tree, path: string): T; /** * This method is specifically for updating JSON in a Tree * @param path Path of JSON file in the Tree * @param callback Manipulation of the JSON data * @returns A rule which updates a JSON file file in a Tree */ export declare function updateJsonInTree(path: string, callback: (json: T, context: SchematicContext) => O): Rule; export declare function getWorkspacePath(host: Tree): string; declare type TargetsConfig = Record; export declare function getTargetsConfigFromProject(projectConfig: { architect?: TargetsConfig; } & { targets?: TargetsConfig; }): TargetsConfig | null; export declare function isKarmaUsedInWorkspace(tree: Tree): boolean; export declare function getProjectConfig(host: Tree, name: string): any; export declare function offsetFromRoot(fullPathToSourceDir: string): string; export declare function updateWorkspaceInTree(callback: (json: T, context: SchematicContext, host: Tree) => O): Rule; export declare function addJestTargetToProject(projectName: string, targetName: 'test'): Rule; /** * Utility to act on all files in a tree that are not ignored by git. */ export declare function visitNotIgnoredFiles(visitor: (file: Path, host: Tree, context: SchematicContext) => void | Rule, dir?: Path): Rule; export declare function createRootJestConfig(path: string, hasE2e: boolean): (tree: import("@angular-devkit/schematics/src/tree/interface").Tree) => Promise; export declare function createJestConfigForProject(projectName: string): Rule; export declare function removeKarmaConfJsForProject(projectName: string): Rule; export declare function sortObjectByKeys(obj: Record): Record; /** * To make certain schematic usage conversion more ergonomic, if the user does not specify a project * and only has a single project in their angular.json we will just go ahead and use that one. */ export declare function determineTargetProjectName(tree: Tree, maybeProject?: string): string | null; /** * Checking if the target project has e2e setup * Method will check if angular project architect has e2e configuration to determine if e2e setup */ export declare function determineTargetProjectHasE2E(angularJSON: any, projectName: string): boolean; export {};