@@ -13,38 +13,39 @@ import {Url} from 'url';
13
13
14
14
/**
15
15
* The description (metadata) of a collection. This type contains every information the engine
16
- * needs to run. The CollectionT type parameter contains additional metadata that you want to
17
- * store while remaining type-safe.
16
+ * needs to run. The CollectionMetadataT type parameter contains additional metadata that you
17
+ * want to store while remaining type-safe.
18
18
*/
19
- export type CollectionDescription < CollectionT extends { } > = CollectionT & {
19
+ export type CollectionDescription < CollectionMetadataT extends { } > = CollectionMetadataT & {
20
20
readonly name : string ;
21
21
} ;
22
22
23
23
/**
24
24
* The description (metadata) of a schematic. This type contains every information the engine
25
- * needs to run. The SchematicT and CollectionT type parameters contain additional metadata
26
- * that you want to store while remaining type-safe.
25
+ * needs to run. The SchematicMetadataT and CollectionMetadataT type parameters contain additional
26
+ * metadata that you want to store while remaining type-safe.
27
27
*/
28
- export type SchematicDescription < CollectionT extends { } , SchematicT extends { } > = SchematicT & {
29
- readonly collection : CollectionDescription < CollectionT > ;
28
+ export type SchematicDescription < CollectionMetadataT extends { } ,
29
+ SchematicMetadataT extends { } > = SchematicMetadataT & {
30
+ readonly collection : CollectionDescription < CollectionMetadataT > ;
30
31
readonly name : string ;
31
32
} ;
32
33
33
34
34
35
/**
35
36
* The Host for the Engine. Specifically, the piece of the tooling responsible for resolving
36
- * collections and schematics descriptions. The SchematicT and CollectionT type parameters contain
37
- * additional metadata that you want to store while remaining type-safe.
37
+ * collections and schematics descriptions. The SchematicMetadataT and CollectionMetadataT type
38
+ * parameters contain additional metadata that you want to store while remaining type-safe.
38
39
*/
39
- export interface EngineHost < CollectionT extends { } , SchematicT extends { } > {
40
- createCollectionDescription ( name : string ) : CollectionDescription < CollectionT > | null ;
40
+ export interface EngineHost < CollectionMetadataT extends { } , SchematicMetadataT extends { } > {
41
+ createCollectionDescription ( name : string ) : CollectionDescription < CollectionMetadataT > | null ;
41
42
createSchematicDescription (
42
43
name : string ,
43
- collection : CollectionDescription < CollectionT > ) :
44
- SchematicDescription < CollectionT , SchematicT > | null ;
44
+ collection : CollectionDescription < CollectionMetadataT > ) :
45
+ SchematicDescription < CollectionMetadataT , SchematicMetadataT > | null ;
45
46
getSchematicRuleFactory < OptionT > (
46
- schematic : SchematicDescription < CollectionT , SchematicT > ,
47
- collection : CollectionDescription < CollectionT > ) : RuleFactory < OptionT > ;
47
+ schematic : SchematicDescription < CollectionMetadataT , SchematicMetadataT > ,
48
+ collection : CollectionDescription < CollectionMetadataT > ) : RuleFactory < OptionT > ;
48
49
createSourceFromUrl ( url : Url ) : Source | null ;
49
50
50
51
readonly defaultMergeStrategy ?: MergeStrategy ;
@@ -55,16 +56,18 @@ export interface EngineHost<CollectionT extends {}, SchematicT extends {}> {
55
56
* The root Engine for creating and running schematics and collections. Everything related to
56
57
* a schematic execution starts from this interface.
57
58
*
58
- * CollectionT is, by default, a generic Collection metadata type. This is used throughout the
59
- * engine typings so that you can use a type that's merged into descriptions, while being type-safe.
59
+ * CollectionMetadataT is, by default, a generic Collection metadata type. This is used throughout
60
+ * the engine typings so that you can use a type that's merged into descriptions, while being
61
+ * type-safe.
60
62
*
61
- * SchematicT is a type that contains additional typing for the Schematic Description.
63
+ * SchematicMetadataT is a type that contains additional typing for the Schematic Description.
62
64
*/
63
- export interface Engine < CollectionT extends { } , SchematicT extends { } > {
64
- createCollection ( name : string ) : Collection < CollectionT , SchematicT > ;
65
+ export interface Engine < CollectionMetadataT extends { } , SchematicMetadataT extends { } > {
66
+ createCollection ( name : string ) : Collection < CollectionMetadataT , SchematicMetadataT > ;
65
67
createSchematic (
66
68
name : string ,
67
- collection : Collection < CollectionT , SchematicT > ) : Schematic < CollectionT , SchematicT > ;
69
+ collection : Collection < CollectionMetadataT , SchematicMetadataT >
70
+ ) : Schematic < CollectionMetadataT , SchematicMetadataT > ;
68
71
createSourceFromUrl ( url : Url ) : Source ;
69
72
70
73
readonly defaultMergeStrategy : MergeStrategy ;
@@ -75,21 +78,20 @@ export interface Engine<CollectionT extends {}, SchematicT extends {}> {
75
78
* A Collection as created by the Engine. This should be used by the tool to create schematics,
76
79
* or by rules to create other schematics as well.
77
80
*/
78
- export interface Collection < CollectionT , SchematicT > {
79
- readonly name : string ;
80
- readonly description : CollectionDescription < CollectionT > ;
81
+ export interface Collection < CollectionMetadataT , SchematicMetadataT > {
82
+ readonly description : CollectionDescription < CollectionMetadataT > ;
81
83
82
- createSchematic ( name : string ) : Schematic < CollectionT , SchematicT > ;
84
+ createSchematic ( name : string ) : Schematic < CollectionMetadataT , SchematicMetadataT > ;
83
85
}
84
86
85
87
86
88
/**
87
89
* A Schematic as created by the Engine. This should be used by the tool to execute the main
88
90
* schematics, or by rules to execute other schematics as well.
89
91
*/
90
- export interface Schematic < CollectionT , SchematicT > {
91
- readonly description : SchematicDescription < CollectionT , SchematicT > ;
92
- readonly collection : Collection < CollectionT , SchematicT > ;
92
+ export interface Schematic < CollectionMetadataT , SchematicMetadataT > {
93
+ readonly description : SchematicDescription < CollectionMetadataT , SchematicMetadataT > ;
94
+ readonly collection : Collection < CollectionMetadataT , SchematicMetadataT > ;
93
95
94
96
call < T > ( options : T , host : Observable < Tree > ) : Observable < Tree > ;
95
97
}
@@ -99,9 +101,9 @@ export interface Schematic<CollectionT, SchematicT> {
99
101
* A SchematicContext. Contains information necessary for Schematics to execute some rules, for
100
102
* example when using another schematics, as we need the engine and collection.
101
103
*/
102
- export interface TypedSchematicContext < CollectionT , SchematicT > {
103
- readonly engine : Engine < CollectionT , SchematicT > ;
104
- readonly schematic : Schematic < CollectionT , SchematicT > ;
104
+ export interface TypedSchematicContext < CollectionMetadataT , SchematicMetadataT > {
105
+ readonly engine : Engine < CollectionMetadataT , SchematicMetadataT > ;
106
+ readonly schematic : Schematic < CollectionMetadataT , SchematicMetadataT > ;
105
107
readonly host : Observable < Tree > ;
106
108
readonly strategy : MergeStrategy ;
107
109
}
0 commit comments