UNPKG

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