@@ -13,38 +13,39 @@ import {Url} from 'url';
1313
1414/**
1515 * 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.
1818 */
19- export type CollectionDescription < CollectionT extends { } > = CollectionT & {
19+ export type CollectionDescription < CollectionMetadataT extends { } > = CollectionMetadataT & {
2020 readonly name : string ;
2121} ;
2222
2323/**
2424 * 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.
2727 */
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 > ;
3031 readonly name : string ;
3132} ;
3233
3334
3435/**
3536 * 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.
3839 */
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 ;
4142 createSchematicDescription (
4243 name : string ,
43- collection : CollectionDescription < CollectionT > ) :
44- SchematicDescription < CollectionT , SchematicT > | null ;
44+ collection : CollectionDescription < CollectionMetadataT > ) :
45+ SchematicDescription < CollectionMetadataT , SchematicMetadataT > | null ;
4546 getSchematicRuleFactory < OptionT > (
46- schematic : SchematicDescription < CollectionT , SchematicT > ,
47- collection : CollectionDescription < CollectionT > ) : RuleFactory < OptionT > ;
47+ schematic : SchematicDescription < CollectionMetadataT , SchematicMetadataT > ,
48+ collection : CollectionDescription < CollectionMetadataT > ) : RuleFactory < OptionT > ;
4849 createSourceFromUrl ( url : Url ) : Source | null ;
4950
5051 readonly defaultMergeStrategy ?: MergeStrategy ;
@@ -55,16 +56,18 @@ export interface EngineHost<CollectionT extends {}, SchematicT extends {}> {
5556 * The root Engine for creating and running schematics and collections. Everything related to
5657 * a schematic execution starts from this interface.
5758 *
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.
6062 *
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.
6264 */
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 > ;
6567 createSchematic (
6668 name : string ,
67- collection : Collection < CollectionT , SchematicT > ) : Schematic < CollectionT , SchematicT > ;
69+ collection : Collection < CollectionMetadataT , SchematicMetadataT >
70+ ) : Schematic < CollectionMetadataT , SchematicMetadataT > ;
6871 createSourceFromUrl ( url : Url ) : Source ;
6972
7073 readonly defaultMergeStrategy : MergeStrategy ;
@@ -75,21 +78,20 @@ export interface Engine<CollectionT extends {}, SchematicT extends {}> {
7578 * A Collection as created by the Engine. This should be used by the tool to create schematics,
7679 * or by rules to create other schematics as well.
7780 */
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 > ;
8183
82- createSchematic ( name : string ) : Schematic < CollectionT , SchematicT > ;
84+ createSchematic ( name : string ) : Schematic < CollectionMetadataT , SchematicMetadataT > ;
8385}
8486
8587
8688/**
8789 * A Schematic as created by the Engine. This should be used by the tool to execute the main
8890 * schematics, or by rules to execute other schematics as well.
8991 */
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 > ;
9395
9496 call < T > ( options : T , host : Observable < Tree > ) : Observable < Tree > ;
9597}
@@ -99,9 +101,9 @@ export interface Schematic<CollectionT, SchematicT> {
99101 * A SchematicContext. Contains information necessary for Schematics to execute some rules, for
100102 * example when using another schematics, as we need the engine and collection.
101103 */
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 > ;
105107 readonly host : Observable < Tree > ;
106108 readonly strategy : MergeStrategy ;
107109}
0 commit comments