UNPKG

4.13 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 { BaseException } from '@angular-devkit/core';
9import { Observable } from 'rxjs';
10import { Url } from 'url';
11import { MergeStrategy } from '../tree/interface';
12import { Workflow } from '../workflow/interface';
13import { Collection, CollectionDescription, Engine, EngineHost, ExecutionOptions, Schematic, SchematicContext, SchematicDescription, Source, TaskConfiguration, TaskId, TaskInfo, TypedSchematicContext } from './interface';
14export declare class UnknownUrlSourceProtocol extends BaseException {
15 constructor(url: string);
16}
17export declare class UnknownCollectionException extends BaseException {
18 constructor(name: string);
19}
20export declare class CircularCollectionException extends BaseException {
21 constructor(name: string);
22}
23export declare class UnknownSchematicException extends BaseException {
24 constructor(name: string, collection: CollectionDescription<{}>);
25}
26export declare class PrivateSchematicException extends BaseException {
27 constructor(name: string, collection: CollectionDescription<{}>);
28}
29export declare class SchematicEngineConflictingException extends BaseException {
30 constructor();
31}
32export declare class UnregisteredTaskException extends BaseException {
33 constructor(name: string, schematic?: SchematicDescription<{}, {}>);
34}
35export declare class UnknownTaskDependencyException extends BaseException {
36 constructor(id: TaskId);
37}
38export declare class CollectionImpl<CollectionT extends object, SchematicT extends object> implements Collection<CollectionT, SchematicT> {
39 private _description;
40 private _engine;
41 readonly baseDescriptions?: CollectionDescription<CollectionT>[] | undefined;
42 constructor(_description: CollectionDescription<CollectionT>, _engine: SchematicEngine<CollectionT, SchematicT>, baseDescriptions?: CollectionDescription<CollectionT>[] | undefined);
43 get description(): CollectionDescription<CollectionT>;
44 get name(): string;
45 createSchematic(name: string, allowPrivate?: boolean): Schematic<CollectionT, SchematicT>;
46 listSchematicNames(includeHidden?: boolean): string[];
47}
48export declare class TaskScheduler {
49 private _context;
50 private _queue;
51 private _taskIds;
52 private static _taskIdCounter;
53 constructor(_context: SchematicContext);
54 private _calculatePriority;
55 private _mapDependencies;
56 schedule<T extends object>(taskConfiguration: TaskConfiguration<T>): TaskId;
57 finalize(): ReadonlyArray<TaskInfo>;
58}
59export declare class SchematicEngine<CollectionT extends object, SchematicT extends object> implements Engine<CollectionT, SchematicT> {
60 private _host;
61 protected _workflow?: Workflow | undefined;
62 private _collectionCache;
63 private _schematicCache;
64 private _taskSchedulers;
65 constructor(_host: EngineHost<CollectionT, SchematicT>, _workflow?: Workflow | undefined);
66 get workflow(): Workflow | null;
67 get defaultMergeStrategy(): MergeStrategy;
68 createCollection(name: string, requester?: Collection<CollectionT, SchematicT>): Collection<CollectionT, SchematicT>;
69 private _createCollectionDescription;
70 createContext(schematic: Schematic<CollectionT, SchematicT>, parent?: Partial<TypedSchematicContext<CollectionT, SchematicT>>, executionOptions?: Partial<ExecutionOptions>): TypedSchematicContext<CollectionT, SchematicT>;
71 createSchematic(name: string, collection: Collection<CollectionT, SchematicT>, allowPrivate?: boolean): Schematic<CollectionT, SchematicT>;
72 listSchematicNames(collection: Collection<CollectionT, SchematicT>, includeHidden?: boolean): string[];
73 transformOptions<OptionT extends object, ResultT extends object>(schematic: Schematic<CollectionT, SchematicT>, options: OptionT, context?: TypedSchematicContext<CollectionT, SchematicT>): Observable<ResultT>;
74 createSourceFromUrl(url: Url, context: TypedSchematicContext<CollectionT, SchematicT>): Source;
75 executePostTasks(): Observable<void>;
76}