1 | /// <amd-module name="@angular/compiler-cli/ngcc/src/execution/tasks/completion" />
|
---|
2 | /**
|
---|
3 | * @license
|
---|
4 | * Copyright Google LLC All Rights Reserved.
|
---|
5 | *
|
---|
6 | * Use of this source code is governed by an MIT-style license that can be
|
---|
7 | * found in the LICENSE file at https://angular.io/license
|
---|
8 | */
|
---|
9 | import { PathManipulation, ReadonlyFileSystem } from '../../../../src/ngtsc/file_system';
|
---|
10 | import { Logger } from '../../../../src/ngtsc/logging';
|
---|
11 | import { PackageJsonUpdater } from '../../writing/package_json_updater';
|
---|
12 | import { Task, TaskCompletedCallback, TaskProcessingOutcome, TaskQueue } from './api';
|
---|
13 | /**
|
---|
14 | * A function that can handle a specific outcome of a task completion.
|
---|
15 | *
|
---|
16 | * These functions can be composed using the `composeTaskCompletedCallbacks()`
|
---|
17 | * to create a `TaskCompletedCallback` function that can be passed to an `Executor`.
|
---|
18 | */
|
---|
19 | export declare type TaskCompletedHandler = (task: Task, message: string | null) => void;
|
---|
20 | /**
|
---|
21 | * Compose a group of TaskCompletedHandlers into a single TaskCompletedCallback.
|
---|
22 | *
|
---|
23 | * The compose callback will receive an outcome and will delegate to the appropriate handler based
|
---|
24 | * on this outcome.
|
---|
25 | *
|
---|
26 | * @param callbacks a map of outcomes to handlers.
|
---|
27 | */
|
---|
28 | export declare function composeTaskCompletedCallbacks(callbacks: Record<TaskProcessingOutcome, TaskCompletedHandler>): TaskCompletedCallback;
|
---|
29 | /**
|
---|
30 | * Create a handler that will mark the entry-points in a package as being processed.
|
---|
31 | *
|
---|
32 | * @param pkgJsonUpdater The service used to update the package.json
|
---|
33 | */
|
---|
34 | export declare function createMarkAsProcessedHandler(fs: PathManipulation, pkgJsonUpdater: PackageJsonUpdater): TaskCompletedHandler;
|
---|
35 | /**
|
---|
36 | * Create a handler that will throw an error.
|
---|
37 | */
|
---|
38 | export declare function createThrowErrorHandler(fs: ReadonlyFileSystem): TaskCompletedHandler;
|
---|
39 | /**
|
---|
40 | * Create a handler that logs an error and marks the task as failed.
|
---|
41 | */
|
---|
42 | export declare function createLogErrorHandler(logger: Logger, fs: ReadonlyFileSystem, taskQueue: TaskQueue): TaskCompletedHandler;
|
---|