@@ -215,7 +215,7 @@ class TypeConverter implements TypeVisitor<Type> {
215215 // up so in this case we index on file name and reference name.
216216
217217 // Another place where we incorrectly handle merged declarations
218- const src = type . reflection ?. sources ?. [ 0 ] ;
218+ const src = refl ?. sources ?. [ 0 ] ;
219219 if ( ! src ) {
220220 return undefined ;
221221 }
@@ -281,7 +281,7 @@ class TypeConverter implements TypeVisitor<Type> {
281281 throw new Error ( "This shouldn't happen" ) ;
282282 }
283283
284- const path = parseFilePath ( type . symbolId . fileName , this . basePath ) ;
284+ const path = parseFilePath ( type . symbolId ? .fileName ?? "" , this . basePath ) ;
285285 if ( path . includes ( "node_modules/" ) ) {
286286 // External reference
287287 const xref : TypeXRefExternal = {
@@ -420,6 +420,7 @@ class TypeConverter implements TypeVisitor<Type> {
420420 }
421421 const result : Type = [ "{ " ] ;
422422 // lit.indexSignature for 0.25.x, lit.indexSignatures for 0.26.0 and later.
423+ // @ts -ignore
423424 const index_sig = lit . indexSignature ?? lit . indexSignatures ?. [ 0 ] ;
424425 if ( index_sig ) {
425426 if ( index_sig . parameters ?. length !== 1 ) {
@@ -472,6 +473,19 @@ export function convertType(
472473 return typeConverter . convert ( type , context ) ;
473474}
474475
476+ export function convertTypeLiteral (
477+ basePath : string ,
478+ reflToPath : ReadonlyMap <
479+ DeclarationReflection | SignatureReflection ,
480+ string [ ]
481+ > ,
482+ symbolToType : ReadonlySymbolToType ,
483+ type : DeclarationReflection ,
484+ ) : Type {
485+ const typeConverter = new TypeConverter ( basePath , reflToPath , symbolToType ) ;
486+ return typeConverter . convertTypeLiteral ( type ) ;
487+ }
488+
475489export function referenceToXRef (
476490 basePath : string ,
477491 reflToPath : ReadonlyMap <
0 commit comments