UNPKG

1.67 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.dev/license
7 */
8import { BaseException } from '@angular-devkit/core';
9import { FileOperator, Rule } from '../engine/interface';
10export declare const TEMPLATE_FILENAME_RE: RegExp;
11export declare class OptionIsNotDefinedException extends BaseException {
12 constructor(name: string);
13}
14export declare class UnknownPipeException extends BaseException {
15 constructor(name: string);
16}
17export declare class InvalidPipeException extends BaseException {
18 constructor(name: string);
19}
20export type PathTemplateValue = boolean | string | number | undefined;
21export type PathTemplatePipeFunction = (x: string) => PathTemplateValue;
22export type PathTemplateData = {
23 [key: string]: PathTemplateValue | PathTemplateData | PathTemplatePipeFunction;
24};
25export interface PathTemplateOptions {
26 interpolationStart: string;
27 interpolationEnd: string;
28 pipeSeparator?: string;
29}
30export declare function applyContentTemplate<T>(options: T): FileOperator;
31export declare function contentTemplate<T>(options: T): Rule;
32export declare function applyPathTemplate<T extends PathTemplateData>(data: T, options?: PathTemplateOptions): FileOperator;
33export declare function pathTemplate<T extends PathTemplateData>(options: T): Rule;
34/**
35 * Remove every `.template` suffix from file names.
36 */
37export declare function renameTemplateFiles(): Rule;
38export declare function template<T extends object>(options: T): Rule;
39export declare function applyTemplates<T extends object>(options: T): Rule;