@@ -10,17 +10,6 @@ import {
1010
1111export class InterfaceParser extends BaseParser {
1212 parse ( interfaceDecl : InterfaceDeclaration ) : void {
13- this . parseWithImportFlag ( interfaceDecl , false )
14- }
15-
16- parseWithImportFlag ( interfaceDecl : InterfaceDeclaration , isImported : boolean ) : void {
17- this . parseInterfaceWithImportFlag ( interfaceDecl , isImported )
18- }
19-
20- private parseInterfaceWithImportFlag (
21- interfaceDecl : InterfaceDeclaration ,
22- isImported : boolean ,
23- ) : void {
2413 const interfaceName = interfaceDecl . getName ( )
2514
2615 if ( this . processedTypes . has ( interfaceName ) ) {
@@ -30,17 +19,16 @@ export class InterfaceParser extends BaseParser {
3019 this . processedTypes . add ( interfaceName )
3120
3221 const typeParameters = interfaceDecl . getTypeParameters ( )
33- const isExported = this . getIsExported ( interfaceDecl , isImported )
3422
3523 // Check if interface has type parameters (generic)
3624 if ( typeParameters . length > 0 ) {
37- this . parseGenericInterface ( interfaceDecl , isExported )
25+ this . parseGenericInterface ( interfaceDecl )
3826 } else {
39- this . parseRegularInterface ( interfaceDecl , isExported )
27+ this . parseRegularInterface ( interfaceDecl )
4028 }
4129 }
4230
43- private parseRegularInterface ( interfaceDecl : InterfaceDeclaration , isExported : boolean ) : void {
31+ private parseRegularInterface ( interfaceDecl : InterfaceDeclaration ) : void {
4432 const interfaceName = interfaceDecl . getName ( )
4533
4634 // Generate TypeBox type definition
@@ -52,7 +40,7 @@ export class InterfaceParser extends BaseParser {
5240 )
5341
5442 this . newSourceFile . addVariableStatement ( {
55- isExported,
43+ isExported : true ,
5644 declarationKind : VariableDeclarationKind . Const ,
5745 declarations : [
5846 {
@@ -67,11 +55,10 @@ export class InterfaceParser extends BaseParser {
6755 interfaceName ,
6856 this . newSourceFile . compilerNode ,
6957 this . printer ,
70- isExported ,
7158 )
7259 }
7360
74- private parseGenericInterface ( interfaceDecl : InterfaceDeclaration , isExported : boolean ) : void {
61+ private parseGenericInterface ( interfaceDecl : InterfaceDeclaration ) : void {
7562 const interfaceName = interfaceDecl . getName ( )
7663 const typeParameters = interfaceDecl . getTypeParameters ( )
7764
@@ -85,7 +72,7 @@ export class InterfaceParser extends BaseParser {
8572
8673 // Add the function declaration
8774 this . newSourceFile . addVariableStatement ( {
88- isExported,
75+ isExported : true ,
8976 declarationKind : VariableDeclarationKind . Const ,
9077 declarations : [
9178 {
@@ -96,14 +83,10 @@ export class InterfaceParser extends BaseParser {
9683 } )
9784
9885 // Add generic type alias: type A<T extends TSchema> = Static<ReturnType<typeof A<T>>>
99- this . addGenericTypeAlias ( interfaceName , typeParameters , isExported )
86+ this . addGenericTypeAlias ( interfaceName , typeParameters )
10087 }
10188
102- private addGenericTypeAlias (
103- name : string ,
104- typeParameters : TypeParameterDeclaration [ ] ,
105- isExported : boolean ,
106- ) : void {
89+ private addGenericTypeAlias ( name : string , typeParameters : TypeParameterDeclaration [ ] ) : void {
10790 // Create type parameters for the type alias
10891 const typeParamDeclarations = typeParameters . map ( ( typeParam ) => {
10992 const paramName = typeParam . getName ( )
@@ -152,7 +135,7 @@ export class InterfaceParser extends BaseParser {
152135 )
153136
154137 this . newSourceFile . addTypeAlias ( {
155- isExported,
138+ isExported : true ,
156139 name,
157140 typeParameters : typeParamDeclarations . map ( ( tp ) =>
158141 this . printer . printNode ( ts . EmitHint . Unspecified , tp , this . newSourceFile . compilerNode ) ,
0 commit comments