UNPKG

1.66 kBTypeScriptView Raw
1/**
2 * @license
3 * Copyright Google LLC All Rights Reserved.
4 *
5 * Use of this source code is governed by an MIT-style license that can be
6 * found in the LICENSE file at https://angular.io/license
7 */
8import { FileOperator, Rule, Source } from '../engine/interface';
9import { FilePredicate, MergeStrategy, Tree } from '../tree/interface';
10/**
11 * A Source that returns an tree as its single value.
12 */
13export declare function source(tree: Tree): Source;
14/**
15 * A source that returns an empty tree.
16 */
17export declare function empty(): Source;
18/**
19 * Chain multiple rules into a single rule.
20 */
21export declare function chain(rules: Iterable<Rule> | AsyncIterable<Rule>): Rule;
22/**
23 * Apply multiple rules to a source, and returns the source transformed.
24 */
25export declare function apply(source: Source, rules: Rule[]): Source;
26/**
27 * Merge an input tree with the source passed in.
28 */
29export declare function mergeWith(source: Source, strategy?: MergeStrategy): Rule;
30export declare function noop(): Rule;
31export declare function filter(predicate: FilePredicate<boolean>): Rule;
32export declare function asSource(rule: Rule): Source;
33export declare function branchAndMerge(rule: Rule, strategy?: MergeStrategy): Rule;
34export declare function when(predicate: FilePredicate<boolean>, operator: FileOperator): FileOperator;
35export declare function partitionApplyMerge(predicate: FilePredicate<boolean>, ruleYes: Rule, ruleNo?: Rule): Rule;
36export declare function forEach(operator: FileOperator): Rule;
37export declare function composeFileOperators(operators: FileOperator[]): FileOperator;
38export declare function applyToSubtree(path: string, rules: Rule[]): Rule;