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 | */
|
---|
8 | /// <reference types="node" />
|
---|
9 | import { BaseException, InvalidJsonCharacterException, UnexpectedEndOfInputException } from '@angular-devkit/core';
|
---|
10 | import { Observable } from 'rxjs';
|
---|
11 | import { Url } from 'url';
|
---|
12 | import { RuleFactory, Source, TaskExecutor, TaskExecutorFactory } from '../src';
|
---|
13 | import { FileSystemCollectionDesc, FileSystemEngineHost, FileSystemSchematicContext, FileSystemSchematicDesc, FileSystemSchematicDescription } from './description';
|
---|
14 | export declare type OptionTransform<T extends object, R extends object> = (schematic: FileSystemSchematicDescription, options: T, context?: FileSystemSchematicContext) => Observable<R> | PromiseLike<R> | R;
|
---|
15 | export declare type ContextTransform = (context: FileSystemSchematicContext) => FileSystemSchematicContext;
|
---|
16 | export declare class CollectionCannotBeResolvedException extends BaseException {
|
---|
17 | constructor(name: string);
|
---|
18 | }
|
---|
19 | export declare class InvalidCollectionJsonException extends BaseException {
|
---|
20 | constructor(_name: string, path: string, jsonException?: UnexpectedEndOfInputException | InvalidJsonCharacterException);
|
---|
21 | }
|
---|
22 | export declare class SchematicMissingFactoryException extends BaseException {
|
---|
23 | constructor(name: string);
|
---|
24 | }
|
---|
25 | export declare class FactoryCannotBeResolvedException extends BaseException {
|
---|
26 | constructor(name: string);
|
---|
27 | }
|
---|
28 | export declare class CollectionMissingSchematicsMapException extends BaseException {
|
---|
29 | constructor(name: string);
|
---|
30 | }
|
---|
31 | export declare class CollectionMissingFieldsException extends BaseException {
|
---|
32 | constructor(name: string);
|
---|
33 | }
|
---|
34 | export declare class SchematicMissingFieldsException extends BaseException {
|
---|
35 | constructor(name: string);
|
---|
36 | }
|
---|
37 | export declare class SchematicMissingDescriptionException extends BaseException {
|
---|
38 | constructor(name: string);
|
---|
39 | }
|
---|
40 | export declare class SchematicNameCollisionException extends BaseException {
|
---|
41 | constructor(name: string);
|
---|
42 | }
|
---|
43 | /**
|
---|
44 | * A EngineHost base class that uses the file system to resolve collections. This is the base of
|
---|
45 | * all other EngineHost provided by the tooling part of the Schematics library.
|
---|
46 | */
|
---|
47 | export declare abstract class FileSystemEngineHostBase implements FileSystemEngineHost {
|
---|
48 | protected abstract _resolveCollectionPath(name: string, requester?: string): string;
|
---|
49 | protected abstract _resolveReferenceString(name: string, parentPath: string): {
|
---|
50 | ref: RuleFactory<{}>;
|
---|
51 | path: string;
|
---|
52 | } | null;
|
---|
53 | protected abstract _transformCollectionDescription(name: string, desc: Partial<FileSystemCollectionDesc>): FileSystemCollectionDesc;
|
---|
54 | protected abstract _transformSchematicDescription(name: string, collection: FileSystemCollectionDesc, desc: Partial<FileSystemSchematicDesc>): FileSystemSchematicDesc;
|
---|
55 | private _transforms;
|
---|
56 | private _contextTransforms;
|
---|
57 | private _taskFactories;
|
---|
58 | listSchematicNames(collection: FileSystemCollectionDesc): string[];
|
---|
59 | registerOptionsTransform<T extends object, R extends object>(t: OptionTransform<T, R>): void;
|
---|
60 | registerContextTransform(t: ContextTransform): void;
|
---|
61 | /**
|
---|
62 | *
|
---|
63 | * @param name
|
---|
64 | * @return {{path: string}}
|
---|
65 | */
|
---|
66 | createCollectionDescription(name: string, requester?: FileSystemCollectionDesc): FileSystemCollectionDesc;
|
---|
67 | createSchematicDescription(name: string, collection: FileSystemCollectionDesc): FileSystemSchematicDesc | null;
|
---|
68 | createSourceFromUrl(url: Url): Source | null;
|
---|
69 | transformOptions<OptionT extends object, ResultT extends object>(schematic: FileSystemSchematicDesc, options: OptionT, context?: FileSystemSchematicContext): Observable<ResultT>;
|
---|
70 | transformContext(context: FileSystemSchematicContext): FileSystemSchematicContext;
|
---|
71 | getSchematicRuleFactory<OptionT extends object>(schematic: FileSystemSchematicDesc, _collection: FileSystemCollectionDesc): RuleFactory<OptionT>;
|
---|
72 | registerTaskExecutor<T>(factory: TaskExecutorFactory<T>, options?: T): void;
|
---|
73 | createTaskExecutor(name: string): Observable<TaskExecutor>;
|
---|
74 | hasTaskExecutor(name: string): boolean;
|
---|
75 | }
|
---|