/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /// import { BuilderHandlerFn, BuilderInfo, BuilderOutput } from '@angular-devkit/architect'; import { TestProjectHost } from '@angular-devkit/architect/testing'; import { json, logging } from '@angular-devkit/core'; import { Observable } from 'rxjs'; export interface BuilderHarnessExecutionResult { result?: T; error?: Error; logs: readonly logging.LogEntry[]; } export interface BuilderHarnessExecutionOptions { configuration: string; outputLogsOnFailure: boolean; outputLogsOnException: boolean; useNativeFileWatching: boolean; } export declare class BuilderHarness { private readonly builderHandler; private readonly host; private readonly builderInfo; private schemaRegistry; private projectName; private projectMetadata; private targetName?; private options; private builderTargets; private watcherNotifier?; constructor(builderHandler: BuilderHandlerFn, host: TestProjectHost, builderInfo?: Partial); useProject(name: string, metadata?: Record): this; useTarget(name: string, baseOptions: T): this; withConfiguration(configuration: string, options: T): this; withBuilderTarget(target: string, handler: BuilderHandlerFn, options?: O, info?: Partial): this; execute(options?: Partial): Observable; executeOnce(options?: Partial): Promise; appendToFile(path: string, content: string): Promise; writeFile(path: string, content: string | Buffer): Promise; writeFiles(files: Record): Promise; removeFile(path: string): Promise; modifyFile(path: string, modifier: (content: string) => string | Promise): Promise; hasFile(path: string): boolean; hasFileMatch(directory: string, pattern: RegExp): boolean; readFile(path: string): string; private validateProjectName; }