11import SwiftBasicFormat
22import SwiftSyntax
33import SwiftSyntaxBuilder
4+ #if canImport(BridgeJSSkeleton)
5+ import BridgeJSSkeleton
6+ #endif
47
58/// Exports Swift functions and classes to JavaScript
69///
@@ -11,14 +14,14 @@ import SwiftSyntaxBuilder
1114///
1215/// The generated skeletons will be used by ``BridgeJSLink`` to generate
1316/// JavaScript glue code and TypeScript definitions.
14- class ExportSwift {
17+ public class ExportSwift {
1518 let progress : ProgressReporting
1619
1720 private var exportedFunctions : [ ExportedFunction ] = [ ]
1821 private var exportedClasses : [ ExportedClass ] = [ ]
1922 private var typeDeclResolver : TypeDeclResolver = TypeDeclResolver ( )
2023
21- init ( progress: ProgressReporting ) {
24+ public init ( progress: ProgressReporting ) {
2225 self . progress = progress
2326 }
2427
@@ -27,7 +30,7 @@ class ExportSwift {
2730 /// - Parameters:
2831 /// - sourceFile: The parsed Swift source file to process
2932 /// - inputFilePath: The file path for error reporting
30- func addSourceFile( _ sourceFile: SourceFileSyntax , _ inputFilePath: String ) throws {
33+ public func addSourceFile( _ sourceFile: SourceFileSyntax , _ inputFilePath: String ) throws {
3134 progress. print ( " Processing \( inputFilePath) " )
3235 typeDeclResolver. addSourceFile ( sourceFile)
3336
@@ -44,7 +47,7 @@ class ExportSwift {
4447 ///
4548 /// - Returns: A tuple containing the generated Swift code and a skeleton
4649 /// describing the exported APIs
47- func finalize( ) throws -> ( outputSwift: String , outputSkeleton: ExportedSkeleton ) ? {
50+ public func finalize( ) throws -> ( outputSwift: String , outputSkeleton: ExportedSkeleton ) ? {
4851 guard let outputSwift = renderSwiftGlue ( ) else {
4952 return nil
5053 }
0 commit comments