@@ -19,7 +19,7 @@ export class BuildableTree implements Buildable {
1919 result . set ( key , Object . getOwnPropertyDescriptor ( this , key ) )
2020 }
2121
22- const tree = new BuildingTree ( this . widgetClassName , depth )
22+ const tree = new BuildingTree ( this . constructorName , depth )
2323 function registerOnParam ( name : string , value : string ) {
2424 // checker logic if default field or not
2525 const named : boolean = ! defaultParamKeys . includes ( name ) ;
@@ -82,18 +82,33 @@ export class BuildableTree implements Buildable {
8282 return tree . build ( ) ;
8383 }
8484
85- get widgetClassName ( ) : string {
85+ /**
86+ * I.E "Transform" is default class name, when you want to make "Transform.rotate()", override with this.
87+ * @param name new name for the class invocation
88+ */
89+ // @ignore ()
90+ private factoryName : string = null ;
91+ extendWithFactoryName ( name : string ) {
92+ this . factoryName = this . factoryName
93+ return this ;
94+ }
95+
96+ get constructorName ( ) : string {
97+ if ( this . factoryName ) {
98+ return `${ this . constructor . name } .${ this . factoryName } ` ;
99+ }
86100 return this . constructor . name ;
87101 }
88102}
89103
90104
91105export class SnippetBuildableTree extends BuildableTree implements SnippetBuilder {
106+
92107 lookup ( ) {
93108 return this . _defaultSnippet ;
94109 }
95110 _defaultSnippet : string ;
96- get widgetClassName ( ) : string {
111+ get constructorName ( ) : string {
97112 return this . constructor . name ;
98113 }
99114}
0 commit comments