@@ -275,6 +275,12 @@ function baseCreate(
275275 scriptSnapshots . clear ( ) ;
276276 projectVersion ++ ;
277277 } ,
278+ getProgram ( ) {
279+ return tsLs . getProgram ( ) ;
280+ } ,
281+ /**
282+ * @deprecated use `getProgram()` instead
283+ */
278284 __internal__ : {
279285 tsLs,
280286 } ,
@@ -650,13 +656,16 @@ function createSchemaResolvers(
650656 } ) ) ,
651657 required : ! ( prop . flags & ts . SymbolFlags . Optional ) ,
652658 type : getFullyQualifiedName ( subtype ) ,
653- rawType : rawType ? subtype : undefined ,
654659 get declarations ( ) {
655660 return declarations ??= getDeclarations ( prop . declarations ?? [ ] ) ;
656661 } ,
657662 get schema ( ) {
658663 return schema ??= resolveSchema ( subtype ) ;
659664 } ,
665+ rawType : rawType ? subtype : undefined ,
666+ getTypeObject ( ) {
667+ return subtype ;
668+ } ,
660669 } ;
661670 }
662671 function resolveSlotProperties ( prop : ts . Symbol ) : SlotMeta {
@@ -670,14 +679,17 @@ function createSchemaResolvers(
670679 return {
671680 name : prop . getName ( ) ,
672681 type : getFullyQualifiedName ( subtype ) ,
673- rawType : rawType ? subtype : undefined ,
674682 description : ts . displayPartsToString ( prop . getDocumentationComment ( typeChecker ) ) ,
675683 get declarations ( ) {
676684 return declarations ??= getDeclarations ( prop . declarations ?? [ ] ) ;
677685 } ,
678686 get schema ( ) {
679687 return schema ??= resolveSchema ( subtype ) ;
680688 } ,
689+ rawType : rawType ? subtype : undefined ,
690+ getTypeObject ( ) {
691+ return subtype ;
692+ } ,
681693 } ;
682694 }
683695 function resolveExposedProperties ( expose : ts . Symbol ) : ExposeMeta {
@@ -688,25 +700,30 @@ function createSchemaResolvers(
688700 return {
689701 name : expose . getName ( ) ,
690702 type : getFullyQualifiedName ( subtype ) ,
691- rawType : rawType ? subtype : undefined ,
692703 description : ts . displayPartsToString ( expose . getDocumentationComment ( typeChecker ) ) ,
693704 get declarations ( ) {
694705 return declarations ??= getDeclarations ( expose . declarations ?? [ ] ) ;
695706 } ,
696707 get schema ( ) {
697708 return schema ??= resolveSchema ( subtype ) ;
698709 } ,
710+ rawType : rawType ? subtype : undefined ,
711+ getTypeObject ( ) {
712+ return subtype ;
713+ } ,
699714 } ;
700715 }
701716 function resolveEventSignature ( call : ts . Signature ) : EventMeta {
702717 let schema : PropertyMetaSchema [ ] | undefined ;
703718 let declarations : Declaration [ ] | undefined ;
704- let subtype = undefined ;
719+ let subtype : ts . Type | undefined ;
720+ let symbol : ts . Symbol | undefined ;
705721 let subtypeStr = '[]' ;
706722 let getSchema = ( ) => [ ] as PropertyMetaSchema [ ] ;
707723
708724 if ( call . parameters . length >= 2 ) {
709- subtype = typeChecker . getTypeOfSymbolAtLocation ( call . parameters [ 1 ] ! , symbolNode ) ;
725+ symbol = call . parameters [ 1 ] ! ;
726+ subtype = typeChecker . getTypeOfSymbolAtLocation ( symbol , symbolNode ) ;
710727 if ( ( call . parameters [ 1 ] ! . valueDeclaration as any ) ?. dotDotDotToken ) {
711728 subtypeStr = getFullyQualifiedName ( subtype ) ;
712729 getSchema = ( ) => typeChecker . getTypeArguments ( subtype ! as ts . TypeReference ) . map ( resolveSchema ) ;
@@ -736,14 +753,17 @@ function createSchemaResolvers(
736753 text : tag . text !== undefined ? ts . displayPartsToString ( tag . text ) : undefined ,
737754 } ) ) ,
738755 type : subtypeStr ,
739- rawType : rawType ? subtype : undefined ,
740756 signature : typeChecker . signatureToString ( call ) ,
741757 get declarations ( ) {
742758 return declarations ??= call . declaration ? getDeclarations ( [ call . declaration ] ) : [ ] ;
743759 } ,
744760 get schema ( ) {
745761 return schema ??= getSchema ( ) ;
746762 } ,
763+ rawType : rawType ? subtype : undefined ,
764+ getTypeObject ( ) {
765+ return subtype ;
766+ } ,
747767 } ;
748768 }
749769 function resolveCallbackSchema ( signature : ts . Signature ) : PropertyMetaSchema {
0 commit comments