File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ module.exports = function createTypeDefinitionFile(log) {
5757 _ . forEach ( docs , function ( doc ) {
5858 _ . forEach ( typeDefDocs , function ( typeDefDoc ) {
5959 if ( typeDefDoc . moduleDocs [ doc . id ] ) {
60+ // Add a copy, because we are going to modify it
6061 typeDefDoc . moduleDocs [ doc . id ] . doc = doc ;
6162 }
6263 } ) ;
@@ -68,6 +69,24 @@ module.exports = function createTypeDefinitionFile(log) {
6869 log . error ( 'createTypeDefinitionFile processor: no such module "' + alias + '" (Did you forget to add it to the modules to load?)' ) ;
6970 doc = null ;
7071 }
72+ _ . forEach ( modDoc . doc . exports , function ( exportDoc ) {
73+
74+ // Search for classes with a constructor marked as `@private`
75+ if ( exportDoc . docType === 'class' && exportDoc . constructorDoc && exportDoc . constructorDoc . private ) {
76+
77+ // Convert this class to an interface with no constructor
78+ exportDoc . docType = 'interface' ;
79+ exportDoc . constructorDoc = null ;
80+
81+ // Add the `declare var SomeClass extends InjectableReference` construct
82+ modDoc . doc . exports . push ( {
83+ docType : 'var' ,
84+ name : exportDoc . name ,
85+ id : exportDoc . id ,
86+ heritage : ': InjectableReference'
87+ } ) ;
88+ }
89+ } ) ;
7190 } ) ;
7291 if ( doc ) {
7392 docs . push ( doc ) ;
Original file line number Diff line number Diff line change 2323 stack: string;
2424 toString(): string;
2525 }
26+ interface InjectableReference {}
2627}
2728{% endblock %}
2829
You can’t perform that action at this time.
0 commit comments