diff --git a/Benchmarks/Sources/Generated/JavaScript/BridgeJS.json b/Benchmarks/Sources/Generated/JavaScript/BridgeJS.json index 7209c62f7..124e817ba 100644 --- a/Benchmarks/Sources/Generated/JavaScript/BridgeJS.json +++ b/Benchmarks/Sources/Generated/JavaScript/BridgeJS.json @@ -1,5 +1,8 @@ { "exported" : { + "aliases" : [ + + ], "classes" : [ { "constructor" : { diff --git a/Examples/PlayBridgeJS/Sources/PlayBridgeJS/Generated/JavaScript/BridgeJS.json b/Examples/PlayBridgeJS/Sources/PlayBridgeJS/Generated/JavaScript/BridgeJS.json index 6f1fc940c..1d8314066 100644 --- a/Examples/PlayBridgeJS/Sources/PlayBridgeJS/Generated/JavaScript/BridgeJS.json +++ b/Examples/PlayBridgeJS/Sources/PlayBridgeJS/Generated/JavaScript/BridgeJS.json @@ -1,5 +1,8 @@ { "exported" : { + "aliases" : [ + + ], "classes" : [ { "constructor" : { diff --git a/Plugins/BridgeJS/Sources/BridgeJSCore/ClosureCodegen.swift b/Plugins/BridgeJS/Sources/BridgeJSCore/ClosureCodegen.swift index 45cfb73f1..230b0f113 100644 --- a/Plugins/BridgeJS/Sources/BridgeJSCore/ClosureCodegen.swift +++ b/Plugins/BridgeJS/Sources/BridgeJSCore/ClosureCodegen.swift @@ -143,7 +143,8 @@ public struct ClosureCodegen { let argNames = liftInfo.parameters.map { (argName, _) in liftInfo.parameters.count > 1 ? "\(paramName)\(argName.capitalizedFirstLetter)" : paramName } - liftedParams.append("\(paramType.swiftType).bridgeJSLiftParameter(\(argNames.joined(separator: ", ")))") + let liftCall = "\(paramType.unaliased.swiftType).bridgeJSLiftParameter(\(argNames.joined(separator: ", ")))" + liftedParams.append(paramType.liftAliases(expression: liftCall)) } let closureCallExpr = ExprSyntax("closure(\(raw: liftedParams.joined(separator: ", ")))") @@ -184,7 +185,8 @@ public struct ClosureCodegen { } printer.write("}") default: - printer.write("return result.bridgeJSLowerReturn()") + let lowered = signature.returnType.lowerAliases(expression: "result") + printer.write("return \(lowered).bridgeJSLowerReturn()") } } } diff --git a/Plugins/BridgeJS/Sources/BridgeJSCore/ExportSwift.swift b/Plugins/BridgeJS/Sources/BridgeJSCore/ExportSwift.swift index b649b244d..89b243f1a 100644 --- a/Plugins/BridgeJS/Sources/BridgeJSCore/ExportSwift.swift +++ b/Plugins/BridgeJS/Sources/BridgeJSCore/ExportSwift.swift @@ -147,15 +147,15 @@ public class ExportSwift { } else { optionalSwiftType = "JSUndefinedOr" } - typeNameForIntrinsic = "\(optionalSwiftType)<\(wrappedType.swiftType)>" - liftingExpr = ExprSyntax( - "\(raw: typeNameForIntrinsic).bridgeJSLiftParameter(\(raw: argumentsToLift.joined(separator: ", ")))" - ) + typeNameForIntrinsic = "\(optionalSwiftType)<\(wrappedType.unaliased.swiftType)>" + let liftCall = + "\(typeNameForIntrinsic).bridgeJSLiftParameter(\(argumentsToLift.joined(separator: ", ")))" + liftingExpr = "\(raw: param.type.liftAliases(expression: liftCall))" default: - typeNameForIntrinsic = param.type.swiftType - liftingExpr = ExprSyntax( - "\(raw: typeNameForIntrinsic).bridgeJSLiftParameter(\(raw: argumentsToLift.joined(separator: ", ")))" - ) + typeNameForIntrinsic = param.type.unaliased.swiftType + let liftCall = + "\(typeNameForIntrinsic).bridgeJSLiftParameter(\(argumentsToLift.joined(separator: ", ")))" + liftingExpr = "\(raw: param.type.liftAliases(expression: liftCall))" } liftedParameterExprs.append(liftingExpr) @@ -200,7 +200,8 @@ public class ExportSwift { } if effects.isAsync, returnType != .void { - return CodeBlockItemSyntax(item: .init(StmtSyntax("return \(raw: callExpr).jsValue"))) + let lowered = returnType.lowerAliases(expression: callExpr.description) + return CodeBlockItemSyntax(item: .init(StmtSyntax("return \(raw: lowered).jsValue"))) } if returnType == .void { @@ -298,17 +299,18 @@ public class ExportSwift { return } + let returnAccessor = returnType.lowerAliases(expression: "ret") switch returnType { case .closure(_, useJSTypedClosure: false): append("return JSTypedClosure(ret).bridgeJSLowerReturn()") case .array, .nullable(.array, _): let stackCodegen = StackCodegen() - for stmt in stackCodegen.lowerStatements(for: returnType, accessor: "ret", varPrefix: "ret") { + for stmt in stackCodegen.lowerStatements(for: returnType, accessor: returnAccessor, varPrefix: "ret") { append(stmt) } case .dictionary(.swiftProtocol): let stackCodegen = StackCodegen() - for stmt in stackCodegen.lowerStatements(for: returnType, accessor: "ret", varPrefix: "ret") { + for stmt in stackCodegen.lowerStatements(for: returnType, accessor: returnAccessor, varPrefix: "ret") { append(stmt) } case .swiftProtocol: @@ -324,7 +326,7 @@ public class ExportSwift { """ ) default: - append("return ret.bridgeJSLowerReturn()") + append("return \(raw: returnAccessor).bridgeJSLowerReturn()") } } @@ -754,8 +756,8 @@ struct StackCodegen { switch type { case .string, .integer, .bool, .float, .double, .jsObject(nil), .jsValue, .swiftStruct, .swiftHeapObject, .unsafePointer, - .swiftProtocol, .caseEnum, .associatedValueEnum, .rawValueEnum, .array, .dictionary: - return "\(raw: type.swiftType).bridgeJSStackPop()" + .swiftProtocol, .caseEnum, .associatedValueEnum, .rawValueEnum, .array, .dictionary, .alias: + return "\(raw: type.liftAliases(expression: "\(type.unaliased.swiftType).bridgeJSStackPop()"))" case .jsObject(let className?): return "\(raw: className)(unsafelyWrapping: JSObject.bridgeJSStackPop())" case .nullable(let wrappedType, let kind): @@ -772,8 +774,10 @@ struct StackCodegen { switch wrappedType { case .string, .integer, .bool, .float, .double, .jsObject(nil), .jsValue, .swiftStruct, .swiftHeapObject, .caseEnum, .associatedValueEnum, .rawValueEnum, - .array, .dictionary: - return "\(raw: typeName)<\(raw: wrappedType.swiftType)>.bridgeJSStackPop()" + .array, .dictionary, .alias: + let popCall = "\(typeName)<\(wrappedType.unaliased.swiftType)>.bridgeJSStackPop()" + let nullableType = BridgeType.nullable(wrappedType, kind) + return "\(raw: nullableType.liftAliases(expression: popCall))" case .jsObject(let className?): return "\(raw: typeName).bridgeJSStackPop().map { \(raw: className)(unsafelyWrapping: $0) }" case .nullable, .void, .namespaceEnum, .closure, .unsafePointer, .swiftProtocol: @@ -795,7 +799,7 @@ struct StackCodegen { switch type { case .string, .integer, .bool, .float, .double, .jsValue, .jsObject(nil), .swiftHeapObject, .unsafePointer, .closure, - .caseEnum, .rawValueEnum, .associatedValueEnum, .swiftStruct, .nullable: + .caseEnum, .rawValueEnum, .associatedValueEnum, .swiftStruct, .nullable, .alias: return ["\(raw: accessor).bridgeJSStackPush()"] case .jsObject(_?): return ["\(raw: accessor).jsObject.bridgeJSStackPush()"] @@ -1081,9 +1085,10 @@ struct EnumCodegen { ) { for (index, associatedValue) in associatedValues.enumerated() { let paramName = associatedValue.label ?? "param\(index)" + let accessor = associatedValue.type.lowerAliases(expression: paramName) let statements = stackCodegen.lowerStatements( for: associatedValue.type, - accessor: paramName, + accessor: accessor, varPrefix: paramName ) for statement in statements { @@ -1216,7 +1221,7 @@ struct StructCodegen { let instanceProps = structDef.properties.filter { !$0.isStatic } for property in instanceProps { - let accessor = "self.\(property.name)" + let accessor = property.type.lowerAliases(expression: "self.\(property.name)") let statements = stackCodegen.lowerStatements( for: property.type, accessor: accessor, @@ -1442,6 +1447,64 @@ extension UnsafePointerType { } extension BridgeType { + var unaliased: BridgeType { + switch self { + case .alias(_, let underlying): return underlying.unaliased + case .nullable(let wrapped, let kind): return .nullable(wrapped.unaliased, kind) + case .array(let element): return .array(element.unaliased) + case .dictionary(let value): return .dictionary(value.unaliased) + case .bool, .integer, .float, .double, .string, .jsValue, .jsObject, + .swiftHeapObject, .unsafePointer, .swiftProtocol, .void, + .caseEnum, .rawValueEnum, .associatedValueEnum, .swiftStruct, + .namespaceEnum, .closure: + return self + } + } + + /// If this type contains an alias, convert the expression with a type of the alias to the underlying type. + func liftAliases(expression: String) -> String { + switch self { + case .alias(let name, _): + return "\(name).bridgeFromJS(\(expression))" + case .nullable(let wrapped, _): + let lifted = wrapped.liftAliases(expression: "$0") + return lifted == "$0" ? expression : "\(expression).map { \(lifted) }" + case .array(let element): + let lifted = element.liftAliases(expression: "$0") + return lifted == "$0" ? expression : "\(expression).map { \(lifted) }" + case .dictionary(let value): + let lifted = value.liftAliases(expression: "$0") + return lifted == "$0" ? expression : "\(expression).mapValues { \(lifted) }" + case .bool, .integer, .float, .double, .string, .jsValue, .jsObject, + .swiftHeapObject, .unsafePointer, .swiftProtocol, .void, + .caseEnum, .rawValueEnum, .associatedValueEnum, .swiftStruct, + .namespaceEnum, .closure: + return expression + } + } + + /// Opposite of `liftAliases`: if this type contains an alias, convert the expression with a type of the underlying to the alias type. + func lowerAliases(expression: String) -> String { + switch self { + case .alias: + return "\(expression).bridgeToJS()" + case .nullable(let wrapped, _): + let lowered = wrapped.lowerAliases(expression: "$0") + return lowered == "$0" ? expression : "\(expression).map { \(lowered) }" + case .array(let element): + let lowered = element.lowerAliases(expression: "$0") + return lowered == "$0" ? expression : "\(expression).map { \(lowered) }" + case .dictionary(let value): + let lowered = value.lowerAliases(expression: "$0") + return lowered == "$0" ? expression : "\(expression).mapValues { \(lowered) }" + case .bool, .integer, .float, .double, .string, .jsValue, .jsObject, + .swiftHeapObject, .unsafePointer, .swiftProtocol, .void, + .caseEnum, .rawValueEnum, .associatedValueEnum, .swiftStruct, + .namespaceEnum, .closure: + return expression + } + } + var swiftType: String { switch self { case .bool: return "Bool" @@ -1470,6 +1533,7 @@ extension BridgeType { let effectsStr = (signature.isAsync ? " async" : "") + (signature.isThrows ? " throws" : "") let closureType = "(\(paramTypes))\(effectsStr) -> \(signature.returnType.swiftType)" return useJSTypedClosure ? "JSTypedClosure<\(closureType)>" : closureType + case .alias(let name, _): return name } } @@ -1494,6 +1558,8 @@ extension BridgeType { return true case .nullable(let wrapped, _): return wrapped.isStackUsingParameter + case .alias(_, let underlying): + return underlying.isStackUsingParameter default: return false } @@ -1552,6 +1618,8 @@ extension BridgeType { return LiftingIntrinsicInfo(parameters: [("callbackId", .i32)]) case .array, .dictionary: return LiftingIntrinsicInfo(parameters: []) + case .alias(_, let underlying): + return try underlying.liftParameterInfo() } } @@ -1603,6 +1671,8 @@ extension BridgeType { return .jsObject case .array, .dictionary: return .array + case .alias(_, let underlying): + return try underlying.loweringReturnInfo() } } } diff --git a/Plugins/BridgeJS/Sources/BridgeJSCore/ExternalModuleIndex.swift b/Plugins/BridgeJS/Sources/BridgeJSCore/ExternalModuleIndex.swift index 91fd4388a..33a27d087 100644 --- a/Plugins/BridgeJS/Sources/BridgeJSCore/ExternalModuleIndex.swift +++ b/Plugins/BridgeJS/Sources/BridgeJSCore/ExternalModuleIndex.swift @@ -63,6 +63,12 @@ public struct ExternalModuleIndex { for proto in exported.protocols { register(dotPath: proto.name, bridgeType: .swiftProtocol(proto.name)) } + for alias in exported.aliases { + register( + dotPath: alias.swiftCallName, + bridgeType: .alias(name: alias.swiftCallName, underlying: alias.underlying) + ) + } entriesByModule[moduleName] = moduleEntries } diff --git a/Plugins/BridgeJS/Sources/BridgeJSCore/ImportTS.swift b/Plugins/BridgeJS/Sources/BridgeJSCore/ImportTS.swift index d491c4058..f9b28d078 100644 --- a/Plugins/BridgeJS/Sources/BridgeJSCore/ImportTS.swift +++ b/Plugins/BridgeJS/Sources/BridgeJSCore/ImportTS.swift @@ -172,7 +172,8 @@ public struct ImportTS { if loweringInfo.useBorrowing { let returnVariableName = "ret\(borrowedArguments.count)" let assign = needsReturnVariable ? "let \(returnVariableName) = " : "" - body.write("\(assign)\(param.name).bridgeJSWithLoweredParameter { \(pattern) in") + let loweredAlias = param.type.lowerAliases(expression: param.name) + body.write("\(assign)\(loweredAlias).bridgeJSWithLoweredParameter { \(pattern) in") body.indent() borrowedArguments.append( BorrowedArgument( @@ -203,7 +204,8 @@ public struct ImportTS { "(\(raw: param.name) as! _BridgedSwiftProtocolExportable).bridgeJSLowerAsProtocolReturn()" ) } else { - initializerExpr = ExprSyntax("\(raw: param.name).bridgeJSLowerParameter()") + let loweredAlias = param.type.lowerAliases(expression: param.name) + initializerExpr = ExprSyntax("\(raw: loweredAlias).bridgeJSLowerParameter()") } if loweringInfo.loweredParameters.isEmpty { @@ -296,18 +298,21 @@ public struct ImportTS { if returnType.usesSideChannelForOptionalReturn() { // Side channel returns: extern function returns Void, value is retrieved via side channel - body.write("return \(returnType.swiftType).bridgeJSLiftReturnFromSideChannel()") + let liftCall = "\(returnType.unaliased.swiftType).bridgeJSLiftReturnFromSideChannel()" + body.write("return \(returnType.liftAliases(expression: liftCall))") } else { let liftExpr: String switch returnType { case .closure(let signature, _): liftExpr = "_BJS_Closure_\(signature.mangleName).bridgeJSLift(ret)" default: + let liftCall: String if liftingInfo.valueToLift != nil { - liftExpr = "\(returnType.swiftType).bridgeJSLiftReturn(ret)" + liftCall = "\(returnType.unaliased.swiftType).bridgeJSLiftReturn(ret)" } else { - liftExpr = "\(returnType.swiftType).bridgeJSLiftReturn()" + liftCall = "\(returnType.unaliased.swiftType).bridgeJSLiftReturn()" } + liftExpr = returnType.liftAliases(expression: liftCall) } body.write("return \(liftExpr)") } @@ -964,6 +969,8 @@ extension BridgeType { return LoweringParameterInfo(loweredParameters: params, useBorrowing: wrappedInfo.useBorrowing) case .array, .dictionary: return LoweringParameterInfo(loweredParameters: []) + case .alias(_, let underlying): + return try underlying.loweringParameterInfo(context: context) } } @@ -1035,13 +1042,15 @@ extension BridgeType { throw BridgeJSCoreError("Namespace enums cannot be used as return values") case .nullable(let wrappedType, _): // jsObject uses stack ABI for optionals — returns void, value goes through stacks - if case .jsObject = wrappedType { + if case .jsObject = wrappedType.unaliased { return LiftingReturnInfo(valueToLift: nil) } let wrappedInfo = try wrappedType.liftingReturnInfo(context: context) return LiftingReturnInfo(valueToLift: wrappedInfo.valueToLift) case .array, .dictionary: return LiftingReturnInfo(valueToLift: nil) + case .alias(_, let underlying): + return try underlying.liftingReturnInfo(context: context) } } } diff --git a/Plugins/BridgeJS/Sources/BridgeJSCore/SwiftToSkeleton.swift b/Plugins/BridgeJS/Sources/BridgeJSCore/SwiftToSkeleton.swift index 57b9a57df..2c39ac93b 100644 --- a/Plugins/BridgeJS/Sources/BridgeJSCore/SwiftToSkeleton.swift +++ b/Plugins/BridgeJS/Sources/BridgeJSCore/SwiftToSkeleton.swift @@ -358,6 +358,11 @@ public final class SwiftToSkeleton { if let enumDecl = typeDecl.as(EnumDeclSyntax.self) { let swiftCallName = SwiftToSkeleton.computeSwiftCallName(for: enumDecl, itemName: enumDecl.name.text) + if let jsAttribute = enumDecl.attributes.firstJSAttribute, + let aliasTarget = extractAliasTarget(from: jsAttribute) + { + return aliasType(target: aliasTarget, swiftCallName: swiftCallName, errors: &errors) + } let rawTypeString = enumDecl.inheritanceClause?.inheritedTypes.first { inheritedType in let typeName = inheritedType.type.trimmedDescription return ExportSwiftConstants.supportedRawTypes.contains(typeName) @@ -398,6 +403,11 @@ public final class SwiftToSkeleton { if structDecl.attributes.hasAttribute(name: "JSClass") { return .jsObject(swiftCallName) } + if let jsAttribute = structDecl.attributes.firstJSAttribute, + let aliasTarget = extractAliasTarget(from: jsAttribute) + { + return aliasType(target: aliasTarget, swiftCallName: swiftCallName, errors: &errors) + } return .swiftStruct(swiftCallName) } @@ -415,6 +425,13 @@ public final class SwiftToSkeleton { return .jsObject(swiftCallName) } + if let classDecl = typeDecl.as(ClassDeclSyntax.self), + let jsAttribute = classDecl.attributes.firstJSAttribute, + let aliasTarget = extractAliasTarget(from: jsAttribute) + { + return aliasType(target: aliasTarget, swiftCallName: swiftCallName, errors: &errors) + } + return .swiftHeapObject(swiftCallName) } @@ -476,6 +493,50 @@ public final class SwiftToSkeleton { } } + fileprivate func extractAliasTarget(from jsAttribute: AttributeSyntax) -> TypeSyntax? { + guard + let arguments = jsAttribute.arguments?.as(LabeledExprListSyntax.self), + let asArg = arguments.first(where: { $0.label?.text == "as" }), + let memberAccess = asArg.expression.as(MemberAccessExprSyntax.self), + memberAccess.declName.baseName.text == "self", + let base = memberAccess.base + else { + return nil + } + return TypeSyntax(stringLiteral: base.trimmedDescription) + } + + fileprivate func aliasType( + target aliasTarget: TypeSyntax, + swiftCallName: String, + errors: inout [DiagnosticError] + ) -> BridgeType? { + if let targetDecl = typeDeclResolver.resolve(aliasTarget), + let targetJSAttribute = targetDecl.attributes.firstJSAttribute, + extractAliasTarget(from: targetJSAttribute) != nil + { + errors.append( + DiagnosticError( + node: aliasTarget, + message: "`@JS(as:)` target must be a `@JS` type, not another `@JS(as:)` type", + hint: "Use the underlying `@JS` type directly" + ) + ) + return nil + } + guard let targetType = lookupType(for: aliasTarget, errors: &errors) else { return nil } + if case .swiftProtocol = targetType { + errors.append( + DiagnosticError( + node: aliasTarget, + message: "`@JS(as:)` cannot target a `@JS protocol`" + ) + ) + return nil + } + return .alias(name: swiftCallName, underlying: targetType) + } + fileprivate static func parseUnsafePointerType(_ type: TypeSyntax) -> UnsafePointerType? { func parse(baseName: String, genericArg: TypeSyntax?) -> UnsafePointerType? { let pointee = genericArg?.trimmedDescription @@ -609,6 +670,7 @@ private final class ExportSwiftAPICollector: SyntaxAnyVisitor { /// The names of the exported structs, in the order they were written in the source file var exportedStructNames: [String] = [] var exportedStructByName: [String: ExportedStruct] = [:] + var exportedAliases: [ExportedAlias] = [] var errors: [DiagnosticError] = [] /// Extensions collected during the walk, to be resolved after all files have been walked var deferredExtensions: [ExtensionDeclSyntax] = [] @@ -619,6 +681,7 @@ private final class ExportSwiftAPICollector: SyntaxAnyVisitor { result.enums.append(contentsOf: exportedEnumNames.map { exportedEnumByName[$0]! }) result.structs.append(contentsOf: exportedStructNames.map { exportedStructByName[$0]! }) result.protocols.append(contentsOf: exportedProtocolNames.map { exportedProtocolByName[$0]! }) + result.aliases.append(contentsOf: exportedAliases) } /// Creates a unique key by combining name and namespace @@ -1490,6 +1553,11 @@ private final class ExportSwiftAPICollector: SyntaxAnyVisitor { return .skipChildren } + if let aliasTarget = parent.extractAliasTarget(from: jsAttribute) { + recordAlias(node: node, aliasTarget: aliasTarget) + return .skipChildren + } + let namespaceResult = resolveNamespace(from: jsAttribute, for: node, declarationType: "class") guard namespaceResult.isValid else { return .skipChildren @@ -1587,11 +1655,38 @@ private final class ExportSwiftAPICollector: SyntaxAnyVisitor { return true } + private func recordAlias( + node: some SyntaxProtocol & NamedDeclSyntax, + aliasTarget: TypeSyntax + ) { + let swiftCallName = SwiftToSkeleton.computeSwiftCallName(for: node, itemName: node.name.text) + var lookupErrors: [DiagnosticError] = [] + guard + let aliasBridgeType = parent.aliasType( + target: aliasTarget, + swiftCallName: swiftCallName, + errors: &lookupErrors + ), + case .alias(_, let underlying) = aliasBridgeType + else { + errors.append(contentsOf: lookupErrors) + return + } + exportedAliases.append( + ExportedAlias(swiftCallName: swiftCallName, underlying: underlying) + ) + } + override func visit(_ node: EnumDeclSyntax) -> SyntaxVisitorContinueKind { guard let jsAttribute = node.attributes.firstJSAttribute else { return .skipChildren } + if let aliasTarget = parent.extractAliasTarget(from: jsAttribute) { + recordAlias(node: node, aliasTarget: aliasTarget) + return .skipChildren + } + let name = node.name.text let rawType: String? = node.inheritanceClause?.inheritedTypes.first { inheritedType in @@ -1691,24 +1786,7 @@ private final class ExportSwiftAPICollector: SyntaxAnyVisitor { } for enumCase in exportedEnum.cases { for associatedValue in enumCase.associatedValues { - switch associatedValue.type { - case .string, .integer, .float, .double, .bool, .caseEnum, .rawValueEnum, - .swiftStruct, .swiftHeapObject, .jsObject, .associatedValueEnum, .array: - break - case .nullable(let wrappedType, _): - switch wrappedType { - case .string, .integer, .float, .double, .bool, .caseEnum, .rawValueEnum, - .swiftStruct, .swiftHeapObject, .jsObject, .associatedValueEnum, .array: - break - default: - diagnose( - node: node, - message: "Unsupported associated value type: \(associatedValue.type.swiftType)", - hint: - "Only primitive types, enums, structs, classes, JSObject, arrays, and their optionals are supported in associated-value enums" - ) - } - default: + if !associatedValue.type.isSupportedAsAssociatedValue() { diagnose( node: node, message: "Unsupported associated value type: \(associatedValue.type.swiftType)", @@ -1789,6 +1867,11 @@ private final class ExportSwiftAPICollector: SyntaxAnyVisitor { return .skipChildren } + if let aliasTarget = parent.extractAliasTarget(from: jsAttribute) { + recordAlias(node: node, aliasTarget: aliasTarget) + return .skipChildren + } + let name = node.name.text let namespaceResult = resolveNamespace(from: jsAttribute, for: node, declarationType: "struct") @@ -2888,6 +2971,22 @@ private final class ImportSwiftMacrosAPICollector: SyntaxAnyVisitor { } } +extension BridgeType { + fileprivate func isSupportedAsAssociatedValue(allowNullable: Bool = true) -> Bool { + switch self { + case .string, .integer, .float, .double, .bool, .caseEnum, .rawValueEnum, + .swiftStruct, .swiftHeapObject, .jsObject, .associatedValueEnum, .array: + return true + case .alias(_, let underlying): + return underlying.isSupportedAsAssociatedValue(allowNullable: false) + case .nullable(let wrapped, _) where allowNullable: + return wrapped.isSupportedAsAssociatedValue(allowNullable: false) + default: + return false + } + } +} + extension GenericArgumentListSyntax { /// Compatibility helper for accessing the first argument as a TypeSyntax /// diff --git a/Plugins/BridgeJS/Sources/BridgeJSLink/BridgeJSLink.swift b/Plugins/BridgeJS/Sources/BridgeJSLink/BridgeJSLink.swift index 03dfa87a2..5dc0a2cc6 100644 --- a/Plugins/BridgeJS/Sources/BridgeJSLink/BridgeJSLink.swift +++ b/Plugins/BridgeJS/Sources/BridgeJSLink/BridgeJSLink.swift @@ -1459,6 +1459,8 @@ public struct BridgeJSLink { } } return type.tsType + case .alias(_, let underlying): + return resolveTypeScriptType(underlying, exportedSkeletons: exportedSkeletons) case .nullable(let wrapped, let kind): let base = resolveTypeScriptType(wrapped, exportedSkeletons: exportedSkeletons) return "\(base) | \(kind.absenceLiteral)" @@ -3685,6 +3687,8 @@ extension BridgeType { return "\(inner)[]" case .dictionary(let valueType): return "Record" + case .alias(_, let underlying): + return underlying.tsType } } diff --git a/Plugins/BridgeJS/Sources/BridgeJSLink/JSGlueGen.swift b/Plugins/BridgeJS/Sources/BridgeJSLink/JSGlueGen.swift index 51ef16b20..990235157 100644 --- a/Plugins/BridgeJS/Sources/BridgeJSLink/JSGlueGen.swift +++ b/Plugins/BridgeJS/Sources/BridgeJSLink/JSGlueGen.swift @@ -651,6 +651,9 @@ struct IntrinsicJSFragment: Sendable { kind: JSOptionalKind, context bridgeContext: BridgeContext = .importTS ) throws -> IntrinsicJSFragment { + if case .alias(_, let underlying) = wrappedType { + return try optionalLiftParameter(wrappedType: underlying, kind: kind, context: bridgeContext) + } if wrappedType.isSingleParamScalar { let coerce = wrappedType.liftCoerce return IntrinsicJSFragment( @@ -739,6 +742,9 @@ struct IntrinsicJSFragment: Sendable { wrappedType: BridgeType, kind: JSOptionalKind ) throws -> IntrinsicJSFragment { + if case .alias(_, let underlying) = wrappedType { + return try optionalLowerParameter(wrappedType: underlying, kind: kind) + } if wrappedType.isSingleParamScalar { let wasmType = wrappedType.wasmParams[0].type let coerce = wrappedType.lowerCoerce @@ -967,6 +973,9 @@ struct IntrinsicJSFragment: Sendable { wrappedType: BridgeType, kind: JSOptionalKind ) -> IntrinsicJSFragment { + if case .alias(_, let underlying) = wrappedType { + return optionalLiftReturn(wrappedType: underlying, kind: kind) + } if let scalarKind = wrappedType.optionalScalarKind { return optionalLiftReturnFromStorage(storage: scalarKind.storageName) } @@ -1064,6 +1073,9 @@ struct IntrinsicJSFragment: Sendable { } static func optionalLowerReturn(wrappedType: BridgeType, kind: JSOptionalKind) throws -> IntrinsicJSFragment { + if case .alias(_, let underlying) = wrappedType { + return try optionalLowerReturn(wrappedType: underlying, kind: kind) + } switch wrappedType { case .void, .nullable, .namespaceEnum, .closure: throw BridgeJSLinkError(message: "Unsupported optional wrapped type for protocol export: \(wrappedType)") @@ -1188,6 +1200,9 @@ struct IntrinsicJSFragment: Sendable { // MARK: - Protocol Support static func protocolPropertyOptionalToSideChannel(wrappedType: BridgeType) throws -> IntrinsicJSFragment { + if case .alias(_, let underlying) = wrappedType { + return try protocolPropertyOptionalToSideChannel(wrappedType: underlying) + } if let scalarKind = wrappedType.optionalScalarKind { let storage = scalarKind.storageName return IntrinsicJSFragment( @@ -1323,6 +1338,8 @@ struct IntrinsicJSFragment: Sendable { return try arrayLower(elementType: elementType) case .dictionary(let valueType): return try dictionaryLower(valueType: valueType) + case .alias(_, let underlying): + return try lowerParameter(type: underlying) default: throw BridgeJSLinkError(message: "Unhandled type in lowerParameter: \(type)") } @@ -1380,6 +1397,8 @@ struct IntrinsicJSFragment: Sendable { return try arrayLift(elementType: elementType) case .dictionary(let valueType): return try dictionaryLift(valueType: valueType) + case .alias(_, let underlying): + return try liftReturn(type: underlying) default: throw BridgeJSLinkError(message: "Unhandled type in liftReturn: \(type)") } @@ -1478,6 +1497,8 @@ struct IntrinsicJSFragment: Sendable { return try arrayLift(elementType: elementType) case .dictionary(let valueType): return try dictionaryLift(valueType: valueType) + case .alias(_, let underlying): + return try liftParameter(type: underlying, context: context) default: throw BridgeJSLinkError(message: "Unhandled type in liftParameter: \(type)") } @@ -1540,6 +1561,8 @@ struct IntrinsicJSFragment: Sendable { return try arrayLower(elementType: elementType) case .dictionary(let valueType): return try dictionaryLower(valueType: valueType) + case .alias(_, let underlying): + return try lowerReturn(type: underlying, context: context) default: throw BridgeJSLinkError(message: "Unhandled type in lowerReturn: \(type)") } @@ -1957,6 +1980,9 @@ struct IntrinsicJSFragment: Sendable { } private static func stackLiftFragment(elementType: BridgeType) throws -> IntrinsicJSFragment { + if case .alias(_, let underlying) = elementType { + return try stackLiftFragment(elementType: underlying) + } if case .nullable(let wrappedType, let kind) = elementType { return try optionalElementRaiseFragment(wrappedType: wrappedType, kind: kind) } @@ -2084,6 +2110,9 @@ struct IntrinsicJSFragment: Sendable { } private static func stackLowerFragment(elementType: BridgeType) throws -> IntrinsicJSFragment { + if case .alias(_, let underlying) = elementType { + return try stackLowerFragment(elementType: underlying) + } if case .nullable(let wrappedType, let kind) = elementType { return try optionalElementLowerFragment(wrappedType: wrappedType, kind: kind) } @@ -2208,6 +2237,9 @@ struct IntrinsicJSFragment: Sendable { wrappedType: BridgeType, kind: JSOptionalKind ) throws -> IntrinsicJSFragment { + if case .alias(_, let underlying) = wrappedType { + return try optionalElementRaiseFragment(wrappedType: underlying, kind: kind) + } if case .associatedValueEnum(let fullName) = wrappedType { let base = fullName.components(separatedBy: ".").last ?? fullName let absenceLiteral = kind.absenceLiteral @@ -2274,6 +2306,9 @@ struct IntrinsicJSFragment: Sendable { wrappedType: BridgeType, kind: JSOptionalKind ) throws -> IntrinsicJSFragment { + if case .alias(_, let underlying) = wrappedType { + return try optionalElementLowerFragment(wrappedType: underlying, kind: kind) + } if case .associatedValueEnum(let fullName) = wrappedType { let base = fullName.components(separatedBy: ".").last ?? fullName return IntrinsicJSFragment( @@ -2693,6 +2728,8 @@ private extension BridgeType { return .stackABI case .nullable(let wrapped, _): return wrapped.optionalConvention + case .alias(_, let underlying): + return underlying.optionalConvention } } @@ -2706,6 +2743,8 @@ private extension BridgeType { return .i32(-1) case .nullable(let wrapped, _): return wrapped.nilSentinel + case .alias(_, let underlying): + return underlying.nilSentinel default: return .none } @@ -2771,6 +2810,8 @@ private extension BridgeType { return [] case .nullable(let wrapped, _): return wrapped.wasmParams + case .alias(_, let underlying): + return underlying.wasmParams } } diff --git a/Plugins/BridgeJS/Sources/BridgeJSSkeleton/BridgeJSSkeleton.swift b/Plugins/BridgeJS/Sources/BridgeJSSkeleton/BridgeJSSkeleton.swift index 346b7333b..de17a15a5 100644 --- a/Plugins/BridgeJS/Sources/BridgeJSSkeleton/BridgeJSSkeleton.swift +++ b/Plugins/BridgeJS/Sources/BridgeJSSkeleton/BridgeJSSkeleton.swift @@ -273,6 +273,7 @@ public enum BridgeType: Codable, Equatable, Hashable, Sendable { case swiftProtocol(String) case swiftStruct(String) indirect case closure(ClosureSignature, useJSTypedClosure: Bool) + indirect case alias(name: String, underlying: BridgeType) } public enum WasmCoreType: String, Codable, Sendable { @@ -977,12 +978,23 @@ public struct ExportedProperty: Codable, Equatable, Sendable { } } +public struct ExportedAlias: Codable { + public let swiftCallName: String + public let underlying: BridgeType + + public init(swiftCallName: String, underlying: BridgeType) { + self.swiftCallName = swiftCallName + self.underlying = underlying + } +} + public struct ExportedSkeleton: Codable { public var functions: [ExportedFunction] public var classes: [ExportedClass] public var enums: [ExportedEnum] public var structs: [ExportedStruct] public var protocols: [ExportedProtocol] + public var aliases: [ExportedAlias] /// Whether to expose exported APIs to the global namespace. /// /// When `true`, exported functions, classes, and namespaces are available @@ -1002,6 +1014,7 @@ public struct ExportedSkeleton: Codable { enums: [ExportedEnum], structs: [ExportedStruct] = [], protocols: [ExportedProtocol] = [], + aliases: [ExportedAlias] = [], exposeToGlobal: Bool, identityMode: String? = nil ) { @@ -1010,6 +1023,7 @@ public struct ExportedSkeleton: Codable { self.enums = enums self.structs = structs self.protocols = protocols + self.aliases = aliases self.exposeToGlobal = exposeToGlobal self.identityMode = identityMode } @@ -1020,12 +1034,13 @@ public struct ExportedSkeleton: Codable { self.enums.append(contentsOf: other.enums) self.structs.append(contentsOf: other.structs) self.protocols.append(contentsOf: other.protocols) + self.aliases.append(contentsOf: other.aliases) assert(self.exposeToGlobal == other.exposeToGlobal) assert(self.identityMode == other.identityMode) } public var isEmpty: Bool { - functions.isEmpty && classes.isEmpty && enums.isEmpty && structs.isEmpty && protocols.isEmpty + functions.isEmpty && classes.isEmpty && enums.isEmpty && structs.isEmpty && protocols.isEmpty && aliases.isEmpty } } @@ -1575,6 +1590,8 @@ extension BridgeType { case .dictionary: // Dictionaries use stack-based return with entry count (no direct WASM return type) return nil + case .alias(_, let underlying): + return underlying.abiReturnType } } @@ -1642,6 +1659,8 @@ extension BridgeType { case .dictionary(let valueType): // Dictionary mangling: "SD" prefix followed by value type (key is always String) return "SD\(valueType.mangleTypeName)" + case .alias(let name, _): + return "Al\(name.count)\(name)" } } @@ -1653,8 +1672,11 @@ extension BridgeType { guard case .nullable(let wrappedType, _) = self else { return false } + return wrappedType.requiresSideChannelForOptionalReturnIfWrapped + } - switch wrappedType { + private var requiresSideChannelForOptionalReturnIfWrapped: Bool { + switch self { case .string, .integer, .float, .double, .swiftProtocol: return true case .rawValueEnum(_, let rawType): @@ -1668,6 +1690,8 @@ extension BridgeType { } case .bool, .caseEnum, .swiftHeapObject, .associatedValueEnum, .jsObject: return false + case .alias(_, let underlying): + return underlying.requiresSideChannelForOptionalReturnIfWrapped default: return false } diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/DiagnosticsTests.swift b/Plugins/BridgeJS/Tests/BridgeJSToolTests/DiagnosticsTests.swift index e71a1f84e..95275017e 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/DiagnosticsTests.swift +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/DiagnosticsTests.swift @@ -305,6 +305,78 @@ import Testing #expect(skeleton.exported != nil) } + @Test + func chainedJSAsDiagnostic() throws { + let source = """ + @JS(as: B.self) struct A { + consuming func bridgeToJS() -> B { fatalError() } + static func bridgeFromJS(_ value: consuming B) -> A { fatalError() } + } + @JS(as: C.self) struct B { + consuming func bridgeToJS() -> C { fatalError() } + static func bridgeFromJS(_ value: consuming C) -> B { fatalError() } + } + @JS class C { @JS init() {} } + """ + let swiftAPI = SwiftToSkeleton( + progress: .silent, + moduleName: "TestModule", + exposeToGlobal: false, + externalModuleIndex: .empty + ) + swiftAPI.addSourceFile(Parser.parse(source: source), inputFilePath: "test.swift") + #expect(throws: BridgeJSCoreDiagnosticError.self) { + _ = try swiftAPI.finalize() + } + } + + @Test + func cyclicJSAsDiagnostic() throws { + let source = """ + @JS(as: B.self) struct A { + consuming func bridgeToJS() -> B { fatalError() } + static func bridgeFromJS(_ value: consuming B) -> A { fatalError() } + } + @JS(as: A.self) struct B { + consuming func bridgeToJS() -> A { fatalError() } + static func bridgeFromJS(_ value: consuming A) -> B { fatalError() } + } + """ + let swiftAPI = SwiftToSkeleton( + progress: .silent, + moduleName: "TestModule", + exposeToGlobal: false, + externalModuleIndex: .empty + ) + swiftAPI.addSourceFile(Parser.parse(source: source), inputFilePath: "test.swift") + #expect(throws: BridgeJSCoreDiagnosticError.self) { + _ = try swiftAPI.finalize() + } + } + + @Test + func jsAsProtocolTargetDiagnostic() throws { + let source = """ + @JS protocol Audible { + func play() + } + @JS(as: Audible.self) struct AudibleTag { + consuming func bridgeToJS() -> any Audible { fatalError() } + static func bridgeFromJS(_ value: consuming any Audible) -> AudibleTag { fatalError() } + } + """ + let swiftAPI = SwiftToSkeleton( + progress: .silent, + moduleName: "TestModule", + exposeToGlobal: false, + externalModuleIndex: .empty + ) + swiftAPI.addSourceFile(Parser.parse(source: source), inputFilePath: "test.swift") + #expect(throws: BridgeJSCoreDiagnosticError.self) { + _ = try swiftAPI.finalize() + } + } + @Test func omitsNextLineWhenErrorIsOnLastLine() throws { let source = """ diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/Inputs/MacroSwift/Alias.swift b/Plugins/BridgeJS/Tests/BridgeJSToolTests/Inputs/MacroSwift/Alias.swift new file mode 100644 index 000000000..f4d56653f --- /dev/null +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/Inputs/MacroSwift/Alias.swift @@ -0,0 +1,121 @@ +@JS(as: PolygonReference.self) struct Polygon { + var vertices: [Double] + + consuming func bridgeToJS() -> PolygonReference { + return PolygonReference(underlying: self) + } + + static func bridgeFromJS(_ value: consuming PolygonReference) -> Polygon { + return value.underlying + } +} + +@JS final class PolygonReference { + var underlying: Polygon + + @JS init(underlying: Polygon) { + self.underlying = underlying + } + + @JS func snapshot() -> Polygon + @JS func merge(_ other: Polygon) -> Polygon + @JS static func origin() -> Polygon +} + +@JS(as: TagReference.self) struct Tag { + var name: String + + consuming func bridgeToJS() -> TagReference { + return TagReference(underlying: self) + } + + static func bridgeFromJS(_ value: consuming TagReference) -> Tag { + return value.underlying + } +} + +@JS final class TagReference { + var underlying: Tag + + @JS init(underlying: Tag) { + self.underlying = underlying + } +} + +@JS func roundtripPolygon(_ polygon: Polygon) -> Polygon + +@JS func optionalPolygon(_ polygon: Polygon?) -> Polygon? + +@JS func polygonArray(_ polygons: [Polygon]) -> [Polygon] + +@JS func validatePolygon(_ polygon: Polygon) throws(JSException) -> Polygon + +@JS func makeTag(_ name: String) -> Tag + +@JS(as: String.self) struct Tagged { + var raw: String + + consuming func bridgeToJS() -> String { + return raw + } + + static func bridgeFromJS(_ value: consuming String) -> Tagged { + return Tagged(raw: value) + } +} + +@JSFunction func acceptTagged(_ tagged: Tagged) throws(JSException) -> Void +@JSFunction func acceptOptionalTagged(_ tagged: Tagged?) throws(JSException) -> Void +@JSFunction func roundtripTagged(_ tagged: Tagged) throws(JSException) -> Tagged + +@JSClass class Surface { + @JSFunction init() throws(JSException) + @JSGetter var label: String +} + +@JS(as: Surface.self) struct Canvas { + consuming func bridgeToJS() -> Surface { + fatalError("test stub") + } + + static func bridgeFromJS(_ value: consuming Surface) -> Canvas { + return Canvas() + } +} + +@JSFunction func produceOptionalCanvas() throws(JSException) -> Canvas? + +@JS enum InnerTag { + case payload(Int) + case empty +} + +@JS(as: InnerTag.self) struct AliasedTag { + consuming func bridgeToJS() -> InnerTag { + return .empty + } + + static func bridgeFromJS(_ value: consuming InnerTag) -> AliasedTag { + return AliasedTag() + } +} + +@JS func roundtripTags(_ xs: [AliasedTag?]) -> [AliasedTag?] + +@JS(as: Int.self) struct UserId { + var rawValue: Int + + consuming func bridgeToJS() -> Int { + return rawValue + } + + static func bridgeFromJS(_ value: consuming Int) -> UserId { + return UserId(rawValue: value) + } +} + +@JS protocol HasOptionalUserId { + var userId: UserId? { get } +} + +@JS func describeUser(_ owner: HasOptionalUserId) -> HasOptionalUserId diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/Inputs/MacroSwift/AliasInClosure.swift b/Plugins/BridgeJS/Tests/BridgeJSToolTests/Inputs/MacroSwift/AliasInClosure.swift new file mode 100644 index 000000000..384481c5c --- /dev/null +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/Inputs/MacroSwift/AliasInClosure.swift @@ -0,0 +1,22 @@ +@JS(as: PolygonReference.self) struct Polygon { + var sides: Int + + consuming func bridgeToJS() -> PolygonReference { + return PolygonReference(sides: sides) + } + + static func bridgeFromJS(_ value: consuming PolygonReference) -> Polygon { + return Polygon(sides: value.sides) + } +} + +@JS final class PolygonReference { + var sides: Int + + @JS init(sides: Int) { + self.sides = sides + } +} + +@JS func makePolygonFactory() -> () -> Polygon +@JS func makePolygonInspector() -> (Polygon) -> Int diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/Inputs/MacroSwift/EnumAlias.swift b/Plugins/BridgeJS/Tests/BridgeJSToolTests/Inputs/MacroSwift/EnumAlias.swift new file mode 100644 index 000000000..7da395c2a --- /dev/null +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/Inputs/MacroSwift/EnumAlias.swift @@ -0,0 +1,29 @@ +@JS(as: ColorBox.self) enum Color { + case red, green, blue + + consuming func bridgeToJS() -> ColorBox { + switch self { + case .red: return ColorBox(name: "red") + case .green: return ColorBox(name: "green") + case .blue: return ColorBox(name: "blue") + } + } + + static func bridgeFromJS(_ value: consuming ColorBox) -> Color { + switch value.name { + case "green": return .green + case "blue": return .blue + default: return .red + } + } +} + +@JS final class ColorBox { + var name: String + + @JS init(name: String) { + self.name = name + } +} + +@JS func roundtripColor(_ color: Color) -> Color diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/Alias.json b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/Alias.json new file mode 100644 index 000000000..bcdc43375 --- /dev/null +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/Alias.json @@ -0,0 +1,719 @@ +{ + "exported" : { + "aliases" : [ + { + "swiftCallName" : "Polygon", + "underlying" : { + "swiftHeapObject" : { + "_0" : "PolygonReference" + } + } + }, + { + "swiftCallName" : "Tag", + "underlying" : { + "swiftHeapObject" : { + "_0" : "TagReference" + } + } + }, + { + "swiftCallName" : "Tagged", + "underlying" : { + "string" : { + + } + } + }, + { + "swiftCallName" : "Canvas", + "underlying" : { + "jsObject" : { + "_0" : "Surface" + } + } + }, + { + "swiftCallName" : "AliasedTag", + "underlying" : { + "associatedValueEnum" : { + "_0" : "InnerTag" + } + } + }, + { + "swiftCallName" : "UserId", + "underlying" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + } + } + ], + "classes" : [ + { + "constructor" : { + "abiName" : "bjs_PolygonReference_init", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "parameters" : [ + { + "label" : "underlying", + "name" : "underlying", + "type" : { + "alias" : { + "name" : "Polygon", + "underlying" : { + "swiftHeapObject" : { + "_0" : "PolygonReference" + } + } + } + } + } + ] + }, + "methods" : [ + { + "abiName" : "bjs_PolygonReference_snapshot", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "name" : "snapshot", + "parameters" : [ + + ], + "returnType" : { + "alias" : { + "name" : "Polygon", + "underlying" : { + "swiftHeapObject" : { + "_0" : "PolygonReference" + } + } + } + } + }, + { + "abiName" : "bjs_PolygonReference_merge", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "name" : "merge", + "parameters" : [ + { + "label" : "_", + "name" : "other", + "type" : { + "alias" : { + "name" : "Polygon", + "underlying" : { + "swiftHeapObject" : { + "_0" : "PolygonReference" + } + } + } + } + } + ], + "returnType" : { + "alias" : { + "name" : "Polygon", + "underlying" : { + "swiftHeapObject" : { + "_0" : "PolygonReference" + } + } + } + } + }, + { + "abiName" : "bjs_PolygonReference_static_origin", + "effects" : { + "isAsync" : false, + "isStatic" : true, + "isThrows" : false + }, + "name" : "origin", + "parameters" : [ + + ], + "returnType" : { + "alias" : { + "name" : "Polygon", + "underlying" : { + "swiftHeapObject" : { + "_0" : "PolygonReference" + } + } + } + }, + "staticContext" : { + "className" : { + "_0" : "PolygonReference" + } + } + } + ], + "name" : "PolygonReference", + "properties" : [ + + ], + "swiftCallName" : "PolygonReference" + }, + { + "constructor" : { + "abiName" : "bjs_TagReference_init", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "parameters" : [ + { + "label" : "underlying", + "name" : "underlying", + "type" : { + "alias" : { + "name" : "Tag", + "underlying" : { + "swiftHeapObject" : { + "_0" : "TagReference" + } + } + } + } + } + ] + }, + "methods" : [ + + ], + "name" : "TagReference", + "properties" : [ + + ], + "swiftCallName" : "TagReference" + } + ], + "enums" : [ + { + "cases" : [ + { + "associatedValues" : [ + { + "type" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + } + } + ], + "name" : "payload" + }, + { + "associatedValues" : [ + + ], + "name" : "empty" + } + ], + "emitStyle" : "const", + "name" : "InnerTag", + "staticMethods" : [ + + ], + "staticProperties" : [ + + ], + "swiftCallName" : "InnerTag", + "tsFullPath" : "InnerTag" + } + ], + "exposeToGlobal" : false, + "functions" : [ + { + "abiName" : "bjs_roundtripPolygon", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "name" : "roundtripPolygon", + "parameters" : [ + { + "label" : "_", + "name" : "polygon", + "type" : { + "alias" : { + "name" : "Polygon", + "underlying" : { + "swiftHeapObject" : { + "_0" : "PolygonReference" + } + } + } + } + } + ], + "returnType" : { + "alias" : { + "name" : "Polygon", + "underlying" : { + "swiftHeapObject" : { + "_0" : "PolygonReference" + } + } + } + } + }, + { + "abiName" : "bjs_optionalPolygon", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "name" : "optionalPolygon", + "parameters" : [ + { + "label" : "_", + "name" : "polygon", + "type" : { + "nullable" : { + "_0" : { + "alias" : { + "name" : "Polygon", + "underlying" : { + "swiftHeapObject" : { + "_0" : "PolygonReference" + } + } + } + }, + "_1" : "null" + } + } + } + ], + "returnType" : { + "nullable" : { + "_0" : { + "alias" : { + "name" : "Polygon", + "underlying" : { + "swiftHeapObject" : { + "_0" : "PolygonReference" + } + } + } + }, + "_1" : "null" + } + } + }, + { + "abiName" : "bjs_polygonArray", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "name" : "polygonArray", + "parameters" : [ + { + "label" : "_", + "name" : "polygons", + "type" : { + "array" : { + "_0" : { + "alias" : { + "name" : "Polygon", + "underlying" : { + "swiftHeapObject" : { + "_0" : "PolygonReference" + } + } + } + } + } + } + } + ], + "returnType" : { + "array" : { + "_0" : { + "alias" : { + "name" : "Polygon", + "underlying" : { + "swiftHeapObject" : { + "_0" : "PolygonReference" + } + } + } + } + } + } + }, + { + "abiName" : "bjs_validatePolygon", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : true + }, + "name" : "validatePolygon", + "parameters" : [ + { + "label" : "_", + "name" : "polygon", + "type" : { + "alias" : { + "name" : "Polygon", + "underlying" : { + "swiftHeapObject" : { + "_0" : "PolygonReference" + } + } + } + } + } + ], + "returnType" : { + "alias" : { + "name" : "Polygon", + "underlying" : { + "swiftHeapObject" : { + "_0" : "PolygonReference" + } + } + } + } + }, + { + "abiName" : "bjs_makeTag", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "name" : "makeTag", + "parameters" : [ + { + "label" : "_", + "name" : "name", + "type" : { + "string" : { + + } + } + } + ], + "returnType" : { + "alias" : { + "name" : "Tag", + "underlying" : { + "swiftHeapObject" : { + "_0" : "TagReference" + } + } + } + } + }, + { + "abiName" : "bjs_roundtripTags", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "name" : "roundtripTags", + "parameters" : [ + { + "label" : "_", + "name" : "xs", + "type" : { + "array" : { + "_0" : { + "nullable" : { + "_0" : { + "alias" : { + "name" : "AliasedTag", + "underlying" : { + "associatedValueEnum" : { + "_0" : "InnerTag" + } + } + } + }, + "_1" : "null" + } + } + } + } + } + ], + "returnType" : { + "array" : { + "_0" : { + "nullable" : { + "_0" : { + "alias" : { + "name" : "AliasedTag", + "underlying" : { + "associatedValueEnum" : { + "_0" : "InnerTag" + } + } + } + }, + "_1" : "null" + } + } + } + } + }, + { + "abiName" : "bjs_describeUser", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "name" : "describeUser", + "parameters" : [ + { + "label" : "_", + "name" : "owner", + "type" : { + "swiftProtocol" : { + "_0" : "HasOptionalUserId" + } + } + } + ], + "returnType" : { + "swiftProtocol" : { + "_0" : "HasOptionalUserId" + } + } + } + ], + "protocols" : [ + { + "methods" : [ + + ], + "name" : "HasOptionalUserId", + "properties" : [ + { + "isReadonly" : true, + "name" : "userId", + "type" : { + "nullable" : { + "_0" : { + "alias" : { + "name" : "UserId", + "underlying" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + } + } + }, + "_1" : "null" + } + } + } + ] + } + ], + "structs" : [ + + ] + }, + "imported" : { + "children" : [ + { + "functions" : [ + { + "accessLevel" : "internal", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : true + }, + "name" : "acceptTagged", + "parameters" : [ + { + "name" : "tagged", + "type" : { + "alias" : { + "name" : "Tagged", + "underlying" : { + "string" : { + + } + } + } + } + } + ], + "returnType" : { + "void" : { + + } + } + }, + { + "accessLevel" : "internal", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : true + }, + "name" : "acceptOptionalTagged", + "parameters" : [ + { + "name" : "tagged", + "type" : { + "nullable" : { + "_0" : { + "alias" : { + "name" : "Tagged", + "underlying" : { + "string" : { + + } + } + } + }, + "_1" : "null" + } + } + } + ], + "returnType" : { + "void" : { + + } + } + }, + { + "accessLevel" : "internal", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : true + }, + "name" : "roundtripTagged", + "parameters" : [ + { + "name" : "tagged", + "type" : { + "alias" : { + "name" : "Tagged", + "underlying" : { + "string" : { + + } + } + } + } + } + ], + "returnType" : { + "alias" : { + "name" : "Tagged", + "underlying" : { + "string" : { + + } + } + } + } + }, + { + "accessLevel" : "internal", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : true + }, + "name" : "produceOptionalCanvas", + "parameters" : [ + + ], + "returnType" : { + "nullable" : { + "_0" : { + "alias" : { + "name" : "Canvas", + "underlying" : { + "jsObject" : { + "_0" : "Surface" + } + } + } + }, + "_1" : "null" + } + } + } + ], + "types" : [ + { + "accessLevel" : "internal", + "constructor" : { + "accessLevel" : "internal", + "parameters" : [ + + ] + }, + "getters" : [ + { + "accessLevel" : "internal", + "name" : "label", + "type" : { + "string" : { + + } + } + } + ], + "methods" : [ + + ], + "name" : "Surface", + "setters" : [ + + ], + "staticMethods" : [ + + ] + } + ] + } + ] + }, + "moduleName" : "TestModule", + "usedExternalModules" : [ + + ] +} \ No newline at end of file diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/Alias.swift b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/Alias.swift new file mode 100644 index 000000000..1a31905f3 --- /dev/null +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/Alias.swift @@ -0,0 +1,389 @@ +struct AnyHasOptionalUserId: HasOptionalUserId, _BridgedSwiftProtocolWrapper { + let jsObject: JSObject + + var userId: Optional { + get { + let jsObjectValue = jsObject.bridgeJSLowerParameter() + bjs_HasOptionalUserId_userId_get(jsObjectValue) + return Optional.bridgeJSLiftReturnFromSideChannel().map { UserId.bridgeFromJS($0) } + } + } + + static func bridgeJSLiftParameter(_ value: Int32) -> Self { + return AnyHasOptionalUserId(jsObject: JSObject(id: UInt32(bitPattern: value))) + } +} + +#if arch(wasm32) +@_extern(wasm, module: "TestModule", name: "bjs_HasOptionalUserId_userId_get") +fileprivate func bjs_HasOptionalUserId_userId_get_extern(_ jsObject: Int32) -> Void +#else +fileprivate func bjs_HasOptionalUserId_userId_get_extern(_ jsObject: Int32) -> Void { + fatalError("Only available on WebAssembly") +} +#endif +@inline(never) fileprivate func bjs_HasOptionalUserId_userId_get(_ jsObject: Int32) -> Void { + return bjs_HasOptionalUserId_userId_get_extern(jsObject) +} + +extension InnerTag: _BridgedSwiftAssociatedValueEnum { + @_spi(BridgeJS) @_transparent public static func bridgeJSStackPopPayload(_ caseId: Int32) -> InnerTag { + switch caseId { + case 0: + return .payload(Int.bridgeJSStackPop()) + case 1: + return .empty + default: + fatalError("Unknown InnerTag case ID: \(caseId)") + } + } + + @_spi(BridgeJS) @_transparent public consuming func bridgeJSStackPushPayload() -> Int32 { + switch self { + case .payload(let param0): + param0.bridgeJSStackPush() + return Int32(0) + case .empty: + return Int32(1) + } + } +} + +@_expose(wasm, "bjs_roundtripPolygon") +@_cdecl("bjs_roundtripPolygon") +public func _bjs_roundtripPolygon(_ polygon: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { + #if arch(wasm32) + let ret = roundtripPolygon(_: Polygon.bridgeFromJS(PolygonReference.bridgeJSLiftParameter(polygon))) + return ret.bridgeToJS().bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_optionalPolygon") +@_cdecl("bjs_optionalPolygon") +public func _bjs_optionalPolygon(_ polygonIsSome: Int32, _ polygonValue: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) + let ret = optionalPolygon(_: Optional.bridgeJSLiftParameter(polygonIsSome, polygonValue).map { Polygon.bridgeFromJS($0) }) + return ret.map { $0.bridgeToJS() }.bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_polygonArray") +@_cdecl("bjs_polygonArray") +public func _bjs_polygonArray() -> Void { + #if arch(wasm32) + let ret = polygonArray(_: [PolygonReference].bridgeJSStackPop().map { Polygon.bridgeFromJS($0) }) + ret.map { $0.bridgeToJS() }.bridgeJSStackPush() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_validatePolygon") +@_cdecl("bjs_validatePolygon") +public func _bjs_validatePolygon(_ polygon: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { + #if arch(wasm32) + do { + let ret = try validatePolygon(_: Polygon.bridgeFromJS(PolygonReference.bridgeJSLiftParameter(polygon))) + return ret.bridgeToJS().bridgeJSLowerReturn() + } catch let error { + if let error = error.thrownValue.object { + withExtendedLifetime(error) { + _swift_js_throw(Int32(bitPattern: $0.id)) + } + } else { + let jsError = JSError(message: String(describing: error)) + withExtendedLifetime(jsError.jsObject) { + _swift_js_throw(Int32(bitPattern: $0.id)) + } + } + return UnsafeMutableRawPointer(bitPattern: -1).unsafelyUnwrapped + } + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_makeTag") +@_cdecl("bjs_makeTag") +public func _bjs_makeTag(_ nameBytes: Int32, _ nameLength: Int32) -> UnsafeMutableRawPointer { + #if arch(wasm32) + let ret = makeTag(_: String.bridgeJSLiftParameter(nameBytes, nameLength)) + return ret.bridgeToJS().bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_roundtripTags") +@_cdecl("bjs_roundtripTags") +public func _bjs_roundtripTags() -> Void { + #if arch(wasm32) + let ret = roundtripTags(_: [Optional].bridgeJSStackPop().map { $0.map { AliasedTag.bridgeFromJS($0) } }) + ret.map { $0.map { $0.bridgeToJS() } }.bridgeJSStackPush() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_describeUser") +@_cdecl("bjs_describeUser") +public func _bjs_describeUser(_ owner: Int32) -> Int32 { + #if arch(wasm32) + let ret = describeUser(_: AnyHasOptionalUserId.bridgeJSLiftParameter(owner)) as! _BridgedSwiftProtocolExportable + return ret.bridgeJSLowerAsProtocolReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_PolygonReference_init") +@_cdecl("bjs_PolygonReference_init") +public func _bjs_PolygonReference_init(_ underlying: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { + #if arch(wasm32) + let ret = PolygonReference(underlying: Polygon.bridgeFromJS(PolygonReference.bridgeJSLiftParameter(underlying))) + return ret.bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_PolygonReference_snapshot") +@_cdecl("bjs_PolygonReference_snapshot") +public func _bjs_PolygonReference_snapshot(_ _self: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { + #if arch(wasm32) + let ret = PolygonReference.bridgeJSLiftParameter(_self).snapshot() + return ret.bridgeToJS().bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_PolygonReference_merge") +@_cdecl("bjs_PolygonReference_merge") +public func _bjs_PolygonReference_merge(_ _self: UnsafeMutableRawPointer, _ other: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { + #if arch(wasm32) + let ret = PolygonReference.bridgeJSLiftParameter(_self).merge(_: Polygon.bridgeFromJS(PolygonReference.bridgeJSLiftParameter(other))) + return ret.bridgeToJS().bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_PolygonReference_static_origin") +@_cdecl("bjs_PolygonReference_static_origin") +public func _bjs_PolygonReference_static_origin() -> UnsafeMutableRawPointer { + #if arch(wasm32) + let ret = PolygonReference.origin() + return ret.bridgeToJS().bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_PolygonReference_deinit") +@_cdecl("bjs_PolygonReference_deinit") +public func _bjs_PolygonReference_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) + Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif +} + +extension PolygonReference: ConvertibleToJSValue, _BridgedSwiftHeapObject, _BridgedSwiftProtocolExportable { + var jsValue: JSValue { + return .object(JSObject(id: UInt32(bitPattern: _bjs_PolygonReference_wrap(Unmanaged.passRetained(self).toOpaque())))) + } + consuming func bridgeJSLowerAsProtocolReturn() -> Int32 { + _bjs_PolygonReference_wrap(Unmanaged.passRetained(self).toOpaque()) + } +} + +#if arch(wasm32) +@_extern(wasm, module: "TestModule", name: "bjs_PolygonReference_wrap") +fileprivate func _bjs_PolygonReference_wrap_extern(_ pointer: UnsafeMutableRawPointer) -> Int32 +#else +fileprivate func _bjs_PolygonReference_wrap_extern(_ pointer: UnsafeMutableRawPointer) -> Int32 { + fatalError("Only available on WebAssembly") +} +#endif +@inline(never) fileprivate func _bjs_PolygonReference_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { + return _bjs_PolygonReference_wrap_extern(pointer) +} + +@_expose(wasm, "bjs_TagReference_init") +@_cdecl("bjs_TagReference_init") +public func _bjs_TagReference_init(_ underlying: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { + #if arch(wasm32) + let ret = TagReference(underlying: Tag.bridgeFromJS(TagReference.bridgeJSLiftParameter(underlying))) + return ret.bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_TagReference_deinit") +@_cdecl("bjs_TagReference_deinit") +public func _bjs_TagReference_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) + Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif +} + +extension TagReference: ConvertibleToJSValue, _BridgedSwiftHeapObject, _BridgedSwiftProtocolExportable { + var jsValue: JSValue { + return .object(JSObject(id: UInt32(bitPattern: _bjs_TagReference_wrap(Unmanaged.passRetained(self).toOpaque())))) + } + consuming func bridgeJSLowerAsProtocolReturn() -> Int32 { + _bjs_TagReference_wrap(Unmanaged.passRetained(self).toOpaque()) + } +} + +#if arch(wasm32) +@_extern(wasm, module: "TestModule", name: "bjs_TagReference_wrap") +fileprivate func _bjs_TagReference_wrap_extern(_ pointer: UnsafeMutableRawPointer) -> Int32 +#else +fileprivate func _bjs_TagReference_wrap_extern(_ pointer: UnsafeMutableRawPointer) -> Int32 { + fatalError("Only available on WebAssembly") +} +#endif +@inline(never) fileprivate func _bjs_TagReference_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { + return _bjs_TagReference_wrap_extern(pointer) +} + +#if arch(wasm32) +@_extern(wasm, module: "TestModule", name: "bjs_acceptTagged") +fileprivate func bjs_acceptTagged_extern(_ taggedBytes: Int32, _ taggedLength: Int32) -> Void +#else +fileprivate func bjs_acceptTagged_extern(_ taggedBytes: Int32, _ taggedLength: Int32) -> Void { + fatalError("Only available on WebAssembly") +} +#endif +@inline(never) fileprivate func bjs_acceptTagged(_ taggedBytes: Int32, _ taggedLength: Int32) -> Void { + return bjs_acceptTagged_extern(taggedBytes, taggedLength) +} + +func _$acceptTagged(_ tagged: Tagged) throws(JSException) -> Void { + tagged.bridgeToJS().bridgeJSWithLoweredParameter { (taggedBytes, taggedLength) in + bjs_acceptTagged(taggedBytes, taggedLength) + } + if let error = _swift_js_take_exception() { + throw error + } +} + +#if arch(wasm32) +@_extern(wasm, module: "TestModule", name: "bjs_acceptOptionalTagged") +fileprivate func bjs_acceptOptionalTagged_extern(_ taggedIsSome: Int32, _ taggedBytes: Int32, _ taggedLength: Int32) -> Void +#else +fileprivate func bjs_acceptOptionalTagged_extern(_ taggedIsSome: Int32, _ taggedBytes: Int32, _ taggedLength: Int32) -> Void { + fatalError("Only available on WebAssembly") +} +#endif +@inline(never) fileprivate func bjs_acceptOptionalTagged(_ taggedIsSome: Int32, _ taggedBytes: Int32, _ taggedLength: Int32) -> Void { + return bjs_acceptOptionalTagged_extern(taggedIsSome, taggedBytes, taggedLength) +} + +func _$acceptOptionalTagged(_ tagged: Optional) throws(JSException) -> Void { + tagged.map { + $0.bridgeToJS() + } .bridgeJSWithLoweredParameter { (taggedIsSome, taggedBytes, taggedLength) in + bjs_acceptOptionalTagged(taggedIsSome, taggedBytes, taggedLength) + } + if let error = _swift_js_take_exception() { + throw error + } +} + +#if arch(wasm32) +@_extern(wasm, module: "TestModule", name: "bjs_roundtripTagged") +fileprivate func bjs_roundtripTagged_extern(_ taggedBytes: Int32, _ taggedLength: Int32) -> Int32 +#else +fileprivate func bjs_roundtripTagged_extern(_ taggedBytes: Int32, _ taggedLength: Int32) -> Int32 { + fatalError("Only available on WebAssembly") +} +#endif +@inline(never) fileprivate func bjs_roundtripTagged(_ taggedBytes: Int32, _ taggedLength: Int32) -> Int32 { + return bjs_roundtripTagged_extern(taggedBytes, taggedLength) +} + +func _$roundtripTagged(_ tagged: Tagged) throws(JSException) -> Tagged { + let ret0 = tagged.bridgeToJS().bridgeJSWithLoweredParameter { (taggedBytes, taggedLength) in + let ret = bjs_roundtripTagged(taggedBytes, taggedLength) + return ret + } + let ret = ret0 + if let error = _swift_js_take_exception() { + throw error + } + return Tagged.bridgeFromJS(String.bridgeJSLiftReturn(ret)) +} + +#if arch(wasm32) +@_extern(wasm, module: "TestModule", name: "bjs_produceOptionalCanvas") +fileprivate func bjs_produceOptionalCanvas_extern() -> Void +#else +fileprivate func bjs_produceOptionalCanvas_extern() -> Void { + fatalError("Only available on WebAssembly") +} +#endif +@inline(never) fileprivate func bjs_produceOptionalCanvas() -> Void { + return bjs_produceOptionalCanvas_extern() +} + +func _$produceOptionalCanvas() throws(JSException) -> Optional { + bjs_produceOptionalCanvas() + if let error = _swift_js_take_exception() { + throw error + } + return Optional.bridgeJSLiftReturn().map { + Canvas.bridgeFromJS($0) + } +} + +#if arch(wasm32) +@_extern(wasm, module: "TestModule", name: "bjs_Surface_init") +fileprivate func bjs_Surface_init_extern() -> Int32 +#else +fileprivate func bjs_Surface_init_extern() -> Int32 { + fatalError("Only available on WebAssembly") +} +#endif +@inline(never) fileprivate func bjs_Surface_init() -> Int32 { + return bjs_Surface_init_extern() +} + +#if arch(wasm32) +@_extern(wasm, module: "TestModule", name: "bjs_Surface_label_get") +fileprivate func bjs_Surface_label_get_extern(_ self: Int32) -> Int32 +#else +fileprivate func bjs_Surface_label_get_extern(_ self: Int32) -> Int32 { + fatalError("Only available on WebAssembly") +} +#endif +@inline(never) fileprivate func bjs_Surface_label_get(_ self: Int32) -> Int32 { + return bjs_Surface_label_get_extern(self) +} + +func _$Surface_init() throws(JSException) -> JSObject { + let ret = bjs_Surface_init() + if let error = _swift_js_take_exception() { + throw error + } + return JSObject.bridgeJSLiftReturn(ret) +} + +func _$Surface_label_get(_ self: JSObject) throws(JSException) -> String { + let selfValue = self.bridgeJSLowerParameter() + let ret = bjs_Surface_label_get(selfValue) + if let error = _swift_js_take_exception() { + throw error + } + return String.bridgeJSLiftReturn(ret) +} \ No newline at end of file diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/AliasInClosure.json b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/AliasInClosure.json new file mode 100644 index 000000000..d76761e0b --- /dev/null +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/AliasInClosure.json @@ -0,0 +1,145 @@ +{ + "exported" : { + "aliases" : [ + { + "swiftCallName" : "Polygon", + "underlying" : { + "swiftHeapObject" : { + "_0" : "PolygonReference" + } + } + } + ], + "classes" : [ + { + "constructor" : { + "abiName" : "bjs_PolygonReference_init", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "parameters" : [ + { + "label" : "sides", + "name" : "sides", + "type" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + } + } + ] + }, + "methods" : [ + + ], + "name" : "PolygonReference", + "properties" : [ + + ], + "swiftCallName" : "PolygonReference" + } + ], + "enums" : [ + + ], + "exposeToGlobal" : false, + "functions" : [ + { + "abiName" : "bjs_makePolygonFactory", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "name" : "makePolygonFactory", + "parameters" : [ + + ], + "returnType" : { + "closure" : { + "_0" : { + "isAsync" : false, + "isThrows" : false, + "mangleName" : "10TestModuley_Al7Polygon", + "moduleName" : "TestModule", + "parameters" : [ + + ], + "returnType" : { + "alias" : { + "name" : "Polygon", + "underlying" : { + "swiftHeapObject" : { + "_0" : "PolygonReference" + } + } + } + }, + "sendingParameters" : false + }, + "useJSTypedClosure" : false + } + } + }, + { + "abiName" : "bjs_makePolygonInspector", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "name" : "makePolygonInspector", + "parameters" : [ + + ], + "returnType" : { + "closure" : { + "_0" : { + "isAsync" : false, + "isThrows" : false, + "mangleName" : "10TestModuleAl7Polygon_Si", + "moduleName" : "TestModule", + "parameters" : [ + { + "alias" : { + "name" : "Polygon", + "underlying" : { + "swiftHeapObject" : { + "_0" : "PolygonReference" + } + } + } + } + ], + "returnType" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + }, + "sendingParameters" : false + }, + "useJSTypedClosure" : false + } + } + } + ], + "protocols" : [ + + ], + "structs" : [ + + ] + }, + "moduleName" : "TestModule", + "usedExternalModules" : [ + + ] +} \ No newline at end of file diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/AliasInClosure.swift b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/AliasInClosure.swift new file mode 100644 index 000000000..3613ead7e --- /dev/null +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/AliasInClosure.swift @@ -0,0 +1,188 @@ +#if arch(wasm32) +@_extern(wasm, module: "bjs", name: "invoke_js_callback_TestModule_10TestModuleAl7Polygon_Si") +fileprivate func invoke_js_callback_TestModule_10TestModuleAl7Polygon_Si_extern(_ callback: Int32, _ param0: UnsafeMutableRawPointer) -> Int32 +#else +fileprivate func invoke_js_callback_TestModule_10TestModuleAl7Polygon_Si_extern(_ callback: Int32, _ param0: UnsafeMutableRawPointer) -> Int32 { + fatalError("Only available on WebAssembly") +} +#endif +@inline(never) fileprivate func invoke_js_callback_TestModule_10TestModuleAl7Polygon_Si(_ callback: Int32, _ param0: UnsafeMutableRawPointer) -> Int32 { + return invoke_js_callback_TestModule_10TestModuleAl7Polygon_Si_extern(callback, param0) +} + +#if arch(wasm32) +@_extern(wasm, module: "bjs", name: "make_swift_closure_TestModule_10TestModuleAl7Polygon_Si") +fileprivate func make_swift_closure_TestModule_10TestModuleAl7Polygon_Si_extern(_ boxPtr: UnsafeMutableRawPointer, _ file: UnsafePointer, _ line: UInt32) -> Int32 +#else +fileprivate func make_swift_closure_TestModule_10TestModuleAl7Polygon_Si_extern(_ boxPtr: UnsafeMutableRawPointer, _ file: UnsafePointer, _ line: UInt32) -> Int32 { + fatalError("Only available on WebAssembly") +} +#endif +@inline(never) fileprivate func make_swift_closure_TestModule_10TestModuleAl7Polygon_Si(_ boxPtr: UnsafeMutableRawPointer, _ file: UnsafePointer, _ line: UInt32) -> Int32 { + return make_swift_closure_TestModule_10TestModuleAl7Polygon_Si_extern(boxPtr, file, line) +} + +private enum _BJS_Closure_10TestModuleAl7Polygon_Si { + static func bridgeJSLift(_ callbackId: Int32) -> (Polygon) -> Int { + let callback = JSObject.bridgeJSLiftParameter(callbackId) + return { [callback] param0 in + #if arch(wasm32) + let callbackValue = callback.bridgeJSLowerParameter() + let param0Pointer = param0.bridgeToJS().bridgeJSLowerParameter() + let ret = invoke_js_callback_TestModule_10TestModuleAl7Polygon_Si(callbackValue, param0Pointer) + return Int.bridgeJSLiftReturn(ret) + #else + fatalError("Only available on WebAssembly") + #endif + } + } +} + +extension JSTypedClosure where Signature == (Polygon) -> Int { + init(fileID: StaticString = #fileID, line: UInt32 = #line, _ body: @escaping (Polygon) -> Int) { + self.init( + makeClosure: make_swift_closure_TestModule_10TestModuleAl7Polygon_Si, + body: body, + fileID: fileID, + line: line + ) + } +} + +@_expose(wasm, "invoke_swift_closure_TestModule_10TestModuleAl7Polygon_Si") +@_cdecl("invoke_swift_closure_TestModule_10TestModuleAl7Polygon_Si") +public func _invoke_swift_closure_TestModule_10TestModuleAl7Polygon_Si(_ boxPtr: UnsafeMutableRawPointer, _ param0: UnsafeMutableRawPointer) -> Int32 { + #if arch(wasm32) + let closure = Unmanaged<_BridgeJSTypedClosureBox<(Polygon) -> Int>>.fromOpaque(boxPtr).takeUnretainedValue().closure + let result = closure(Polygon.bridgeFromJS(PolygonReference.bridgeJSLiftParameter(param0))) + return result.bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +#if arch(wasm32) +@_extern(wasm, module: "bjs", name: "invoke_js_callback_TestModule_10TestModuley_Al7Polygon") +fileprivate func invoke_js_callback_TestModule_10TestModuley_Al7Polygon_extern(_ callback: Int32) -> UnsafeMutableRawPointer +#else +fileprivate func invoke_js_callback_TestModule_10TestModuley_Al7Polygon_extern(_ callback: Int32) -> UnsafeMutableRawPointer { + fatalError("Only available on WebAssembly") +} +#endif +@inline(never) fileprivate func invoke_js_callback_TestModule_10TestModuley_Al7Polygon(_ callback: Int32) -> UnsafeMutableRawPointer { + return invoke_js_callback_TestModule_10TestModuley_Al7Polygon_extern(callback) +} + +#if arch(wasm32) +@_extern(wasm, module: "bjs", name: "make_swift_closure_TestModule_10TestModuley_Al7Polygon") +fileprivate func make_swift_closure_TestModule_10TestModuley_Al7Polygon_extern(_ boxPtr: UnsafeMutableRawPointer, _ file: UnsafePointer, _ line: UInt32) -> Int32 +#else +fileprivate func make_swift_closure_TestModule_10TestModuley_Al7Polygon_extern(_ boxPtr: UnsafeMutableRawPointer, _ file: UnsafePointer, _ line: UInt32) -> Int32 { + fatalError("Only available on WebAssembly") +} +#endif +@inline(never) fileprivate func make_swift_closure_TestModule_10TestModuley_Al7Polygon(_ boxPtr: UnsafeMutableRawPointer, _ file: UnsafePointer, _ line: UInt32) -> Int32 { + return make_swift_closure_TestModule_10TestModuley_Al7Polygon_extern(boxPtr, file, line) +} + +private enum _BJS_Closure_10TestModuley_Al7Polygon { + static func bridgeJSLift(_ callbackId: Int32) -> () -> Polygon { + let callback = JSObject.bridgeJSLiftParameter(callbackId) + return { [callback] in + #if arch(wasm32) + let callbackValue = callback.bridgeJSLowerParameter() + let ret = invoke_js_callback_TestModule_10TestModuley_Al7Polygon(callbackValue) + return Polygon.bridgeFromJS(PolygonReference.bridgeJSLiftReturn(ret)) + #else + fatalError("Only available on WebAssembly") + #endif + } + } +} + +extension JSTypedClosure where Signature == () -> Polygon { + init(fileID: StaticString = #fileID, line: UInt32 = #line, _ body: @escaping () -> Polygon) { + self.init( + makeClosure: make_swift_closure_TestModule_10TestModuley_Al7Polygon, + body: body, + fileID: fileID, + line: line + ) + } +} + +@_expose(wasm, "invoke_swift_closure_TestModule_10TestModuley_Al7Polygon") +@_cdecl("invoke_swift_closure_TestModule_10TestModuley_Al7Polygon") +public func _invoke_swift_closure_TestModule_10TestModuley_Al7Polygon(_ boxPtr: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { + #if arch(wasm32) + let closure = Unmanaged<_BridgeJSTypedClosureBox<() -> Polygon>>.fromOpaque(boxPtr).takeUnretainedValue().closure + let result = closure() + return result.bridgeToJS().bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_makePolygonFactory") +@_cdecl("bjs_makePolygonFactory") +public func _bjs_makePolygonFactory() -> Int32 { + #if arch(wasm32) + let ret = makePolygonFactory() + return JSTypedClosure(ret).bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_makePolygonInspector") +@_cdecl("bjs_makePolygonInspector") +public func _bjs_makePolygonInspector() -> Int32 { + #if arch(wasm32) + let ret = makePolygonInspector() + return JSTypedClosure(ret).bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_PolygonReference_init") +@_cdecl("bjs_PolygonReference_init") +public func _bjs_PolygonReference_init(_ sides: Int32) -> UnsafeMutableRawPointer { + #if arch(wasm32) + let ret = PolygonReference(sides: Int.bridgeJSLiftParameter(sides)) + return ret.bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_PolygonReference_deinit") +@_cdecl("bjs_PolygonReference_deinit") +public func _bjs_PolygonReference_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) + Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif +} + +extension PolygonReference: ConvertibleToJSValue, _BridgedSwiftHeapObject, _BridgedSwiftProtocolExportable { + var jsValue: JSValue { + return .object(JSObject(id: UInt32(bitPattern: _bjs_PolygonReference_wrap(Unmanaged.passRetained(self).toOpaque())))) + } + consuming func bridgeJSLowerAsProtocolReturn() -> Int32 { + _bjs_PolygonReference_wrap(Unmanaged.passRetained(self).toOpaque()) + } +} + +#if arch(wasm32) +@_extern(wasm, module: "TestModule", name: "bjs_PolygonReference_wrap") +fileprivate func _bjs_PolygonReference_wrap_extern(_ pointer: UnsafeMutableRawPointer) -> Int32 +#else +fileprivate func _bjs_PolygonReference_wrap_extern(_ pointer: UnsafeMutableRawPointer) -> Int32 { + fatalError("Only available on WebAssembly") +} +#endif +@inline(never) fileprivate func _bjs_PolygonReference_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { + return _bjs_PolygonReference_wrap_extern(pointer) +} \ No newline at end of file diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/ArrayTypes.json b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/ArrayTypes.json index d4ac7a15f..0fac3bf21 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/ArrayTypes.json +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/ArrayTypes.json @@ -1,5 +1,8 @@ { "exported" : { + "aliases" : [ + + ], "classes" : [ { "methods" : [ diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/Async.json b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/Async.json index 27ba89aca..e9eb53951 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/Async.json +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/Async.json @@ -1,5 +1,8 @@ { "exported" : { + "aliases" : [ + + ], "classes" : [ ], diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/CrossFileExtension.json b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/CrossFileExtension.json index 4c8d575b0..bfa71444c 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/CrossFileExtension.json +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/CrossFileExtension.json @@ -1,5 +1,8 @@ { "exported" : { + "aliases" : [ + + ], "classes" : [ { "constructor" : { diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/CrossFileFunctionTypes.ReverseOrder.json b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/CrossFileFunctionTypes.ReverseOrder.json index 6c589de87..053757256 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/CrossFileFunctionTypes.ReverseOrder.json +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/CrossFileFunctionTypes.ReverseOrder.json @@ -1,5 +1,8 @@ { "exported" : { + "aliases" : [ + + ], "classes" : [ { "constructor" : { diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/CrossFileFunctionTypes.json b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/CrossFileFunctionTypes.json index 9bec040f1..41aa858ac 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/CrossFileFunctionTypes.json +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/CrossFileFunctionTypes.json @@ -1,5 +1,8 @@ { "exported" : { + "aliases" : [ + + ], "classes" : [ { "constructor" : { diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/CrossFileTypeResolution.ReverseOrder.json b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/CrossFileTypeResolution.ReverseOrder.json index edf8177c1..49d656dcd 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/CrossFileTypeResolution.ReverseOrder.json +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/CrossFileTypeResolution.ReverseOrder.json @@ -1,5 +1,8 @@ { "exported" : { + "aliases" : [ + + ], "classes" : [ { "methods" : [ diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/CrossFileTypeResolution.json b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/CrossFileTypeResolution.json index 58bfadab7..377e875bd 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/CrossFileTypeResolution.json +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/CrossFileTypeResolution.json @@ -1,5 +1,8 @@ { "exported" : { + "aliases" : [ + + ], "classes" : [ { "constructor" : { diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/DefaultParameters.json b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/DefaultParameters.json index e7874c072..40e3672b7 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/DefaultParameters.json +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/DefaultParameters.json @@ -1,5 +1,8 @@ { "exported" : { + "aliases" : [ + + ], "classes" : [ { "constructor" : { diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/DictionaryTypes.json b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/DictionaryTypes.json index b1185c644..6830240eb 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/DictionaryTypes.json +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/DictionaryTypes.json @@ -1,5 +1,8 @@ { "exported" : { + "aliases" : [ + + ], "classes" : [ { "methods" : [ diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/EnumAlias.json b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/EnumAlias.json new file mode 100644 index 000000000..0d63db899 --- /dev/null +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/EnumAlias.json @@ -0,0 +1,96 @@ +{ + "exported" : { + "aliases" : [ + { + "swiftCallName" : "Color", + "underlying" : { + "swiftHeapObject" : { + "_0" : "ColorBox" + } + } + } + ], + "classes" : [ + { + "constructor" : { + "abiName" : "bjs_ColorBox_init", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "parameters" : [ + { + "label" : "name", + "name" : "name", + "type" : { + "string" : { + + } + } + } + ] + }, + "methods" : [ + + ], + "name" : "ColorBox", + "properties" : [ + + ], + "swiftCallName" : "ColorBox" + } + ], + "enums" : [ + + ], + "exposeToGlobal" : false, + "functions" : [ + { + "abiName" : "bjs_roundtripColor", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "name" : "roundtripColor", + "parameters" : [ + { + "label" : "_", + "name" : "color", + "type" : { + "alias" : { + "name" : "Color", + "underlying" : { + "swiftHeapObject" : { + "_0" : "ColorBox" + } + } + } + } + } + ], + "returnType" : { + "alias" : { + "name" : "Color", + "underlying" : { + "swiftHeapObject" : { + "_0" : "ColorBox" + } + } + } + } + } + ], + "protocols" : [ + + ], + "structs" : [ + + ] + }, + "moduleName" : "TestModule", + "usedExternalModules" : [ + + ] +} \ No newline at end of file diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/EnumAlias.swift b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/EnumAlias.swift new file mode 100644 index 000000000..615110c90 --- /dev/null +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/EnumAlias.swift @@ -0,0 +1,52 @@ +@_expose(wasm, "bjs_roundtripColor") +@_cdecl("bjs_roundtripColor") +public func _bjs_roundtripColor(_ color: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { + #if arch(wasm32) + let ret = roundtripColor(_: Color.bridgeFromJS(ColorBox.bridgeJSLiftParameter(color))) + return ret.bridgeToJS().bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_ColorBox_init") +@_cdecl("bjs_ColorBox_init") +public func _bjs_ColorBox_init(_ nameBytes: Int32, _ nameLength: Int32) -> UnsafeMutableRawPointer { + #if arch(wasm32) + let ret = ColorBox(name: String.bridgeJSLiftParameter(nameBytes, nameLength)) + return ret.bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_ColorBox_deinit") +@_cdecl("bjs_ColorBox_deinit") +public func _bjs_ColorBox_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) + Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif +} + +extension ColorBox: ConvertibleToJSValue, _BridgedSwiftHeapObject, _BridgedSwiftProtocolExportable { + var jsValue: JSValue { + return .object(JSObject(id: UInt32(bitPattern: _bjs_ColorBox_wrap(Unmanaged.passRetained(self).toOpaque())))) + } + consuming func bridgeJSLowerAsProtocolReturn() -> Int32 { + _bjs_ColorBox_wrap(Unmanaged.passRetained(self).toOpaque()) + } +} + +#if arch(wasm32) +@_extern(wasm, module: "TestModule", name: "bjs_ColorBox_wrap") +fileprivate func _bjs_ColorBox_wrap_extern(_ pointer: UnsafeMutableRawPointer) -> Int32 +#else +fileprivate func _bjs_ColorBox_wrap_extern(_ pointer: UnsafeMutableRawPointer) -> Int32 { + fatalError("Only available on WebAssembly") +} +#endif +@inline(never) fileprivate func _bjs_ColorBox_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { + return _bjs_ColorBox_wrap_extern(pointer) +} \ No newline at end of file diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/EnumAssociatedValue.json b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/EnumAssociatedValue.json index 873c5c49f..39b9d7211 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/EnumAssociatedValue.json +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/EnumAssociatedValue.json @@ -1,5 +1,8 @@ { "exported" : { + "aliases" : [ + + ], "classes" : [ { "methods" : [ diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/EnumCase.json b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/EnumCase.json index c4095b502..8fbb08f28 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/EnumCase.json +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/EnumCase.json @@ -1,5 +1,8 @@ { "exported" : { + "aliases" : [ + + ], "classes" : [ ], diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/EnumNamespace.Global.json b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/EnumNamespace.Global.json index 103a67999..be74590c6 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/EnumNamespace.Global.json +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/EnumNamespace.Global.json @@ -1,5 +1,8 @@ { "exported" : { + "aliases" : [ + + ], "classes" : [ { "constructor" : { diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/EnumNamespace.json b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/EnumNamespace.json index f9890d36b..175c4fa03 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/EnumNamespace.json +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/EnumNamespace.json @@ -1,5 +1,8 @@ { "exported" : { + "aliases" : [ + + ], "classes" : [ { "constructor" : { diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/EnumRawType.json b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/EnumRawType.json index 1cf99cd39..2adb178a3 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/EnumRawType.json +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/EnumRawType.json @@ -1,5 +1,8 @@ { "exported" : { + "aliases" : [ + + ], "classes" : [ ], diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/FixedWidthIntegers.json b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/FixedWidthIntegers.json index 1186ad27d..0844c7475 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/FixedWidthIntegers.json +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/FixedWidthIntegers.json @@ -1,5 +1,8 @@ { "exported" : { + "aliases" : [ + + ], "classes" : [ ], diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/IdentityModeClass.json b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/IdentityModeClass.json index f4a4440c6..bca32c30d 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/IdentityModeClass.json +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/IdentityModeClass.json @@ -1,5 +1,8 @@ { "exported" : { + "aliases" : [ + + ], "classes" : [ { "constructor" : { diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/ImportedTypeInExportedInterface.json b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/ImportedTypeInExportedInterface.json index 600ae8c89..e4d10d07b 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/ImportedTypeInExportedInterface.json +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/ImportedTypeInExportedInterface.json @@ -1,5 +1,8 @@ { "exported" : { + "aliases" : [ + + ], "classes" : [ ], diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/JSTypedArrayTypes.json b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/JSTypedArrayTypes.json index a7b9c8623..5d4425096 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/JSTypedArrayTypes.json +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/JSTypedArrayTypes.json @@ -1,5 +1,8 @@ { "exported" : { + "aliases" : [ + + ], "classes" : [ ], diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/JSValue.json b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/JSValue.json index f0cd29565..eba5d34fb 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/JSValue.json +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/JSValue.json @@ -1,5 +1,8 @@ { "exported" : { + "aliases" : [ + + ], "classes" : [ { "constructor" : { diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/MixedGlobal.json b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/MixedGlobal.json index 0d30063ee..05279a762 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/MixedGlobal.json +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/MixedGlobal.json @@ -1,5 +1,8 @@ { "exported" : { + "aliases" : [ + + ], "classes" : [ { "constructor" : { diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/MixedPrivate.json b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/MixedPrivate.json index e6bcf2e5c..0f46b4ddb 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/MixedPrivate.json +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/MixedPrivate.json @@ -1,5 +1,8 @@ { "exported" : { + "aliases" : [ + + ], "classes" : [ { "constructor" : { diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/Namespaces.Global.json b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/Namespaces.Global.json index 4b6b720f1..d84434693 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/Namespaces.Global.json +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/Namespaces.Global.json @@ -1,5 +1,8 @@ { "exported" : { + "aliases" : [ + + ], "classes" : [ { "constructor" : { diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/Namespaces.json b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/Namespaces.json index 3c07b7dcf..16e0b93bc 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/Namespaces.json +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/Namespaces.json @@ -1,5 +1,8 @@ { "exported" : { + "aliases" : [ + + ], "classes" : [ { "constructor" : { diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/NestedType.json b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/NestedType.json index f924b3eba..c741304a7 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/NestedType.json +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/NestedType.json @@ -1,5 +1,8 @@ { "exported" : { + "aliases" : [ + + ], "classes" : [ { "methods" : [ diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/Optionals.json b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/Optionals.json index 91291c24e..db3bf85e1 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/Optionals.json +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/Optionals.json @@ -1,5 +1,8 @@ { "exported" : { + "aliases" : [ + + ], "classes" : [ { "constructor" : { diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/PrimitiveParameters.json b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/PrimitiveParameters.json index 320499ff3..8b7ee7338 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/PrimitiveParameters.json +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/PrimitiveParameters.json @@ -1,5 +1,8 @@ { "exported" : { + "aliases" : [ + + ], "classes" : [ ], diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/PrimitiveReturn.json b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/PrimitiveReturn.json index 414fedbbd..a2b08f4c6 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/PrimitiveReturn.json +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/PrimitiveReturn.json @@ -1,5 +1,8 @@ { "exported" : { + "aliases" : [ + + ], "classes" : [ ], diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/PropertyTypes.json b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/PropertyTypes.json index 281538dd6..8e6496336 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/PropertyTypes.json +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/PropertyTypes.json @@ -1,5 +1,8 @@ { "exported" : { + "aliases" : [ + + ], "classes" : [ { "constructor" : { diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/Protocol.json b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/Protocol.json index feca4615b..bc443c6c0 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/Protocol.json +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/Protocol.json @@ -1,5 +1,8 @@ { "exported" : { + "aliases" : [ + + ], "classes" : [ { "constructor" : { diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/ProtocolInClosure.json b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/ProtocolInClosure.json index 70273f8b3..56f8e26e0 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/ProtocolInClosure.json +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/ProtocolInClosure.json @@ -1,5 +1,8 @@ { "exported" : { + "aliases" : [ + + ], "classes" : [ { "constructor" : { diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/StaticFunctions.Global.json b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/StaticFunctions.Global.json index 800018440..c023fd8ab 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/StaticFunctions.Global.json +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/StaticFunctions.Global.json @@ -1,5 +1,8 @@ { "exported" : { + "aliases" : [ + + ], "classes" : [ { "constructor" : { diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/StaticFunctions.json b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/StaticFunctions.json index 36110488c..c80a6bb3e 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/StaticFunctions.json +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/StaticFunctions.json @@ -1,5 +1,8 @@ { "exported" : { + "aliases" : [ + + ], "classes" : [ { "constructor" : { diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/StaticProperties.Global.json b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/StaticProperties.Global.json index 1cbe44619..7935c2aa1 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/StaticProperties.Global.json +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/StaticProperties.Global.json @@ -1,5 +1,8 @@ { "exported" : { + "aliases" : [ + + ], "classes" : [ { "constructor" : { diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/StaticProperties.json b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/StaticProperties.json index 8fc0667b0..35a94cddd 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/StaticProperties.json +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/StaticProperties.json @@ -1,5 +1,8 @@ { "exported" : { + "aliases" : [ + + ], "classes" : [ { "constructor" : { diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/StringParameter.json b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/StringParameter.json index d9dc0ec43..68b13c0b0 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/StringParameter.json +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/StringParameter.json @@ -1,5 +1,8 @@ { "exported" : { + "aliases" : [ + + ], "classes" : [ ], diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/StringReturn.json b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/StringReturn.json index e2cf9ffac..f1e2ccbfd 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/StringReturn.json +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/StringReturn.json @@ -1,5 +1,8 @@ { "exported" : { + "aliases" : [ + + ], "classes" : [ ], diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/SwiftClass.json b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/SwiftClass.json index a3ddab63e..e1bb767c1 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/SwiftClass.json +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/SwiftClass.json @@ -1,5 +1,8 @@ { "exported" : { + "aliases" : [ + + ], "classes" : [ { "constructor" : { diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/SwiftClosure.json b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/SwiftClosure.json index ac18f6dc2..57295d499 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/SwiftClosure.json +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/SwiftClosure.json @@ -1,5 +1,8 @@ { "exported" : { + "aliases" : [ + + ], "classes" : [ { "constructor" : { diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/SwiftStruct.json b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/SwiftStruct.json index bfde01318..d1a4b6882 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/SwiftStruct.json +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/SwiftStruct.json @@ -1,5 +1,8 @@ { "exported" : { + "aliases" : [ + + ], "classes" : [ { "constructor" : { diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/SwiftStructImports.json b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/SwiftStructImports.json index fc59471bb..d67fe1d67 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/SwiftStructImports.json +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/SwiftStructImports.json @@ -1,5 +1,8 @@ { "exported" : { + "aliases" : [ + + ], "classes" : [ ], diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/Throws.json b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/Throws.json index 942e5fb45..0e45eefca 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/Throws.json +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/Throws.json @@ -1,5 +1,8 @@ { "exported" : { + "aliases" : [ + + ], "classes" : [ ], diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/UnsafePointer.json b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/UnsafePointer.json index a382778e9..1b1a1088b 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/UnsafePointer.json +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/UnsafePointer.json @@ -1,5 +1,8 @@ { "exported" : { + "aliases" : [ + + ], "classes" : [ ], diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/VoidParameterVoidReturn.json b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/VoidParameterVoidReturn.json index d31f775fb..4fef14d6a 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/VoidParameterVoidReturn.json +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/VoidParameterVoidReturn.json @@ -1,5 +1,8 @@ { "exported" : { + "aliases" : [ + + ], "classes" : [ ], diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Alias.d.ts b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Alias.d.ts new file mode 100644 index 000000000..3ee338254 --- /dev/null +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Alias.d.ts @@ -0,0 +1,71 @@ +// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit, +// DO NOT EDIT. +// +// To update this file, just rebuild your project or run +// `swift package bridge-js`. + +export interface HasOptionalUserId { + readonly userId: number | null; +} + +export const InnerTagValues: { + readonly Tag: { + readonly Payload: 0; + readonly Empty: 1; + }; +}; + +export type InnerTagTag = + { tag: typeof InnerTagValues.Tag.Payload; param0: number } | { tag: typeof InnerTagValues.Tag.Empty } + +export type InnerTagObject = typeof InnerTagValues; + +/// Represents a Swift heap object like a class instance or an actor instance. +export interface SwiftHeapObject { + /// Release the heap object. + /// + /// Note: Calling this method will release the heap object and it will no longer be accessible. + release(): void; +} +export interface PolygonReference extends SwiftHeapObject { + snapshot(): PolygonReference; + merge(other: PolygonReference): PolygonReference; +} +export interface TagReference extends SwiftHeapObject { +} +export interface Surface { + readonly label: string; +} +export type Exports = { + PolygonReference: { + new(underlying: PolygonReference): PolygonReference; + origin(): PolygonReference; + } + TagReference: { + new(underlying: TagReference): TagReference; + } + roundtripPolygon(polygon: PolygonReference): PolygonReference; + optionalPolygon(polygon: PolygonReference | null): PolygonReference | null; + polygonArray(polygons: PolygonReference[]): PolygonReference[]; + validatePolygon(polygon: PolygonReference): PolygonReference; + makeTag(name: string): TagReference; + roundtripTags(xs: (InnerTagTag | null)[]): (InnerTagTag | null)[]; + describeUser(owner: HasOptionalUserId): HasOptionalUserId; + InnerTag: InnerTagObject +} +export type Imports = { + acceptTagged(tagged: string): void; + acceptOptionalTagged(tagged: string | null): void; + roundtripTagged(tagged: string): string; + produceOptionalCanvas(): Surface | null; + Surface: { + new(): Surface; + } +} +export function createInstantiator(options: { + imports: Imports; +}, swift: any): Promise<{ + addImports: (importObject: WebAssembly.Imports) => void; + setInstance: (instance: WebAssembly.Instance) => void; + createExports: (instance: WebAssembly.Instance) => Exports; +}>; \ No newline at end of file diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Alias.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Alias.js new file mode 100644 index 000000000..c55e429d5 --- /dev/null +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Alias.js @@ -0,0 +1,517 @@ +// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit, +// DO NOT EDIT. +// +// To update this file, just rebuild your project or run +// `swift package bridge-js`. + +export const InnerTagValues = { + Tag: { + Payload: 0, + Empty: 1, + }, +}; +export async function createInstantiator(options, swift) { + let instance; + let memory; + let setException; + let decodeString; + const textDecoder = new TextDecoder("utf-8"); + const textEncoder = new TextEncoder("utf-8"); + let tmpRetString; + let tmpRetBytes; + let tmpRetException; + let tmpRetOptionalBool; + let tmpRetOptionalInt; + let tmpRetOptionalFloat; + let tmpRetOptionalDouble; + let tmpRetOptionalHeapObject; + let strStack = []; + let i32Stack = []; + let i64Stack = []; + let f32Stack = []; + let f64Stack = []; + let ptrStack = []; + let taStack = []; + const enumHelpers = {}; + const structHelpers = {}; + + let _exports = null; + let bjs = null; + const __bjs_createInnerTagValuesHelpers = () => ({ + lower: (value) => { + const enumTag = value.tag; + switch (enumTag) { + case InnerTagValues.Tag.Payload: { + i32Stack.push((value.param0 | 0)); + return InnerTagValues.Tag.Payload; + } + case InnerTagValues.Tag.Empty: { + return InnerTagValues.Tag.Empty; + } + default: throw new Error("Unknown InnerTagValues tag: " + String(enumTag)); + } + }, + lift: (tag) => { + tag = tag | 0; + switch (tag) { + case InnerTagValues.Tag.Payload: { + const int = i32Stack.pop(); + return { tag: InnerTagValues.Tag.Payload, param0: int }; + } + case InnerTagValues.Tag.Empty: return { tag: InnerTagValues.Tag.Empty }; + default: throw new Error("Unknown InnerTagValues tag returned from Swift: " + String(tag)); + } + } + }); + + return { + /** + * @param {WebAssembly.Imports} importObject + */ + addImports: (importObject, importsContext) => { + bjs = {}; + importObject["bjs"] = bjs; + const imports = options.getImports(importsContext); + bjs["swift_js_return_string"] = function(ptr, len) { + tmpRetString = decodeString(ptr, len); + } + bjs["swift_js_init_memory"] = function(sourceId, bytesPtr) { + const source = swift.memory.getObject(sourceId); + swift.memory.release(sourceId); + const bytes = new Uint8Array(memory.buffer, bytesPtr); + bytes.set(source); + } + bjs["swift_js_make_js_string"] = function(ptr, len) { + return swift.memory.retain(decodeString(ptr, len)); + } + bjs["swift_js_init_memory_with_result"] = function(ptr, len) { + const target = new Uint8Array(memory.buffer, ptr, len); + target.set(tmpRetBytes); + tmpRetBytes = undefined; + } + bjs["swift_js_throw"] = function(id) { + tmpRetException = swift.memory.retainByRef(id); + } + bjs["swift_js_retain"] = function(id) { + return swift.memory.retainByRef(id); + } + bjs["swift_js_release"] = function(id) { + swift.memory.release(id); + } + bjs["swift_js_push_i32"] = function(v) { + i32Stack.push(v | 0); + } + bjs["swift_js_push_f32"] = function(v) { + f32Stack.push(Math.fround(v)); + } + bjs["swift_js_push_f64"] = function(v) { + f64Stack.push(v); + } + bjs["swift_js_push_string"] = function(ptr, len) { + const value = decodeString(ptr, len); + strStack.push(value); + } + bjs["swift_js_pop_i32"] = function() { + return i32Stack.pop(); + } + bjs["swift_js_pop_f32"] = function() { + return f32Stack.pop(); + } + bjs["swift_js_pop_f64"] = function() { + return f64Stack.pop(); + } + bjs["swift_js_push_pointer"] = function(pointer) { + ptrStack.push(pointer); + } + bjs["swift_js_pop_pointer"] = function() { + return ptrStack.pop(); + } + bjs["swift_js_push_i64"] = function(v) { + i64Stack.push(v); + } + bjs["swift_js_pop_i64"] = function() { + return i64Stack.pop(); + } + const taCtors = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array]; + bjs["swift_js_push_typed_array"] = function(kind, ptr, count) { + const Ctor = taCtors[kind]; + const byteLen = count * Ctor.BYTES_PER_ELEMENT; + const copy = memory.buffer.slice(ptr, ptr + byteLen); + taStack.push(Array.from(new Ctor(copy))); + } + bjs["swift_js_return_optional_bool"] = function(isSome, value) { + if (isSome === 0) { + tmpRetOptionalBool = null; + } else { + tmpRetOptionalBool = value !== 0; + } + } + bjs["swift_js_return_optional_int"] = function(isSome, value) { + if (isSome === 0) { + tmpRetOptionalInt = null; + } else { + tmpRetOptionalInt = value | 0; + } + } + bjs["swift_js_return_optional_float"] = function(isSome, value) { + if (isSome === 0) { + tmpRetOptionalFloat = null; + } else { + tmpRetOptionalFloat = Math.fround(value); + } + } + bjs["swift_js_return_optional_double"] = function(isSome, value) { + if (isSome === 0) { + tmpRetOptionalDouble = null; + } else { + tmpRetOptionalDouble = value; + } + } + bjs["swift_js_return_optional_string"] = function(isSome, ptr, len) { + if (isSome === 0) { + tmpRetString = null; + } else { + tmpRetString = decodeString(ptr, len); + } + } + bjs["swift_js_return_optional_object"] = function(isSome, objectId) { + if (isSome === 0) { + tmpRetString = null; + } else { + tmpRetString = swift.memory.getObject(objectId); + } + } + bjs["swift_js_return_optional_heap_object"] = function(isSome, pointer) { + if (isSome === 0) { + tmpRetOptionalHeapObject = null; + } else { + tmpRetOptionalHeapObject = pointer; + } + } + bjs["swift_js_get_optional_int_presence"] = function() { + return tmpRetOptionalInt != null ? 1 : 0; + } + bjs["swift_js_get_optional_int_value"] = function() { + const value = tmpRetOptionalInt; + tmpRetOptionalInt = undefined; + return value; + } + bjs["swift_js_get_optional_string"] = function() { + const str = tmpRetString; + tmpRetString = undefined; + if (str == null) { + return -1; + } else { + const bytes = textEncoder.encode(str); + tmpRetBytes = bytes; + return bytes.length; + } + } + bjs["swift_js_get_optional_float_presence"] = function() { + return tmpRetOptionalFloat != null ? 1 : 0; + } + bjs["swift_js_get_optional_float_value"] = function() { + const value = tmpRetOptionalFloat; + tmpRetOptionalFloat = undefined; + return value; + } + bjs["swift_js_get_optional_double_presence"] = function() { + return tmpRetOptionalDouble != null ? 1 : 0; + } + bjs["swift_js_get_optional_double_value"] = function() { + const value = tmpRetOptionalDouble; + tmpRetOptionalDouble = undefined; + return value; + } + bjs["swift_js_get_optional_heap_object_pointer"] = function() { + const pointer = tmpRetOptionalHeapObject; + tmpRetOptionalHeapObject = undefined; + return pointer || 0; + } + bjs["swift_js_closure_unregister"] = function(funcRef) {} + // Wrapper functions for module: TestModule + if (!importObject["TestModule"]) { + importObject["TestModule"] = {}; + } + importObject["TestModule"]["bjs_PolygonReference_wrap"] = function(pointer) { + const obj = _exports['PolygonReference'].__construct(pointer); + return swift.memory.retain(obj); + }; + importObject["TestModule"]["bjs_TagReference_wrap"] = function(pointer) { + const obj = _exports['TagReference'].__construct(pointer); + return swift.memory.retain(obj); + }; + const TestModule = importObject["TestModule"] = importObject["TestModule"] || {}; + TestModule["bjs_acceptTagged"] = function bjs_acceptTagged(taggedBytes, taggedCount) { + try { + const string = decodeString(taggedBytes, taggedCount); + imports.acceptTagged(string); + } catch (error) { + setException(error); + } + } + TestModule["bjs_acceptOptionalTagged"] = function bjs_acceptOptionalTagged(taggedIsSome, taggedBytes, taggedCount) { + try { + let optResult; + if (taggedIsSome) { + const string = decodeString(taggedBytes, taggedCount); + optResult = string; + } else { + optResult = null; + } + imports.acceptOptionalTagged(optResult); + } catch (error) { + setException(error); + } + } + TestModule["bjs_roundtripTagged"] = function bjs_roundtripTagged(taggedBytes, taggedCount) { + try { + const string = decodeString(taggedBytes, taggedCount); + let ret = imports.roundtripTagged(string); + tmpRetBytes = textEncoder.encode(ret); + return tmpRetBytes.length; + } catch (error) { + setException(error); + } + } + TestModule["bjs_produceOptionalCanvas"] = function bjs_produceOptionalCanvas() { + try { + let ret = imports.produceOptionalCanvas(); + const isSome = ret != null; + if (isSome) { + const objId = swift.memory.retain(ret); + i32Stack.push(objId); + } + i32Stack.push(isSome ? 1 : 0); + } catch (error) { + setException(error); + } + } + TestModule["bjs_Surface_init"] = function bjs_Surface_init() { + try { + return swift.memory.retain(new imports.Surface()); + } catch (error) { + setException(error); + return 0 + } + } + TestModule["bjs_Surface_label_get"] = function bjs_Surface_label_get(self) { + try { + let ret = swift.memory.getObject(self).label; + tmpRetBytes = textEncoder.encode(ret); + return tmpRetBytes.length; + } catch (error) { + setException(error); + } + } + TestModule["bjs_HasOptionalUserId_userId_get"] = function bjs_HasOptionalUserId_userId_get(self) { + try { + let ret = swift.memory.getObject(self).userId; + tmpRetOptionalInt = ret; + } catch (error) { + setException(error); + } + } + }, + setInstance: (i) => { + instance = i; + memory = instance.exports.memory; + + decodeString = (ptr, len) => { const bytes = new Uint8Array(memory.buffer, ptr >>> 0, len >>> 0); return textDecoder.decode(bytes); } + + setException = (error) => { + instance.exports._swift_js_exception.value = swift.memory.retain(error) + } + }, + /** @param {WebAssembly.Instance} instance */ + createExports: (instance) => { + const js = swift.memory.heap; + const swiftHeapObjectFinalizationRegistry = (typeof FinalizationRegistry === "undefined") ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry((state) => { + if (state.hasReleased) { + return; + } + state.hasReleased = true; + state.identityMap?.delete(state.pointer); + state.deinit(state.pointer); + }); + + /// Represents a Swift heap object like a class instance or an actor instance. + class SwiftHeapObject { + static __wrap(pointer, deinit, prototype, identityCache) { + const makeFresh = (identityMap) => { + const obj = Object.create(prototype); + const state = { pointer, deinit, hasReleased: false, identityMap }; + obj.pointer = pointer; + obj.__swiftHeapObjectState = state; + swiftHeapObjectFinalizationRegistry.register(obj, state, state); + if (identityMap) { + identityMap.set(pointer, new WeakRef(obj)); + } + return obj; + }; + + if (!identityCache) { + return makeFresh(null); + } + + const cached = identityCache.get(pointer)?.deref(); + if (cached && !cached.__swiftHeapObjectState.hasReleased) { + deinit(pointer); + return cached; + } + if (identityCache.has(pointer)) { + identityCache.delete(pointer); + } + + return makeFresh(identityCache); + } + + release() { + const state = this.__swiftHeapObjectState; + if (state.hasReleased) { + return; + } + state.hasReleased = true; + swiftHeapObjectFinalizationRegistry.unregister(state); + state.identityMap?.delete(state.pointer); + state.deinit(state.pointer); + } + } + class PolygonReference extends SwiftHeapObject { + static __construct(ptr) { + return SwiftHeapObject.__wrap(ptr, instance.exports.bjs_PolygonReference_deinit, PolygonReference.prototype, null); + } + + constructor(underlying) { + const ret = instance.exports.bjs_PolygonReference_init(underlying.pointer); + return PolygonReference.__construct(ret); + } + snapshot() { + const ret = instance.exports.bjs_PolygonReference_snapshot(this.pointer); + return PolygonReference.__construct(ret); + } + merge(other) { + const ret = instance.exports.bjs_PolygonReference_merge(this.pointer, other.pointer); + return PolygonReference.__construct(ret); + } + static origin() { + const ret = instance.exports.bjs_PolygonReference_static_origin(); + return PolygonReference.__construct(ret); + } + } + class TagReference extends SwiftHeapObject { + static __construct(ptr) { + return SwiftHeapObject.__wrap(ptr, instance.exports.bjs_TagReference_deinit, TagReference.prototype, null); + } + + constructor(underlying) { + const ret = instance.exports.bjs_TagReference_init(underlying.pointer); + return TagReference.__construct(ret); + } + } + const InnerTagHelpers = __bjs_createInnerTagValuesHelpers(); + enumHelpers.InnerTag = InnerTagHelpers; + + const exports = { + PolygonReference, + TagReference, + roundtripPolygon: function bjs_roundtripPolygon(polygon) { + const ret = instance.exports.bjs_roundtripPolygon(polygon.pointer); + return PolygonReference.__construct(ret); + }, + optionalPolygon: function bjs_optionalPolygon(polygon) { + const isSome = polygon != null; + let result; + if (isSome) { + result = polygon.pointer; + } else { + result = 0; + } + instance.exports.bjs_optionalPolygon(+isSome, result); + const pointer = tmpRetOptionalHeapObject; + tmpRetOptionalHeapObject = undefined; + const optResult = pointer === null ? null : PolygonReference.__construct(pointer); + return optResult; + }, + polygonArray: function bjs_polygonArray(polygons) { + for (const elem of polygons) { + ptrStack.push(elem.pointer); + } + i32Stack.push(polygons.length); + instance.exports.bjs_polygonArray(); + const arrayLen = i32Stack.pop(); + let arrayResult; + if (arrayLen === -1) { + arrayResult = taStack.pop(); + } else { + arrayResult = []; + for (let i = 0; i < arrayLen; i++) { + const ptr = ptrStack.pop(); + const obj = PolygonReference.__construct(ptr); + arrayResult.push(obj); + } + arrayResult.reverse(); + } + return arrayResult; + }, + validatePolygon: function bjs_validatePolygon(polygon) { + const ret = instance.exports.bjs_validatePolygon(polygon.pointer); + if (tmpRetException) { + const error = swift.memory.getObject(tmpRetException); + swift.memory.release(tmpRetException); + tmpRetException = undefined; + throw error; + } + return PolygonReference.__construct(ret); + }, + makeTag: function bjs_makeTag(name) { + const nameBytes = textEncoder.encode(name); + const nameId = swift.memory.retain(nameBytes); + const ret = instance.exports.bjs_makeTag(nameId, nameBytes.length); + return TagReference.__construct(ret); + }, + roundtripTags: function bjs_roundtripTags(xs) { + for (const elem of xs) { + const isSome = elem != null ? 1 : 0; + if (isSome) { + const caseId = enumHelpers.InnerTag.lower(elem); + i32Stack.push(caseId); + } else { + i32Stack.push(-1); + } + } + i32Stack.push(xs.length); + instance.exports.bjs_roundtripTags(); + const arrayLen = i32Stack.pop(); + let arrayResult; + if (arrayLen === -1) { + arrayResult = taStack.pop(); + } else { + arrayResult = []; + for (let i = 0; i < arrayLen; i++) { + const caseId1 = i32Stack.pop(); + let optValue; + if (caseId1 === -1) { + optValue = null; + } else { + optValue = enumHelpers.InnerTag.lift(caseId1); + } + arrayResult.push(optValue); + } + arrayResult.reverse(); + } + return arrayResult; + }, + describeUser: function bjs_describeUser(owner) { + const ret = instance.exports.bjs_describeUser(swift.memory.retain(owner)); + const ret1 = swift.memory.getObject(ret); + swift.memory.release(ret); + return ret1; + }, + InnerTag: InnerTagValues, + }; + _exports = exports; + return exports; + }, + } +} \ No newline at end of file diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/AliasInClosure.d.ts b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/AliasInClosure.d.ts new file mode 100644 index 000000000..f1d5d5fa9 --- /dev/null +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/AliasInClosure.d.ts @@ -0,0 +1,31 @@ +// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit, +// DO NOT EDIT. +// +// To update this file, just rebuild your project or run +// `swift package bridge-js`. + +/// Represents a Swift heap object like a class instance or an actor instance. +export interface SwiftHeapObject { + /// Release the heap object. + /// + /// Note: Calling this method will release the heap object and it will no longer be accessible. + release(): void; +} +export interface PolygonReference extends SwiftHeapObject { +} +export type Exports = { + PolygonReference: { + new(sides: number): PolygonReference; + } + makePolygonFactory(): () => PolygonReference; + makePolygonInspector(): (arg0: PolygonReference) => number; +} +export type Imports = { +} +export function createInstantiator(options: { + imports: Imports; +}, swift: any): Promise<{ + addImports: (importObject: WebAssembly.Imports) => void; + setInstance: (instance: WebAssembly.Instance) => void; + createExports: (instance: WebAssembly.Instance) => Exports; +}>; \ No newline at end of file diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/AliasInClosure.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/AliasInClosure.js new file mode 100644 index 000000000..21c96aed6 --- /dev/null +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/AliasInClosure.js @@ -0,0 +1,372 @@ +// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit, +// DO NOT EDIT. +// +// To update this file, just rebuild your project or run +// `swift package bridge-js`. + +export async function createInstantiator(options, swift) { + let instance; + let memory; + let setException; + let decodeString; + const textDecoder = new TextDecoder("utf-8"); + const textEncoder = new TextEncoder("utf-8"); + let tmpRetString; + let tmpRetBytes; + let tmpRetException; + let tmpRetOptionalBool; + let tmpRetOptionalInt; + let tmpRetOptionalFloat; + let tmpRetOptionalDouble; + let tmpRetOptionalHeapObject; + let strStack = []; + let i32Stack = []; + let i64Stack = []; + let f32Stack = []; + let f64Stack = []; + let ptrStack = []; + let taStack = []; + const enumHelpers = {}; + const structHelpers = {}; + + let _exports = null; + let bjs = null; + const swiftClosureRegistry = (typeof FinalizationRegistry === "undefined") ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry((state) => { + if (state.unregistered) { return; } + instance?.exports?.bjs_release_swift_closure(state.pointer); + }); + const makeClosure = (pointer, file, line, func) => { + const state = { pointer, file, line, unregistered: false }; + const real = (...args) => { + if (state.unregistered) { + const bytes = new Uint8Array(memory.buffer, state.file); + let length = 0; + while (bytes[length] !== 0) { length += 1; } + const fileID = decodeString(state.file, length); + throw new Error(`Attempted to call a released JSTypedClosure created at ${fileID}:${state.line}`); + } + return func(...args); + }; + real.__unregister = () => { + if (state.unregistered) { return; } + state.unregistered = true; + swiftClosureRegistry.unregister(state); + }; + swiftClosureRegistry.register(real, state, state); + return swift.memory.retain(real); + }; + + + return { + /** + * @param {WebAssembly.Imports} importObject + */ + addImports: (importObject, importsContext) => { + bjs = {}; + importObject["bjs"] = bjs; + bjs["swift_js_return_string"] = function(ptr, len) { + tmpRetString = decodeString(ptr, len); + } + bjs["swift_js_init_memory"] = function(sourceId, bytesPtr) { + const source = swift.memory.getObject(sourceId); + swift.memory.release(sourceId); + const bytes = new Uint8Array(memory.buffer, bytesPtr); + bytes.set(source); + } + bjs["swift_js_make_js_string"] = function(ptr, len) { + return swift.memory.retain(decodeString(ptr, len)); + } + bjs["swift_js_init_memory_with_result"] = function(ptr, len) { + const target = new Uint8Array(memory.buffer, ptr, len); + target.set(tmpRetBytes); + tmpRetBytes = undefined; + } + bjs["swift_js_throw"] = function(id) { + tmpRetException = swift.memory.retainByRef(id); + } + bjs["swift_js_retain"] = function(id) { + return swift.memory.retainByRef(id); + } + bjs["swift_js_release"] = function(id) { + swift.memory.release(id); + } + bjs["swift_js_push_i32"] = function(v) { + i32Stack.push(v | 0); + } + bjs["swift_js_push_f32"] = function(v) { + f32Stack.push(Math.fround(v)); + } + bjs["swift_js_push_f64"] = function(v) { + f64Stack.push(v); + } + bjs["swift_js_push_string"] = function(ptr, len) { + const value = decodeString(ptr, len); + strStack.push(value); + } + bjs["swift_js_pop_i32"] = function() { + return i32Stack.pop(); + } + bjs["swift_js_pop_f32"] = function() { + return f32Stack.pop(); + } + bjs["swift_js_pop_f64"] = function() { + return f64Stack.pop(); + } + bjs["swift_js_push_pointer"] = function(pointer) { + ptrStack.push(pointer); + } + bjs["swift_js_pop_pointer"] = function() { + return ptrStack.pop(); + } + bjs["swift_js_push_i64"] = function(v) { + i64Stack.push(v); + } + bjs["swift_js_pop_i64"] = function() { + return i64Stack.pop(); + } + const taCtors = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array]; + bjs["swift_js_push_typed_array"] = function(kind, ptr, count) { + const Ctor = taCtors[kind]; + const byteLen = count * Ctor.BYTES_PER_ELEMENT; + const copy = memory.buffer.slice(ptr, ptr + byteLen); + taStack.push(Array.from(new Ctor(copy))); + } + bjs["swift_js_return_optional_bool"] = function(isSome, value) { + if (isSome === 0) { + tmpRetOptionalBool = null; + } else { + tmpRetOptionalBool = value !== 0; + } + } + bjs["swift_js_return_optional_int"] = function(isSome, value) { + if (isSome === 0) { + tmpRetOptionalInt = null; + } else { + tmpRetOptionalInt = value | 0; + } + } + bjs["swift_js_return_optional_float"] = function(isSome, value) { + if (isSome === 0) { + tmpRetOptionalFloat = null; + } else { + tmpRetOptionalFloat = Math.fround(value); + } + } + bjs["swift_js_return_optional_double"] = function(isSome, value) { + if (isSome === 0) { + tmpRetOptionalDouble = null; + } else { + tmpRetOptionalDouble = value; + } + } + bjs["swift_js_return_optional_string"] = function(isSome, ptr, len) { + if (isSome === 0) { + tmpRetString = null; + } else { + tmpRetString = decodeString(ptr, len); + } + } + bjs["swift_js_return_optional_object"] = function(isSome, objectId) { + if (isSome === 0) { + tmpRetString = null; + } else { + tmpRetString = swift.memory.getObject(objectId); + } + } + bjs["swift_js_return_optional_heap_object"] = function(isSome, pointer) { + if (isSome === 0) { + tmpRetOptionalHeapObject = null; + } else { + tmpRetOptionalHeapObject = pointer; + } + } + bjs["swift_js_get_optional_int_presence"] = function() { + return tmpRetOptionalInt != null ? 1 : 0; + } + bjs["swift_js_get_optional_int_value"] = function() { + const value = tmpRetOptionalInt; + tmpRetOptionalInt = undefined; + return value; + } + bjs["swift_js_get_optional_string"] = function() { + const str = tmpRetString; + tmpRetString = undefined; + if (str == null) { + return -1; + } else { + const bytes = textEncoder.encode(str); + tmpRetBytes = bytes; + return bytes.length; + } + } + bjs["swift_js_get_optional_float_presence"] = function() { + return tmpRetOptionalFloat != null ? 1 : 0; + } + bjs["swift_js_get_optional_float_value"] = function() { + const value = tmpRetOptionalFloat; + tmpRetOptionalFloat = undefined; + return value; + } + bjs["swift_js_get_optional_double_presence"] = function() { + return tmpRetOptionalDouble != null ? 1 : 0; + } + bjs["swift_js_get_optional_double_value"] = function() { + const value = tmpRetOptionalDouble; + tmpRetOptionalDouble = undefined; + return value; + } + bjs["swift_js_get_optional_heap_object_pointer"] = function() { + const pointer = tmpRetOptionalHeapObject; + tmpRetOptionalHeapObject = undefined; + return pointer || 0; + } + bjs["swift_js_closure_unregister"] = function(funcRef) {} + bjs["swift_js_closure_unregister"] = function(funcRef) { + const func = swift.memory.getObject(funcRef); + func.__unregister(); + } + bjs["invoke_js_callback_TestModule_10TestModuleAl7Polygon_Si"] = function(callbackId, param0) { + try { + const callback = swift.memory.getObject(callbackId); + let ret = callback(_exports['PolygonReference'].__construct(param0)); + return ret; + } catch (error) { + setException(error); + return 0 + } + } + bjs["make_swift_closure_TestModule_10TestModuleAl7Polygon_Si"] = function(boxPtr, file, line) { + const lower_closure_TestModule_10TestModuleAl7Polygon_Si = function(param0) { + const ret = instance.exports.invoke_swift_closure_TestModule_10TestModuleAl7Polygon_Si(boxPtr, param0.pointer); + if (tmpRetException) { + const error = swift.memory.getObject(tmpRetException); + swift.memory.release(tmpRetException); + tmpRetException = undefined; + throw error; + } + return ret; + }; + return makeClosure(boxPtr, file, line, lower_closure_TestModule_10TestModuleAl7Polygon_Si); + } + bjs["invoke_js_callback_TestModule_10TestModuley_Al7Polygon"] = function(callbackId) { + try { + const callback = swift.memory.getObject(callbackId); + let ret = callback(); + return ret.pointer; + } catch (error) { + setException(error); + return 0 + } + } + bjs["make_swift_closure_TestModule_10TestModuley_Al7Polygon"] = function(boxPtr, file, line) { + const lower_closure_TestModule_10TestModuley_Al7Polygon = function() { + const ret = instance.exports.invoke_swift_closure_TestModule_10TestModuley_Al7Polygon(boxPtr); + if (tmpRetException) { + const error = swift.memory.getObject(tmpRetException); + swift.memory.release(tmpRetException); + tmpRetException = undefined; + throw error; + } + return _exports['PolygonReference'].__construct(ret); + }; + return makeClosure(boxPtr, file, line, lower_closure_TestModule_10TestModuley_Al7Polygon); + } + // Wrapper functions for module: TestModule + if (!importObject["TestModule"]) { + importObject["TestModule"] = {}; + } + importObject["TestModule"]["bjs_PolygonReference_wrap"] = function(pointer) { + const obj = _exports['PolygonReference'].__construct(pointer); + return swift.memory.retain(obj); + }; + }, + setInstance: (i) => { + instance = i; + memory = instance.exports.memory; + + decodeString = (ptr, len) => { const bytes = new Uint8Array(memory.buffer, ptr >>> 0, len >>> 0); return textDecoder.decode(bytes); } + + setException = (error) => { + instance.exports._swift_js_exception.value = swift.memory.retain(error) + } + }, + /** @param {WebAssembly.Instance} instance */ + createExports: (instance) => { + const js = swift.memory.heap; + const swiftHeapObjectFinalizationRegistry = (typeof FinalizationRegistry === "undefined") ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry((state) => { + if (state.hasReleased) { + return; + } + state.hasReleased = true; + state.identityMap?.delete(state.pointer); + state.deinit(state.pointer); + }); + + /// Represents a Swift heap object like a class instance or an actor instance. + class SwiftHeapObject { + static __wrap(pointer, deinit, prototype, identityCache) { + const makeFresh = (identityMap) => { + const obj = Object.create(prototype); + const state = { pointer, deinit, hasReleased: false, identityMap }; + obj.pointer = pointer; + obj.__swiftHeapObjectState = state; + swiftHeapObjectFinalizationRegistry.register(obj, state, state); + if (identityMap) { + identityMap.set(pointer, new WeakRef(obj)); + } + return obj; + }; + + if (!identityCache) { + return makeFresh(null); + } + + const cached = identityCache.get(pointer)?.deref(); + if (cached && !cached.__swiftHeapObjectState.hasReleased) { + deinit(pointer); + return cached; + } + if (identityCache.has(pointer)) { + identityCache.delete(pointer); + } + + return makeFresh(identityCache); + } + + release() { + const state = this.__swiftHeapObjectState; + if (state.hasReleased) { + return; + } + state.hasReleased = true; + swiftHeapObjectFinalizationRegistry.unregister(state); + state.identityMap?.delete(state.pointer); + state.deinit(state.pointer); + } + } + class PolygonReference extends SwiftHeapObject { + static __construct(ptr) { + return SwiftHeapObject.__wrap(ptr, instance.exports.bjs_PolygonReference_deinit, PolygonReference.prototype, null); + } + + constructor(sides) { + const ret = instance.exports.bjs_PolygonReference_init(sides); + return PolygonReference.__construct(ret); + } + } + const exports = { + PolygonReference, + makePolygonFactory: function bjs_makePolygonFactory() { + const ret = instance.exports.bjs_makePolygonFactory(); + return swift.memory.getObject(ret); + }, + makePolygonInspector: function bjs_makePolygonInspector() { + const ret = instance.exports.bjs_makePolygonInspector(); + return swift.memory.getObject(ret); + }, + }; + _exports = exports; + return exports; + }, + } +} \ No newline at end of file diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/EnumAlias.d.ts b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/EnumAlias.d.ts new file mode 100644 index 000000000..9525038e6 --- /dev/null +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/EnumAlias.d.ts @@ -0,0 +1,30 @@ +// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit, +// DO NOT EDIT. +// +// To update this file, just rebuild your project or run +// `swift package bridge-js`. + +/// Represents a Swift heap object like a class instance or an actor instance. +export interface SwiftHeapObject { + /// Release the heap object. + /// + /// Note: Calling this method will release the heap object and it will no longer be accessible. + release(): void; +} +export interface ColorBox extends SwiftHeapObject { +} +export type Exports = { + ColorBox: { + new(name: string): ColorBox; + } + roundtripColor(color: ColorBox): ColorBox; +} +export type Imports = { +} +export function createInstantiator(options: { + imports: Imports; +}, swift: any): Promise<{ + addImports: (importObject: WebAssembly.Imports) => void; + setInstance: (instance: WebAssembly.Instance) => void; + createExports: (instance: WebAssembly.Instance) => Exports; +}>; \ No newline at end of file diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/EnumAlias.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/EnumAlias.js new file mode 100644 index 000000000..01f0472ab --- /dev/null +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/EnumAlias.js @@ -0,0 +1,295 @@ +// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit, +// DO NOT EDIT. +// +// To update this file, just rebuild your project or run +// `swift package bridge-js`. + +export async function createInstantiator(options, swift) { + let instance; + let memory; + let setException; + let decodeString; + const textDecoder = new TextDecoder("utf-8"); + const textEncoder = new TextEncoder("utf-8"); + let tmpRetString; + let tmpRetBytes; + let tmpRetException; + let tmpRetOptionalBool; + let tmpRetOptionalInt; + let tmpRetOptionalFloat; + let tmpRetOptionalDouble; + let tmpRetOptionalHeapObject; + let strStack = []; + let i32Stack = []; + let i64Stack = []; + let f32Stack = []; + let f64Stack = []; + let ptrStack = []; + let taStack = []; + const enumHelpers = {}; + const structHelpers = {}; + + let _exports = null; + let bjs = null; + + return { + /** + * @param {WebAssembly.Imports} importObject + */ + addImports: (importObject, importsContext) => { + bjs = {}; + importObject["bjs"] = bjs; + bjs["swift_js_return_string"] = function(ptr, len) { + tmpRetString = decodeString(ptr, len); + } + bjs["swift_js_init_memory"] = function(sourceId, bytesPtr) { + const source = swift.memory.getObject(sourceId); + swift.memory.release(sourceId); + const bytes = new Uint8Array(memory.buffer, bytesPtr); + bytes.set(source); + } + bjs["swift_js_make_js_string"] = function(ptr, len) { + return swift.memory.retain(decodeString(ptr, len)); + } + bjs["swift_js_init_memory_with_result"] = function(ptr, len) { + const target = new Uint8Array(memory.buffer, ptr, len); + target.set(tmpRetBytes); + tmpRetBytes = undefined; + } + bjs["swift_js_throw"] = function(id) { + tmpRetException = swift.memory.retainByRef(id); + } + bjs["swift_js_retain"] = function(id) { + return swift.memory.retainByRef(id); + } + bjs["swift_js_release"] = function(id) { + swift.memory.release(id); + } + bjs["swift_js_push_i32"] = function(v) { + i32Stack.push(v | 0); + } + bjs["swift_js_push_f32"] = function(v) { + f32Stack.push(Math.fround(v)); + } + bjs["swift_js_push_f64"] = function(v) { + f64Stack.push(v); + } + bjs["swift_js_push_string"] = function(ptr, len) { + const value = decodeString(ptr, len); + strStack.push(value); + } + bjs["swift_js_pop_i32"] = function() { + return i32Stack.pop(); + } + bjs["swift_js_pop_f32"] = function() { + return f32Stack.pop(); + } + bjs["swift_js_pop_f64"] = function() { + return f64Stack.pop(); + } + bjs["swift_js_push_pointer"] = function(pointer) { + ptrStack.push(pointer); + } + bjs["swift_js_pop_pointer"] = function() { + return ptrStack.pop(); + } + bjs["swift_js_push_i64"] = function(v) { + i64Stack.push(v); + } + bjs["swift_js_pop_i64"] = function() { + return i64Stack.pop(); + } + const taCtors = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array]; + bjs["swift_js_push_typed_array"] = function(kind, ptr, count) { + const Ctor = taCtors[kind]; + const byteLen = count * Ctor.BYTES_PER_ELEMENT; + const copy = memory.buffer.slice(ptr, ptr + byteLen); + taStack.push(Array.from(new Ctor(copy))); + } + bjs["swift_js_return_optional_bool"] = function(isSome, value) { + if (isSome === 0) { + tmpRetOptionalBool = null; + } else { + tmpRetOptionalBool = value !== 0; + } + } + bjs["swift_js_return_optional_int"] = function(isSome, value) { + if (isSome === 0) { + tmpRetOptionalInt = null; + } else { + tmpRetOptionalInt = value | 0; + } + } + bjs["swift_js_return_optional_float"] = function(isSome, value) { + if (isSome === 0) { + tmpRetOptionalFloat = null; + } else { + tmpRetOptionalFloat = Math.fround(value); + } + } + bjs["swift_js_return_optional_double"] = function(isSome, value) { + if (isSome === 0) { + tmpRetOptionalDouble = null; + } else { + tmpRetOptionalDouble = value; + } + } + bjs["swift_js_return_optional_string"] = function(isSome, ptr, len) { + if (isSome === 0) { + tmpRetString = null; + } else { + tmpRetString = decodeString(ptr, len); + } + } + bjs["swift_js_return_optional_object"] = function(isSome, objectId) { + if (isSome === 0) { + tmpRetString = null; + } else { + tmpRetString = swift.memory.getObject(objectId); + } + } + bjs["swift_js_return_optional_heap_object"] = function(isSome, pointer) { + if (isSome === 0) { + tmpRetOptionalHeapObject = null; + } else { + tmpRetOptionalHeapObject = pointer; + } + } + bjs["swift_js_get_optional_int_presence"] = function() { + return tmpRetOptionalInt != null ? 1 : 0; + } + bjs["swift_js_get_optional_int_value"] = function() { + const value = tmpRetOptionalInt; + tmpRetOptionalInt = undefined; + return value; + } + bjs["swift_js_get_optional_string"] = function() { + const str = tmpRetString; + tmpRetString = undefined; + if (str == null) { + return -1; + } else { + const bytes = textEncoder.encode(str); + tmpRetBytes = bytes; + return bytes.length; + } + } + bjs["swift_js_get_optional_float_presence"] = function() { + return tmpRetOptionalFloat != null ? 1 : 0; + } + bjs["swift_js_get_optional_float_value"] = function() { + const value = tmpRetOptionalFloat; + tmpRetOptionalFloat = undefined; + return value; + } + bjs["swift_js_get_optional_double_presence"] = function() { + return tmpRetOptionalDouble != null ? 1 : 0; + } + bjs["swift_js_get_optional_double_value"] = function() { + const value = tmpRetOptionalDouble; + tmpRetOptionalDouble = undefined; + return value; + } + bjs["swift_js_get_optional_heap_object_pointer"] = function() { + const pointer = tmpRetOptionalHeapObject; + tmpRetOptionalHeapObject = undefined; + return pointer || 0; + } + bjs["swift_js_closure_unregister"] = function(funcRef) {} + // Wrapper functions for module: TestModule + if (!importObject["TestModule"]) { + importObject["TestModule"] = {}; + } + importObject["TestModule"]["bjs_ColorBox_wrap"] = function(pointer) { + const obj = _exports['ColorBox'].__construct(pointer); + return swift.memory.retain(obj); + }; + }, + setInstance: (i) => { + instance = i; + memory = instance.exports.memory; + + decodeString = (ptr, len) => { const bytes = new Uint8Array(memory.buffer, ptr >>> 0, len >>> 0); return textDecoder.decode(bytes); } + + setException = (error) => { + instance.exports._swift_js_exception.value = swift.memory.retain(error) + } + }, + /** @param {WebAssembly.Instance} instance */ + createExports: (instance) => { + const js = swift.memory.heap; + const swiftHeapObjectFinalizationRegistry = (typeof FinalizationRegistry === "undefined") ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry((state) => { + if (state.hasReleased) { + return; + } + state.hasReleased = true; + state.identityMap?.delete(state.pointer); + state.deinit(state.pointer); + }); + + /// Represents a Swift heap object like a class instance or an actor instance. + class SwiftHeapObject { + static __wrap(pointer, deinit, prototype, identityCache) { + const makeFresh = (identityMap) => { + const obj = Object.create(prototype); + const state = { pointer, deinit, hasReleased: false, identityMap }; + obj.pointer = pointer; + obj.__swiftHeapObjectState = state; + swiftHeapObjectFinalizationRegistry.register(obj, state, state); + if (identityMap) { + identityMap.set(pointer, new WeakRef(obj)); + } + return obj; + }; + + if (!identityCache) { + return makeFresh(null); + } + + const cached = identityCache.get(pointer)?.deref(); + if (cached && !cached.__swiftHeapObjectState.hasReleased) { + deinit(pointer); + return cached; + } + if (identityCache.has(pointer)) { + identityCache.delete(pointer); + } + + return makeFresh(identityCache); + } + + release() { + const state = this.__swiftHeapObjectState; + if (state.hasReleased) { + return; + } + state.hasReleased = true; + swiftHeapObjectFinalizationRegistry.unregister(state); + state.identityMap?.delete(state.pointer); + state.deinit(state.pointer); + } + } + class ColorBox extends SwiftHeapObject { + static __construct(ptr) { + return SwiftHeapObject.__wrap(ptr, instance.exports.bjs_ColorBox_deinit, ColorBox.prototype, null); + } + + constructor(name) { + const nameBytes = textEncoder.encode(name); + const nameId = swift.memory.retain(nameBytes); + const ret = instance.exports.bjs_ColorBox_init(nameId, nameBytes.length); + return ColorBox.__construct(ret); + } + } + const exports = { + ColorBox, + roundtripColor: function bjs_roundtripColor(color) { + const ret = instance.exports.bjs_roundtripColor(color.pointer); + return ColorBox.__construct(ret); + }, + }; + _exports = exports; + return exports; + }, + } +} \ No newline at end of file diff --git a/Sources/JavaScriptKit/Macros.swift b/Sources/JavaScriptKit/Macros.swift index 3189cdeab..191cf15d6 100644 --- a/Sources/JavaScriptKit/Macros.swift +++ b/Sources/JavaScriptKit/Macros.swift @@ -113,8 +113,12 @@ public enum JSImportFrom: String { /// /// - Important: This feature is still experimental. No API stability is guaranteed, and the API may change in future releases. @attached(peer) -public macro JS(namespace: String? = nil, enumStyle: JSEnumStyle = .const, identityMode: Bool = false) = - Builtin.ExternalMacro +public macro JS( + as aliasOf: Any.Type? = nil, + namespace: String? = nil, + enumStyle: JSEnumStyle = .const, + identityMode: Bool = false +) = Builtin.ExternalMacro /// A macro that generates a Swift getter that reads a value from JavaScript. /// diff --git a/Tests/BridgeJSGlobalTests/Generated/JavaScript/BridgeJS.json b/Tests/BridgeJSGlobalTests/Generated/JavaScript/BridgeJS.json index 5e9626840..48c0904bf 100644 --- a/Tests/BridgeJSGlobalTests/Generated/JavaScript/BridgeJS.json +++ b/Tests/BridgeJSGlobalTests/Generated/JavaScript/BridgeJS.json @@ -1,5 +1,8 @@ { "exported" : { + "aliases" : [ + + ], "classes" : [ { "constructor" : { diff --git a/Tests/BridgeJSIdentityTests/Generated/JavaScript/BridgeJS.json b/Tests/BridgeJSIdentityTests/Generated/JavaScript/BridgeJS.json index 56db0a3ed..53d837ece 100644 --- a/Tests/BridgeJSIdentityTests/Generated/JavaScript/BridgeJS.json +++ b/Tests/BridgeJSIdentityTests/Generated/JavaScript/BridgeJS.json @@ -1,5 +1,8 @@ { "exported" : { + "aliases" : [ + + ], "classes" : [ { "constructor" : { diff --git a/Tests/BridgeJSRuntimeTests/AliasAPIs.swift b/Tests/BridgeJSRuntimeTests/AliasAPIs.swift new file mode 100644 index 000000000..bd6737b77 --- /dev/null +++ b/Tests/BridgeJSRuntimeTests/AliasAPIs.swift @@ -0,0 +1,401 @@ +import JavaScriptKit + +@JS(as: PolygonReference.self) struct Polygon { + var vertices: [Double] + var label: String + + consuming func bridgeToJS() -> PolygonReference { + return PolygonReference(underlying: self) + } + + static func bridgeFromJS(_ value: consuming PolygonReference) -> Polygon { + return value.underlying + } +} + +@JS final class PolygonReference { + var underlying: Polygon + + @JS init(verticesData: [Double], label: String) { + self.underlying = Polygon(vertices: verticesData, label: label) + } + + init(underlying: Polygon) { + self.underlying = underlying + } + + @JS func vertexCount() -> Int { + return underlying.vertices.count + } + + @JS func summary() -> String { + return "\(underlying.label)(\(underlying.vertices.count))" + } + + @JS func snapshot() -> Polygon { + return underlying + } + + @JS func merge(_ other: Polygon) -> Polygon { + var combined = underlying + combined.vertices.append(contentsOf: other.vertices) + return combined + } + + @JS static func origin(label: String) -> Polygon { + return Polygon(vertices: [], label: label) + } +} + +@JS(as: TagReference.self) struct Tag { + var name: String + + consuming func bridgeToJS() -> TagReference { + return TagReference(underlying: self) + } + + static func bridgeFromJS(_ value: consuming TagReference) -> Tag { + return value.underlying + } +} + +@JS final class TagReference { + var underlying: Tag + + init(underlying: Tag) { + self.underlying = underlying + } + + @JS func describe() -> String { + return "tag:\(underlying.name)" + } +} + +@JS func makeTag(_ name: String) -> Tag { + return Tag(name: name) +} + +@JS func roundTripPolygon(_ polygon: Polygon) -> Polygon { + return polygon +} + +@JS func appendVertex(_ polygon: Polygon, _ value: Double) -> Polygon { + var copy = polygon + copy.vertices.append(value) + return copy +} + +@JS func optionalRoundTripPolygon(_ polygon: Polygon?) -> Polygon? { + return polygon +} + +@JS func polygonVertexCount(_ polygon: Polygon) -> Int { + return polygon.vertices.count +} + +@JS func roundTripPolygonArray(_ polygons: [Polygon]) -> [Polygon] { + return polygons +} + +@JS func concatPolygons(_ polygons: [Polygon]) -> Polygon { + var combined = Polygon(vertices: [], label: "concat") + for p in polygons { + combined.vertices.append(contentsOf: p.vertices) + } + return combined +} + +@JS func validatePolygon(_ polygon: Polygon) throws(JSException) -> Polygon { + if polygon.vertices.isEmpty { + throw JSException(JSError(message: "empty polygon").jsValue) + } + return polygon +} + +@JS func splitPolygon(_ polygon: Polygon) -> [Polygon] { + return polygon.vertices.map { Polygon(vertices: [$0], label: polygon.label) } +} + +@JS(as: TokenReference.self) struct Token: ~Copyable { + let value: Int + + consuming func bridgeToJS() -> TokenReference { + return TokenReference(value: value) + } + + static func bridgeFromJS(_ value: consuming TokenReference) -> Token { + return Token(value: value.value) + } +} + +@JS final class TokenReference { + let value: Int + + @JS init(value: Int) { + self.value = value + } + + @JS func read() -> Int { + return value + } +} + +@JS func incrementToken(_ token: borrowing Token) -> Token { + return Token(value: token.value + 1) +} + +@JS func makeToken(_ value: Int) -> Token { + return Token(value: value) +} + +@JS func makePolygonInspector() -> (Polygon) -> Int { + return { polygon in polygon.vertices.count } +} + +@JS func asyncMakePolygon(_ label: String) async -> Polygon { + return Polygon(vertices: [9, 9], label: label) +} + +@JS func roundTripOptionalPolygonArray(_ polygons: [Polygon?]) -> [Polygon?] { + return polygons +} + +@JS(as: TagHolderReference.self) struct TagHolder { + var tag: Tag + var version: Int + + consuming func bridgeToJS() -> TagHolderReference { + return TagHolderReference(tag: tag, version: version) + } + + static func bridgeFromJS(_ value: consuming TagHolderReference) -> TagHolder { + return TagHolder(tag: value.tag, version: value.version) + } +} + +@JS final class TagHolderReference { + @JS var tag: Tag + @JS var version: Int + + @JS init(tag: Tag, version: Int) { + self.tag = tag + self.version = version + } + + @JS func describe() -> String { + return "holder(\(tag.name), v\(version))" + } +} + +@JS func makeTagHolder(_ name: String, _ version: Int) -> TagHolder { + return TagHolder(tag: Tag(name: name), version: version) +} + +@JS(as: JSCoordinate.self) struct Coordinate { + var latitude: Double + var longitude: Double + + var hemisphere: String { + latitude >= 0 ? "northern" : "southern" + } + + consuming func bridgeToJS() -> JSCoordinate { + return JSCoordinate(latitude: latitude, longitude: longitude) + } + + static func bridgeFromJS(_ value: consuming JSCoordinate) -> Coordinate { + return Coordinate(latitude: value.latitude, longitude: value.longitude) + } +} + +@JS struct JSCoordinate { + var latitude: Double + var longitude: Double + + @JS init(latitude: Double, longitude: Double) { + self.latitude = latitude + self.longitude = longitude + } +} + +@JS func roundTripCoordinate(_ coordinate: Coordinate) -> Coordinate { + return coordinate +} + +@JS(as: PriorityReference.self) enum Priority { + case low, medium, high + + consuming func bridgeToJS() -> PriorityReference { + return PriorityReference(underlying: self) + } + + static func bridgeFromJS(_ value: consuming PriorityReference) -> Priority { + return value.underlying + } +} + +@JS final class PriorityReference { + let underlying: Priority + + init(underlying: Priority) { + self.underlying = underlying + } + + @JS func describe() -> String { + switch underlying { + case .low: return "low" + case .medium: return "medium" + case .high: return "high" + } + } + + @JS func weight() -> Int { + switch underlying { + case .low: return 1 + case .medium: return 5 + case .high: return 10 + } + } + + @JS static func low() -> Priority { return .low } + @JS static func medium() -> Priority { return .medium } + @JS static func high() -> Priority { return .high } +} + +@JS func roundTripPriority(_ priority: Priority) -> Priority { + return priority +} + +@JS(as: Severity.self) struct Alert { + let level: Severity + + var requiresImmediateAction: Bool { + level == .error + } + + consuming func bridgeToJS() -> Severity { + return level + } + + static func bridgeFromJS(_ value: consuming Severity) -> Alert { + return Alert(level: value) + } +} + +@JS enum Severity { + case notice, warning, error +} + +@JS func roundTripAlert(_ alert: Alert) -> Alert { + return alert +} + +@JS func makeAlert(_ level: Severity) -> Alert { + return Alert(level: level) +} + +@JS(as: SessionState.self) class Session { + var token: String + + init(token: String) { + self.token = token + } + + consuming func bridgeToJS() -> SessionState { + return SessionState(token: token) + } + + static func bridgeFromJS(_ value: consuming SessionState) -> Session { + return Session(token: value.token) + } +} + +@JS struct SessionState { + var token: String + + @JS init(token: String) { + self.token = token + } +} + +@JS func roundTripSession(_ session: Session) -> Session { + return session +} + +@JS func makeSession(_ token: String) -> Session { + return Session(token: token) +} + +@JS enum Shape { + case polygon(Polygon) + case empty +} + +@JS func roundTripShape(_ s: Shape) -> Shape { + return s +} + +@JS func makeShapePolygon(_ polygon: Polygon) -> Shape { + return .polygon(polygon) +} + +@JS func makeShapeEmpty() -> Shape { + return .empty +} + +// MARK: - Imports + +@JS(as: String.self) struct Tagged { + var raw: String + + consuming func bridgeToJS() -> String { + return raw + } + + static func bridgeFromJS(_ value: consuming String) -> Tagged { + return Tagged(raw: value) + } +} + +@JSClass struct Surface { + @JSFunction init(_ label: String) throws(JSException) + @JSGetter var label: String +} + +@JS(as: Surface.self) struct Canvas { + var label: String + + consuming func bridgeToJS() -> Surface { + return try! Surface(label) + } + + static func bridgeFromJS(_ value: consuming Surface) -> Canvas { + return Canvas(label: (try? value.label) ?? "") + } +} + +@JS enum InnerTag { + case payload(Int) + case empty +} + +@JS(as: InnerTag.self) struct AliasedTag { + var underlying: InnerTag + + consuming func bridgeToJS() -> InnerTag { + return underlying + } + + static func bridgeFromJS(_ value: consuming InnerTag) -> AliasedTag { + return AliasedTag(underlying: value) + } +} + +@JSClass struct AliasImports { + @JSFunction static func jsRoundTripTagged(_ value: Tagged) throws(JSException) -> Tagged + @JSFunction static func jsRoundTripOptionalTagged(_ value: Tagged?) throws(JSException) -> Tagged? + @JSFunction static func jsProduceOptionalCanvas(_ label: String?) throws(JSException) -> Canvas? + @JSFunction static func jsRoundTripAliasedTags(_ values: [AliasedTag?]) throws(JSException) -> [AliasedTag?] + @JSFunction static func jsRoundTripPolygon(_ value: Polygon) throws(JSException) -> Polygon + @JSFunction static func jsRoundTripCoordinate(_ value: Coordinate) throws(JSException) -> Coordinate +} diff --git a/Tests/BridgeJSRuntimeTests/AliasTests.swift b/Tests/BridgeJSRuntimeTests/AliasTests.swift new file mode 100644 index 000000000..2e4548ec9 --- /dev/null +++ b/Tests/BridgeJSRuntimeTests/AliasTests.swift @@ -0,0 +1,72 @@ +import XCTest +import JavaScriptKit + +@_extern(wasm, module: "BridgeJSRuntimeTests", name: "runAliasWorks") +@_extern(c) +func runAliasWorks() -> Void + +final class AliasTests: XCTestCase { + func testAliasEndToEnd() { + runAliasWorks() + } + + func testAliasAsyncEndToEnd() async throws { + try await runAliasAsyncWorks() + } + + // MARK: - Imports + + func testRoundTripTagged() throws { + let result = try AliasImports.jsRoundTripTagged(Tagged(raw: "hello")) + XCTAssertEqual(result.raw, "hello") + } + + func testRoundTripOptionalTagged() throws { + XCTAssertNil(try AliasImports.jsRoundTripOptionalTagged(nil)) + let echoed = try AliasImports.jsRoundTripOptionalTagged(Tagged(raw: "present")) + XCTAssertEqual(echoed?.raw, "present") + } + + func testProduceOptionalCanvas() throws { + XCTAssertNil(try AliasImports.jsProduceOptionalCanvas(nil)) + let canvas = try AliasImports.jsProduceOptionalCanvas("hello") + XCTAssertEqual(canvas?.label, "hello") + } + + func testRoundTripAliasedTagArray() throws { + let inputs: [AliasedTag?] = [ + AliasedTag(underlying: .payload(7)), + nil, + AliasedTag(underlying: .empty), + nil, + ] + let echoed = try AliasImports.jsRoundTripAliasedTags(inputs) + XCTAssertEqual(echoed.count, 4) + if case .payload(let n) = echoed[0]?.underlying { + XCTAssertEqual(n, 7) + } else { + XCTFail("expected .payload(7) at index 0") + } + XCTAssertNil(echoed[1]) + if case .empty = echoed[2]?.underlying { + // ok + } else { + XCTFail("expected .empty at index 2") + } + XCTAssertNil(echoed[3]) + } + + func testRoundTripPolygonImport() throws { + let polygon = Polygon(vertices: [1, 2, 3], label: "import") + let echoed = try AliasImports.jsRoundTripPolygon(polygon) + XCTAssertEqual(echoed.label, "import") + XCTAssertEqual(echoed.vertices, [1, 2, 3]) + } + + func testRoundTripCoordinateImport() throws { + let coordinate = Coordinate(latitude: 12.5, longitude: -34.25) + let echoed = try AliasImports.jsRoundTripCoordinate(coordinate) + XCTAssertEqual(echoed.latitude, 12.5) + XCTAssertEqual(echoed.longitude, -34.25) + } +} diff --git a/Tests/BridgeJSRuntimeTests/Generated/BridgeJS.Macros.swift b/Tests/BridgeJSRuntimeTests/Generated/BridgeJS.Macros.swift index 08d0db2a7..b2f7795cc 100644 --- a/Tests/BridgeJSRuntimeTests/Generated/BridgeJS.Macros.swift +++ b/Tests/BridgeJSRuntimeTests/Generated/BridgeJS.Macros.swift @@ -44,6 +44,8 @@ extension FeatureFlag: _BridgedSwiftEnumNoPayload, _BridgedSwiftRawValueEnum {} @JSFunction func runAsyncWorks() async throws(JSException) -> Void +@JSFunction func runAliasAsyncWorks() async throws(JSException) -> Void + @JSFunction func fetchWeatherData(_ city: String) async throws(JSException) -> WeatherData @JSClass struct WeatherData { diff --git a/Tests/BridgeJSRuntimeTests/Generated/BridgeJS.swift b/Tests/BridgeJSRuntimeTests/Generated/BridgeJS.swift index 3fa4eb9d5..1192d4b33 100644 --- a/Tests/BridgeJSRuntimeTests/Generated/BridgeJS.swift +++ b/Tests/BridgeJSRuntimeTests/Generated/BridgeJS.swift @@ -644,6 +644,69 @@ public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTests9Di #endif } +#if arch(wasm32) +@_extern(wasm, module: "bjs", name: "invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsAl7Polygon_Si") +fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsAl7Polygon_Si_extern(_ callback: Int32, _ param0: UnsafeMutableRawPointer) -> Int32 +#else +fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsAl7Polygon_Si_extern(_ callback: Int32, _ param0: UnsafeMutableRawPointer) -> Int32 { + fatalError("Only available on WebAssembly") +} +#endif +@inline(never) fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsAl7Polygon_Si(_ callback: Int32, _ param0: UnsafeMutableRawPointer) -> Int32 { + return invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsAl7Polygon_Si_extern(callback, param0) +} + +#if arch(wasm32) +@_extern(wasm, module: "bjs", name: "make_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsAl7Polygon_Si") +fileprivate func make_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsAl7Polygon_Si_extern(_ boxPtr: UnsafeMutableRawPointer, _ file: UnsafePointer, _ line: UInt32) -> Int32 +#else +fileprivate func make_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsAl7Polygon_Si_extern(_ boxPtr: UnsafeMutableRawPointer, _ file: UnsafePointer, _ line: UInt32) -> Int32 { + fatalError("Only available on WebAssembly") +} +#endif +@inline(never) fileprivate func make_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsAl7Polygon_Si(_ boxPtr: UnsafeMutableRawPointer, _ file: UnsafePointer, _ line: UInt32) -> Int32 { + return make_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsAl7Polygon_Si_extern(boxPtr, file, line) +} + +private enum _BJS_Closure_20BridgeJSRuntimeTestsAl7Polygon_Si { + static func bridgeJSLift(_ callbackId: Int32) -> (Polygon) -> Int { + let callback = JSObject.bridgeJSLiftParameter(callbackId) + return { [callback] param0 in + #if arch(wasm32) + let callbackValue = callback.bridgeJSLowerParameter() + let param0Pointer = param0.bridgeToJS().bridgeJSLowerParameter() + let ret = invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsAl7Polygon_Si(callbackValue, param0Pointer) + return Int.bridgeJSLiftReturn(ret) + #else + fatalError("Only available on WebAssembly") + #endif + } + } +} + +extension JSTypedClosure where Signature == (Polygon) -> Int { + init(fileID: StaticString = #fileID, line: UInt32 = #line, _ body: @escaping (Polygon) -> Int) { + self.init( + makeClosure: make_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsAl7Polygon_Si, + body: body, + fileID: fileID, + line: line + ) + } +} + +@_expose(wasm, "invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsAl7Polygon_Si") +@_cdecl("invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsAl7Polygon_Si") +public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsAl7Polygon_Si(_ boxPtr: UnsafeMutableRawPointer, _ param0: UnsafeMutableRawPointer) -> Int32 { + #if arch(wasm32) + let closure = Unmanaged<_BridgeJSTypedClosureBox<(Polygon) -> Int>>.fromOpaque(boxPtr).takeUnretainedValue().closure + let result = closure(Polygon.bridgeFromJS(PolygonReference.bridgeJSLiftParameter(param0))) + return result.bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + #if arch(wasm32) @_extern(wasm, module: "bjs", name: "invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSS_7GreeterC") fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSS_7GreeterC_extern(_ callback: Int32, _ param0Bytes: Int32, _ param0Length: Int32) -> UnsafeMutableRawPointer @@ -3332,6 +3395,91 @@ fileprivate func bjs_DataProcessor_optionalHelper_set_extern(_ jsObject: Int32, return bjs_DataProcessor_optionalHelper_set_extern(jsObject, newValueIsSome, newValuePointer) } +extension Severity: _BridgedSwiftCaseEnum { + @_spi(BridgeJS) @_transparent public consuming func bridgeJSLowerParameter() -> Int32 { + return bridgeJSRawValue + } + @_spi(BridgeJS) @_transparent public static func bridgeJSLiftReturn(_ value: Int32) -> Severity { + return bridgeJSLiftParameter(value) + } + @_spi(BridgeJS) @_transparent public static func bridgeJSLiftParameter(_ value: Int32) -> Severity { + return Severity(bridgeJSRawValue: value)! + } + @_spi(BridgeJS) @_transparent public consuming func bridgeJSLowerReturn() -> Int32 { + return bridgeJSLowerParameter() + } + + @_spi(BridgeJS) @usableFromInline init?(bridgeJSRawValue: Int32) { + switch bridgeJSRawValue { + case 0: + self = .notice + case 1: + self = .warning + case 2: + self = .error + default: + return nil + } + } + + @_spi(BridgeJS) @usableFromInline var bridgeJSRawValue: Int32 { + switch self { + case .notice: + return 0 + case .warning: + return 1 + case .error: + return 2 + } + } +} + +extension Shape: _BridgedSwiftAssociatedValueEnum { + @_spi(BridgeJS) @_transparent public static func bridgeJSStackPopPayload(_ caseId: Int32) -> Shape { + switch caseId { + case 0: + return .polygon(Polygon.bridgeFromJS(PolygonReference.bridgeJSStackPop())) + case 1: + return .empty + default: + fatalError("Unknown Shape case ID: \(caseId)") + } + } + + @_spi(BridgeJS) @_transparent public consuming func bridgeJSStackPushPayload() -> Int32 { + switch self { + case .polygon(let param0): + param0.bridgeToJS().bridgeJSStackPush() + return Int32(0) + case .empty: + return Int32(1) + } + } +} + +extension InnerTag: _BridgedSwiftAssociatedValueEnum { + @_spi(BridgeJS) @_transparent public static func bridgeJSStackPopPayload(_ caseId: Int32) -> InnerTag { + switch caseId { + case 0: + return .payload(Int.bridgeJSStackPop()) + case 1: + return .empty + default: + fatalError("Unknown InnerTag case ID: \(caseId)") + } + } + + @_spi(BridgeJS) @_transparent public consuming func bridgeJSStackPushPayload() -> Int32 { + switch self { + case .payload(let param0): + param0.bridgeJSStackPush() + return Int32(0) + case .empty: + return Int32(1) + } + } +} + @_expose(wasm, "bjs_ArraySupportExports_static_roundTripIntArray") @_cdecl("bjs_ArraySupportExports_static_roundTripIntArray") public func _bjs_ArraySupportExports_static_roundTripIntArray() -> Void { @@ -5385,6 +5533,122 @@ extension APIOptionalResult: _BridgedSwiftAssociatedValueEnum { } } +extension JSCoordinate: _BridgedSwiftStruct { + @_spi(BridgeJS) @_transparent public static func bridgeJSStackPop() -> JSCoordinate { + let longitude = Double.bridgeJSStackPop() + let latitude = Double.bridgeJSStackPop() + return JSCoordinate(latitude: latitude, longitude: longitude) + } + + @_spi(BridgeJS) @_transparent public consuming func bridgeJSStackPush() { + self.latitude.bridgeJSStackPush() + self.longitude.bridgeJSStackPush() + } + + init(unsafelyCopying jsObject: JSObject) { + _bjs_struct_lower_JSCoordinate(jsObject.bridgeJSLowerParameter()) + self = Self.bridgeJSStackPop() + } + + func toJSObject() -> JSObject { + let __bjs_self = self + __bjs_self.bridgeJSStackPush() + return JSObject(id: UInt32(bitPattern: _bjs_struct_lift_JSCoordinate())) + } +} + +#if arch(wasm32) +@_extern(wasm, module: "bjs", name: "swift_js_struct_lower_JSCoordinate") +fileprivate func _bjs_struct_lower_JSCoordinate_extern(_ objectId: Int32) -> Void +#else +fileprivate func _bjs_struct_lower_JSCoordinate_extern(_ objectId: Int32) -> Void { + fatalError("Only available on WebAssembly") +} +#endif +@inline(never) fileprivate func _bjs_struct_lower_JSCoordinate(_ objectId: Int32) -> Void { + return _bjs_struct_lower_JSCoordinate_extern(objectId) +} + +#if arch(wasm32) +@_extern(wasm, module: "bjs", name: "swift_js_struct_lift_JSCoordinate") +fileprivate func _bjs_struct_lift_JSCoordinate_extern() -> Int32 +#else +fileprivate func _bjs_struct_lift_JSCoordinate_extern() -> Int32 { + fatalError("Only available on WebAssembly") +} +#endif +@inline(never) fileprivate func _bjs_struct_lift_JSCoordinate() -> Int32 { + return _bjs_struct_lift_JSCoordinate_extern() +} + +@_expose(wasm, "bjs_JSCoordinate_init") +@_cdecl("bjs_JSCoordinate_init") +public func _bjs_JSCoordinate_init(_ latitude: Float64, _ longitude: Float64) -> Void { + #if arch(wasm32) + let ret = JSCoordinate(latitude: Double.bridgeJSLiftParameter(latitude), longitude: Double.bridgeJSLiftParameter(longitude)) + return ret.bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +extension SessionState: _BridgedSwiftStruct { + @_spi(BridgeJS) @_transparent public static func bridgeJSStackPop() -> SessionState { + let token = String.bridgeJSStackPop() + return SessionState(token: token) + } + + @_spi(BridgeJS) @_transparent public consuming func bridgeJSStackPush() { + self.token.bridgeJSStackPush() + } + + init(unsafelyCopying jsObject: JSObject) { + _bjs_struct_lower_SessionState(jsObject.bridgeJSLowerParameter()) + self = Self.bridgeJSStackPop() + } + + func toJSObject() -> JSObject { + let __bjs_self = self + __bjs_self.bridgeJSStackPush() + return JSObject(id: UInt32(bitPattern: _bjs_struct_lift_SessionState())) + } +} + +#if arch(wasm32) +@_extern(wasm, module: "bjs", name: "swift_js_struct_lower_SessionState") +fileprivate func _bjs_struct_lower_SessionState_extern(_ objectId: Int32) -> Void +#else +fileprivate func _bjs_struct_lower_SessionState_extern(_ objectId: Int32) -> Void { + fatalError("Only available on WebAssembly") +} +#endif +@inline(never) fileprivate func _bjs_struct_lower_SessionState(_ objectId: Int32) -> Void { + return _bjs_struct_lower_SessionState_extern(objectId) +} + +#if arch(wasm32) +@_extern(wasm, module: "bjs", name: "swift_js_struct_lift_SessionState") +fileprivate func _bjs_struct_lift_SessionState_extern() -> Int32 +#else +fileprivate func _bjs_struct_lift_SessionState_extern() -> Int32 { + fatalError("Only available on WebAssembly") +} +#endif +@inline(never) fileprivate func _bjs_struct_lift_SessionState() -> Int32 { + return _bjs_struct_lift_SessionState_extern() +} + +@_expose(wasm, "bjs_SessionState_init") +@_cdecl("bjs_SessionState_init") +public func _bjs_SessionState_init(_ tokenBytes: Int32, _ tokenLength: Int32) -> Void { + #if arch(wasm32) + let ret = SessionState(token: String.bridgeJSLiftParameter(tokenBytes, tokenLength)) + return ret.bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + extension NestedStructGroupA.Metadata: _BridgedSwiftStruct { @_spi(BridgeJS) @_transparent public static func bridgeJSStackPop() -> NestedStructGroupA.Metadata { let count = Int.bridgeJSStackPop() @@ -6729,142 +6993,422 @@ public func _bjs_ArrayMembers_firstString() -> Void { #endif } -@_expose(wasm, "bjs_roundTripVoid") -@_cdecl("bjs_roundTripVoid") -public func _bjs_roundTripVoid() -> Void { +@_expose(wasm, "bjs_makeTag") +@_cdecl("bjs_makeTag") +public func _bjs_makeTag(_ nameBytes: Int32, _ nameLength: Int32) -> UnsafeMutableRawPointer { #if arch(wasm32) - roundTripVoid() + let ret = makeTag(_: String.bridgeJSLiftParameter(nameBytes, nameLength)) + return ret.bridgeToJS().bridgeJSLowerReturn() #else fatalError("Only available on WebAssembly") #endif } -@_expose(wasm, "bjs_roundTripFloat") -@_cdecl("bjs_roundTripFloat") -public func _bjs_roundTripFloat(_ v: Float32) -> Float32 { +@_expose(wasm, "bjs_roundTripPolygon") +@_cdecl("bjs_roundTripPolygon") +public func _bjs_roundTripPolygon(_ polygon: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { #if arch(wasm32) - let ret = roundTripFloat(v: Float.bridgeJSLiftParameter(v)) - return ret.bridgeJSLowerReturn() + let ret = roundTripPolygon(_: Polygon.bridgeFromJS(PolygonReference.bridgeJSLiftParameter(polygon))) + return ret.bridgeToJS().bridgeJSLowerReturn() #else fatalError("Only available on WebAssembly") #endif } -@_expose(wasm, "bjs_roundTripDouble") -@_cdecl("bjs_roundTripDouble") -public func _bjs_roundTripDouble(_ v: Float64) -> Float64 { +@_expose(wasm, "bjs_appendVertex") +@_cdecl("bjs_appendVertex") +public func _bjs_appendVertex(_ polygon: UnsafeMutableRawPointer, _ value: Float64) -> UnsafeMutableRawPointer { #if arch(wasm32) - let ret = roundTripDouble(v: Double.bridgeJSLiftParameter(v)) - return ret.bridgeJSLowerReturn() + let ret = appendVertex(_: Polygon.bridgeFromJS(PolygonReference.bridgeJSLiftParameter(polygon)), _: Double.bridgeJSLiftParameter(value)) + return ret.bridgeToJS().bridgeJSLowerReturn() #else fatalError("Only available on WebAssembly") #endif } -@_expose(wasm, "bjs_roundTripBool") -@_cdecl("bjs_roundTripBool") -public func _bjs_roundTripBool(_ v: Int32) -> Int32 { +@_expose(wasm, "bjs_optionalRoundTripPolygon") +@_cdecl("bjs_optionalRoundTripPolygon") +public func _bjs_optionalRoundTripPolygon(_ polygonIsSome: Int32, _ polygonValue: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) - let ret = roundTripBool(v: Bool.bridgeJSLiftParameter(v)) - return ret.bridgeJSLowerReturn() + let ret = optionalRoundTripPolygon(_: Optional.bridgeJSLiftParameter(polygonIsSome, polygonValue).map { Polygon.bridgeFromJS($0) }) + return ret.map { $0.bridgeToJS() }.bridgeJSLowerReturn() #else fatalError("Only available on WebAssembly") #endif } -@_expose(wasm, "bjs_roundTripString") -@_cdecl("bjs_roundTripString") -public func _bjs_roundTripString(_ vBytes: Int32, _ vLength: Int32) -> Void { +@_expose(wasm, "bjs_polygonVertexCount") +@_cdecl("bjs_polygonVertexCount") +public func _bjs_polygonVertexCount(_ polygon: UnsafeMutableRawPointer) -> Int32 { #if arch(wasm32) - let ret = roundTripString(v: String.bridgeJSLiftParameter(vBytes, vLength)) + let ret = polygonVertexCount(_: Polygon.bridgeFromJS(PolygonReference.bridgeJSLiftParameter(polygon))) return ret.bridgeJSLowerReturn() #else fatalError("Only available on WebAssembly") #endif } -@_expose(wasm, "bjs_roundTripSwiftHeapObject") -@_cdecl("bjs_roundTripSwiftHeapObject") -public func _bjs_roundTripSwiftHeapObject(_ v: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { +@_expose(wasm, "bjs_roundTripPolygonArray") +@_cdecl("bjs_roundTripPolygonArray") +public func _bjs_roundTripPolygonArray() -> Void { #if arch(wasm32) - let ret = roundTripSwiftHeapObject(v: Greeter.bridgeJSLiftParameter(v)) - return ret.bridgeJSLowerReturn() + let ret = roundTripPolygonArray(_: [PolygonReference].bridgeJSStackPop().map { Polygon.bridgeFromJS($0) }) + ret.map { $0.bridgeToJS() }.bridgeJSStackPush() #else fatalError("Only available on WebAssembly") #endif } -@_expose(wasm, "bjs_roundTripUnsafeRawPointer") -@_cdecl("bjs_roundTripUnsafeRawPointer") -public func _bjs_roundTripUnsafeRawPointer(_ v: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { +@_expose(wasm, "bjs_concatPolygons") +@_cdecl("bjs_concatPolygons") +public func _bjs_concatPolygons() -> UnsafeMutableRawPointer { #if arch(wasm32) - let ret = roundTripUnsafeRawPointer(v: UnsafeRawPointer.bridgeJSLiftParameter(v)) - return ret.bridgeJSLowerReturn() + let ret = concatPolygons(_: [PolygonReference].bridgeJSStackPop().map { Polygon.bridgeFromJS($0) }) + return ret.bridgeToJS().bridgeJSLowerReturn() #else fatalError("Only available on WebAssembly") #endif } -@_expose(wasm, "bjs_roundTripUnsafeMutableRawPointer") -@_cdecl("bjs_roundTripUnsafeMutableRawPointer") -public func _bjs_roundTripUnsafeMutableRawPointer(_ v: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { +@_expose(wasm, "bjs_validatePolygon") +@_cdecl("bjs_validatePolygon") +public func _bjs_validatePolygon(_ polygon: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { #if arch(wasm32) - let ret = roundTripUnsafeMutableRawPointer(v: UnsafeMutableRawPointer.bridgeJSLiftParameter(v)) - return ret.bridgeJSLowerReturn() + do { + let ret = try validatePolygon(_: Polygon.bridgeFromJS(PolygonReference.bridgeJSLiftParameter(polygon))) + return ret.bridgeToJS().bridgeJSLowerReturn() + } catch let error { + if let error = error.thrownValue.object { + withExtendedLifetime(error) { + _swift_js_throw(Int32(bitPattern: $0.id)) + } + } else { + let jsError = JSError(message: String(describing: error)) + withExtendedLifetime(jsError.jsObject) { + _swift_js_throw(Int32(bitPattern: $0.id)) + } + } + return UnsafeMutableRawPointer(bitPattern: -1).unsafelyUnwrapped + } #else fatalError("Only available on WebAssembly") #endif } -@_expose(wasm, "bjs_roundTripOpaquePointer") -@_cdecl("bjs_roundTripOpaquePointer") -public func _bjs_roundTripOpaquePointer(_ v: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { +@_expose(wasm, "bjs_splitPolygon") +@_cdecl("bjs_splitPolygon") +public func _bjs_splitPolygon(_ polygon: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) - let ret = roundTripOpaquePointer(v: OpaquePointer.bridgeJSLiftParameter(v)) - return ret.bridgeJSLowerReturn() + let ret = splitPolygon(_: Polygon.bridgeFromJS(PolygonReference.bridgeJSLiftParameter(polygon))) + ret.map { $0.bridgeToJS() }.bridgeJSStackPush() #else fatalError("Only available on WebAssembly") #endif } -@_expose(wasm, "bjs_roundTripUnsafePointer") -@_cdecl("bjs_roundTripUnsafePointer") -public func _bjs_roundTripUnsafePointer(_ v: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { +@_expose(wasm, "bjs_incrementToken") +@_cdecl("bjs_incrementToken") +public func _bjs_incrementToken(_ token: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { #if arch(wasm32) - let ret = roundTripUnsafePointer(v: UnsafePointer.bridgeJSLiftParameter(v)) - return ret.bridgeJSLowerReturn() + let ret = incrementToken(_: Token.bridgeFromJS(TokenReference.bridgeJSLiftParameter(token))) + return ret.bridgeToJS().bridgeJSLowerReturn() #else fatalError("Only available on WebAssembly") #endif } -@_expose(wasm, "bjs_roundTripUnsafeMutablePointer") -@_cdecl("bjs_roundTripUnsafeMutablePointer") -public func _bjs_roundTripUnsafeMutablePointer(_ v: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { +@_expose(wasm, "bjs_makeToken") +@_cdecl("bjs_makeToken") +public func _bjs_makeToken(_ value: Int32) -> UnsafeMutableRawPointer { #if arch(wasm32) - let ret = roundTripUnsafeMutablePointer(v: UnsafeMutablePointer.bridgeJSLiftParameter(v)) - return ret.bridgeJSLowerReturn() + let ret = makeToken(_: Int.bridgeJSLiftParameter(value)) + return ret.bridgeToJS().bridgeJSLowerReturn() #else fatalError("Only available on WebAssembly") #endif } -@_expose(wasm, "bjs_roundTripJSObject") -@_cdecl("bjs_roundTripJSObject") -public func _bjs_roundTripJSObject(_ v: Int32) -> Int32 { +@_expose(wasm, "bjs_makePolygonInspector") +@_cdecl("bjs_makePolygonInspector") +public func _bjs_makePolygonInspector() -> Int32 { #if arch(wasm32) - let ret = roundTripJSObject(v: JSObject.bridgeJSLiftParameter(v)) - return ret.bridgeJSLowerReturn() + let ret = makePolygonInspector() + return JSTypedClosure(ret).bridgeJSLowerReturn() #else fatalError("Only available on WebAssembly") #endif } -@_expose(wasm, "bjs_roundTripDictionaryExport") -@_cdecl("bjs_roundTripDictionaryExport") -public func _bjs_roundTripDictionaryExport() -> Void { +@_expose(wasm, "bjs_asyncMakePolygon") +@_cdecl("bjs_asyncMakePolygon") +public func _bjs_asyncMakePolygon(_ labelBytes: Int32, _ labelLength: Int32) -> Int32 { #if arch(wasm32) - let ret = roundTripDictionaryExport(v: [String: Int].bridgeJSLiftParameter()) + let ret = JSPromise.async { + return await asyncMakePolygon(_: String.bridgeJSLiftParameter(labelBytes, labelLength)).bridgeToJS().jsValue + }.jsObject + return ret.bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_roundTripOptionalPolygonArray") +@_cdecl("bjs_roundTripOptionalPolygonArray") +public func _bjs_roundTripOptionalPolygonArray() -> Void { + #if arch(wasm32) + let ret = roundTripOptionalPolygonArray(_: [Optional].bridgeJSStackPop().map { $0.map { Polygon.bridgeFromJS($0) } }) + ret.map { $0.map { $0.bridgeToJS() } }.bridgeJSStackPush() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_makeTagHolder") +@_cdecl("bjs_makeTagHolder") +public func _bjs_makeTagHolder(_ nameBytes: Int32, _ nameLength: Int32, _ version: Int32) -> UnsafeMutableRawPointer { + #if arch(wasm32) + let ret = makeTagHolder(_: String.bridgeJSLiftParameter(nameBytes, nameLength), _: Int.bridgeJSLiftParameter(version)) + return ret.bridgeToJS().bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_roundTripCoordinate") +@_cdecl("bjs_roundTripCoordinate") +public func _bjs_roundTripCoordinate() -> Void { + #if arch(wasm32) + let ret = roundTripCoordinate(_: Coordinate.bridgeFromJS(JSCoordinate.bridgeJSLiftParameter())) + return ret.bridgeToJS().bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_roundTripPriority") +@_cdecl("bjs_roundTripPriority") +public func _bjs_roundTripPriority(_ priority: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { + #if arch(wasm32) + let ret = roundTripPriority(_: Priority.bridgeFromJS(PriorityReference.bridgeJSLiftParameter(priority))) + return ret.bridgeToJS().bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_roundTripAlert") +@_cdecl("bjs_roundTripAlert") +public func _bjs_roundTripAlert(_ alert: Int32) -> Int32 { + #if arch(wasm32) + let ret = roundTripAlert(_: Alert.bridgeFromJS(Severity.bridgeJSLiftParameter(alert))) + return ret.bridgeToJS().bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_makeAlert") +@_cdecl("bjs_makeAlert") +public func _bjs_makeAlert(_ level: Int32) -> Int32 { + #if arch(wasm32) + let ret = makeAlert(_: Severity.bridgeJSLiftParameter(level)) + return ret.bridgeToJS().bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_roundTripSession") +@_cdecl("bjs_roundTripSession") +public func _bjs_roundTripSession() -> Void { + #if arch(wasm32) + let ret = roundTripSession(_: Session.bridgeFromJS(SessionState.bridgeJSLiftParameter())) + return ret.bridgeToJS().bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_makeSession") +@_cdecl("bjs_makeSession") +public func _bjs_makeSession(_ tokenBytes: Int32, _ tokenLength: Int32) -> Void { + #if arch(wasm32) + let ret = makeSession(_: String.bridgeJSLiftParameter(tokenBytes, tokenLength)) + return ret.bridgeToJS().bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_roundTripShape") +@_cdecl("bjs_roundTripShape") +public func _bjs_roundTripShape(_ s: Int32) -> Void { + #if arch(wasm32) + let ret = roundTripShape(_: Shape.bridgeJSLiftParameter(s)) + return ret.bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_makeShapePolygon") +@_cdecl("bjs_makeShapePolygon") +public func _bjs_makeShapePolygon(_ polygon: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) + let ret = makeShapePolygon(_: Polygon.bridgeFromJS(PolygonReference.bridgeJSLiftParameter(polygon))) + return ret.bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_makeShapeEmpty") +@_cdecl("bjs_makeShapeEmpty") +public func _bjs_makeShapeEmpty() -> Void { + #if arch(wasm32) + let ret = makeShapeEmpty() + return ret.bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_roundTripVoid") +@_cdecl("bjs_roundTripVoid") +public func _bjs_roundTripVoid() -> Void { + #if arch(wasm32) + roundTripVoid() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_roundTripFloat") +@_cdecl("bjs_roundTripFloat") +public func _bjs_roundTripFloat(_ v: Float32) -> Float32 { + #if arch(wasm32) + let ret = roundTripFloat(v: Float.bridgeJSLiftParameter(v)) + return ret.bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_roundTripDouble") +@_cdecl("bjs_roundTripDouble") +public func _bjs_roundTripDouble(_ v: Float64) -> Float64 { + #if arch(wasm32) + let ret = roundTripDouble(v: Double.bridgeJSLiftParameter(v)) + return ret.bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_roundTripBool") +@_cdecl("bjs_roundTripBool") +public func _bjs_roundTripBool(_ v: Int32) -> Int32 { + #if arch(wasm32) + let ret = roundTripBool(v: Bool.bridgeJSLiftParameter(v)) + return ret.bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_roundTripString") +@_cdecl("bjs_roundTripString") +public func _bjs_roundTripString(_ vBytes: Int32, _ vLength: Int32) -> Void { + #if arch(wasm32) + let ret = roundTripString(v: String.bridgeJSLiftParameter(vBytes, vLength)) + return ret.bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_roundTripSwiftHeapObject") +@_cdecl("bjs_roundTripSwiftHeapObject") +public func _bjs_roundTripSwiftHeapObject(_ v: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { + #if arch(wasm32) + let ret = roundTripSwiftHeapObject(v: Greeter.bridgeJSLiftParameter(v)) + return ret.bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_roundTripUnsafeRawPointer") +@_cdecl("bjs_roundTripUnsafeRawPointer") +public func _bjs_roundTripUnsafeRawPointer(_ v: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { + #if arch(wasm32) + let ret = roundTripUnsafeRawPointer(v: UnsafeRawPointer.bridgeJSLiftParameter(v)) + return ret.bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_roundTripUnsafeMutableRawPointer") +@_cdecl("bjs_roundTripUnsafeMutableRawPointer") +public func _bjs_roundTripUnsafeMutableRawPointer(_ v: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { + #if arch(wasm32) + let ret = roundTripUnsafeMutableRawPointer(v: UnsafeMutableRawPointer.bridgeJSLiftParameter(v)) + return ret.bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_roundTripOpaquePointer") +@_cdecl("bjs_roundTripOpaquePointer") +public func _bjs_roundTripOpaquePointer(_ v: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { + #if arch(wasm32) + let ret = roundTripOpaquePointer(v: OpaquePointer.bridgeJSLiftParameter(v)) + return ret.bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_roundTripUnsafePointer") +@_cdecl("bjs_roundTripUnsafePointer") +public func _bjs_roundTripUnsafePointer(_ v: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { + #if arch(wasm32) + let ret = roundTripUnsafePointer(v: UnsafePointer.bridgeJSLiftParameter(v)) + return ret.bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_roundTripUnsafeMutablePointer") +@_cdecl("bjs_roundTripUnsafeMutablePointer") +public func _bjs_roundTripUnsafeMutablePointer(_ v: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { + #if arch(wasm32) + let ret = roundTripUnsafeMutablePointer(v: UnsafeMutablePointer.bridgeJSLiftParameter(v)) + return ret.bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_roundTripJSObject") +@_cdecl("bjs_roundTripJSObject") +public func _bjs_roundTripJSObject(_ v: Int32) -> Int32 { + #if arch(wasm32) + let ret = roundTripJSObject(v: JSObject.bridgeJSLiftParameter(v)) + return ret.bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_roundTripDictionaryExport") +@_cdecl("bjs_roundTripDictionaryExport") +public func _bjs_roundTripDictionaryExport() -> Void { + #if arch(wasm32) + let ret = roundTripDictionaryExport(v: [String: Int].bridgeJSLiftParameter()) return ret.bridgeJSLowerReturn() #else fatalError("Only available on WebAssembly") @@ -7956,210 +8500,583 @@ public func _bjs_roundTripPointerFields() -> Void { #endif } -@_expose(wasm, "bjs_testStructDefault") -@_cdecl("bjs_testStructDefault") -public func _bjs_testStructDefault() -> Void { +@_expose(wasm, "bjs_testStructDefault") +@_cdecl("bjs_testStructDefault") +public func _bjs_testStructDefault() -> Void { + #if arch(wasm32) + let ret = testStructDefault(point: DataPoint.bridgeJSLiftParameter()) + return ret.bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_cartToJSObject") +@_cdecl("bjs_cartToJSObject") +public func _bjs_cartToJSObject() -> Int32 { + #if arch(wasm32) + let ret = cartToJSObject(_: CopyableCart.bridgeJSLiftParameter()) + return ret.bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_nestedCartToJSObject") +@_cdecl("bjs_nestedCartToJSObject") +public func _bjs_nestedCartToJSObject() -> Int32 { + #if arch(wasm32) + let ret = nestedCartToJSObject(_: CopyableNestedCart.bridgeJSLiftParameter()) + return ret.bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_roundTripDataPoint") +@_cdecl("bjs_roundTripDataPoint") +public func _bjs_roundTripDataPoint() -> Void { + #if arch(wasm32) + let ret = roundTripDataPoint(_: DataPoint.bridgeJSLiftParameter()) + return ret.bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_roundTripPublicPoint") +@_cdecl("bjs_roundTripPublicPoint") +public func _bjs_roundTripPublicPoint() -> Void { + #if arch(wasm32) + let ret = roundTripPublicPoint(_: PublicPoint.bridgeJSLiftParameter()) + return ret.bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_roundTripContact") +@_cdecl("bjs_roundTripContact") +public func _bjs_roundTripContact() -> Void { + #if arch(wasm32) + let ret = roundTripContact(_: Contact.bridgeJSLiftParameter()) + return ret.bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_roundTripConfig") +@_cdecl("bjs_roundTripConfig") +public func _bjs_roundTripConfig() -> Void { + #if arch(wasm32) + let ret = roundTripConfig(_: Config.bridgeJSLiftParameter()) + return ret.bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_roundTripSessionData") +@_cdecl("bjs_roundTripSessionData") +public func _bjs_roundTripSessionData() -> Void { + #if arch(wasm32) + let ret = roundTripSessionData(_: SessionData.bridgeJSLiftParameter()) + return ret.bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_roundTripValidationReport") +@_cdecl("bjs_roundTripValidationReport") +public func _bjs_roundTripValidationReport() -> Void { + #if arch(wasm32) + let ret = roundTripValidationReport(_: ValidationReport.bridgeJSLiftParameter()) + return ret.bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_roundTripAdvancedConfig") +@_cdecl("bjs_roundTripAdvancedConfig") +public func _bjs_roundTripAdvancedConfig() -> Void { + #if arch(wasm32) + let ret = roundTripAdvancedConfig(_: AdvancedConfig.bridgeJSLiftParameter()) + return ret.bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_roundTripMeasurementConfig") +@_cdecl("bjs_roundTripMeasurementConfig") +public func _bjs_roundTripMeasurementConfig() -> Void { + #if arch(wasm32) + let ret = roundTripMeasurementConfig(_: MeasurementConfig.bridgeJSLiftParameter()) + return ret.bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_updateValidationReport") +@_cdecl("bjs_updateValidationReport") +public func _bjs_updateValidationReport(_ newResultIsSome: Int32, _ newResultCaseId: Int32) -> Void { + #if arch(wasm32) + let _tmp_report = ValidationReport.bridgeJSLiftParameter() + let _tmp_newResult = Optional.bridgeJSLiftParameter(newResultIsSome, newResultCaseId) + let ret = updateValidationReport(_: _tmp_newResult, _: _tmp_report) + return ret.bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_testContainerWithStruct") +@_cdecl("bjs_testContainerWithStruct") +public func _bjs_testContainerWithStruct() -> UnsafeMutableRawPointer { + #if arch(wasm32) + let ret = testContainerWithStruct(_: DataPoint.bridgeJSLiftParameter()) + return ret.bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_roundTripJSObjectContainer") +@_cdecl("bjs_roundTripJSObjectContainer") +public func _bjs_roundTripJSObjectContainer() -> Void { + #if arch(wasm32) + let ret = roundTripJSObjectContainer(_: JSObjectContainer.bridgeJSLiftParameter()) + return ret.bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_roundTripFooContainer") +@_cdecl("bjs_roundTripFooContainer") +public func _bjs_roundTripFooContainer() -> Void { + #if arch(wasm32) + let ret = roundTripFooContainer(_: FooContainer.bridgeJSLiftParameter()) + return ret.bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_roundTripArrayMembers") +@_cdecl("bjs_roundTripArrayMembers") +public func _bjs_roundTripArrayMembers() -> Void { + #if arch(wasm32) + let ret = roundTripArrayMembers(_: ArrayMembers.bridgeJSLiftParameter()) + return ret.bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_arrayMembersSum") +@_cdecl("bjs_arrayMembersSum") +public func _bjs_arrayMembersSum() -> Int32 { + #if arch(wasm32) + let _tmp_values = [Int].bridgeJSStackPop() + let _tmp_value = ArrayMembers.bridgeJSLiftParameter() + let ret = arrayMembersSum(_: _tmp_value, _: _tmp_values) + return ret.bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_arrayMembersFirst") +@_cdecl("bjs_arrayMembersFirst") +public func _bjs_arrayMembersFirst() -> Void { + #if arch(wasm32) + let _tmp_values = [String].bridgeJSStackPop() + let _tmp_value = ArrayMembers.bridgeJSLiftParameter() + let ret = arrayMembersFirst(_: _tmp_value, _: _tmp_values) + return ret.bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_PolygonReference_init") +@_cdecl("bjs_PolygonReference_init") +public func _bjs_PolygonReference_init(_ labelBytes: Int32, _ labelLength: Int32) -> UnsafeMutableRawPointer { + #if arch(wasm32) + let ret = PolygonReference(verticesData: [Double].bridgeJSStackPop(), label: String.bridgeJSLiftParameter(labelBytes, labelLength)) + return ret.bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_PolygonReference_vertexCount") +@_cdecl("bjs_PolygonReference_vertexCount") +public func _bjs_PolygonReference_vertexCount(_ _self: UnsafeMutableRawPointer) -> Int32 { + #if arch(wasm32) + let ret = PolygonReference.bridgeJSLiftParameter(_self).vertexCount() + return ret.bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_PolygonReference_summary") +@_cdecl("bjs_PolygonReference_summary") +public func _bjs_PolygonReference_summary(_ _self: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) + let ret = PolygonReference.bridgeJSLiftParameter(_self).summary() + return ret.bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_PolygonReference_snapshot") +@_cdecl("bjs_PolygonReference_snapshot") +public func _bjs_PolygonReference_snapshot(_ _self: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { + #if arch(wasm32) + let ret = PolygonReference.bridgeJSLiftParameter(_self).snapshot() + return ret.bridgeToJS().bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_PolygonReference_merge") +@_cdecl("bjs_PolygonReference_merge") +public func _bjs_PolygonReference_merge(_ _self: UnsafeMutableRawPointer, _ other: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { + #if arch(wasm32) + let ret = PolygonReference.bridgeJSLiftParameter(_self).merge(_: Polygon.bridgeFromJS(PolygonReference.bridgeJSLiftParameter(other))) + return ret.bridgeToJS().bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_PolygonReference_static_origin") +@_cdecl("bjs_PolygonReference_static_origin") +public func _bjs_PolygonReference_static_origin(_ labelBytes: Int32, _ labelLength: Int32) -> UnsafeMutableRawPointer { + #if arch(wasm32) + let ret = PolygonReference.origin(label: String.bridgeJSLiftParameter(labelBytes, labelLength)) + return ret.bridgeToJS().bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_PolygonReference_deinit") +@_cdecl("bjs_PolygonReference_deinit") +public func _bjs_PolygonReference_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) + Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif +} + +extension PolygonReference: ConvertibleToJSValue, _BridgedSwiftHeapObject, _BridgedSwiftProtocolExportable { + var jsValue: JSValue { + return .object(JSObject(id: UInt32(bitPattern: _bjs_PolygonReference_wrap(Unmanaged.passRetained(self).toOpaque())))) + } + consuming func bridgeJSLowerAsProtocolReturn() -> Int32 { + _bjs_PolygonReference_wrap(Unmanaged.passRetained(self).toOpaque()) + } +} + +#if arch(wasm32) +@_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_PolygonReference_wrap") +fileprivate func _bjs_PolygonReference_wrap_extern(_ pointer: UnsafeMutableRawPointer) -> Int32 +#else +fileprivate func _bjs_PolygonReference_wrap_extern(_ pointer: UnsafeMutableRawPointer) -> Int32 { + fatalError("Only available on WebAssembly") +} +#endif +@inline(never) fileprivate func _bjs_PolygonReference_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { + return _bjs_PolygonReference_wrap_extern(pointer) +} + +@_expose(wasm, "bjs_TagReference_describe") +@_cdecl("bjs_TagReference_describe") +public func _bjs_TagReference_describe(_ _self: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) + let ret = TagReference.bridgeJSLiftParameter(_self).describe() + return ret.bridgeJSLowerReturn() + #else + fatalError("Only available on WebAssembly") + #endif +} + +@_expose(wasm, "bjs_TagReference_deinit") +@_cdecl("bjs_TagReference_deinit") +public func _bjs_TagReference_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) + Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif +} + +extension TagReference: ConvertibleToJSValue, _BridgedSwiftHeapObject, _BridgedSwiftProtocolExportable { + var jsValue: JSValue { + return .object(JSObject(id: UInt32(bitPattern: _bjs_TagReference_wrap(Unmanaged.passRetained(self).toOpaque())))) + } + consuming func bridgeJSLowerAsProtocolReturn() -> Int32 { + _bjs_TagReference_wrap(Unmanaged.passRetained(self).toOpaque()) + } +} + +#if arch(wasm32) +@_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_TagReference_wrap") +fileprivate func _bjs_TagReference_wrap_extern(_ pointer: UnsafeMutableRawPointer) -> Int32 +#else +fileprivate func _bjs_TagReference_wrap_extern(_ pointer: UnsafeMutableRawPointer) -> Int32 { + fatalError("Only available on WebAssembly") +} +#endif +@inline(never) fileprivate func _bjs_TagReference_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { + return _bjs_TagReference_wrap_extern(pointer) +} + +@_expose(wasm, "bjs_TokenReference_init") +@_cdecl("bjs_TokenReference_init") +public func _bjs_TokenReference_init(_ value: Int32) -> UnsafeMutableRawPointer { #if arch(wasm32) - let ret = testStructDefault(point: DataPoint.bridgeJSLiftParameter()) + let ret = TokenReference(value: Int.bridgeJSLiftParameter(value)) return ret.bridgeJSLowerReturn() #else fatalError("Only available on WebAssembly") #endif } -@_expose(wasm, "bjs_cartToJSObject") -@_cdecl("bjs_cartToJSObject") -public func _bjs_cartToJSObject() -> Int32 { +@_expose(wasm, "bjs_TokenReference_read") +@_cdecl("bjs_TokenReference_read") +public func _bjs_TokenReference_read(_ _self: UnsafeMutableRawPointer) -> Int32 { #if arch(wasm32) - let ret = cartToJSObject(_: CopyableCart.bridgeJSLiftParameter()) + let ret = TokenReference.bridgeJSLiftParameter(_self).read() return ret.bridgeJSLowerReturn() #else fatalError("Only available on WebAssembly") #endif } -@_expose(wasm, "bjs_nestedCartToJSObject") -@_cdecl("bjs_nestedCartToJSObject") -public func _bjs_nestedCartToJSObject() -> Int32 { +@_expose(wasm, "bjs_TokenReference_deinit") +@_cdecl("bjs_TokenReference_deinit") +public func _bjs_TokenReference_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) - let ret = nestedCartToJSObject(_: CopyableNestedCart.bridgeJSLiftParameter()) - return ret.bridgeJSLowerReturn() + Unmanaged.fromOpaque(pointer).release() #else fatalError("Only available on WebAssembly") #endif } -@_expose(wasm, "bjs_roundTripDataPoint") -@_cdecl("bjs_roundTripDataPoint") -public func _bjs_roundTripDataPoint() -> Void { - #if arch(wasm32) - let ret = roundTripDataPoint(_: DataPoint.bridgeJSLiftParameter()) - return ret.bridgeJSLowerReturn() - #else +extension TokenReference: ConvertibleToJSValue, _BridgedSwiftHeapObject, _BridgedSwiftProtocolExportable { + var jsValue: JSValue { + return .object(JSObject(id: UInt32(bitPattern: _bjs_TokenReference_wrap(Unmanaged.passRetained(self).toOpaque())))) + } + consuming func bridgeJSLowerAsProtocolReturn() -> Int32 { + _bjs_TokenReference_wrap(Unmanaged.passRetained(self).toOpaque()) + } +} + +#if arch(wasm32) +@_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_TokenReference_wrap") +fileprivate func _bjs_TokenReference_wrap_extern(_ pointer: UnsafeMutableRawPointer) -> Int32 +#else +fileprivate func _bjs_TokenReference_wrap_extern(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") - #endif +} +#endif +@inline(never) fileprivate func _bjs_TokenReference_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { + return _bjs_TokenReference_wrap_extern(pointer) } -@_expose(wasm, "bjs_roundTripPublicPoint") -@_cdecl("bjs_roundTripPublicPoint") -public func _bjs_roundTripPublicPoint() -> Void { +@_expose(wasm, "bjs_TagHolderReference_init") +@_cdecl("bjs_TagHolderReference_init") +public func _bjs_TagHolderReference_init(_ tag: UnsafeMutableRawPointer, _ version: Int32) -> UnsafeMutableRawPointer { #if arch(wasm32) - let ret = roundTripPublicPoint(_: PublicPoint.bridgeJSLiftParameter()) + let ret = TagHolderReference(tag: Tag.bridgeFromJS(TagReference.bridgeJSLiftParameter(tag)), version: Int.bridgeJSLiftParameter(version)) return ret.bridgeJSLowerReturn() #else fatalError("Only available on WebAssembly") #endif } -@_expose(wasm, "bjs_roundTripContact") -@_cdecl("bjs_roundTripContact") -public func _bjs_roundTripContact() -> Void { +@_expose(wasm, "bjs_TagHolderReference_describe") +@_cdecl("bjs_TagHolderReference_describe") +public func _bjs_TagHolderReference_describe(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) - let ret = roundTripContact(_: Contact.bridgeJSLiftParameter()) + let ret = TagHolderReference.bridgeJSLiftParameter(_self).describe() return ret.bridgeJSLowerReturn() #else fatalError("Only available on WebAssembly") #endif } -@_expose(wasm, "bjs_roundTripConfig") -@_cdecl("bjs_roundTripConfig") -public func _bjs_roundTripConfig() -> Void { +@_expose(wasm, "bjs_TagHolderReference_tag_get") +@_cdecl("bjs_TagHolderReference_tag_get") +public func _bjs_TagHolderReference_tag_get(_ _self: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { #if arch(wasm32) - let ret = roundTripConfig(_: Config.bridgeJSLiftParameter()) - return ret.bridgeJSLowerReturn() + let ret = TagHolderReference.bridgeJSLiftParameter(_self).tag + return ret.bridgeToJS().bridgeJSLowerReturn() #else fatalError("Only available on WebAssembly") #endif } -@_expose(wasm, "bjs_roundTripSessionData") -@_cdecl("bjs_roundTripSessionData") -public func _bjs_roundTripSessionData() -> Void { +@_expose(wasm, "bjs_TagHolderReference_tag_set") +@_cdecl("bjs_TagHolderReference_tag_set") +public func _bjs_TagHolderReference_tag_set(_ _self: UnsafeMutableRawPointer, _ value: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) - let ret = roundTripSessionData(_: SessionData.bridgeJSLiftParameter()) - return ret.bridgeJSLowerReturn() + TagHolderReference.bridgeJSLiftParameter(_self).tag = Tag.bridgeFromJS(TagReference.bridgeJSLiftParameter(value)) #else fatalError("Only available on WebAssembly") #endif } -@_expose(wasm, "bjs_roundTripValidationReport") -@_cdecl("bjs_roundTripValidationReport") -public func _bjs_roundTripValidationReport() -> Void { +@_expose(wasm, "bjs_TagHolderReference_version_get") +@_cdecl("bjs_TagHolderReference_version_get") +public func _bjs_TagHolderReference_version_get(_ _self: UnsafeMutableRawPointer) -> Int32 { #if arch(wasm32) - let ret = roundTripValidationReport(_: ValidationReport.bridgeJSLiftParameter()) + let ret = TagHolderReference.bridgeJSLiftParameter(_self).version return ret.bridgeJSLowerReturn() #else fatalError("Only available on WebAssembly") #endif } -@_expose(wasm, "bjs_roundTripAdvancedConfig") -@_cdecl("bjs_roundTripAdvancedConfig") -public func _bjs_roundTripAdvancedConfig() -> Void { +@_expose(wasm, "bjs_TagHolderReference_version_set") +@_cdecl("bjs_TagHolderReference_version_set") +public func _bjs_TagHolderReference_version_set(_ _self: UnsafeMutableRawPointer, _ value: Int32) -> Void { #if arch(wasm32) - let ret = roundTripAdvancedConfig(_: AdvancedConfig.bridgeJSLiftParameter()) - return ret.bridgeJSLowerReturn() + TagHolderReference.bridgeJSLiftParameter(_self).version = Int.bridgeJSLiftParameter(value) #else fatalError("Only available on WebAssembly") #endif } -@_expose(wasm, "bjs_roundTripMeasurementConfig") -@_cdecl("bjs_roundTripMeasurementConfig") -public func _bjs_roundTripMeasurementConfig() -> Void { +@_expose(wasm, "bjs_TagHolderReference_deinit") +@_cdecl("bjs_TagHolderReference_deinit") +public func _bjs_TagHolderReference_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) - let ret = roundTripMeasurementConfig(_: MeasurementConfig.bridgeJSLiftParameter()) - return ret.bridgeJSLowerReturn() + Unmanaged.fromOpaque(pointer).release() #else fatalError("Only available on WebAssembly") #endif } -@_expose(wasm, "bjs_updateValidationReport") -@_cdecl("bjs_updateValidationReport") -public func _bjs_updateValidationReport(_ newResultIsSome: Int32, _ newResultCaseId: Int32) -> Void { - #if arch(wasm32) - let _tmp_report = ValidationReport.bridgeJSLiftParameter() - let _tmp_newResult = Optional.bridgeJSLiftParameter(newResultIsSome, newResultCaseId) - let ret = updateValidationReport(_: _tmp_newResult, _: _tmp_report) - return ret.bridgeJSLowerReturn() - #else +extension TagHolderReference: ConvertibleToJSValue, _BridgedSwiftHeapObject, _BridgedSwiftProtocolExportable { + var jsValue: JSValue { + return .object(JSObject(id: UInt32(bitPattern: _bjs_TagHolderReference_wrap(Unmanaged.passRetained(self).toOpaque())))) + } + consuming func bridgeJSLowerAsProtocolReturn() -> Int32 { + _bjs_TagHolderReference_wrap(Unmanaged.passRetained(self).toOpaque()) + } +} + +#if arch(wasm32) +@_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_TagHolderReference_wrap") +fileprivate func _bjs_TagHolderReference_wrap_extern(_ pointer: UnsafeMutableRawPointer) -> Int32 +#else +fileprivate func _bjs_TagHolderReference_wrap_extern(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") - #endif +} +#endif +@inline(never) fileprivate func _bjs_TagHolderReference_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { + return _bjs_TagHolderReference_wrap_extern(pointer) } -@_expose(wasm, "bjs_testContainerWithStruct") -@_cdecl("bjs_testContainerWithStruct") -public func _bjs_testContainerWithStruct() -> UnsafeMutableRawPointer { +@_expose(wasm, "bjs_PriorityReference_describe") +@_cdecl("bjs_PriorityReference_describe") +public func _bjs_PriorityReference_describe(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) - let ret = testContainerWithStruct(_: DataPoint.bridgeJSLiftParameter()) + let ret = PriorityReference.bridgeJSLiftParameter(_self).describe() return ret.bridgeJSLowerReturn() #else fatalError("Only available on WebAssembly") #endif } -@_expose(wasm, "bjs_roundTripJSObjectContainer") -@_cdecl("bjs_roundTripJSObjectContainer") -public func _bjs_roundTripJSObjectContainer() -> Void { +@_expose(wasm, "bjs_PriorityReference_weight") +@_cdecl("bjs_PriorityReference_weight") +public func _bjs_PriorityReference_weight(_ _self: UnsafeMutableRawPointer) -> Int32 { #if arch(wasm32) - let ret = roundTripJSObjectContainer(_: JSObjectContainer.bridgeJSLiftParameter()) + let ret = PriorityReference.bridgeJSLiftParameter(_self).weight() return ret.bridgeJSLowerReturn() #else fatalError("Only available on WebAssembly") #endif } -@_expose(wasm, "bjs_roundTripFooContainer") -@_cdecl("bjs_roundTripFooContainer") -public func _bjs_roundTripFooContainer() -> Void { +@_expose(wasm, "bjs_PriorityReference_static_low") +@_cdecl("bjs_PriorityReference_static_low") +public func _bjs_PriorityReference_static_low() -> UnsafeMutableRawPointer { #if arch(wasm32) - let ret = roundTripFooContainer(_: FooContainer.bridgeJSLiftParameter()) - return ret.bridgeJSLowerReturn() + let ret = PriorityReference.low() + return ret.bridgeToJS().bridgeJSLowerReturn() #else fatalError("Only available on WebAssembly") #endif } -@_expose(wasm, "bjs_roundTripArrayMembers") -@_cdecl("bjs_roundTripArrayMembers") -public func _bjs_roundTripArrayMembers() -> Void { +@_expose(wasm, "bjs_PriorityReference_static_medium") +@_cdecl("bjs_PriorityReference_static_medium") +public func _bjs_PriorityReference_static_medium() -> UnsafeMutableRawPointer { #if arch(wasm32) - let ret = roundTripArrayMembers(_: ArrayMembers.bridgeJSLiftParameter()) - return ret.bridgeJSLowerReturn() + let ret = PriorityReference.medium() + return ret.bridgeToJS().bridgeJSLowerReturn() #else fatalError("Only available on WebAssembly") #endif } -@_expose(wasm, "bjs_arrayMembersSum") -@_cdecl("bjs_arrayMembersSum") -public func _bjs_arrayMembersSum() -> Int32 { +@_expose(wasm, "bjs_PriorityReference_static_high") +@_cdecl("bjs_PriorityReference_static_high") +public func _bjs_PriorityReference_static_high() -> UnsafeMutableRawPointer { #if arch(wasm32) - let _tmp_values = [Int].bridgeJSStackPop() - let _tmp_value = ArrayMembers.bridgeJSLiftParameter() - let ret = arrayMembersSum(_: _tmp_value, _: _tmp_values) - return ret.bridgeJSLowerReturn() + let ret = PriorityReference.high() + return ret.bridgeToJS().bridgeJSLowerReturn() #else fatalError("Only available on WebAssembly") #endif } -@_expose(wasm, "bjs_arrayMembersFirst") -@_cdecl("bjs_arrayMembersFirst") -public func _bjs_arrayMembersFirst() -> Void { +@_expose(wasm, "bjs_PriorityReference_deinit") +@_cdecl("bjs_PriorityReference_deinit") +public func _bjs_PriorityReference_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) - let _tmp_values = [String].bridgeJSStackPop() - let _tmp_value = ArrayMembers.bridgeJSLiftParameter() - let ret = arrayMembersFirst(_: _tmp_value, _: _tmp_values) - return ret.bridgeJSLowerReturn() + Unmanaged.fromOpaque(pointer).release() #else fatalError("Only available on WebAssembly") #endif } +extension PriorityReference: ConvertibleToJSValue, _BridgedSwiftHeapObject, _BridgedSwiftProtocolExportable { + var jsValue: JSValue { + return .object(JSObject(id: UInt32(bitPattern: _bjs_PriorityReference_wrap(Unmanaged.passRetained(self).toOpaque())))) + } + consuming func bridgeJSLowerAsProtocolReturn() -> Int32 { + _bjs_PriorityReference_wrap(Unmanaged.passRetained(self).toOpaque()) + } +} + +#if arch(wasm32) +@_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_PriorityReference_wrap") +fileprivate func _bjs_PriorityReference_wrap_extern(_ pointer: UnsafeMutableRawPointer) -> Int32 +#else +fileprivate func _bjs_PriorityReference_wrap_extern(_ pointer: UnsafeMutableRawPointer) -> Int32 { + fatalError("Only available on WebAssembly") +} +#endif +@inline(never) fileprivate func _bjs_PriorityReference_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { + return _bjs_PriorityReference_wrap_extern(pointer) +} + @_expose(wasm, "bjs_ClosureSupportExports_static_makeIntToInt") @_cdecl("bjs_ClosureSupportExports_static_makeIntToInt") public func _bjs_ClosureSupportExports_static_makeIntToInt(_ base: Int32) -> Int32 { @@ -11100,6 +12017,196 @@ fileprivate func _bjs_LeakCheck_wrap_extern(_ pointer: UnsafeMutableRawPointer) return _bjs_LeakCheck_wrap_extern(pointer) } +#if arch(wasm32) +@_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_Surface_init") +fileprivate func bjs_Surface_init_extern(_ labelBytes: Int32, _ labelLength: Int32) -> Int32 +#else +fileprivate func bjs_Surface_init_extern(_ labelBytes: Int32, _ labelLength: Int32) -> Int32 { + fatalError("Only available on WebAssembly") +} +#endif +@inline(never) fileprivate func bjs_Surface_init(_ labelBytes: Int32, _ labelLength: Int32) -> Int32 { + return bjs_Surface_init_extern(labelBytes, labelLength) +} + +#if arch(wasm32) +@_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_Surface_label_get") +fileprivate func bjs_Surface_label_get_extern(_ self: Int32) -> Int32 +#else +fileprivate func bjs_Surface_label_get_extern(_ self: Int32) -> Int32 { + fatalError("Only available on WebAssembly") +} +#endif +@inline(never) fileprivate func bjs_Surface_label_get(_ self: Int32) -> Int32 { + return bjs_Surface_label_get_extern(self) +} + +func _$Surface_init(_ label: String) throws(JSException) -> JSObject { + let ret0 = label.bridgeJSWithLoweredParameter { (labelBytes, labelLength) in + let ret = bjs_Surface_init(labelBytes, labelLength) + return ret + } + let ret = ret0 + if let error = _swift_js_take_exception() { + throw error + } + return JSObject.bridgeJSLiftReturn(ret) +} + +func _$Surface_label_get(_ self: JSObject) throws(JSException) -> String { + let selfValue = self.bridgeJSLowerParameter() + let ret = bjs_Surface_label_get(selfValue) + if let error = _swift_js_take_exception() { + throw error + } + return String.bridgeJSLiftReturn(ret) +} + +#if arch(wasm32) +@_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_AliasImports_jsRoundTripTagged_static") +fileprivate func bjs_AliasImports_jsRoundTripTagged_static_extern(_ valueBytes: Int32, _ valueLength: Int32) -> Int32 +#else +fileprivate func bjs_AliasImports_jsRoundTripTagged_static_extern(_ valueBytes: Int32, _ valueLength: Int32) -> Int32 { + fatalError("Only available on WebAssembly") +} +#endif +@inline(never) fileprivate func bjs_AliasImports_jsRoundTripTagged_static(_ valueBytes: Int32, _ valueLength: Int32) -> Int32 { + return bjs_AliasImports_jsRoundTripTagged_static_extern(valueBytes, valueLength) +} + +#if arch(wasm32) +@_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_AliasImports_jsRoundTripOptionalTagged_static") +fileprivate func bjs_AliasImports_jsRoundTripOptionalTagged_static_extern(_ valueIsSome: Int32, _ valueBytes: Int32, _ valueLength: Int32) -> Void +#else +fileprivate func bjs_AliasImports_jsRoundTripOptionalTagged_static_extern(_ valueIsSome: Int32, _ valueBytes: Int32, _ valueLength: Int32) -> Void { + fatalError("Only available on WebAssembly") +} +#endif +@inline(never) fileprivate func bjs_AliasImports_jsRoundTripOptionalTagged_static(_ valueIsSome: Int32, _ valueBytes: Int32, _ valueLength: Int32) -> Void { + return bjs_AliasImports_jsRoundTripOptionalTagged_static_extern(valueIsSome, valueBytes, valueLength) +} + +#if arch(wasm32) +@_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_AliasImports_jsProduceOptionalCanvas_static") +fileprivate func bjs_AliasImports_jsProduceOptionalCanvas_static_extern(_ labelIsSome: Int32, _ labelBytes: Int32, _ labelLength: Int32) -> Void +#else +fileprivate func bjs_AliasImports_jsProduceOptionalCanvas_static_extern(_ labelIsSome: Int32, _ labelBytes: Int32, _ labelLength: Int32) -> Void { + fatalError("Only available on WebAssembly") +} +#endif +@inline(never) fileprivate func bjs_AliasImports_jsProduceOptionalCanvas_static(_ labelIsSome: Int32, _ labelBytes: Int32, _ labelLength: Int32) -> Void { + return bjs_AliasImports_jsProduceOptionalCanvas_static_extern(labelIsSome, labelBytes, labelLength) +} + +#if arch(wasm32) +@_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_AliasImports_jsRoundTripAliasedTags_static") +fileprivate func bjs_AliasImports_jsRoundTripAliasedTags_static_extern() -> Void +#else +fileprivate func bjs_AliasImports_jsRoundTripAliasedTags_static_extern() -> Void { + fatalError("Only available on WebAssembly") +} +#endif +@inline(never) fileprivate func bjs_AliasImports_jsRoundTripAliasedTags_static() -> Void { + return bjs_AliasImports_jsRoundTripAliasedTags_static_extern() +} + +#if arch(wasm32) +@_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_AliasImports_jsRoundTripPolygon_static") +fileprivate func bjs_AliasImports_jsRoundTripPolygon_static_extern(_ value: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer +#else +fileprivate func bjs_AliasImports_jsRoundTripPolygon_static_extern(_ value: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { + fatalError("Only available on WebAssembly") +} +#endif +@inline(never) fileprivate func bjs_AliasImports_jsRoundTripPolygon_static(_ value: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { + return bjs_AliasImports_jsRoundTripPolygon_static_extern(value) +} + +#if arch(wasm32) +@_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_AliasImports_jsRoundTripCoordinate_static") +fileprivate func bjs_AliasImports_jsRoundTripCoordinate_static_extern(_ value: Int32) -> Int32 +#else +fileprivate func bjs_AliasImports_jsRoundTripCoordinate_static_extern(_ value: Int32) -> Int32 { + fatalError("Only available on WebAssembly") +} +#endif +@inline(never) fileprivate func bjs_AliasImports_jsRoundTripCoordinate_static(_ value: Int32) -> Int32 { + return bjs_AliasImports_jsRoundTripCoordinate_static_extern(value) +} + +func _$AliasImports_jsRoundTripTagged(_ value: Tagged) throws(JSException) -> Tagged { + let ret0 = value.bridgeToJS().bridgeJSWithLoweredParameter { (valueBytes, valueLength) in + let ret = bjs_AliasImports_jsRoundTripTagged_static(valueBytes, valueLength) + return ret + } + let ret = ret0 + if let error = _swift_js_take_exception() { + throw error + } + return Tagged.bridgeFromJS(String.bridgeJSLiftReturn(ret)) +} + +func _$AliasImports_jsRoundTripOptionalTagged(_ value: Optional) throws(JSException) -> Optional { + value.map { + $0.bridgeToJS() + } .bridgeJSWithLoweredParameter { (valueIsSome, valueBytes, valueLength) in + bjs_AliasImports_jsRoundTripOptionalTagged_static(valueIsSome, valueBytes, valueLength) + } + if let error = _swift_js_take_exception() { + throw error + } + return Optional.bridgeJSLiftReturnFromSideChannel().map { + Tagged.bridgeFromJS($0) + } +} + +func _$AliasImports_jsProduceOptionalCanvas(_ label: Optional) throws(JSException) -> Optional { + label.bridgeJSWithLoweredParameter { (labelIsSome, labelBytes, labelLength) in + bjs_AliasImports_jsProduceOptionalCanvas_static(labelIsSome, labelBytes, labelLength) + } + if let error = _swift_js_take_exception() { + throw error + } + return Optional.bridgeJSLiftReturn().map { + Canvas.bridgeFromJS($0) + } +} + +func _$AliasImports_jsRoundTripAliasedTags(_ values: [Optional]) throws(JSException) -> [Optional] { + let _ = values.map { + $0.map { + $0.bridgeToJS() + } + } .bridgeJSLowerParameter() + bjs_AliasImports_jsRoundTripAliasedTags_static() + if let error = _swift_js_take_exception() { + throw error + } + return [Optional].bridgeJSLiftReturn().map { + $0.map { + AliasedTag.bridgeFromJS($0) + } + } +} + +func _$AliasImports_jsRoundTripPolygon(_ value: Polygon) throws(JSException) -> Polygon { + let valuePointer = value.bridgeToJS().bridgeJSLowerParameter() + let ret = bjs_AliasImports_jsRoundTripPolygon_static(valuePointer) + if let error = _swift_js_take_exception() { + throw error + } + return Polygon.bridgeFromJS(PolygonReference.bridgeJSLiftReturn(ret)) +} + +func _$AliasImports_jsRoundTripCoordinate(_ value: Coordinate) throws(JSException) -> Coordinate { + let valueObjectId = value.bridgeToJS().bridgeJSLowerParameter() + let ret = bjs_AliasImports_jsRoundTripCoordinate_static(valueObjectId) + if let error = _swift_js_take_exception() { + throw error + } + return Coordinate.bridgeFromJS(JSCoordinate.bridgeJSLiftReturn(ret)) +} + #if arch(wasm32) @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_ArrayElementObject_init") fileprivate func bjs_ArrayElementObject_init_extern(_ idBytes: Int32, _ idLength: Int32) -> Int32 @@ -12567,6 +13674,28 @@ func _$runAsyncWorks() async throws(JSException) -> Void { } } +#if arch(wasm32) +@_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_runAliasAsyncWorks") +fileprivate func bjs_runAliasAsyncWorks_extern(_ resolveRef: Int32, _ rejectRef: Int32) -> Void +#else +fileprivate func bjs_runAliasAsyncWorks_extern(_ resolveRef: Int32, _ rejectRef: Int32) -> Void { + fatalError("Only available on WebAssembly") +} +#endif +@inline(never) fileprivate func bjs_runAliasAsyncWorks(_ resolveRef: Int32, _ rejectRef: Int32) -> Void { + return bjs_runAliasAsyncWorks_extern(resolveRef, rejectRef) +} + +func _$runAliasAsyncWorks() async throws(JSException) -> Void { + try await _bjs_awaitPromise(makeResolveClosure: { + JSTypedClosure<() -> Void>($0) + }, makeRejectClosure: { + JSTypedClosure<(sending JSValue) -> Void>($0) + }) { resolveRef, rejectRef in + bjs_runAliasAsyncWorks(resolveRef, rejectRef) + } +} + #if arch(wasm32) @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_fetchWeatherData") fileprivate func bjs_fetchWeatherData_extern(_ resolveRef: Int32, _ rejectRef: Int32, _ cityBytes: Int32, _ cityLength: Int32) -> Void diff --git a/Tests/BridgeJSRuntimeTests/Generated/JavaScript/BridgeJS.json b/Tests/BridgeJSRuntimeTests/Generated/JavaScript/BridgeJS.json index 94142f470..fb6286e97 100644 --- a/Tests/BridgeJSRuntimeTests/Generated/JavaScript/BridgeJS.json +++ b/Tests/BridgeJSRuntimeTests/Generated/JavaScript/BridgeJS.json @@ -1,127 +1,236 @@ { "exported" : { + "aliases" : [ + { + "swiftCallName" : "Polygon", + "underlying" : { + "swiftHeapObject" : { + "_0" : "PolygonReference" + } + } + }, + { + "swiftCallName" : "Tag", + "underlying" : { + "swiftHeapObject" : { + "_0" : "TagReference" + } + } + }, + { + "swiftCallName" : "Token", + "underlying" : { + "swiftHeapObject" : { + "_0" : "TokenReference" + } + } + }, + { + "swiftCallName" : "TagHolder", + "underlying" : { + "swiftHeapObject" : { + "_0" : "TagHolderReference" + } + } + }, + { + "swiftCallName" : "Coordinate", + "underlying" : { + "swiftStruct" : { + "_0" : "JSCoordinate" + } + } + }, + { + "swiftCallName" : "Priority", + "underlying" : { + "swiftHeapObject" : { + "_0" : "PriorityReference" + } + } + }, + { + "swiftCallName" : "Alert", + "underlying" : { + "caseEnum" : { + "_0" : "Severity" + } + } + }, + { + "swiftCallName" : "Session", + "underlying" : { + "swiftStruct" : { + "_0" : "SessionState" + } + } + }, + { + "swiftCallName" : "Tagged", + "underlying" : { + "string" : { + + } + } + }, + { + "swiftCallName" : "Canvas", + "underlying" : { + "jsObject" : { + "_0" : "Surface" + } + } + }, + { + "swiftCallName" : "AliasedTag", + "underlying" : { + "associatedValueEnum" : { + "_0" : "InnerTag" + } + } + } + ], "classes" : [ { + "constructor" : { + "abiName" : "bjs_PolygonReference_init", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "parameters" : [ + { + "label" : "verticesData", + "name" : "verticesData", + "type" : { + "array" : { + "_0" : { + "double" : { + + } + } + } + } + }, + { + "label" : "label", + "name" : "label", + "type" : { + "string" : { + + } + } + } + ] + }, "methods" : [ { - "abiName" : "bjs_ClosureSupportExports_static_makeIntToInt", + "abiName" : "bjs_PolygonReference_vertexCount", "effects" : { "isAsync" : false, - "isStatic" : true, + "isStatic" : false, "isThrows" : false }, - "name" : "makeIntToInt", + "name" : "vertexCount", "parameters" : [ - { - "label" : "_", - "name" : "base", - "type" : { - "integer" : { - "_0" : { - "isSigned" : true, - "width" : "word" - } - } + + ], + "returnType" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" } } + } + }, + { + "abiName" : "bjs_PolygonReference_summary", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "name" : "summary", + "parameters" : [ + ], "returnType" : { - "closure" : { - "_0" : { - "isAsync" : false, - "isThrows" : false, - "mangleName" : "20BridgeJSRuntimeTestsSi_Si", - "moduleName" : "BridgeJSRuntimeTests", - "parameters" : [ - { - "integer" : { - "_0" : { - "isSigned" : true, - "width" : "word" - } - } - } - ], - "returnType" : { - "integer" : { - "_0" : { - "isSigned" : true, - "width" : "word" - } - } - }, - "sendingParameters" : false - }, - "useJSTypedClosure" : false + "string" : { + } + } + }, + { + "abiName" : "bjs_PolygonReference_snapshot", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false }, - "staticContext" : { - "className" : { - "_0" : "ClosureSupportExports" + "name" : "snapshot", + "parameters" : [ + + ], + "returnType" : { + "alias" : { + "name" : "Polygon", + "underlying" : { + "swiftHeapObject" : { + "_0" : "PolygonReference" + } + } } } }, { - "abiName" : "bjs_ClosureSupportExports_static_makeDoubleToDouble", + "abiName" : "bjs_PolygonReference_merge", "effects" : { "isAsync" : false, - "isStatic" : true, + "isStatic" : false, "isThrows" : false }, - "name" : "makeDoubleToDouble", + "name" : "merge", "parameters" : [ { "label" : "_", - "name" : "base", + "name" : "other", "type" : { - "double" : { - + "alias" : { + "name" : "Polygon", + "underlying" : { + "swiftHeapObject" : { + "_0" : "PolygonReference" + } + } } } } ], "returnType" : { - "closure" : { - "_0" : { - "isAsync" : false, - "isThrows" : false, - "mangleName" : "20BridgeJSRuntimeTestsSd_Sd", - "moduleName" : "BridgeJSRuntimeTests", - "parameters" : [ - { - "double" : { - - } - } - ], - "returnType" : { - "double" : { - - } - }, - "sendingParameters" : false - }, - "useJSTypedClosure" : false - } - }, - "staticContext" : { - "className" : { - "_0" : "ClosureSupportExports" + "alias" : { + "name" : "Polygon", + "underlying" : { + "swiftHeapObject" : { + "_0" : "PolygonReference" + } + } } } }, { - "abiName" : "bjs_ClosureSupportExports_static_makeStringToString", + "abiName" : "bjs_PolygonReference_static_origin", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "makeStringToString", + "name" : "origin", "parameters" : [ { - "label" : "_", - "name" : "prefix", + "label" : "label", + "name" : "label", "type" : { "string" : { @@ -130,201 +239,108 @@ } ], "returnType" : { - "closure" : { - "_0" : { - "isAsync" : false, - "isThrows" : false, - "mangleName" : "20BridgeJSRuntimeTestsSS_SS", - "moduleName" : "BridgeJSRuntimeTests", - "parameters" : [ - { - "string" : { - - } - } - ], - "returnType" : { - "string" : { - - } - }, - "sendingParameters" : false - }, - "useJSTypedClosure" : false + "alias" : { + "name" : "Polygon", + "underlying" : { + "swiftHeapObject" : { + "_0" : "PolygonReference" + } + } } }, "staticContext" : { "className" : { - "_0" : "ClosureSupportExports" + "_0" : "PolygonReference" } } - }, + } + ], + "name" : "PolygonReference", + "properties" : [ + + ], + "swiftCallName" : "PolygonReference" + }, + { + "methods" : [ { - "abiName" : "bjs_ClosureSupportExports_static_makeJSIntToInt", + "abiName" : "bjs_TagReference_describe", "effects" : { "isAsync" : false, - "isStatic" : true, + "isStatic" : false, "isThrows" : false }, - "name" : "makeJSIntToInt", + "name" : "describe", "parameters" : [ - { - "label" : "_", - "name" : "base", - "type" : { - "integer" : { - "_0" : { - "isSigned" : true, - "width" : "word" - } - } - } - } + ], "returnType" : { - "closure" : { - "_0" : { - "isAsync" : false, - "isThrows" : false, - "mangleName" : "20BridgeJSRuntimeTestsSi_Si", - "moduleName" : "BridgeJSRuntimeTests", - "parameters" : [ - { - "integer" : { - "_0" : { - "isSigned" : true, - "width" : "word" - } - } - } - ], - "returnType" : { - "integer" : { - "_0" : { - "isSigned" : true, - "width" : "word" - } - } - }, - "sendingParameters" : false - }, - "useJSTypedClosure" : true - } - }, - "staticContext" : { - "className" : { - "_0" : "ClosureSupportExports" + "string" : { + } } - }, - { - "abiName" : "bjs_ClosureSupportExports_static_makeJSDoubleToDouble", - "effects" : { - "isAsync" : false, - "isStatic" : true, - "isThrows" : false - }, - "name" : "makeJSDoubleToDouble", - "parameters" : [ - { - "label" : "_", - "name" : "base", - "type" : { - "double" : { + } + ], + "name" : "TagReference", + "properties" : [ + ], + "swiftCallName" : "TagReference" + }, + { + "constructor" : { + "abiName" : "bjs_TokenReference_init", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "parameters" : [ + { + "label" : "value", + "name" : "value", + "type" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" } } } - ], - "returnType" : { - "closure" : { - "_0" : { - "isAsync" : false, - "isThrows" : false, - "mangleName" : "20BridgeJSRuntimeTestsSd_Sd", - "moduleName" : "BridgeJSRuntimeTests", - "parameters" : [ - { - "double" : { - - } - } - ], - "returnType" : { - "double" : { - - } - }, - "sendingParameters" : false - }, - "useJSTypedClosure" : true - } - }, - "staticContext" : { - "className" : { - "_0" : "ClosureSupportExports" - } } - }, + ] + }, + "methods" : [ { - "abiName" : "bjs_ClosureSupportExports_static_makeJSStringToString", + "abiName" : "bjs_TokenReference_read", "effects" : { "isAsync" : false, - "isStatic" : true, + "isStatic" : false, "isThrows" : false }, - "name" : "makeJSStringToString", + "name" : "read", "parameters" : [ - { - "label" : "_", - "name" : "prefix", - "type" : { - "string" : { - } - } - } ], "returnType" : { - "closure" : { + "integer" : { "_0" : { - "isAsync" : false, - "isThrows" : false, - "mangleName" : "20BridgeJSRuntimeTestsSS_SS", - "moduleName" : "BridgeJSRuntimeTests", - "parameters" : [ - { - "string" : { - - } - } - ], - "returnType" : { - "string" : { - - } - }, - "sendingParameters" : false - }, - "useJSTypedClosure" : true - } - }, - "staticContext" : { - "className" : { - "_0" : "ClosureSupportExports" + "isSigned" : true, + "width" : "word" + } } } } ], - "name" : "ClosureSupportExports", + "name" : "TokenReference", "properties" : [ ], - "swiftCallName" : "ClosureSupportExports" + "swiftCallName" : "TokenReference" }, { "constructor" : { - "abiName" : "bjs_DefaultArgumentConstructorDefaults_init", + "abiName" : "bjs_TagHolderReference_init", "effects" : { "isAsync" : false, "isStatic" : false, @@ -332,27 +348,22 @@ }, "parameters" : [ { - "defaultValue" : { - "string" : { - "_0" : "Default" - } - }, - "label" : "name", - "name" : "name", + "label" : "tag", + "name" : "tag", "type" : { - "string" : { - + "alias" : { + "name" : "Tag", + "underlying" : { + "swiftHeapObject" : { + "_0" : "TagReference" + } + } } } }, { - "defaultValue" : { - "int" : { - "_0" : 42 - } - }, - "label" : "count", - "name" : "count", + "label" : "version", + "name" : "version", "type" : { "integer" : { "_0" : { @@ -361,60 +372,12 @@ } } } - }, - { - "defaultValue" : { - "bool" : { - "_0" : true - } - }, - "label" : "enabled", - "name" : "enabled", - "type" : { - "bool" : { - - } - } - }, - { - "defaultValue" : { - "enumCase" : { - "_0" : "Status", - "_1" : "success" - } - }, - "label" : "status", - "name" : "status", - "type" : { - "caseEnum" : { - "_0" : "Status" - } - } - }, - { - "defaultValue" : { - "null" : { - - } - }, - "label" : "tag", - "name" : "tag", - "type" : { - "nullable" : { - "_0" : { - "string" : { - - } - }, - "_1" : "null" - } - } } ] }, "methods" : [ { - "abiName" : "bjs_DefaultArgumentConstructorDefaults_describe", + "abiName" : "bjs_TagHolderReference_describe", "effects" : { "isAsync" : false, "isStatic" : false, @@ -431,22 +394,27 @@ } } ], - "name" : "DefaultArgumentConstructorDefaults", + "name" : "TagHolderReference", "properties" : [ { "isReadonly" : false, "isStatic" : false, - "name" : "name", + "name" : "tag", "type" : { - "string" : { - + "alias" : { + "name" : "Tag", + "underlying" : { + "swiftHeapObject" : { + "_0" : "TagReference" + } + } } } }, { "isReadonly" : false, "isStatic" : false, - "name" : "count", + "name" : "version", "type" : { "integer" : { "_0" : { @@ -455,177 +423,157 @@ } } } - }, + } + ], + "swiftCallName" : "TagHolderReference" + }, + { + "methods" : [ { - "isReadonly" : false, - "isStatic" : false, - "name" : "enabled", - "type" : { - "bool" : { + "abiName" : "bjs_PriorityReference_describe", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "name" : "describe", + "parameters" : [ + + ], + "returnType" : { + "string" : { } } }, { - "isReadonly" : false, - "isStatic" : false, - "name" : "status", - "type" : { - "caseEnum" : { - "_0" : "Status" - } - } - }, - { - "isReadonly" : false, - "isStatic" : false, - "name" : "tag", - "type" : { - "nullable" : { - "_0" : { - "string" : { - - } - }, - "_1" : "null" - } - } - } - ], - "swiftCallName" : "DefaultArgumentConstructorDefaults" - }, - { - "constructor" : { - "abiName" : "bjs_Greeter_init", - "effects" : { - "isAsync" : false, - "isStatic" : false, - "isThrows" : false - }, - "parameters" : [ - { - "label" : "name", - "name" : "name", - "type" : { - "string" : { + "abiName" : "bjs_PriorityReference_weight", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "name" : "weight", + "parameters" : [ + ], + "returnType" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" } } } - ] - }, - "explicitAccessControl" : "public", - "methods" : [ + }, { - "abiName" : "bjs_Greeter_greet", + "abiName" : "bjs_PriorityReference_static_low", "effects" : { "isAsync" : false, - "isStatic" : false, + "isStatic" : true, "isThrows" : false }, - "name" : "greet", + "name" : "low", "parameters" : [ ], "returnType" : { - "string" : { - + "alias" : { + "name" : "Priority", + "underlying" : { + "swiftHeapObject" : { + "_0" : "PriorityReference" + } + } + } + }, + "staticContext" : { + "className" : { + "_0" : "PriorityReference" } } }, { - "abiName" : "bjs_Greeter_changeName", + "abiName" : "bjs_PriorityReference_static_medium", "effects" : { "isAsync" : false, - "isStatic" : false, + "isStatic" : true, "isThrows" : false }, - "name" : "changeName", + "name" : "medium", "parameters" : [ - { - "label" : "name", - "name" : "name", - "type" : { - "string" : { + ], + "returnType" : { + "alias" : { + "name" : "Priority", + "underlying" : { + "swiftHeapObject" : { + "_0" : "PriorityReference" } } } - ], - "returnType" : { - "void" : { - + }, + "staticContext" : { + "className" : { + "_0" : "PriorityReference" } } }, { - "abiName" : "bjs_Greeter_greetWith", + "abiName" : "bjs_PriorityReference_static_high", "effects" : { "isAsync" : false, - "isStatic" : false, + "isStatic" : true, "isThrows" : false }, - "name" : "greetWith", + "name" : "high", "parameters" : [ - { - "label" : "greeter", - "name" : "greeter", - "type" : { - "swiftHeapObject" : { - "_0" : "Greeter" - } - } - }, - { - "label" : "customGreeting", - "name" : "customGreeting", - "type" : { - "closure" : { - "_0" : { - "isAsync" : false, - "isThrows" : false, - "mangleName" : "20BridgeJSRuntimeTests7GreeterC_SS", - "moduleName" : "BridgeJSRuntimeTests", - "parameters" : [ - { - "swiftHeapObject" : { - "_0" : "Greeter" - } - } - ], - "returnType" : { - "string" : { - } - }, - "sendingParameters" : false - }, - "useJSTypedClosure" : false + ], + "returnType" : { + "alias" : { + "name" : "Priority", + "underlying" : { + "swiftHeapObject" : { + "_0" : "PriorityReference" } } } - ], - "returnType" : { - "string" : { - + }, + "staticContext" : { + "className" : { + "_0" : "PriorityReference" } } - }, + } + ], + "name" : "PriorityReference", + "properties" : [ + + ], + "swiftCallName" : "PriorityReference" + }, + { + "methods" : [ { - "abiName" : "bjs_Greeter_makeFormatter", + "abiName" : "bjs_ClosureSupportExports_static_makeIntToInt", "effects" : { "isAsync" : false, - "isStatic" : false, + "isStatic" : true, "isThrows" : false }, - "name" : "makeFormatter", + "name" : "makeIntToInt", "parameters" : [ { - "label" : "suffix", - "name" : "suffix", + "label" : "_", + "name" : "base", "type" : { - "string" : { - + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } } } } @@ -635,40 +583,51 @@ "_0" : { "isAsync" : false, "isThrows" : false, - "mangleName" : "20BridgeJSRuntimeTestsSS_SS", + "mangleName" : "20BridgeJSRuntimeTestsSi_Si", "moduleName" : "BridgeJSRuntimeTests", "parameters" : [ { - "string" : { - + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } } } ], "returnType" : { - "string" : { - + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } } }, "sendingParameters" : false }, "useJSTypedClosure" : false } + }, + "staticContext" : { + "className" : { + "_0" : "ClosureSupportExports" + } } }, { - "abiName" : "bjs_Greeter_static_makeCreator", + "abiName" : "bjs_ClosureSupportExports_static_makeDoubleToDouble", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "makeCreator", + "name" : "makeDoubleToDouble", "parameters" : [ { - "label" : "defaultName", - "name" : "defaultName", + "label" : "_", + "name" : "base", "type" : { - "string" : { + "double" : { } } @@ -679,18 +638,18 @@ "_0" : { "isAsync" : false, "isThrows" : false, - "mangleName" : "20BridgeJSRuntimeTestsSS_7GreeterC", + "mangleName" : "20BridgeJSRuntimeTestsSd_Sd", "moduleName" : "BridgeJSRuntimeTests", "parameters" : [ { - "string" : { + "double" : { } } ], "returnType" : { - "swiftHeapObject" : { - "_0" : "Greeter" + "double" : { + } }, "sendingParameters" : false @@ -700,32 +659,40 @@ }, "staticContext" : { "className" : { - "_0" : "Greeter" + "_0" : "ClosureSupportExports" } } }, { - "abiName" : "bjs_Greeter_makeCustomGreeter", + "abiName" : "bjs_ClosureSupportExports_static_makeStringToString", "effects" : { "isAsync" : false, - "isStatic" : false, + "isStatic" : true, "isThrows" : false }, - "name" : "makeCustomGreeter", + "name" : "makeStringToString", "parameters" : [ + { + "label" : "_", + "name" : "prefix", + "type" : { + "string" : { + } + } + } ], "returnType" : { "closure" : { "_0" : { "isAsync" : false, "isThrows" : false, - "mangleName" : "20BridgeJSRuntimeTests7GreeterC_SS", + "mangleName" : "20BridgeJSRuntimeTestsSS_SS", "moduleName" : "BridgeJSRuntimeTests", "parameters" : [ { - "swiftHeapObject" : { - "_0" : "Greeter" + "string" : { + } } ], @@ -738,254 +705,277 @@ }, "useJSTypedClosure" : false } - } - }, - { - "abiName" : "bjs_Greeter_greetEnthusiastically", - "effects" : { - "isAsync" : false, - "isStatic" : false, - "isThrows" : false }, - "name" : "greetEnthusiastically", - "parameters" : [ - - ], - "returnType" : { - "string" : { - + "staticContext" : { + "className" : { + "_0" : "ClosureSupportExports" } } }, { - "abiName" : "bjs_Greeter_static_greetAnonymously", + "abiName" : "bjs_ClosureSupportExports_static_makeJSIntToInt", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "greetAnonymously", + "name" : "makeJSIntToInt", "parameters" : [ - + { + "label" : "_", + "name" : "base", + "type" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + } + } ], "returnType" : { - "string" : { - + "closure" : { + "_0" : { + "isAsync" : false, + "isThrows" : false, + "mangleName" : "20BridgeJSRuntimeTestsSi_Si", + "moduleName" : "BridgeJSRuntimeTests", + "parameters" : [ + { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + } + ], + "returnType" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + }, + "sendingParameters" : false + }, + "useJSTypedClosure" : true } }, "staticContext" : { "className" : { - "_0" : "Greeter" - } - } - } - ], - "name" : "Greeter", - "properties" : [ - { - "isReadonly" : false, - "isStatic" : false, - "name" : "name", - "type" : { - "string" : { - - } - } - }, - { - "isReadonly" : true, - "isStatic" : false, - "name" : "prefix", - "type" : { - "string" : { - - } - } - }, - { - "isReadonly" : true, - "isStatic" : false, - "name" : "nameCount", - "type" : { - "integer" : { - "_0" : { - "isSigned" : true, - "width" : "word" - } + "_0" : "ClosureSupportExports" } } }, { - "isReadonly" : true, - "isStatic" : true, - "name" : "defaultGreeting", - "staticContext" : { - "className" : { - "_0" : "Greeter" - } - }, - "type" : { - "string" : { - - } - } - } - ], - "swiftCallName" : "Greeter" - }, - { - "methods" : [ - { - "abiName" : "bjs_Calculator_square", + "abiName" : "bjs_ClosureSupportExports_static_makeJSDoubleToDouble", "effects" : { "isAsync" : false, - "isStatic" : false, + "isStatic" : true, "isThrows" : false }, - "name" : "square", + "name" : "makeJSDoubleToDouble", "parameters" : [ { - "label" : "value", - "name" : "value", + "label" : "_", + "name" : "base", "type" : { - "integer" : { - "_0" : { - "isSigned" : true, - "width" : "word" - } + "double" : { + } } } ], "returnType" : { - "integer" : { + "closure" : { "_0" : { - "isSigned" : true, - "width" : "word" - } + "isAsync" : false, + "isThrows" : false, + "mangleName" : "20BridgeJSRuntimeTestsSd_Sd", + "moduleName" : "BridgeJSRuntimeTests", + "parameters" : [ + { + "double" : { + + } + } + ], + "returnType" : { + "double" : { + + } + }, + "sendingParameters" : false + }, + "useJSTypedClosure" : true + } + }, + "staticContext" : { + "className" : { + "_0" : "ClosureSupportExports" } } }, { - "abiName" : "bjs_Calculator_add", + "abiName" : "bjs_ClosureSupportExports_static_makeJSStringToString", "effects" : { "isAsync" : false, - "isStatic" : false, + "isStatic" : true, "isThrows" : false }, - "name" : "add", + "name" : "makeJSStringToString", "parameters" : [ { - "label" : "a", - "name" : "a", - "type" : { - "integer" : { - "_0" : { - "isSigned" : true, - "width" : "word" - } - } - } - }, - { - "label" : "b", - "name" : "b", + "label" : "_", + "name" : "prefix", "type" : { - "integer" : { - "_0" : { - "isSigned" : true, - "width" : "word" - } + "string" : { + } } } ], "returnType" : { - "integer" : { + "closure" : { "_0" : { - "isSigned" : true, - "width" : "word" - } + "isAsync" : false, + "isThrows" : false, + "mangleName" : "20BridgeJSRuntimeTestsSS_SS", + "moduleName" : "BridgeJSRuntimeTests", + "parameters" : [ + { + "string" : { + + } + } + ], + "returnType" : { + "string" : { + + } + }, + "sendingParameters" : false + }, + "useJSTypedClosure" : true + } + }, + "staticContext" : { + "className" : { + "_0" : "ClosureSupportExports" } } } ], - "name" : "Calculator", - "properties" : [ - - ], - "swiftCallName" : "Calculator" - }, - { - "explicitAccessControl" : "internal", - "methods" : [ - - ], - "name" : "InternalGreeter", - "properties" : [ - - ], - "swiftCallName" : "InternalGreeter" - }, - { - "explicitAccessControl" : "public", - "methods" : [ - - ], - "name" : "PublicGreeter", - "properties" : [ - - ], - "swiftCallName" : "PublicGreeter" - }, - { - "explicitAccessControl" : "package", - "methods" : [ - - ], - "name" : "PackageGreeter", + "name" : "ClosureSupportExports", "properties" : [ ], - "swiftCallName" : "PackageGreeter" + "swiftCallName" : "ClosureSupportExports" }, { "constructor" : { - "abiName" : "bjs_Utils_Converter_init", + "abiName" : "bjs_DefaultArgumentConstructorDefaults_init", "effects" : { "isAsync" : false, "isStatic" : false, "isThrows" : false }, "parameters" : [ + { + "defaultValue" : { + "string" : { + "_0" : "Default" + } + }, + "label" : "name", + "name" : "name", + "type" : { + "string" : { - ] - }, - "methods" : [ - { - "abiName" : "bjs_Utils_Converter_toString", - "effects" : { - "isAsync" : false, - "isStatic" : false, - "isThrows" : false + } + } }, - "name" : "toString", - "namespace" : [ - "Utils" - ], - "parameters" : [ - { - "label" : "value", - "name" : "value", - "type" : { - "integer" : { - "_0" : { - "isSigned" : true, - "width" : "word" - } + { + "defaultValue" : { + "int" : { + "_0" : 42 + } + }, + "label" : "count", + "name" : "count", + "type" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" } } } + }, + { + "defaultValue" : { + "bool" : { + "_0" : true + } + }, + "label" : "enabled", + "name" : "enabled", + "type" : { + "bool" : { + + } + } + }, + { + "defaultValue" : { + "enumCase" : { + "_0" : "Status", + "_1" : "success" + } + }, + "label" : "status", + "name" : "status", + "type" : { + "caseEnum" : { + "_0" : "Status" + } + } + }, + { + "defaultValue" : { + "null" : { + + } + }, + "label" : "tag", + "name" : "tag", + "type" : { + "nullable" : { + "_0" : { + "string" : { + + } + }, + "_1" : "null" + } + } + } + ] + }, + "methods" : [ + { + "abiName" : "bjs_DefaultArgumentConstructorDefaults_describe", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "name" : "describe", + "parameters" : [ + ], "returnType" : { "string" : { @@ -994,18 +984,22 @@ } } ], - "name" : "Converter", - "namespace" : [ - "Utils" - ], + "name" : "DefaultArgumentConstructorDefaults", "properties" : [ { "isReadonly" : false, "isStatic" : false, - "name" : "precision", - "namespace" : [ - "Utils" - ], + "name" : "name", + "type" : { + "string" : { + + } + } + }, + { + "isReadonly" : false, + "isStatic" : false, + "name" : "count", "type" : { "integer" : { "_0" : { @@ -1014,66 +1008,48 @@ } } } - } - ], - "swiftCallName" : "Utils.Converter" - }, - { - "constructor" : { - "abiName" : "bjs_Networking_API_HTTPServer_init", - "effects" : { - "isAsync" : false, - "isStatic" : false, - "isThrows" : false }, - "parameters" : [ + { + "isReadonly" : false, + "isStatic" : false, + "name" : "enabled", + "type" : { + "bool" : { - ] - }, - "methods" : [ + } + } + }, { - "abiName" : "bjs_Networking_API_HTTPServer_call", - "effects" : { - "isAsync" : false, - "isStatic" : false, - "isThrows" : false - }, - "name" : "call", - "namespace" : [ - "Networking", - "API" - ], - "parameters" : [ - { - "label" : "_", - "name" : "method", - "type" : { - "caseEnum" : { - "_0" : "Networking.API.Method" - } - } + "isReadonly" : false, + "isStatic" : false, + "name" : "status", + "type" : { + "caseEnum" : { + "_0" : "Status" } - ], - "returnType" : { - "void" : { + } + }, + { + "isReadonly" : false, + "isStatic" : false, + "name" : "tag", + "type" : { + "nullable" : { + "_0" : { + "string" : { + } + }, + "_1" : "null" } } } ], - "name" : "HTTPServer", - "namespace" : [ - "Networking", - "API" - ], - "properties" : [ - - ], - "swiftCallName" : "Networking.API.HTTPServer" + "swiftCallName" : "DefaultArgumentConstructorDefaults" }, { "constructor" : { - "abiName" : "bjs___Swift_Foundation_UUID_init", + "abiName" : "bjs_Greeter_init", "effects" : { "isAsync" : false, "isStatic" : false, @@ -1081,8 +1057,8 @@ }, "parameters" : [ { - "label" : "value", - "name" : "value", + "label" : "name", + "name" : "name", "type" : { "string" : { @@ -1091,15 +1067,16 @@ } ] }, + "explicitAccessControl" : "public", "methods" : [ { - "abiName" : "bjs___Swift_Foundation_UUID_uuidString", + "abiName" : "bjs_Greeter_greet", "effects" : { "isAsync" : false, "isStatic" : false, "isThrows" : false }, - "name" : "uuidString", + "name" : "greet", "parameters" : [ ], @@ -1110,17 +1087,17 @@ } }, { - "abiName" : "bjs___Swift_Foundation_UUID_static_fromValue", + "abiName" : "bjs_Greeter_changeName", "effects" : { "isAsync" : false, - "isStatic" : true, + "isStatic" : false, "isThrows" : false }, - "name" : "fromValue", + "name" : "changeName", "parameters" : [ { - "label" : "_", - "name" : "value", + "label" : "name", + "name" : "name", "type" : { "string" : { @@ -1129,368 +1106,249 @@ } ], "returnType" : { - "swiftHeapObject" : { - "_0" : "UUID" - } - }, - "staticContext" : { - "className" : { - "_0" : "__Swift_Foundation_UUID" - } - } - } - ], - "name" : "UUID", - "namespace" : [ - "__Swift", - "Foundation" - ], - "properties" : [ - { - "isReadonly" : true, - "isStatic" : true, - "name" : "placeholder", - "staticContext" : { - "className" : { - "_0" : "__Swift_Foundation_UUID" - } - }, - "type" : { - "string" : { + "void" : { } } - } - ], - "swiftCallName" : "UUID" - }, - { - "constructor" : { - "abiName" : "bjs_Networking_APIV2_Internal_TestServer_init", - "effects" : { - "isAsync" : false, - "isStatic" : false, - "isThrows" : false }, - "parameters" : [ - - ] - }, - "methods" : [ { - "abiName" : "bjs_Networking_APIV2_Internal_TestServer_call", + "abiName" : "bjs_Greeter_greetWith", "effects" : { "isAsync" : false, "isStatic" : false, "isThrows" : false }, - "name" : "call", - "namespace" : [ - "Networking", - "APIV2", - "Internal" - ], + "name" : "greetWith", "parameters" : [ { - "label" : "_", - "name" : "method", + "label" : "greeter", + "name" : "greeter", "type" : { - "caseEnum" : { - "_0" : "Internal.SupportedMethod" + "swiftHeapObject" : { + "_0" : "Greeter" } } - } - ], - "returnType" : { - "void" : { - - } - } - } - ], - "name" : "TestServer", - "namespace" : [ - "Networking", - "APIV2", - "Internal" - ], - "properties" : [ + }, + { + "label" : "customGreeting", + "name" : "customGreeting", + "type" : { + "closure" : { + "_0" : { + "isAsync" : false, + "isThrows" : false, + "mangleName" : "20BridgeJSRuntimeTests7GreeterC_SS", + "moduleName" : "BridgeJSRuntimeTests", + "parameters" : [ + { + "swiftHeapObject" : { + "_0" : "Greeter" + } + } + ], + "returnType" : { + "string" : { - ], - "swiftCallName" : "Internal.TestServer" - }, - { - "constructor" : { - "abiName" : "bjs_SimplePropertyHolder_init", - "effects" : { - "isAsync" : false, - "isStatic" : false, - "isThrows" : false - }, - "parameters" : [ - { - "label" : "value", - "name" : "value", - "type" : { - "integer" : { - "_0" : { - "isSigned" : true, - "width" : "word" + } + }, + "sendingParameters" : false + }, + "useJSTypedClosure" : false } } } - } - ] - }, - "methods" : [ + ], + "returnType" : { + "string" : { - ], - "name" : "SimplePropertyHolder", - "properties" : [ - { - "isReadonly" : false, - "isStatic" : false, - "name" : "value", - "type" : { - "integer" : { - "_0" : { - "isSigned" : true, - "width" : "word" - } } } - } - ], - "swiftCallName" : "SimplePropertyHolder" - }, - { - "constructor" : { - "abiName" : "bjs_PropertyHolder_init", - "effects" : { - "isAsync" : false, - "isStatic" : false, - "isThrows" : false }, - "parameters" : [ - { - "label" : "intValue", - "name" : "intValue", - "type" : { - "integer" : { - "_0" : { - "isSigned" : true, - "width" : "word" - } - } - } + { + "abiName" : "bjs_Greeter_makeFormatter", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false }, - { - "label" : "floatValue", - "name" : "floatValue", - "type" : { - "float" : { + "name" : "makeFormatter", + "parameters" : [ + { + "label" : "suffix", + "name" : "suffix", + "type" : { + "string" : { + } } } - }, - { - "label" : "doubleValue", - "name" : "doubleValue", - "type" : { - "double" : { + ], + "returnType" : { + "closure" : { + "_0" : { + "isAsync" : false, + "isThrows" : false, + "mangleName" : "20BridgeJSRuntimeTestsSS_SS", + "moduleName" : "BridgeJSRuntimeTests", + "parameters" : [ + { + "string" : { - } - } - }, - { - "label" : "boolValue", - "name" : "boolValue", - "type" : { - "bool" : { + } + } + ], + "returnType" : { + "string" : { - } + } + }, + "sendingParameters" : false + }, + "useJSTypedClosure" : false } + } + }, + { + "abiName" : "bjs_Greeter_static_makeCreator", + "effects" : { + "isAsync" : false, + "isStatic" : true, + "isThrows" : false }, - { - "label" : "stringValue", - "name" : "stringValue", - "type" : { - "string" : { + "name" : "makeCreator", + "parameters" : [ + { + "label" : "defaultName", + "name" : "defaultName", + "type" : { + "string" : { + } } } - }, - { - "label" : "jsObject", - "name" : "jsObject", - "type" : { - "jsObject" : { + ], + "returnType" : { + "closure" : { + "_0" : { + "isAsync" : false, + "isThrows" : false, + "mangleName" : "20BridgeJSRuntimeTestsSS_7GreeterC", + "moduleName" : "BridgeJSRuntimeTests", + "parameters" : [ + { + "string" : { - } + } + } + ], + "returnType" : { + "swiftHeapObject" : { + "_0" : "Greeter" + } + }, + "sendingParameters" : false + }, + "useJSTypedClosure" : false } }, - { - "label" : "sibling", - "name" : "sibling", - "type" : { - "swiftHeapObject" : { - "_0" : "SimplePropertyHolder" - } + "staticContext" : { + "className" : { + "_0" : "Greeter" } } - ] - }, - "methods" : [ + }, { - "abiName" : "bjs_PropertyHolder_getAllValues", + "abiName" : "bjs_Greeter_makeCustomGreeter", "effects" : { "isAsync" : false, "isStatic" : false, "isThrows" : false }, - "name" : "getAllValues", + "name" : "makeCustomGreeter", "parameters" : [ ], "returnType" : { - "string" : { - - } - } - } - ], - "name" : "PropertyHolder", - "properties" : [ - { - "isReadonly" : false, - "isStatic" : false, - "name" : "intValue", - "type" : { - "integer" : { - "_0" : { - "isSigned" : true, - "width" : "word" - } - } - } - }, - { - "isReadonly" : false, - "isStatic" : false, - "name" : "floatValue", - "type" : { - "float" : { - - } - } - }, - { - "isReadonly" : false, - "isStatic" : false, - "name" : "doubleValue", - "type" : { - "double" : { + "closure" : { + "_0" : { + "isAsync" : false, + "isThrows" : false, + "mangleName" : "20BridgeJSRuntimeTests7GreeterC_SS", + "moduleName" : "BridgeJSRuntimeTests", + "parameters" : [ + { + "swiftHeapObject" : { + "_0" : "Greeter" + } + } + ], + "returnType" : { + "string" : { + } + }, + "sendingParameters" : false + }, + "useJSTypedClosure" : false } } }, { - "isReadonly" : false, - "isStatic" : false, - "name" : "boolValue", - "type" : { - "bool" : { + "abiName" : "bjs_Greeter_greetEnthusiastically", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "name" : "greetEnthusiastically", + "parameters" : [ - } - } - }, - { - "isReadonly" : false, - "isStatic" : false, - "name" : "stringValue", - "type" : { + ], + "returnType" : { "string" : { } } }, { - "isReadonly" : true, - "isStatic" : false, - "name" : "readonlyInt", - "type" : { - "integer" : { - "_0" : { - "isSigned" : true, - "width" : "word" - } - } - } - }, - { - "isReadonly" : true, - "isStatic" : false, - "name" : "readonlyFloat", - "type" : { - "float" : { - - } - } - }, - { - "isReadonly" : true, - "isStatic" : false, - "name" : "readonlyDouble", - "type" : { - "double" : { - - } - } - }, - { - "isReadonly" : true, - "isStatic" : false, - "name" : "readonlyBool", - "type" : { - "bool" : { + "abiName" : "bjs_Greeter_static_greetAnonymously", + "effects" : { + "isAsync" : false, + "isStatic" : true, + "isThrows" : false + }, + "name" : "greetAnonymously", + "parameters" : [ - } - } - }, - { - "isReadonly" : true, - "isStatic" : false, - "name" : "readonlyString", - "type" : { + ], + "returnType" : { "string" : { } - } - }, - { - "isReadonly" : false, - "isStatic" : false, - "name" : "jsObject", - "type" : { - "jsObject" : { - + }, + "staticContext" : { + "className" : { + "_0" : "Greeter" } } - }, + } + ], + "name" : "Greeter", + "properties" : [ { "isReadonly" : false, "isStatic" : false, - "name" : "sibling", + "name" : "name", "type" : { - "swiftHeapObject" : { - "_0" : "SimplePropertyHolder" + "string" : { + } } }, { - "isReadonly" : false, + "isReadonly" : true, "isStatic" : false, - "name" : "lazyValue", + "name" : "prefix", "type" : { "string" : { @@ -1500,7 +1358,7 @@ { "isReadonly" : true, "isStatic" : false, - "name" : "computedReadonly", + "name" : "nameCount", "type" : { "integer" : { "_0" : { @@ -1511,57 +1369,37 @@ } }, { - "isReadonly" : false, - "isStatic" : false, - "name" : "computedReadWrite", + "isReadonly" : true, + "isStatic" : true, + "name" : "defaultGreeting", + "staticContext" : { + "className" : { + "_0" : "Greeter" + } + }, "type" : { "string" : { } } - }, - { - "isReadonly" : false, - "isStatic" : false, - "name" : "observedProperty", - "type" : { - "integer" : { - "_0" : { - "isSigned" : true, - "width" : "word" - } - } - } } ], - "swiftCallName" : "PropertyHolder" + "swiftCallName" : "Greeter" }, { "methods" : [ { - "abiName" : "bjs_MathUtils_static_add", + "abiName" : "bjs_Calculator_square", "effects" : { "isAsync" : false, - "isStatic" : true, + "isStatic" : false, "isThrows" : false }, - "name" : "add", + "name" : "square", "parameters" : [ { - "label" : "a", - "name" : "a", - "type" : { - "integer" : { - "_0" : { - "isSigned" : true, - "width" : "word" - } - } - } - }, - { - "label" : "b", - "name" : "b", + "label" : "value", + "name" : "value", "type" : { "integer" : { "_0" : { @@ -1579,21 +1417,16 @@ "width" : "word" } } - }, - "staticContext" : { - "className" : { - "_0" : "MathUtils" - } } }, { - "abiName" : "bjs_MathUtils_static_substract", + "abiName" : "bjs_Calculator_add", "effects" : { "isAsync" : false, - "isStatic" : true, + "isStatic" : false, "isThrows" : false }, - "name" : "substract", + "name" : "add", "parameters" : [ { "label" : "a", @@ -1627,23 +1460,51 @@ "width" : "word" } } - }, - "staticContext" : { - "className" : { - "_0" : "MathUtils" - } } } ], - "name" : "MathUtils", + "name" : "Calculator", "properties" : [ ], - "swiftCallName" : "MathUtils" + "swiftCallName" : "Calculator" + }, + { + "explicitAccessControl" : "internal", + "methods" : [ + + ], + "name" : "InternalGreeter", + "properties" : [ + + ], + "swiftCallName" : "InternalGreeter" + }, + { + "explicitAccessControl" : "public", + "methods" : [ + + ], + "name" : "PublicGreeter", + "properties" : [ + + ], + "swiftCallName" : "PublicGreeter" + }, + { + "explicitAccessControl" : "package", + "methods" : [ + + ], + "name" : "PackageGreeter", + "properties" : [ + + ], + "swiftCallName" : "PackageGreeter" }, { "constructor" : { - "abiName" : "bjs_StaticPropertyHolder_init", + "abiName" : "bjs_Utils_Converter_init", "effects" : { "isAsync" : false, "isStatic" : false, @@ -1654,34 +1515,50 @@ ] }, "methods" : [ - - ], - "name" : "StaticPropertyHolder", - "properties" : [ { - "isReadonly" : true, - "isStatic" : true, - "name" : "staticConstant", - "staticContext" : { - "className" : { - "_0" : "StaticPropertyHolder" - } + "abiName" : "bjs_Utils_Converter_toString", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false }, - "type" : { + "name" : "toString", + "namespace" : [ + "Utils" + ], + "parameters" : [ + { + "label" : "value", + "name" : "value", + "type" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + } + } + ], + "returnType" : { "string" : { } } - }, + } + ], + "name" : "Converter", + "namespace" : [ + "Utils" + ], + "properties" : [ { "isReadonly" : false, - "isStatic" : true, - "name" : "staticVariable", - "staticContext" : { - "className" : { - "_0" : "StaticPropertyHolder" - } - }, + "isStatic" : false, + "name" : "precision", + "namespace" : [ + "Utils" + ], "type" : { "integer" : { "_0" : { @@ -1690,164 +1567,214 @@ } } } + } + ], + "swiftCallName" : "Utils.Converter" + }, + { + "constructor" : { + "abiName" : "bjs_Networking_API_HTTPServer_init", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false }, + "parameters" : [ + + ] + }, + "methods" : [ { - "isReadonly" : false, - "isStatic" : true, - "name" : "staticString", - "staticContext" : { - "className" : { - "_0" : "StaticPropertyHolder" - } + "abiName" : "bjs_Networking_API_HTTPServer_call", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false }, - "type" : { - "string" : { + "name" : "call", + "namespace" : [ + "Networking", + "API" + ], + "parameters" : [ + { + "label" : "_", + "name" : "method", + "type" : { + "caseEnum" : { + "_0" : "Networking.API.Method" + } + } + } + ], + "returnType" : { + "void" : { } } + } + ], + "name" : "HTTPServer", + "namespace" : [ + "Networking", + "API" + ], + "properties" : [ + + ], + "swiftCallName" : "Networking.API.HTTPServer" + }, + { + "constructor" : { + "abiName" : "bjs___Swift_Foundation_UUID_init", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false }, - { - "isReadonly" : false, - "isStatic" : true, - "name" : "staticBool", - "staticContext" : { - "className" : { - "_0" : "StaticPropertyHolder" - } - }, - "type" : { - "bool" : { + "parameters" : [ + { + "label" : "value", + "name" : "value", + "type" : { + "string" : { + } } } - }, + ] + }, + "methods" : [ { - "isReadonly" : false, - "isStatic" : true, - "name" : "staticFloat", - "staticContext" : { - "className" : { - "_0" : "StaticPropertyHolder" - } + "abiName" : "bjs___Swift_Foundation_UUID_uuidString", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false }, - "type" : { - "float" : { + "name" : "uuidString", + "parameters" : [ + + ], + "returnType" : { + "string" : { } } }, { - "isReadonly" : false, - "isStatic" : true, - "name" : "staticDouble", - "staticContext" : { - "className" : { - "_0" : "StaticPropertyHolder" - } + "abiName" : "bjs___Swift_Foundation_UUID_static_fromValue", + "effects" : { + "isAsync" : false, + "isStatic" : true, + "isThrows" : false }, - "type" : { - "double" : { + "name" : "fromValue", + "parameters" : [ + { + "label" : "_", + "name" : "value", + "type" : { + "string" : { + } + } } - } - }, - { - "isReadonly" : false, - "isStatic" : true, - "name" : "computedProperty", - "staticContext" : { - "className" : { - "_0" : "StaticPropertyHolder" + ], + "returnType" : { + "swiftHeapObject" : { + "_0" : "UUID" } }, - "type" : { - "string" : { - - } - } - }, - { - "isReadonly" : true, - "isStatic" : true, - "name" : "readOnlyComputed", "staticContext" : { "className" : { - "_0" : "StaticPropertyHolder" - } - }, - "type" : { - "integer" : { - "_0" : { - "isSigned" : true, - "width" : "word" - } + "_0" : "__Swift_Foundation_UUID" } } - }, + } + ], + "name" : "UUID", + "namespace" : [ + "__Swift", + "Foundation" + ], + "properties" : [ { - "isReadonly" : false, + "isReadonly" : true, "isStatic" : true, - "name" : "optionalString", + "name" : "placeholder", "staticContext" : { "className" : { - "_0" : "StaticPropertyHolder" + "_0" : "__Swift_Foundation_UUID" } }, "type" : { - "nullable" : { - "_0" : { - "string" : { + "string" : { - } - }, - "_1" : "null" } } + } + ], + "swiftCallName" : "UUID" + }, + { + "constructor" : { + "abiName" : "bjs_Networking_APIV2_Internal_TestServer_init", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false }, + "parameters" : [ + + ] + }, + "methods" : [ { - "isReadonly" : false, - "isStatic" : true, - "name" : "optionalInt", - "staticContext" : { - "className" : { - "_0" : "StaticPropertyHolder" - } + "abiName" : "bjs_Networking_APIV2_Internal_TestServer_call", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false }, - "type" : { - "nullable" : { - "_0" : { - "integer" : { - "_0" : { - "isSigned" : true, - "width" : "word" - } + "name" : "call", + "namespace" : [ + "Networking", + "APIV2", + "Internal" + ], + "parameters" : [ + { + "label" : "_", + "name" : "method", + "type" : { + "caseEnum" : { + "_0" : "Internal.SupportedMethod" } - }, - "_1" : "null" - } - } - }, - { - "isReadonly" : false, - "isStatic" : true, - "name" : "jsObjectProperty", - "staticContext" : { - "className" : { - "_0" : "StaticPropertyHolder" + } } - }, - "type" : { - "jsObject" : { + ], + "returnType" : { + "void" : { } } } ], - "swiftCallName" : "StaticPropertyHolder" + "name" : "TestServer", + "namespace" : [ + "Networking", + "APIV2", + "Internal" + ], + "properties" : [ + + ], + "swiftCallName" : "Internal.TestServer" }, { "constructor" : { - "abiName" : "bjs_DataProcessorManager_init", + "abiName" : "bjs_SimplePropertyHolder_init", "effects" : { "isAsync" : false, "isStatic" : false, @@ -1855,104 +1782,126 @@ }, "parameters" : [ { - "label" : "processor", - "name" : "processor", + "label" : "value", + "name" : "value", "type" : { - "swiftProtocol" : { - "_0" : "DataProcessor" + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } } } } ] }, "methods" : [ + + ], + "name" : "SimplePropertyHolder", + "properties" : [ { - "abiName" : "bjs_DataProcessorManager_incrementByAmount", - "effects" : { - "isAsync" : false, - "isStatic" : false, - "isThrows" : false - }, - "name" : "incrementByAmount", - "parameters" : [ - { - "label" : "_", - "name" : "amount", - "type" : { - "integer" : { - "_0" : { - "isSigned" : true, - "width" : "word" - } - } + "isReadonly" : false, + "isStatic" : false, + "name" : "value", + "type" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" } } - ], - "returnType" : { - "void" : { - - } } + } + ], + "swiftCallName" : "SimplePropertyHolder" + }, + { + "constructor" : { + "abiName" : "bjs_PropertyHolder_init", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false }, - { - "abiName" : "bjs_DataProcessorManager_setProcessorLabel", - "effects" : { - "isAsync" : false, - "isStatic" : false, - "isThrows" : false + "parameters" : [ + { + "label" : "intValue", + "name" : "intValue", + "type" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + } }, - "name" : "setProcessorLabel", - "parameters" : [ - { - "label" : "_", - "name" : "prefix", - "type" : { - "string" : { + { + "label" : "floatValue", + "name" : "floatValue", + "type" : { + "float" : { - } } - }, - { - "label" : "_", - "name" : "suffix", - "type" : { - "string" : { + } + }, + { + "label" : "doubleValue", + "name" : "doubleValue", + "type" : { + "double" : { - } } } - ], - "returnType" : { - "void" : { + }, + { + "label" : "boolValue", + "name" : "boolValue", + "type" : { + "bool" : { + } } - } - }, - { - "abiName" : "bjs_DataProcessorManager_isProcessorEven", - "effects" : { - "isAsync" : false, - "isStatic" : false, - "isThrows" : false }, - "name" : "isProcessorEven", - "parameters" : [ + { + "label" : "stringValue", + "name" : "stringValue", + "type" : { + "string" : { - ], - "returnType" : { - "bool" : { + } + } + }, + { + "label" : "jsObject", + "name" : "jsObject", + "type" : { + "jsObject" : { + } + } + }, + { + "label" : "sibling", + "name" : "sibling", + "type" : { + "swiftHeapObject" : { + "_0" : "SimplePropertyHolder" + } } } - }, + ] + }, + "methods" : [ { - "abiName" : "bjs_DataProcessorManager_getProcessorLabel", + "abiName" : "bjs_PropertyHolder_getAllValues", "effects" : { "isAsync" : false, "isStatic" : false, "isThrows" : false }, - "name" : "getProcessorLabel", + "name" : "getAllValues", "parameters" : [ ], @@ -1961,19 +1910,15 @@ } } - }, + } + ], + "name" : "PropertyHolder", + "properties" : [ { - "abiName" : "bjs_DataProcessorManager_getCurrentValue", - "effects" : { - "isAsync" : false, - "isStatic" : false, - "isThrows" : false - }, - "name" : "getCurrentValue", - "parameters" : [ - - ], - "returnType" : { + "isReadonly" : false, + "isStatic" : false, + "name" : "intValue", + "type" : { "integer" : { "_0" : { "isSigned" : true, @@ -1983,441 +1928,508 @@ } }, { - "abiName" : "bjs_DataProcessorManager_incrementBoth", - "effects" : { - "isAsync" : false, - "isStatic" : false, - "isThrows" : false - }, - "name" : "incrementBoth", - "parameters" : [ - - ], - "returnType" : { - "void" : { + "isReadonly" : false, + "isStatic" : false, + "name" : "floatValue", + "type" : { + "float" : { } } }, { - "abiName" : "bjs_DataProcessorManager_getBackupValue", - "effects" : { - "isAsync" : false, - "isStatic" : false, - "isThrows" : false - }, - "name" : "getBackupValue", - "parameters" : [ + "isReadonly" : false, + "isStatic" : false, + "name" : "doubleValue", + "type" : { + "double" : { - ], - "returnType" : { - "nullable" : { + } + } + }, + { + "isReadonly" : false, + "isStatic" : false, + "name" : "boolValue", + "type" : { + "bool" : { + + } + } + }, + { + "isReadonly" : false, + "isStatic" : false, + "name" : "stringValue", + "type" : { + "string" : { + + } + } + }, + { + "isReadonly" : true, + "isStatic" : false, + "name" : "readonlyInt", + "type" : { + "integer" : { "_0" : { - "integer" : { - "_0" : { - "isSigned" : true, - "width" : "word" - } - } - }, - "_1" : "null" + "isSigned" : true, + "width" : "word" + } } } }, { - "abiName" : "bjs_DataProcessorManager_hasBackup", - "effects" : { - "isAsync" : false, - "isStatic" : false, - "isThrows" : false - }, - "name" : "hasBackup", - "parameters" : [ + "isReadonly" : true, + "isStatic" : false, + "name" : "readonlyFloat", + "type" : { + "float" : { - ], - "returnType" : { + } + } + }, + { + "isReadonly" : true, + "isStatic" : false, + "name" : "readonlyDouble", + "type" : { + "double" : { + + } + } + }, + { + "isReadonly" : true, + "isStatic" : false, + "name" : "readonlyBool", + "type" : { "bool" : { } } }, { - "abiName" : "bjs_DataProcessorManager_getProcessorOptionalTag", - "effects" : { - "isAsync" : false, - "isStatic" : false, - "isThrows" : false - }, - "name" : "getProcessorOptionalTag", - "parameters" : [ + "isReadonly" : true, + "isStatic" : false, + "name" : "readonlyString", + "type" : { + "string" : { - ], - "returnType" : { - "nullable" : { - "_0" : { - "string" : { + } + } + }, + { + "isReadonly" : false, + "isStatic" : false, + "name" : "jsObject", + "type" : { + "jsObject" : { - } - }, - "_1" : "null" } } }, { - "abiName" : "bjs_DataProcessorManager_setProcessorOptionalTag", - "effects" : { - "isAsync" : false, - "isStatic" : false, - "isThrows" : false - }, - "name" : "setProcessorOptionalTag", - "parameters" : [ - { - "label" : "_", - "name" : "tag", - "type" : { - "nullable" : { - "_0" : { - "string" : { + "isReadonly" : false, + "isStatic" : false, + "name" : "sibling", + "type" : { + "swiftHeapObject" : { + "_0" : "SimplePropertyHolder" + } + } + }, + { + "isReadonly" : false, + "isStatic" : false, + "name" : "lazyValue", + "type" : { + "string" : { - } - }, - "_1" : "null" - } + } + } + }, + { + "isReadonly" : true, + "isStatic" : false, + "name" : "computedReadonly", + "type" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" } } - ], - "returnType" : { - "void" : { + } + }, + { + "isReadonly" : false, + "isStatic" : false, + "name" : "computedReadWrite", + "type" : { + "string" : { } } }, { - "abiName" : "bjs_DataProcessorManager_getProcessorOptionalCount", + "isReadonly" : false, + "isStatic" : false, + "name" : "observedProperty", + "type" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + } + } + ], + "swiftCallName" : "PropertyHolder" + }, + { + "methods" : [ + { + "abiName" : "bjs_MathUtils_static_add", "effects" : { "isAsync" : false, - "isStatic" : false, + "isStatic" : true, "isThrows" : false }, - "name" : "getProcessorOptionalCount", + "name" : "add", "parameters" : [ - - ], - "returnType" : { - "nullable" : { - "_0" : { + { + "label" : "a", + "name" : "a", + "type" : { "integer" : { "_0" : { "isSigned" : true, "width" : "word" } } - }, - "_1" : "null" - } - } - }, - { - "abiName" : "bjs_DataProcessorManager_setProcessorOptionalCount", - "effects" : { - "isAsync" : false, - "isStatic" : false, - "isThrows" : false - }, - "name" : "setProcessorOptionalCount", - "parameters" : [ + } + }, { - "label" : "_", - "name" : "count", + "label" : "b", + "name" : "b", "type" : { - "nullable" : { + "integer" : { "_0" : { - "integer" : { - "_0" : { - "isSigned" : true, - "width" : "word" - } - } - }, - "_1" : "null" + "isSigned" : true, + "width" : "word" + } } } } ], "returnType" : { - "void" : { - + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + }, + "staticContext" : { + "className" : { + "_0" : "MathUtils" } } }, { - "abiName" : "bjs_DataProcessorManager_getProcessorDirection", + "abiName" : "bjs_MathUtils_static_substract", "effects" : { "isAsync" : false, - "isStatic" : false, + "isStatic" : true, "isThrows" : false }, - "name" : "getProcessorDirection", + "name" : "substract", "parameters" : [ - - ], - "returnType" : { - "nullable" : { - "_0" : { - "caseEnum" : { - "_0" : "Direction" + { + "label" : "a", + "name" : "a", + "type" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } } - }, - "_1" : "null" - } - } - }, - { - "abiName" : "bjs_DataProcessorManager_setProcessorDirection", - "effects" : { - "isAsync" : false, - "isStatic" : false, - "isThrows" : false - }, - "name" : "setProcessorDirection", - "parameters" : [ + } + }, { - "label" : "_", - "name" : "direction", + "label" : "b", + "name" : "b", "type" : { - "nullable" : { + "integer" : { "_0" : { - "caseEnum" : { - "_0" : "Direction" - } - }, - "_1" : "null" + "isSigned" : true, + "width" : "word" + } } } } ], "returnType" : { - "void" : { - + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + }, + "staticContext" : { + "className" : { + "_0" : "MathUtils" } } + } + ], + "name" : "MathUtils", + "properties" : [ + + ], + "swiftCallName" : "MathUtils" + }, + { + "constructor" : { + "abiName" : "bjs_StaticPropertyHolder_init", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false }, + "parameters" : [ + + ] + }, + "methods" : [ + + ], + "name" : "StaticPropertyHolder", + "properties" : [ { - "abiName" : "bjs_DataProcessorManager_getProcessorTheme", - "effects" : { - "isAsync" : false, - "isStatic" : false, - "isThrows" : false + "isReadonly" : true, + "isStatic" : true, + "name" : "staticConstant", + "staticContext" : { + "className" : { + "_0" : "StaticPropertyHolder" + } }, - "name" : "getProcessorTheme", - "parameters" : [ + "type" : { + "string" : { - ], - "returnType" : { - "nullable" : { - "_0" : { - "rawValueEnum" : { - "_0" : "Theme", - "_1" : "String" - } - }, - "_1" : "null" } } }, { - "abiName" : "bjs_DataProcessorManager_setProcessorTheme", - "effects" : { - "isAsync" : false, - "isStatic" : false, - "isThrows" : false + "isReadonly" : false, + "isStatic" : true, + "name" : "staticVariable", + "staticContext" : { + "className" : { + "_0" : "StaticPropertyHolder" + } }, - "name" : "setProcessorTheme", - "parameters" : [ - { - "label" : "_", - "name" : "theme", - "type" : { - "nullable" : { - "_0" : { - "rawValueEnum" : { - "_0" : "Theme", - "_1" : "String" - } - }, - "_1" : "null" - } + "type" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" } } - ], - "returnType" : { - "void" : { + } + }, + { + "isReadonly" : false, + "isStatic" : true, + "name" : "staticString", + "staticContext" : { + "className" : { + "_0" : "StaticPropertyHolder" + } + }, + "type" : { + "string" : { } } }, { - "abiName" : "bjs_DataProcessorManager_getProcessorHttpStatus", - "effects" : { - "isAsync" : false, - "isStatic" : false, - "isThrows" : false + "isReadonly" : false, + "isStatic" : true, + "name" : "staticBool", + "staticContext" : { + "className" : { + "_0" : "StaticPropertyHolder" + } }, - "name" : "getProcessorHttpStatus", - "parameters" : [ + "type" : { + "bool" : { - ], - "returnType" : { - "nullable" : { - "_0" : { - "rawValueEnum" : { - "_0" : "HttpStatus", - "_1" : "Int" - } - }, - "_1" : "null" } } }, { - "abiName" : "bjs_DataProcessorManager_setProcessorHttpStatus", - "effects" : { - "isAsync" : false, - "isStatic" : false, - "isThrows" : false - }, - "name" : "setProcessorHttpStatus", - "parameters" : [ - { - "label" : "_", - "name" : "status", - "type" : { - "nullable" : { - "_0" : { - "rawValueEnum" : { - "_0" : "HttpStatus", - "_1" : "Int" - } - }, - "_1" : "null" - } - } + "isReadonly" : false, + "isStatic" : true, + "name" : "staticFloat", + "staticContext" : { + "className" : { + "_0" : "StaticPropertyHolder" } - ], - "returnType" : { - "void" : { + }, + "type" : { + "float" : { } } }, { - "abiName" : "bjs_DataProcessorManager_getProcessorAPIResult", - "effects" : { - "isAsync" : false, - "isStatic" : false, - "isThrows" : false + "isReadonly" : false, + "isStatic" : true, + "name" : "staticDouble", + "staticContext" : { + "className" : { + "_0" : "StaticPropertyHolder" + } }, - "name" : "getProcessorAPIResult", - "parameters" : [ + "type" : { + "double" : { - ], - "returnType" : { - "nullable" : { - "_0" : { - "associatedValueEnum" : { - "_0" : "APIResult" - } - }, - "_1" : "null" } } }, { - "abiName" : "bjs_DataProcessorManager_setProcessorAPIResult", - "effects" : { - "isAsync" : false, - "isStatic" : false, - "isThrows" : false + "isReadonly" : false, + "isStatic" : true, + "name" : "computedProperty", + "staticContext" : { + "className" : { + "_0" : "StaticPropertyHolder" + } }, - "name" : "setProcessorAPIResult", - "parameters" : [ - { - "label" : "_", - "name" : "apiResult", - "type" : { - "nullable" : { - "_0" : { - "associatedValueEnum" : { - "_0" : "APIResult" - } - }, - "_1" : "null" - } - } - } - ], - "returnType" : { - "void" : { + "type" : { + "string" : { } } - } - ], - "name" : "DataProcessorManager", - "properties" : [ + }, + { + "isReadonly" : true, + "isStatic" : true, + "name" : "readOnlyComputed", + "staticContext" : { + "className" : { + "_0" : "StaticPropertyHolder" + } + }, + "type" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + } + }, { "isReadonly" : false, - "isStatic" : false, - "name" : "processor", + "isStatic" : true, + "name" : "optionalString", + "staticContext" : { + "className" : { + "_0" : "StaticPropertyHolder" + } + }, "type" : { - "swiftProtocol" : { - "_0" : "DataProcessor" + "nullable" : { + "_0" : { + "string" : { + + } + }, + "_1" : "null" } } }, { "isReadonly" : false, - "isStatic" : false, - "name" : "backupProcessor", + "isStatic" : true, + "name" : "optionalInt", + "staticContext" : { + "className" : { + "_0" : "StaticPropertyHolder" + } + }, "type" : { "nullable" : { "_0" : { - "swiftProtocol" : { - "_0" : "DataProcessor" + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } } }, "_1" : "null" } } + }, + { + "isReadonly" : false, + "isStatic" : true, + "name" : "jsObjectProperty", + "staticContext" : { + "className" : { + "_0" : "StaticPropertyHolder" + } + }, + "type" : { + "jsObject" : { + + } + } } ], - "swiftCallName" : "DataProcessorManager" + "swiftCallName" : "StaticPropertyHolder" }, { "constructor" : { - "abiName" : "bjs_SwiftDataProcessor_init", + "abiName" : "bjs_DataProcessorManager_init", "effects" : { "isAsync" : false, "isStatic" : false, "isThrows" : false }, "parameters" : [ - + { + "label" : "processor", + "name" : "processor", + "type" : { + "swiftProtocol" : { + "_0" : "DataProcessor" + } + } + } ] }, "methods" : [ { - "abiName" : "bjs_SwiftDataProcessor_increment", + "abiName" : "bjs_DataProcessorManager_incrementByAmount", "effects" : { "isAsync" : false, "isStatic" : false, "isThrows" : false }, - "name" : "increment", + "name" : "incrementByAmount", "parameters" : [ { - "label" : "by", + "label" : "_", "name" : "amount", "type" : { "integer" : { @@ -2436,37 +2448,17 @@ } }, { - "abiName" : "bjs_SwiftDataProcessor_getValue", - "effects" : { - "isAsync" : false, - "isStatic" : false, - "isThrows" : false - }, - "name" : "getValue", - "parameters" : [ - - ], - "returnType" : { - "integer" : { - "_0" : { - "isSigned" : true, - "width" : "word" - } - } - } - }, - { - "abiName" : "bjs_SwiftDataProcessor_setLabelElements", + "abiName" : "bjs_DataProcessorManager_setProcessorLabel", "effects" : { "isAsync" : false, "isStatic" : false, "isThrows" : false }, - "name" : "setLabelElements", + "name" : "setProcessorLabel", "parameters" : [ { "label" : "_", - "name" : "labelPrefix", + "name" : "prefix", "type" : { "string" : { @@ -2475,7 +2467,7 @@ }, { "label" : "_", - "name" : "labelSuffix", + "name" : "suffix", "type" : { "string" : { @@ -2490,127 +2482,134 @@ } }, { - "abiName" : "bjs_SwiftDataProcessor_getLabel", + "abiName" : "bjs_DataProcessorManager_isProcessorEven", "effects" : { "isAsync" : false, "isStatic" : false, "isThrows" : false }, - "name" : "getLabel", + "name" : "isProcessorEven", "parameters" : [ ], "returnType" : { - "string" : { + "bool" : { } } }, { - "abiName" : "bjs_SwiftDataProcessor_isEven", + "abiName" : "bjs_DataProcessorManager_getProcessorLabel", "effects" : { "isAsync" : false, "isStatic" : false, "isThrows" : false }, - "name" : "isEven", + "name" : "getProcessorLabel", "parameters" : [ ], "returnType" : { - "bool" : { + "string" : { } } }, { - "abiName" : "bjs_SwiftDataProcessor_processGreeter", + "abiName" : "bjs_DataProcessorManager_getCurrentValue", "effects" : { "isAsync" : false, "isStatic" : false, "isThrows" : false }, - "name" : "processGreeter", + "name" : "getCurrentValue", "parameters" : [ - { - "label" : "_", - "name" : "greeter", - "type" : { - "swiftHeapObject" : { - "_0" : "Greeter" - } - } - } + ], "returnType" : { - "string" : { - + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } } } }, { - "abiName" : "bjs_SwiftDataProcessor_createGreeter", + "abiName" : "bjs_DataProcessorManager_incrementBoth", "effects" : { "isAsync" : false, "isStatic" : false, "isThrows" : false }, - "name" : "createGreeter", + "name" : "incrementBoth", "parameters" : [ ], "returnType" : { - "swiftHeapObject" : { - "_0" : "Greeter" + "void" : { + } } }, { - "abiName" : "bjs_SwiftDataProcessor_processOptionalGreeter", + "abiName" : "bjs_DataProcessorManager_getBackupValue", "effects" : { "isAsync" : false, "isStatic" : false, "isThrows" : false }, - "name" : "processOptionalGreeter", + "name" : "getBackupValue", "parameters" : [ - { - "label" : "_", - "name" : "greeter", - "type" : { - "nullable" : { + + ], + "returnType" : { + "nullable" : { + "_0" : { + "integer" : { "_0" : { - "swiftHeapObject" : { - "_0" : "Greeter" - } - }, - "_1" : "null" + "isSigned" : true, + "width" : "word" + } } - } + }, + "_1" : "null" } + } + }, + { + "abiName" : "bjs_DataProcessorManager_hasBackup", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "name" : "hasBackup", + "parameters" : [ + ], "returnType" : { - "string" : { + "bool" : { } } }, { - "abiName" : "bjs_SwiftDataProcessor_createOptionalGreeter", + "abiName" : "bjs_DataProcessorManager_getProcessorOptionalTag", "effects" : { "isAsync" : false, "isStatic" : false, "isThrows" : false }, - "name" : "createOptionalGreeter", + "name" : "getProcessorOptionalTag", "parameters" : [ ], "returnType" : { "nullable" : { "_0" : { - "swiftHeapObject" : { - "_0" : "Greeter" + "string" : { + } }, "_1" : "null" @@ -2618,22 +2617,22 @@ } }, { - "abiName" : "bjs_SwiftDataProcessor_handleAPIResult", + "abiName" : "bjs_DataProcessorManager_setProcessorOptionalTag", "effects" : { "isAsync" : false, "isStatic" : false, "isThrows" : false }, - "name" : "handleAPIResult", + "name" : "setProcessorOptionalTag", "parameters" : [ { "label" : "_", - "name" : "result", + "name" : "tag", "type" : { "nullable" : { "_0" : { - "associatedValueEnum" : { - "_0" : "APIResult" + "string" : { + } }, "_1" : "null" @@ -2648,62 +2647,79 @@ } }, { - "abiName" : "bjs_SwiftDataProcessor_getAPIResult", + "abiName" : "bjs_DataProcessorManager_getProcessorOptionalCount", "effects" : { "isAsync" : false, "isStatic" : false, "isThrows" : false }, - "name" : "getAPIResult", + "name" : "getProcessorOptionalCount", "parameters" : [ ], "returnType" : { "nullable" : { "_0" : { - "associatedValueEnum" : { - "_0" : "APIResult" + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } } }, "_1" : "null" } } - } - ], - "name" : "SwiftDataProcessor", - "properties" : [ + }, { - "isReadonly" : false, - "isStatic" : false, - "name" : "count", - "type" : { - "integer" : { - "_0" : { - "isSigned" : true, - "width" : "word" + "abiName" : "bjs_DataProcessorManager_setProcessorOptionalCount", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "name" : "setProcessorOptionalCount", + "parameters" : [ + { + "label" : "_", + "name" : "count", + "type" : { + "nullable" : { + "_0" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + }, + "_1" : "null" + } } } - } - }, - { - "isReadonly" : true, - "isStatic" : false, - "name" : "name", - "type" : { - "string" : { + ], + "returnType" : { + "void" : { } } }, { - "isReadonly" : false, - "isStatic" : false, - "name" : "optionalTag", - "type" : { + "abiName" : "bjs_DataProcessorManager_getProcessorDirection", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "name" : "getProcessorDirection", + "parameters" : [ + + ], + "returnType" : { "nullable" : { "_0" : { - "string" : { - + "caseEnum" : { + "_0" : "Direction" } }, "_1" : "null" @@ -2711,43 +2727,47 @@ } }, { - "isReadonly" : false, - "isStatic" : false, - "name" : "optionalCount", - "type" : { - "nullable" : { - "_0" : { - "integer" : { + "abiName" : "bjs_DataProcessorManager_setProcessorDirection", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "name" : "setProcessorDirection", + "parameters" : [ + { + "label" : "_", + "name" : "direction", + "type" : { + "nullable" : { "_0" : { - "isSigned" : true, - "width" : "word" - } + "caseEnum" : { + "_0" : "Direction" + } + }, + "_1" : "null" } - }, - "_1" : "null" + } } - } - }, - { - "isReadonly" : false, - "isStatic" : false, - "name" : "direction", - "type" : { - "nullable" : { - "_0" : { - "caseEnum" : { - "_0" : "Direction" - } - }, - "_1" : "null" + ], + "returnType" : { + "void" : { + } } }, { - "isReadonly" : false, - "isStatic" : false, - "name" : "optionalTheme", - "type" : { + "abiName" : "bjs_DataProcessorManager_getProcessorTheme", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "name" : "getProcessorTheme", + "parameters" : [ + + ], + "returnType" : { "nullable" : { "_0" : { "rawValueEnum" : { @@ -2760,278 +2780,246 @@ } }, { - "isReadonly" : false, - "isStatic" : false, - "name" : "httpStatus", - "type" : { - "nullable" : { - "_0" : { - "rawValueEnum" : { - "_0" : "HttpStatus", - "_1" : "Int" - } - }, - "_1" : "null" - } - } - }, - { - "isReadonly" : false, - "isStatic" : false, - "name" : "apiResult", - "type" : { - "nullable" : { - "_0" : { - "associatedValueEnum" : { - "_0" : "APIResult" + "abiName" : "bjs_DataProcessorManager_setProcessorTheme", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "name" : "setProcessorTheme", + "parameters" : [ + { + "label" : "_", + "name" : "theme", + "type" : { + "nullable" : { + "_0" : { + "rawValueEnum" : { + "_0" : "Theme", + "_1" : "String" + } + }, + "_1" : "null" } - }, - "_1" : "null" + } } - } - }, - { - "isReadonly" : false, - "isStatic" : false, - "name" : "helper", - "type" : { - "swiftHeapObject" : { - "_0" : "Greeter" + ], + "returnType" : { + "void" : { + } } }, { - "isReadonly" : false, - "isStatic" : false, - "name" : "optionalHelper", - "type" : { + "abiName" : "bjs_DataProcessorManager_getProcessorHttpStatus", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "name" : "getProcessorHttpStatus", + "parameters" : [ + + ], + "returnType" : { "nullable" : { "_0" : { - "swiftHeapObject" : { - "_0" : "Greeter" + "rawValueEnum" : { + "_0" : "HttpStatus", + "_1" : "Int" } }, "_1" : "null" } } - } - ], - "swiftCallName" : "SwiftDataProcessor" - }, - { - "methods" : [ + }, { - "abiName" : "bjs_ProtocolReturnTests_static_createNativeProcessor", + "abiName" : "bjs_DataProcessorManager_setProcessorHttpStatus", "effects" : { "isAsync" : false, - "isStatic" : true, + "isStatic" : false, "isThrows" : false }, - "name" : "createNativeProcessor", + "name" : "setProcessorHttpStatus", "parameters" : [ - + { + "label" : "_", + "name" : "status", + "type" : { + "nullable" : { + "_0" : { + "rawValueEnum" : { + "_0" : "HttpStatus", + "_1" : "Int" + } + }, + "_1" : "null" + } + } + } ], "returnType" : { - "swiftProtocol" : { - "_0" : "DataProcessor" - } - }, - "staticContext" : { - "className" : { - "_0" : "ProtocolReturnTests" + "void" : { + } } }, { - "abiName" : "bjs_ProtocolReturnTests_static_createNativeProcessorOptional", + "abiName" : "bjs_DataProcessorManager_getProcessorAPIResult", "effects" : { "isAsync" : false, - "isStatic" : true, + "isStatic" : false, "isThrows" : false }, - "name" : "createNativeProcessorOptional", + "name" : "getProcessorAPIResult", "parameters" : [ ], "returnType" : { "nullable" : { "_0" : { - "swiftProtocol" : { - "_0" : "DataProcessor" + "associatedValueEnum" : { + "_0" : "APIResult" } }, "_1" : "null" } - }, - "staticContext" : { - "className" : { - "_0" : "ProtocolReturnTests" - } } }, { - "abiName" : "bjs_ProtocolReturnTests_static_createNativeProcessorNil", + "abiName" : "bjs_DataProcessorManager_setProcessorAPIResult", "effects" : { "isAsync" : false, - "isStatic" : true, + "isStatic" : false, "isThrows" : false }, - "name" : "createNativeProcessorNil", + "name" : "setProcessorAPIResult", "parameters" : [ - - ], - "returnType" : { - "nullable" : { - "_0" : { - "swiftProtocol" : { - "_0" : "DataProcessor" + { + "label" : "_", + "name" : "apiResult", + "type" : { + "nullable" : { + "_0" : { + "associatedValueEnum" : { + "_0" : "APIResult" + } + }, + "_1" : "null" } - }, - "_1" : "null" - } - }, - "staticContext" : { - "className" : { - "_0" : "ProtocolReturnTests" + } } - } - }, - { - "abiName" : "bjs_ProtocolReturnTests_static_createNativeProcessorArray", - "effects" : { - "isAsync" : false, - "isStatic" : true, - "isThrows" : false - }, - "name" : "createNativeProcessorArray", - "parameters" : [ - ], "returnType" : { - "array" : { - "_0" : { - "swiftProtocol" : { - "_0" : "DataProcessor" - } - } + "void" : { + } - }, - "staticContext" : { - "className" : { - "_0" : "ProtocolReturnTests" + } + } + ], + "name" : "DataProcessorManager", + "properties" : [ + { + "isReadonly" : false, + "isStatic" : false, + "name" : "processor", + "type" : { + "swiftProtocol" : { + "_0" : "DataProcessor" } } }, { - "abiName" : "bjs_ProtocolReturnTests_static_createNativeProcessorDictionary", - "effects" : { - "isAsync" : false, - "isStatic" : true, - "isThrows" : false - }, - "name" : "createNativeProcessorDictionary", - "parameters" : [ - - ], - "returnType" : { - "dictionary" : { + "isReadonly" : false, + "isStatic" : false, + "name" : "backupProcessor", + "type" : { + "nullable" : { "_0" : { "swiftProtocol" : { "_0" : "DataProcessor" } - } - } - }, - "staticContext" : { - "className" : { - "_0" : "ProtocolReturnTests" + }, + "_1" : "null" } } } ], - "name" : "ProtocolReturnTests", - "properties" : [ - - ], - "swiftCallName" : "ProtocolReturnTests" + "swiftCallName" : "DataProcessorManager" }, { "constructor" : { - "abiName" : "bjs_TextProcessor_init", + "abiName" : "bjs_SwiftDataProcessor_init", "effects" : { "isAsync" : false, "isStatic" : false, "isThrows" : false }, "parameters" : [ - { - "label" : "transform", - "name" : "transform", - "type" : { - "closure" : { - "_0" : { - "isAsync" : false, - "isThrows" : false, - "mangleName" : "20BridgeJSRuntimeTestsSS_SS", - "moduleName" : "BridgeJSRuntimeTests", - "parameters" : [ - { - "string" : { - } - } - ], - "returnType" : { - "string" : { - - } - }, - "sendingParameters" : false - }, - "useJSTypedClosure" : false - } - } - } ] }, "methods" : [ { - "abiName" : "bjs_TextProcessor_process", + "abiName" : "bjs_SwiftDataProcessor_increment", "effects" : { "isAsync" : false, "isStatic" : false, "isThrows" : false }, - "name" : "process", + "name" : "increment", "parameters" : [ { - "label" : "_", - "name" : "text", + "label" : "by", + "name" : "amount", "type" : { - "string" : { - + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } } } } ], "returnType" : { - "string" : { + "void" : { } } }, { - "abiName" : "bjs_TextProcessor_processWithCustom", + "abiName" : "bjs_SwiftDataProcessor_getValue", "effects" : { "isAsync" : false, "isStatic" : false, "isThrows" : false }, - "name" : "processWithCustom", + "name" : "getValue", + "parameters" : [ + + ], + "returnType" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + } + }, + { + "abiName" : "bjs_SwiftDataProcessor_setLabelElements", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "name" : "setLabelElements", "parameters" : [ { "label" : "_", - "name" : "text", + "name" : "labelPrefix", "type" : { "string" : { @@ -3039,128 +3027,70 @@ } }, { - "label" : "customTransform", - "name" : "customTransform", + "label" : "_", + "name" : "labelSuffix", "type" : { - "closure" : { - "_0" : { - "isAsync" : false, - "isThrows" : false, - "mangleName" : "20BridgeJSRuntimeTestsSiSSSd_SS", - "moduleName" : "BridgeJSRuntimeTests", - "parameters" : [ - { - "integer" : { - "_0" : { - "isSigned" : true, - "width" : "word" - } - } - }, - { - "string" : { - - } - }, - { - "double" : { - - } - } - ], - "returnType" : { - "string" : { + "string" : { - } - }, - "sendingParameters" : false - }, - "useJSTypedClosure" : false } } } ], "returnType" : { - "string" : { + "void" : { } } }, { - "abiName" : "bjs_TextProcessor_getTransform", + "abiName" : "bjs_SwiftDataProcessor_getLabel", "effects" : { "isAsync" : false, "isStatic" : false, "isThrows" : false }, - "name" : "getTransform", + "name" : "getLabel", "parameters" : [ ], "returnType" : { - "closure" : { - "_0" : { - "isAsync" : false, - "isThrows" : false, - "mangleName" : "20BridgeJSRuntimeTestsSS_SS", - "moduleName" : "BridgeJSRuntimeTests", - "parameters" : [ - { - "string" : { + "string" : { - } - } - ], - "returnType" : { - "string" : { + } + } + }, + { + "abiName" : "bjs_SwiftDataProcessor_isEven", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "name" : "isEven", + "parameters" : [ + + ], + "returnType" : { + "bool" : { - } - }, - "sendingParameters" : false - }, - "useJSTypedClosure" : false } } }, { - "abiName" : "bjs_TextProcessor_processOptionalString", + "abiName" : "bjs_SwiftDataProcessor_processGreeter", "effects" : { "isAsync" : false, "isStatic" : false, "isThrows" : false }, - "name" : "processOptionalString", + "name" : "processGreeter", "parameters" : [ { "label" : "_", - "name" : "callback", + "name" : "greeter", "type" : { - "closure" : { - "_0" : { - "isAsync" : false, - "isThrows" : false, - "mangleName" : "20BridgeJSRuntimeTestsSqSS_SS", - "moduleName" : "BridgeJSRuntimeTests", - "parameters" : [ - { - "nullable" : { - "_0" : { - "string" : { - - } - }, - "_1" : "null" - } - } - ], - "returnType" : { - "string" : { - - } - }, - "sendingParameters" : false - }, - "useJSTypedClosure" : false + "swiftHeapObject" : { + "_0" : "Greeter" } } } @@ -3172,59 +3102,24 @@ } }, { - "abiName" : "bjs_TextProcessor_processOptionalInt", + "abiName" : "bjs_SwiftDataProcessor_createGreeter", "effects" : { "isAsync" : false, "isStatic" : false, "isThrows" : false }, - "name" : "processOptionalInt", + "name" : "createGreeter", "parameters" : [ - { - "label" : "_", - "name" : "callback", - "type" : { - "closure" : { - "_0" : { - "isAsync" : false, - "isThrows" : false, - "mangleName" : "20BridgeJSRuntimeTestsSqSi_SS", - "moduleName" : "BridgeJSRuntimeTests", - "parameters" : [ - { - "nullable" : { - "_0" : { - "integer" : { - "_0" : { - "isSigned" : true, - "width" : "word" - } - } - }, - "_1" : "null" - } - } - ], - "returnType" : { - "string" : { - } - }, - "sendingParameters" : false - }, - "useJSTypedClosure" : false - } - } - } ], "returnType" : { - "string" : { - + "swiftHeapObject" : { + "_0" : "Greeter" } } }, { - "abiName" : "bjs_TextProcessor_processOptionalGreeter", + "abiName" : "bjs_SwiftDataProcessor_processOptionalGreeter", "effects" : { "isAsync" : false, "isStatic" : false, @@ -3234,34 +3129,15 @@ "parameters" : [ { "label" : "_", - "name" : "callback", + "name" : "greeter", "type" : { - "closure" : { + "nullable" : { "_0" : { - "isAsync" : false, - "isThrows" : false, - "mangleName" : "20BridgeJSRuntimeTestsSq7GreeterC_SS", - "moduleName" : "BridgeJSRuntimeTests", - "parameters" : [ - { - "nullable" : { - "_0" : { - "swiftHeapObject" : { - "_0" : "Greeter" - } - }, - "_1" : "null" - } - } - ], - "returnType" : { - "string" : { - - } - }, - "sendingParameters" : false + "swiftHeapObject" : { + "_0" : "Greeter" + } }, - "useJSTypedClosure" : false + "_1" : "null" } } } @@ -3273,215 +3149,87 @@ } }, { - "abiName" : "bjs_TextProcessor_makeOptionalStringFormatter", - "effects" : { - "isAsync" : false, - "isStatic" : false, - "isThrows" : false - }, - "name" : "makeOptionalStringFormatter", - "parameters" : [ - - ], - "returnType" : { - "closure" : { - "_0" : { - "isAsync" : false, - "isThrows" : false, - "mangleName" : "20BridgeJSRuntimeTestsSqSS_SS", - "moduleName" : "BridgeJSRuntimeTests", - "parameters" : [ - { - "nullable" : { - "_0" : { - "string" : { - - } - }, - "_1" : "null" - } - } - ], - "returnType" : { - "string" : { - - } - }, - "sendingParameters" : false - }, - "useJSTypedClosure" : false - } - } - }, - { - "abiName" : "bjs_TextProcessor_makeOptionalGreeterCreator", + "abiName" : "bjs_SwiftDataProcessor_createOptionalGreeter", "effects" : { "isAsync" : false, "isStatic" : false, "isThrows" : false }, - "name" : "makeOptionalGreeterCreator", + "name" : "createOptionalGreeter", "parameters" : [ ], "returnType" : { - "closure" : { + "nullable" : { "_0" : { - "isAsync" : false, - "isThrows" : false, - "mangleName" : "20BridgeJSRuntimeTestsy_Sq7GreeterC", - "moduleName" : "BridgeJSRuntimeTests", - "parameters" : [ - - ], - "returnType" : { - "nullable" : { - "_0" : { - "swiftHeapObject" : { - "_0" : "Greeter" - } - }, - "_1" : "null" - } - }, - "sendingParameters" : false + "swiftHeapObject" : { + "_0" : "Greeter" + } }, - "useJSTypedClosure" : false + "_1" : "null" } } }, { - "abiName" : "bjs_TextProcessor_processDirection", + "abiName" : "bjs_SwiftDataProcessor_handleAPIResult", "effects" : { "isAsync" : false, "isStatic" : false, "isThrows" : false }, - "name" : "processDirection", + "name" : "handleAPIResult", "parameters" : [ { "label" : "_", - "name" : "callback", + "name" : "result", "type" : { - "closure" : { + "nullable" : { "_0" : { - "isAsync" : false, - "isThrows" : false, - "mangleName" : "20BridgeJSRuntimeTests9DirectionO_SS", - "moduleName" : "BridgeJSRuntimeTests", - "parameters" : [ - { - "caseEnum" : { - "_0" : "Direction" - } - } - ], - "returnType" : { - "string" : { - - } - }, - "sendingParameters" : false + "associatedValueEnum" : { + "_0" : "APIResult" + } }, - "useJSTypedClosure" : false + "_1" : "null" } } } ], "returnType" : { - "string" : { + "void" : { } } }, { - "abiName" : "bjs_TextProcessor_processTheme", + "abiName" : "bjs_SwiftDataProcessor_getAPIResult", "effects" : { "isAsync" : false, "isStatic" : false, "isThrows" : false }, - "name" : "processTheme", + "name" : "getAPIResult", "parameters" : [ - { - "label" : "_", - "name" : "callback", - "type" : { - "closure" : { - "_0" : { - "isAsync" : false, - "isThrows" : false, - "mangleName" : "20BridgeJSRuntimeTests5ThemeO_SS", - "moduleName" : "BridgeJSRuntimeTests", - "parameters" : [ - { - "rawValueEnum" : { - "_0" : "Theme", - "_1" : "String" - } - } - ], - "returnType" : { - "string" : { - } - }, - "sendingParameters" : false - }, - "useJSTypedClosure" : false - } - } - } ], "returnType" : { - "string" : { - + "nullable" : { + "_0" : { + "associatedValueEnum" : { + "_0" : "APIResult" + } + }, + "_1" : "null" } } - }, + } + ], + "name" : "SwiftDataProcessor", + "properties" : [ { - "abiName" : "bjs_TextProcessor_processHttpStatus", - "effects" : { - "isAsync" : false, - "isStatic" : false, - "isThrows" : false - }, - "name" : "processHttpStatus", - "parameters" : [ - { - "label" : "_", - "name" : "callback", - "type" : { - "closure" : { - "_0" : { - "isAsync" : false, - "isThrows" : false, - "mangleName" : "20BridgeJSRuntimeTests10HttpStatusO_Si", - "moduleName" : "BridgeJSRuntimeTests", - "parameters" : [ - { - "rawValueEnum" : { - "_0" : "HttpStatus", - "_1" : "Int" - } - } - ], - "returnType" : { - "integer" : { - "_0" : { - "isSigned" : true, - "width" : "word" - } - } - }, - "sendingParameters" : false - }, - "useJSTypedClosure" : false - } - } - } - ], - "returnType" : { + "isReadonly" : false, + "isStatic" : false, + "name" : "count", + "type" : { "integer" : { "_0" : { "isSigned" : true, @@ -3491,492 +3239,391 @@ } }, { - "abiName" : "bjs_TextProcessor_processAPIResult", - "effects" : { - "isAsync" : false, - "isStatic" : false, - "isThrows" : false - }, - "name" : "processAPIResult", - "parameters" : [ - { - "label" : "_", - "name" : "callback", - "type" : { - "closure" : { - "_0" : { - "isAsync" : false, - "isThrows" : false, - "mangleName" : "20BridgeJSRuntimeTests9APIResultO_SS", - "moduleName" : "BridgeJSRuntimeTests", - "parameters" : [ - { - "associatedValueEnum" : { - "_0" : "APIResult" - } - } - ], - "returnType" : { - "string" : { - - } - }, - "sendingParameters" : false - }, - "useJSTypedClosure" : false - } - } - } - ], - "returnType" : { + "isReadonly" : true, + "isStatic" : false, + "name" : "name", + "type" : { "string" : { } } }, { - "abiName" : "bjs_TextProcessor_makeDirectionChecker", - "effects" : { - "isAsync" : false, - "isStatic" : false, - "isThrows" : false - }, - "name" : "makeDirectionChecker", - "parameters" : [ - - ], - "returnType" : { - "closure" : { + "isReadonly" : false, + "isStatic" : false, + "name" : "optionalTag", + "type" : { + "nullable" : { "_0" : { - "isAsync" : false, - "isThrows" : false, - "mangleName" : "20BridgeJSRuntimeTests9DirectionO_Sb", - "moduleName" : "BridgeJSRuntimeTests", - "parameters" : [ - { - "caseEnum" : { - "_0" : "Direction" - } - } - ], - "returnType" : { - "bool" : { + "string" : { - } - }, - "sendingParameters" : false + } }, - "useJSTypedClosure" : false + "_1" : "null" } } }, { - "abiName" : "bjs_TextProcessor_makeThemeValidator", - "effects" : { - "isAsync" : false, - "isStatic" : false, - "isThrows" : false - }, - "name" : "makeThemeValidator", - "parameters" : [ - - ], - "returnType" : { - "closure" : { + "isReadonly" : false, + "isStatic" : false, + "name" : "optionalCount", + "type" : { + "nullable" : { "_0" : { - "isAsync" : false, - "isThrows" : false, - "mangleName" : "20BridgeJSRuntimeTests5ThemeO_Sb", - "moduleName" : "BridgeJSRuntimeTests", - "parameters" : [ - { - "rawValueEnum" : { - "_0" : "Theme", - "_1" : "String" - } - } - ], - "returnType" : { - "bool" : { - + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" } - }, - "sendingParameters" : false + } }, - "useJSTypedClosure" : false + "_1" : "null" } } }, { - "abiName" : "bjs_TextProcessor_makeStatusCodeExtractor", - "effects" : { - "isAsync" : false, - "isStatic" : false, - "isThrows" : false - }, - "name" : "makeStatusCodeExtractor", - "parameters" : [ - - ], - "returnType" : { - "closure" : { + "isReadonly" : false, + "isStatic" : false, + "name" : "direction", + "type" : { + "nullable" : { "_0" : { - "isAsync" : false, - "isThrows" : false, - "mangleName" : "20BridgeJSRuntimeTests10HttpStatusO_Si", - "moduleName" : "BridgeJSRuntimeTests", - "parameters" : [ - { - "rawValueEnum" : { - "_0" : "HttpStatus", - "_1" : "Int" - } - } - ], - "returnType" : { - "integer" : { - "_0" : { - "isSigned" : true, - "width" : "word" - } - } - }, - "sendingParameters" : false + "caseEnum" : { + "_0" : "Direction" + } }, - "useJSTypedClosure" : false + "_1" : "null" } } }, { - "abiName" : "bjs_TextProcessor_makeAPIResultHandler", - "effects" : { - "isAsync" : false, - "isStatic" : false, - "isThrows" : false - }, - "name" : "makeAPIResultHandler", - "parameters" : [ - - ], - "returnType" : { - "closure" : { + "isReadonly" : false, + "isStatic" : false, + "name" : "optionalTheme", + "type" : { + "nullable" : { "_0" : { - "isAsync" : false, - "isThrows" : false, - "mangleName" : "20BridgeJSRuntimeTests9APIResultO_SS", - "moduleName" : "BridgeJSRuntimeTests", - "parameters" : [ - { - "associatedValueEnum" : { - "_0" : "APIResult" - } - } - ], - "returnType" : { - "string" : { - - } - }, - "sendingParameters" : false + "rawValueEnum" : { + "_0" : "Theme", + "_1" : "String" + } }, - "useJSTypedClosure" : false + "_1" : "null" } } }, { - "abiName" : "bjs_TextProcessor_processOptionalDirection", - "effects" : { - "isAsync" : false, - "isStatic" : false, - "isThrows" : false - }, - "name" : "processOptionalDirection", - "parameters" : [ - { - "label" : "_", - "name" : "callback", - "type" : { - "closure" : { - "_0" : { - "isAsync" : false, - "isThrows" : false, - "mangleName" : "20BridgeJSRuntimeTestsSq9DirectionO_SS", - "moduleName" : "BridgeJSRuntimeTests", - "parameters" : [ - { - "nullable" : { - "_0" : { - "caseEnum" : { - "_0" : "Direction" - } - }, - "_1" : "null" - } - } - ], - "returnType" : { - "string" : { - - } - }, - "sendingParameters" : false - }, - "useJSTypedClosure" : false + "isReadonly" : false, + "isStatic" : false, + "name" : "httpStatus", + "type" : { + "nullable" : { + "_0" : { + "rawValueEnum" : { + "_0" : "HttpStatus", + "_1" : "Int" } - } + }, + "_1" : "null" } - ], - "returnType" : { - "string" : { - + } + }, + { + "isReadonly" : false, + "isStatic" : false, + "name" : "apiResult", + "type" : { + "nullable" : { + "_0" : { + "associatedValueEnum" : { + "_0" : "APIResult" + } + }, + "_1" : "null" } } }, { - "abiName" : "bjs_TextProcessor_processOptionalTheme", + "isReadonly" : false, + "isStatic" : false, + "name" : "helper", + "type" : { + "swiftHeapObject" : { + "_0" : "Greeter" + } + } + }, + { + "isReadonly" : false, + "isStatic" : false, + "name" : "optionalHelper", + "type" : { + "nullable" : { + "_0" : { + "swiftHeapObject" : { + "_0" : "Greeter" + } + }, + "_1" : "null" + } + } + } + ], + "swiftCallName" : "SwiftDataProcessor" + }, + { + "methods" : [ + { + "abiName" : "bjs_ProtocolReturnTests_static_createNativeProcessor", "effects" : { "isAsync" : false, - "isStatic" : false, + "isStatic" : true, "isThrows" : false }, - "name" : "processOptionalTheme", + "name" : "createNativeProcessor", "parameters" : [ - { - "label" : "_", - "name" : "callback", - "type" : { - "closure" : { - "_0" : { - "isAsync" : false, - "isThrows" : false, - "mangleName" : "20BridgeJSRuntimeTestsSq5ThemeO_SS", - "moduleName" : "BridgeJSRuntimeTests", - "parameters" : [ - { - "nullable" : { - "_0" : { - "rawValueEnum" : { - "_0" : "Theme", - "_1" : "String" - } - }, - "_1" : "null" - } - } - ], - "returnType" : { - "string" : { - } - }, - "sendingParameters" : false - }, - "useJSTypedClosure" : false - } - } - } ], "returnType" : { - "string" : { - + "swiftProtocol" : { + "_0" : "DataProcessor" + } + }, + "staticContext" : { + "className" : { + "_0" : "ProtocolReturnTests" } } }, { - "abiName" : "bjs_TextProcessor_processOptionalAPIResult", + "abiName" : "bjs_ProtocolReturnTests_static_createNativeProcessorOptional", "effects" : { "isAsync" : false, - "isStatic" : false, + "isStatic" : true, "isThrows" : false }, - "name" : "processOptionalAPIResult", + "name" : "createNativeProcessorOptional", "parameters" : [ - { - "label" : "_", - "name" : "callback", - "type" : { - "closure" : { - "_0" : { - "isAsync" : false, - "isThrows" : false, - "mangleName" : "20BridgeJSRuntimeTestsSq9APIResultO_SS", - "moduleName" : "BridgeJSRuntimeTests", - "parameters" : [ - { - "nullable" : { - "_0" : { - "associatedValueEnum" : { - "_0" : "APIResult" - } - }, - "_1" : "null" - } - } - ], - "returnType" : { - "string" : { - } - }, - "sendingParameters" : false - }, - "useJSTypedClosure" : false - } - } - } ], "returnType" : { - "string" : { - + "nullable" : { + "_0" : { + "swiftProtocol" : { + "_0" : "DataProcessor" + } + }, + "_1" : "null" + } + }, + "staticContext" : { + "className" : { + "_0" : "ProtocolReturnTests" } } }, { - "abiName" : "bjs_TextProcessor_makeOptionalDirectionFormatter", + "abiName" : "bjs_ProtocolReturnTests_static_createNativeProcessorNil", "effects" : { "isAsync" : false, - "isStatic" : false, + "isStatic" : true, "isThrows" : false }, - "name" : "makeOptionalDirectionFormatter", + "name" : "createNativeProcessorNil", "parameters" : [ ], "returnType" : { - "closure" : { + "nullable" : { "_0" : { - "isAsync" : false, - "isThrows" : false, - "mangleName" : "20BridgeJSRuntimeTestsSq9DirectionO_SS", - "moduleName" : "BridgeJSRuntimeTests", - "parameters" : [ - { - "nullable" : { - "_0" : { - "caseEnum" : { - "_0" : "Direction" - } - }, - "_1" : "null" - } - } - ], - "returnType" : { - "string" : { - - } - }, - "sendingParameters" : false + "swiftProtocol" : { + "_0" : "DataProcessor" + } }, - "useJSTypedClosure" : false + "_1" : "null" + } + }, + "staticContext" : { + "className" : { + "_0" : "ProtocolReturnTests" } } }, { - "abiName" : "bjs_TextProcessor_processDataProcessor", + "abiName" : "bjs_ProtocolReturnTests_static_createNativeProcessorArray", "effects" : { "isAsync" : false, - "isStatic" : false, + "isStatic" : true, "isThrows" : false }, - "name" : "processDataProcessor", + "name" : "createNativeProcessorArray", "parameters" : [ - { - "label" : "_", - "name" : "callback", - "type" : { - "closure" : { - "_0" : { - "isAsync" : false, - "isThrows" : false, - "mangleName" : "20BridgeJSRuntimeTests13DataProcessorP_SS", - "moduleName" : "BridgeJSRuntimeTests", - "parameters" : [ - { - "swiftProtocol" : { - "_0" : "DataProcessor" - } - } - ], - "returnType" : { - "string" : { - } - }, - "sendingParameters" : false - }, - "useJSTypedClosure" : false + ], + "returnType" : { + "array" : { + "_0" : { + "swiftProtocol" : { + "_0" : "DataProcessor" } } } + }, + "staticContext" : { + "className" : { + "_0" : "ProtocolReturnTests" + } + } + }, + { + "abiName" : "bjs_ProtocolReturnTests_static_createNativeProcessorDictionary", + "effects" : { + "isAsync" : false, + "isStatic" : true, + "isThrows" : false + }, + "name" : "createNativeProcessorDictionary", + "parameters" : [ + ], "returnType" : { - "string" : { - + "dictionary" : { + "_0" : { + "swiftProtocol" : { + "_0" : "DataProcessor" + } + } + } + }, + "staticContext" : { + "className" : { + "_0" : "ProtocolReturnTests" } } + } + ], + "name" : "ProtocolReturnTests", + "properties" : [ + + ], + "swiftCallName" : "ProtocolReturnTests" + }, + { + "constructor" : { + "abiName" : "bjs_TextProcessor_init", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false }, + "parameters" : [ + { + "label" : "transform", + "name" : "transform", + "type" : { + "closure" : { + "_0" : { + "isAsync" : false, + "isThrows" : false, + "mangleName" : "20BridgeJSRuntimeTestsSS_SS", + "moduleName" : "BridgeJSRuntimeTests", + "parameters" : [ + { + "string" : { + + } + } + ], + "returnType" : { + "string" : { + + } + }, + "sendingParameters" : false + }, + "useJSTypedClosure" : false + } + } + } + ] + }, + "methods" : [ { - "abiName" : "bjs_TextProcessor_makeDataProcessorFactory", + "abiName" : "bjs_TextProcessor_process", "effects" : { "isAsync" : false, "isStatic" : false, "isThrows" : false }, - "name" : "makeDataProcessorFactory", + "name" : "process", "parameters" : [ + { + "label" : "_", + "name" : "text", + "type" : { + "string" : { + } + } + } ], "returnType" : { - "closure" : { - "_0" : { - "isAsync" : false, - "isThrows" : false, - "mangleName" : "20BridgeJSRuntimeTestsy_13DataProcessorP", - "moduleName" : "BridgeJSRuntimeTests", - "parameters" : [ + "string" : { - ], - "returnType" : { - "swiftProtocol" : { - "_0" : "DataProcessor" - } - }, - "sendingParameters" : false - }, - "useJSTypedClosure" : false } } }, { - "abiName" : "bjs_TextProcessor_roundtripDataProcessor", + "abiName" : "bjs_TextProcessor_processWithCustom", "effects" : { "isAsync" : false, "isStatic" : false, "isThrows" : false }, - "name" : "roundtripDataProcessor", + "name" : "processWithCustom", "parameters" : [ { "label" : "_", - "name" : "callback", + "name" : "text", + "type" : { + "string" : { + + } + } + }, + { + "label" : "customTransform", + "name" : "customTransform", "type" : { "closure" : { "_0" : { "isAsync" : false, "isThrows" : false, - "mangleName" : "20BridgeJSRuntimeTests13DataProcessorP_13DataProcessorP", + "mangleName" : "20BridgeJSRuntimeTestsSiSSSd_SS", "moduleName" : "BridgeJSRuntimeTests", "parameters" : [ { - "swiftProtocol" : { - "_0" : "DataProcessor" + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + }, + { + "string" : { + + } + }, + { + "double" : { + } } ], "returnType" : { - "swiftProtocol" : { - "_0" : "DataProcessor" + "string" : { + } }, "sendingParameters" : false @@ -3985,24 +3632,41 @@ } } } + ], + "returnType" : { + "string" : { + + } + } + }, + { + "abiName" : "bjs_TextProcessor_getTransform", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "name" : "getTransform", + "parameters" : [ + ], "returnType" : { "closure" : { "_0" : { "isAsync" : false, "isThrows" : false, - "mangleName" : "20BridgeJSRuntimeTests13DataProcessorP_13DataProcessorP", + "mangleName" : "20BridgeJSRuntimeTestsSS_SS", "moduleName" : "BridgeJSRuntimeTests", "parameters" : [ { - "swiftProtocol" : { - "_0" : "DataProcessor" + "string" : { + } } ], "returnType" : { - "swiftProtocol" : { - "_0" : "DataProcessor" + "string" : { + } }, "sendingParameters" : false @@ -4012,13 +3676,13 @@ } }, { - "abiName" : "bjs_TextProcessor_processOptionalDataProcessor", + "abiName" : "bjs_TextProcessor_processOptionalString", "effects" : { "isAsync" : false, "isStatic" : false, "isThrows" : false }, - "name" : "processOptionalDataProcessor", + "name" : "processOptionalString", "parameters" : [ { "label" : "_", @@ -4028,14 +3692,14 @@ "_0" : { "isAsync" : false, "isThrows" : false, - "mangleName" : "20BridgeJSRuntimeTestsSq13DataProcessorP_SS", + "mangleName" : "20BridgeJSRuntimeTestsSqSS_SS", "moduleName" : "BridgeJSRuntimeTests", "parameters" : [ { "nullable" : { "_0" : { - "swiftProtocol" : { - "_0" : "DataProcessor" + "string" : { + } }, "_1" : "null" @@ -4061,13 +3725,13 @@ } }, { - "abiName" : "bjs_TextProcessor_processVector", + "abiName" : "bjs_TextProcessor_processOptionalInt", "effects" : { "isAsync" : false, "isStatic" : false, "isThrows" : false }, - "name" : "processVector", + "name" : "processOptionalInt", "parameters" : [ { "label" : "_", @@ -4077,18 +3741,26 @@ "_0" : { "isAsync" : false, "isThrows" : false, - "mangleName" : "20BridgeJSRuntimeTestsSd_8Vector2DV", + "mangleName" : "20BridgeJSRuntimeTestsSqSi_SS", "moduleName" : "BridgeJSRuntimeTests", "parameters" : [ { - "double" : { - + "nullable" : { + "_0" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + }, + "_1" : "null" } } ], "returnType" : { - "swiftStruct" : { - "_0" : "Vector2D" + "string" : { + } }, "sendingParameters" : false @@ -4099,19 +3771,19 @@ } ], "returnType" : { - "double" : { + "string" : { } } }, { - "abiName" : "bjs_TextProcessor_processOptionalVector", + "abiName" : "bjs_TextProcessor_processOptionalGreeter", "effects" : { "isAsync" : false, "isStatic" : false, "isThrows" : false }, - "name" : "processOptionalVector", + "name" : "processOptionalGreeter", "parameters" : [ { "label" : "_", @@ -4121,23 +3793,23 @@ "_0" : { "isAsync" : false, "isThrows" : false, - "mangleName" : "20BridgeJSRuntimeTestsSd_Sq8Vector2DV", + "mangleName" : "20BridgeJSRuntimeTestsSq7GreeterC_SS", "moduleName" : "BridgeJSRuntimeTests", "parameters" : [ { - "double" : { - + "nullable" : { + "_0" : { + "swiftHeapObject" : { + "_0" : "Greeter" + } + }, + "_1" : "null" } } ], "returnType" : { - "nullable" : { - "_0" : { - "swiftStruct" : { - "_0" : "Vector2D" - } - }, - "_1" : "null" + "string" : { + } }, "sendingParameters" : false @@ -4152,1136 +3824,1263 @@ } } - } - ], - "name" : "TextProcessor", - "properties" : [ - - ], - "swiftCallName" : "TextProcessor" - }, - { - "constructor" : { - "abiName" : "bjs_OptionalHolder_init", - "effects" : { - "isAsync" : false, - "isStatic" : false, - "isThrows" : false }, - "parameters" : [ - { - "label" : "nullableGreeter", - "name" : "nullableGreeter", - "type" : { - "nullable" : { - "_0" : { - "swiftHeapObject" : { - "_0" : "Greeter" - } - }, - "_1" : "null" - } - } + { + "abiName" : "bjs_TextProcessor_makeOptionalStringFormatter", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false }, - { - "label" : "undefinedNumber", - "name" : "undefinedNumber", - "type" : { - "nullable" : { - "_0" : { - "double" : { + "name" : "makeOptionalStringFormatter", + "parameters" : [ + + ], + "returnType" : { + "closure" : { + "_0" : { + "isAsync" : false, + "isThrows" : false, + "mangleName" : "20BridgeJSRuntimeTestsSqSS_SS", + "moduleName" : "BridgeJSRuntimeTests", + "parameters" : [ + { + "nullable" : { + "_0" : { + "string" : { + } + }, + "_1" : "null" + } } - }, - "_1" : "undefined" - } - } - } - ] - }, - "methods" : [ + ], + "returnType" : { + "string" : { - ], - "name" : "OptionalHolder", - "properties" : [ - { - "isReadonly" : false, - "isStatic" : false, - "name" : "nullableGreeter", - "type" : { - "nullable" : { - "_0" : { - "swiftHeapObject" : { - "_0" : "Greeter" - } + } + }, + "sendingParameters" : false }, - "_1" : "null" + "useJSTypedClosure" : false } } }, { - "isReadonly" : false, - "isStatic" : false, - "name" : "undefinedNumber", - "type" : { - "nullable" : { + "abiName" : "bjs_TextProcessor_makeOptionalGreeterCreator", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "name" : "makeOptionalGreeterCreator", + "parameters" : [ + + ], + "returnType" : { + "closure" : { "_0" : { - "double" : { + "isAsync" : false, + "isThrows" : false, + "mangleName" : "20BridgeJSRuntimeTestsy_Sq7GreeterC", + "moduleName" : "BridgeJSRuntimeTests", + "parameters" : [ - } + ], + "returnType" : { + "nullable" : { + "_0" : { + "swiftHeapObject" : { + "_0" : "Greeter" + } + }, + "_1" : "null" + } + }, + "sendingParameters" : false }, - "_1" : "undefined" + "useJSTypedClosure" : false } } - } - ], - "swiftCallName" : "OptionalHolder" - }, - { - "constructor" : { - "abiName" : "bjs_OptionalPropertyHolder_init", - "effects" : { - "isAsync" : false, - "isStatic" : false, - "isThrows" : false }, - "parameters" : [ - { - "label" : "optionalName", - "name" : "optionalName", - "type" : { - "nullable" : { - "_0" : { - "string" : { + { + "abiName" : "bjs_TextProcessor_processDirection", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "name" : "processDirection", + "parameters" : [ + { + "label" : "_", + "name" : "callback", + "type" : { + "closure" : { + "_0" : { + "isAsync" : false, + "isThrows" : false, + "mangleName" : "20BridgeJSRuntimeTests9DirectionO_SS", + "moduleName" : "BridgeJSRuntimeTests", + "parameters" : [ + { + "caseEnum" : { + "_0" : "Direction" + } + } + ], + "returnType" : { + "string" : { - } - }, - "_1" : "null" + } + }, + "sendingParameters" : false + }, + "useJSTypedClosure" : false + } } } - } - ] - }, - "methods" : [ - - ], - "name" : "OptionalPropertyHolder", - "properties" : [ - { - "isReadonly" : false, - "isStatic" : false, - "name" : "optionalName", - "type" : { - "nullable" : { - "_0" : { - "string" : { + ], + "returnType" : { + "string" : { - } - }, - "_1" : "null" } } }, { - "isReadonly" : false, - "isStatic" : false, - "name" : "optionalAge", - "type" : { - "nullable" : { - "_0" : { - "integer" : { + "abiName" : "bjs_TextProcessor_processTheme", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "name" : "processTheme", + "parameters" : [ + { + "label" : "_", + "name" : "callback", + "type" : { + "closure" : { "_0" : { - "isSigned" : true, - "width" : "word" - } + "isAsync" : false, + "isThrows" : false, + "mangleName" : "20BridgeJSRuntimeTests5ThemeO_SS", + "moduleName" : "BridgeJSRuntimeTests", + "parameters" : [ + { + "rawValueEnum" : { + "_0" : "Theme", + "_1" : "String" + } + } + ], + "returnType" : { + "string" : { + + } + }, + "sendingParameters" : false + }, + "useJSTypedClosure" : false } - }, - "_1" : "null" + } + } + ], + "returnType" : { + "string" : { + } } }, { - "isReadonly" : false, - "isStatic" : false, - "name" : "optionalGreeter", - "type" : { - "nullable" : { - "_0" : { - "swiftHeapObject" : { - "_0" : "Greeter" - } - }, - "_1" : "null" - } - } - } - ], - "swiftCallName" : "OptionalPropertyHolder" - }, - { - "constructor" : { - "abiName" : "bjs_Container_init", - "effects" : { - "isAsync" : false, - "isStatic" : false, - "isThrows" : false - }, - "parameters" : [ - { - "label" : "location", - "name" : "location", - "type" : { - "swiftStruct" : { - "_0" : "DataPoint" - } - } - }, - { - "label" : "config", - "name" : "config", - "type" : { - "nullable" : { - "_0" : { - "swiftStruct" : { - "_0" : "Config" - } - }, - "_1" : "null" - } - } - } - ] - }, - "methods" : [ - - ], - "name" : "Container", - "properties" : [ - { - "isReadonly" : false, - "isStatic" : false, - "name" : "location", - "type" : { - "swiftStruct" : { - "_0" : "DataPoint" - } - } - }, - { - "isReadonly" : false, - "isStatic" : false, - "name" : "config", - "type" : { - "nullable" : { - "_0" : { - "swiftStruct" : { - "_0" : "Config" - } - }, - "_1" : "null" - } - } - } - ], - "swiftCallName" : "Container" - }, - { - "constructor" : { - "abiName" : "bjs_LeakCheck_init", - "effects" : { - "isAsync" : false, - "isStatic" : false, - "isThrows" : false - }, - "parameters" : [ - - ] - }, - "explicitAccessControl" : "public", - "methods" : [ - - ], - "name" : "LeakCheck", - "properties" : [ - - ], - "swiftCallName" : "LeakCheck" - } - ], - "enums" : [ - { - "cases" : [ - - ], - "emitStyle" : "const", - "name" : "ArraySupportExports", - "staticMethods" : [ - { - "abiName" : "bjs_ArraySupportExports_static_roundTripIntArray", + "abiName" : "bjs_TextProcessor_processHttpStatus", "effects" : { "isAsync" : false, - "isStatic" : true, + "isStatic" : false, "isThrows" : false }, - "name" : "roundTripIntArray", - "namespace" : [ - "ArraySupportExports" - ], + "name" : "processHttpStatus", "parameters" : [ { "label" : "_", - "name" : "v", + "name" : "callback", "type" : { - "array" : { + "closure" : { "_0" : { - "integer" : { - "_0" : { - "isSigned" : true, - "width" : "word" + "isAsync" : false, + "isThrows" : false, + "mangleName" : "20BridgeJSRuntimeTests10HttpStatusO_Si", + "moduleName" : "BridgeJSRuntimeTests", + "parameters" : [ + { + "rawValueEnum" : { + "_0" : "HttpStatus", + "_1" : "Int" + } } - } - } + ], + "returnType" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + }, + "sendingParameters" : false + }, + "useJSTypedClosure" : false } } } ], "returnType" : { - "array" : { + "integer" : { "_0" : { - "integer" : { - "_0" : { - "isSigned" : true, - "width" : "word" - } - } + "isSigned" : true, + "width" : "word" } } - }, - "staticContext" : { - "namespaceEnum" : { - "_0" : "ArraySupportExports" - } } }, { - "abiName" : "bjs_ArraySupportExports_static_roundTripStringArray", + "abiName" : "bjs_TextProcessor_processAPIResult", "effects" : { "isAsync" : false, - "isStatic" : true, + "isStatic" : false, "isThrows" : false }, - "name" : "roundTripStringArray", - "namespace" : [ - "ArraySupportExports" - ], + "name" : "processAPIResult", "parameters" : [ { "label" : "_", - "name" : "v", + "name" : "callback", "type" : { - "array" : { + "closure" : { "_0" : { - "string" : { + "isAsync" : false, + "isThrows" : false, + "mangleName" : "20BridgeJSRuntimeTests9APIResultO_SS", + "moduleName" : "BridgeJSRuntimeTests", + "parameters" : [ + { + "associatedValueEnum" : { + "_0" : "APIResult" + } + } + ], + "returnType" : { + "string" : { - } - } + } + }, + "sendingParameters" : false + }, + "useJSTypedClosure" : false } } } ], "returnType" : { - "array" : { - "_0" : { - "string" : { + "string" : { - } - } - } - }, - "staticContext" : { - "namespaceEnum" : { - "_0" : "ArraySupportExports" } } }, { - "abiName" : "bjs_ArraySupportExports_static_roundTripDoubleArray", + "abiName" : "bjs_TextProcessor_makeDirectionChecker", "effects" : { "isAsync" : false, - "isStatic" : true, + "isStatic" : false, "isThrows" : false }, - "name" : "roundTripDoubleArray", - "namespace" : [ - "ArraySupportExports" - ], + "name" : "makeDirectionChecker", "parameters" : [ - { - "label" : "_", - "name" : "v", - "type" : { - "array" : { - "_0" : { - "double" : { - } - } - } - } - } ], "returnType" : { - "array" : { + "closure" : { "_0" : { - "double" : { + "isAsync" : false, + "isThrows" : false, + "mangleName" : "20BridgeJSRuntimeTests9DirectionO_Sb", + "moduleName" : "BridgeJSRuntimeTests", + "parameters" : [ + { + "caseEnum" : { + "_0" : "Direction" + } + } + ], + "returnType" : { + "bool" : { - } - } - } - }, - "staticContext" : { - "namespaceEnum" : { - "_0" : "ArraySupportExports" + } + }, + "sendingParameters" : false + }, + "useJSTypedClosure" : false } } }, { - "abiName" : "bjs_ArraySupportExports_static_roundTripBoolArray", + "abiName" : "bjs_TextProcessor_makeThemeValidator", "effects" : { "isAsync" : false, - "isStatic" : true, + "isStatic" : false, "isThrows" : false }, - "name" : "roundTripBoolArray", - "namespace" : [ - "ArraySupportExports" - ], + "name" : "makeThemeValidator", "parameters" : [ - { - "label" : "_", - "name" : "v", - "type" : { - "array" : { - "_0" : { - "bool" : { - } - } - } - } - } ], "returnType" : { - "array" : { + "closure" : { "_0" : { - "bool" : { + "isAsync" : false, + "isThrows" : false, + "mangleName" : "20BridgeJSRuntimeTests5ThemeO_Sb", + "moduleName" : "BridgeJSRuntimeTests", + "parameters" : [ + { + "rawValueEnum" : { + "_0" : "Theme", + "_1" : "String" + } + } + ], + "returnType" : { + "bool" : { - } - } - } - }, - "staticContext" : { - "namespaceEnum" : { - "_0" : "ArraySupportExports" + } + }, + "sendingParameters" : false + }, + "useJSTypedClosure" : false } } }, { - "abiName" : "bjs_ArraySupportExports_static_roundTripUnsafeRawPointerArray", + "abiName" : "bjs_TextProcessor_makeStatusCodeExtractor", "effects" : { "isAsync" : false, - "isStatic" : true, + "isStatic" : false, "isThrows" : false }, - "name" : "roundTripUnsafeRawPointerArray", - "namespace" : [ - "ArraySupportExports" - ], + "name" : "makeStatusCodeExtractor", "parameters" : [ - { - "label" : "_", - "name" : "v", - "type" : { - "array" : { - "_0" : { - "unsafePointer" : { - "_0" : { - "kind" : "unsafeRawPointer" - } + + ], + "returnType" : { + "closure" : { + "_0" : { + "isAsync" : false, + "isThrows" : false, + "mangleName" : "20BridgeJSRuntimeTests10HttpStatusO_Si", + "moduleName" : "BridgeJSRuntimeTests", + "parameters" : [ + { + "rawValueEnum" : { + "_0" : "HttpStatus", + "_1" : "Int" } } - } - } + ], + "returnType" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + }, + "sendingParameters" : false + }, + "useJSTypedClosure" : false } + } + }, + { + "abiName" : "bjs_TextProcessor_makeAPIResultHandler", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "name" : "makeAPIResultHandler", + "parameters" : [ + ], "returnType" : { - "array" : { + "closure" : { "_0" : { - "unsafePointer" : { - "_0" : { - "kind" : "unsafeRawPointer" + "isAsync" : false, + "isThrows" : false, + "mangleName" : "20BridgeJSRuntimeTests9APIResultO_SS", + "moduleName" : "BridgeJSRuntimeTests", + "parameters" : [ + { + "associatedValueEnum" : { + "_0" : "APIResult" + } } - } - } - } - }, - "staticContext" : { - "namespaceEnum" : { - "_0" : "ArraySupportExports" + ], + "returnType" : { + "string" : { + + } + }, + "sendingParameters" : false + }, + "useJSTypedClosure" : false } } }, { - "abiName" : "bjs_ArraySupportExports_static_roundTripUnsafeMutableRawPointerArray", + "abiName" : "bjs_TextProcessor_processOptionalDirection", "effects" : { "isAsync" : false, - "isStatic" : true, + "isStatic" : false, "isThrows" : false }, - "name" : "roundTripUnsafeMutableRawPointerArray", - "namespace" : [ - "ArraySupportExports" - ], + "name" : "processOptionalDirection", "parameters" : [ { "label" : "_", - "name" : "v", + "name" : "callback", "type" : { - "array" : { + "closure" : { "_0" : { - "unsafePointer" : { - "_0" : { - "kind" : "unsafeMutableRawPointer" + "isAsync" : false, + "isThrows" : false, + "mangleName" : "20BridgeJSRuntimeTestsSq9DirectionO_SS", + "moduleName" : "BridgeJSRuntimeTests", + "parameters" : [ + { + "nullable" : { + "_0" : { + "caseEnum" : { + "_0" : "Direction" + } + }, + "_1" : "null" + } } - } - } + ], + "returnType" : { + "string" : { + + } + }, + "sendingParameters" : false + }, + "useJSTypedClosure" : false } } } ], "returnType" : { - "array" : { - "_0" : { - "unsafePointer" : { - "_0" : { - "kind" : "unsafeMutableRawPointer" - } - } - } - } - }, - "staticContext" : { - "namespaceEnum" : { - "_0" : "ArraySupportExports" + "string" : { + } } }, { - "abiName" : "bjs_ArraySupportExports_static_roundTripOpaquePointerArray", + "abiName" : "bjs_TextProcessor_processOptionalTheme", "effects" : { "isAsync" : false, - "isStatic" : true, + "isStatic" : false, "isThrows" : false }, - "name" : "roundTripOpaquePointerArray", - "namespace" : [ - "ArraySupportExports" - ], + "name" : "processOptionalTheme", "parameters" : [ { "label" : "_", - "name" : "v", + "name" : "callback", "type" : { - "array" : { + "closure" : { "_0" : { - "unsafePointer" : { - "_0" : { - "kind" : "opaquePointer" + "isAsync" : false, + "isThrows" : false, + "mangleName" : "20BridgeJSRuntimeTestsSq5ThemeO_SS", + "moduleName" : "BridgeJSRuntimeTests", + "parameters" : [ + { + "nullable" : { + "_0" : { + "rawValueEnum" : { + "_0" : "Theme", + "_1" : "String" + } + }, + "_1" : "null" + } } - } - } + ], + "returnType" : { + "string" : { + + } + }, + "sendingParameters" : false + }, + "useJSTypedClosure" : false } } } ], "returnType" : { - "array" : { - "_0" : { - "unsafePointer" : { - "_0" : { - "kind" : "opaquePointer" - } - } - } - } - }, - "staticContext" : { - "namespaceEnum" : { - "_0" : "ArraySupportExports" + "string" : { + } } }, { - "abiName" : "bjs_ArraySupportExports_static_roundTripUnsafePointerArray", + "abiName" : "bjs_TextProcessor_processOptionalAPIResult", "effects" : { "isAsync" : false, - "isStatic" : true, + "isStatic" : false, "isThrows" : false }, - "name" : "roundTripUnsafePointerArray", - "namespace" : [ - "ArraySupportExports" - ], + "name" : "processOptionalAPIResult", "parameters" : [ { "label" : "_", - "name" : "v", + "name" : "callback", "type" : { - "array" : { + "closure" : { "_0" : { - "unsafePointer" : { - "_0" : { - "kind" : "unsafePointer", - "pointee" : "UInt8" + "isAsync" : false, + "isThrows" : false, + "mangleName" : "20BridgeJSRuntimeTestsSq9APIResultO_SS", + "moduleName" : "BridgeJSRuntimeTests", + "parameters" : [ + { + "nullable" : { + "_0" : { + "associatedValueEnum" : { + "_0" : "APIResult" + } + }, + "_1" : "null" + } } - } - } + ], + "returnType" : { + "string" : { + + } + }, + "sendingParameters" : false + }, + "useJSTypedClosure" : false } } } ], "returnType" : { - "array" : { - "_0" : { - "unsafePointer" : { - "_0" : { - "kind" : "unsafePointer", - "pointee" : "UInt8" - } - } - } - } - }, - "staticContext" : { - "namespaceEnum" : { - "_0" : "ArraySupportExports" + "string" : { + } } }, { - "abiName" : "bjs_ArraySupportExports_static_roundTripUnsafeMutablePointerArray", + "abiName" : "bjs_TextProcessor_makeOptionalDirectionFormatter", "effects" : { "isAsync" : false, - "isStatic" : true, + "isStatic" : false, "isThrows" : false }, - "name" : "roundTripUnsafeMutablePointerArray", - "namespace" : [ - "ArraySupportExports" - ], + "name" : "makeOptionalDirectionFormatter", "parameters" : [ - { - "label" : "_", - "name" : "v", - "type" : { - "array" : { - "_0" : { - "unsafePointer" : { - "_0" : { - "kind" : "unsafeMutablePointer", - "pointee" : "UInt8" - } - } - } - } - } - } + ], "returnType" : { - "array" : { + "closure" : { "_0" : { - "unsafePointer" : { - "_0" : { - "kind" : "unsafeMutablePointer", - "pointee" : "UInt8" + "isAsync" : false, + "isThrows" : false, + "mangleName" : "20BridgeJSRuntimeTestsSq9DirectionO_SS", + "moduleName" : "BridgeJSRuntimeTests", + "parameters" : [ + { + "nullable" : { + "_0" : { + "caseEnum" : { + "_0" : "Direction" + } + }, + "_1" : "null" + } } - } - } - } - }, - "staticContext" : { - "namespaceEnum" : { - "_0" : "ArraySupportExports" + ], + "returnType" : { + "string" : { + + } + }, + "sendingParameters" : false + }, + "useJSTypedClosure" : false } } }, { - "abiName" : "bjs_ArraySupportExports_static_roundTripJSValueArray", + "abiName" : "bjs_TextProcessor_processDataProcessor", "effects" : { "isAsync" : false, - "isStatic" : true, + "isStatic" : false, "isThrows" : false }, - "name" : "roundTripJSValueArray", - "namespace" : [ - "ArraySupportExports" - ], + "name" : "processDataProcessor", "parameters" : [ { "label" : "_", - "name" : "v", + "name" : "callback", "type" : { - "array" : { + "closure" : { "_0" : { - "jsValue" : { + "isAsync" : false, + "isThrows" : false, + "mangleName" : "20BridgeJSRuntimeTests13DataProcessorP_SS", + "moduleName" : "BridgeJSRuntimeTests", + "parameters" : [ + { + "swiftProtocol" : { + "_0" : "DataProcessor" + } + } + ], + "returnType" : { + "string" : { - } - } + } + }, + "sendingParameters" : false + }, + "useJSTypedClosure" : false } } } ], "returnType" : { - "array" : { - "_0" : { - "jsValue" : { + "string" : { - } - } - } - }, - "staticContext" : { - "namespaceEnum" : { - "_0" : "ArraySupportExports" } } }, { - "abiName" : "bjs_ArraySupportExports_static_roundTripJSObjectArray", + "abiName" : "bjs_TextProcessor_makeDataProcessorFactory", "effects" : { "isAsync" : false, - "isStatic" : true, + "isStatic" : false, "isThrows" : false }, - "name" : "roundTripJSObjectArray", - "namespace" : [ - "ArraySupportExports" - ], + "name" : "makeDataProcessorFactory", "parameters" : [ - { - "label" : "_", - "name" : "v", - "type" : { - "array" : { - "_0" : { - "jsObject" : { - } - } - } - } - } ], "returnType" : { - "array" : { + "closure" : { "_0" : { - "jsObject" : { + "isAsync" : false, + "isThrows" : false, + "mangleName" : "20BridgeJSRuntimeTestsy_13DataProcessorP", + "moduleName" : "BridgeJSRuntimeTests", + "parameters" : [ - } - } - } - }, - "staticContext" : { - "namespaceEnum" : { - "_0" : "ArraySupportExports" + ], + "returnType" : { + "swiftProtocol" : { + "_0" : "DataProcessor" + } + }, + "sendingParameters" : false + }, + "useJSTypedClosure" : false } } }, { - "abiName" : "bjs_ArraySupportExports_static_roundTripCaseEnumArray", + "abiName" : "bjs_TextProcessor_roundtripDataProcessor", "effects" : { "isAsync" : false, - "isStatic" : true, + "isStatic" : false, "isThrows" : false }, - "name" : "roundTripCaseEnumArray", - "namespace" : [ - "ArraySupportExports" - ], + "name" : "roundtripDataProcessor", "parameters" : [ { "label" : "_", - "name" : "v", + "name" : "callback", "type" : { - "array" : { + "closure" : { "_0" : { - "caseEnum" : { - "_0" : "Direction" - } - } + "isAsync" : false, + "isThrows" : false, + "mangleName" : "20BridgeJSRuntimeTests13DataProcessorP_13DataProcessorP", + "moduleName" : "BridgeJSRuntimeTests", + "parameters" : [ + { + "swiftProtocol" : { + "_0" : "DataProcessor" + } + } + ], + "returnType" : { + "swiftProtocol" : { + "_0" : "DataProcessor" + } + }, + "sendingParameters" : false + }, + "useJSTypedClosure" : false } } } ], "returnType" : { - "array" : { + "closure" : { "_0" : { - "caseEnum" : { - "_0" : "Direction" - } - } - } - }, - "staticContext" : { - "namespaceEnum" : { - "_0" : "ArraySupportExports" - } - } - }, - { - "abiName" : "bjs_ArraySupportExports_static_roundTripStringRawValueEnumArray", - "effects" : { - "isAsync" : false, - "isStatic" : true, - "isThrows" : false - }, - "name" : "roundTripStringRawValueEnumArray", - "namespace" : [ - "ArraySupportExports" - ], - "parameters" : [ - { - "label" : "_", - "name" : "v", - "type" : { - "array" : { - "_0" : { - "rawValueEnum" : { - "_0" : "Theme", - "_1" : "String" + "isAsync" : false, + "isThrows" : false, + "mangleName" : "20BridgeJSRuntimeTests13DataProcessorP_13DataProcessorP", + "moduleName" : "BridgeJSRuntimeTests", + "parameters" : [ + { + "swiftProtocol" : { + "_0" : "DataProcessor" } } - } - } - } - ], - "returnType" : { - "array" : { - "_0" : { - "rawValueEnum" : { - "_0" : "Theme", - "_1" : "String" - } - } - } - }, - "staticContext" : { - "namespaceEnum" : { - "_0" : "ArraySupportExports" + ], + "returnType" : { + "swiftProtocol" : { + "_0" : "DataProcessor" + } + }, + "sendingParameters" : false + }, + "useJSTypedClosure" : false } } }, { - "abiName" : "bjs_ArraySupportExports_static_roundTripIntRawValueEnumArray", + "abiName" : "bjs_TextProcessor_processOptionalDataProcessor", "effects" : { "isAsync" : false, - "isStatic" : true, + "isStatic" : false, "isThrows" : false }, - "name" : "roundTripIntRawValueEnumArray", - "namespace" : [ - "ArraySupportExports" - ], + "name" : "processOptionalDataProcessor", "parameters" : [ { "label" : "_", - "name" : "v", + "name" : "callback", "type" : { - "array" : { + "closure" : { "_0" : { - "rawValueEnum" : { - "_0" : "HttpStatus", - "_1" : "Int" - } - } + "isAsync" : false, + "isThrows" : false, + "mangleName" : "20BridgeJSRuntimeTestsSq13DataProcessorP_SS", + "moduleName" : "BridgeJSRuntimeTests", + "parameters" : [ + { + "nullable" : { + "_0" : { + "swiftProtocol" : { + "_0" : "DataProcessor" + } + }, + "_1" : "null" + } + } + ], + "returnType" : { + "string" : { + + } + }, + "sendingParameters" : false + }, + "useJSTypedClosure" : false } } } ], "returnType" : { - "array" : { - "_0" : { - "rawValueEnum" : { - "_0" : "HttpStatus", - "_1" : "Int" - } - } - } - }, - "staticContext" : { - "namespaceEnum" : { - "_0" : "ArraySupportExports" + "string" : { + } } }, { - "abiName" : "bjs_ArraySupportExports_static_roundTripInt64RawValueEnumArray", + "abiName" : "bjs_TextProcessor_processVector", "effects" : { "isAsync" : false, - "isStatic" : true, + "isStatic" : false, "isThrows" : false }, - "name" : "roundTripInt64RawValueEnumArray", - "namespace" : [ - "ArraySupportExports" - ], + "name" : "processVector", "parameters" : [ { "label" : "_", - "name" : "v", + "name" : "callback", "type" : { - "array" : { + "closure" : { "_0" : { - "rawValueEnum" : { - "_0" : "FileSize", - "_1" : "Int64" - } - } + "isAsync" : false, + "isThrows" : false, + "mangleName" : "20BridgeJSRuntimeTestsSd_8Vector2DV", + "moduleName" : "BridgeJSRuntimeTests", + "parameters" : [ + { + "double" : { + + } + } + ], + "returnType" : { + "swiftStruct" : { + "_0" : "Vector2D" + } + }, + "sendingParameters" : false + }, + "useJSTypedClosure" : false } } } ], "returnType" : { - "array" : { - "_0" : { - "rawValueEnum" : { - "_0" : "FileSize", - "_1" : "Int64" - } - } - } - }, - "staticContext" : { - "namespaceEnum" : { - "_0" : "ArraySupportExports" + "double" : { + } } }, { - "abiName" : "bjs_ArraySupportExports_static_roundTripUInt64RawValueEnumArray", + "abiName" : "bjs_TextProcessor_processOptionalVector", "effects" : { "isAsync" : false, - "isStatic" : true, + "isStatic" : false, "isThrows" : false }, - "name" : "roundTripUInt64RawValueEnumArray", - "namespace" : [ - "ArraySupportExports" - ], + "name" : "processOptionalVector", "parameters" : [ { "label" : "_", - "name" : "v", + "name" : "callback", "type" : { - "array" : { + "closure" : { "_0" : { - "rawValueEnum" : { - "_0" : "SessionId", - "_1" : "UInt64" - } - } + "isAsync" : false, + "isThrows" : false, + "mangleName" : "20BridgeJSRuntimeTestsSd_Sq8Vector2DV", + "moduleName" : "BridgeJSRuntimeTests", + "parameters" : [ + { + "double" : { + + } + } + ], + "returnType" : { + "nullable" : { + "_0" : { + "swiftStruct" : { + "_0" : "Vector2D" + } + }, + "_1" : "null" + } + }, + "sendingParameters" : false + }, + "useJSTypedClosure" : false } } } ], "returnType" : { - "array" : { - "_0" : { - "rawValueEnum" : { - "_0" : "SessionId", - "_1" : "UInt64" - } + "string" : { + + } + } + } + ], + "name" : "TextProcessor", + "properties" : [ + + ], + "swiftCallName" : "TextProcessor" + }, + { + "constructor" : { + "abiName" : "bjs_OptionalHolder_init", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "parameters" : [ + { + "label" : "nullableGreeter", + "name" : "nullableGreeter", + "type" : { + "nullable" : { + "_0" : { + "swiftHeapObject" : { + "_0" : "Greeter" + } + }, + "_1" : "null" } } }, - "staticContext" : { - "namespaceEnum" : { - "_0" : "ArraySupportExports" + { + "label" : "undefinedNumber", + "name" : "undefinedNumber", + "type" : { + "nullable" : { + "_0" : { + "double" : { + + } + }, + "_1" : "undefined" + } } } - }, + ] + }, + "methods" : [ + + ], + "name" : "OptionalHolder", + "properties" : [ { - "abiName" : "bjs_ArraySupportExports_static_roundTripStructArray", - "effects" : { - "isAsync" : false, - "isStatic" : true, - "isThrows" : false - }, - "name" : "roundTripStructArray", - "namespace" : [ - "ArraySupportExports" - ], - "parameters" : [ - { - "label" : "_", - "name" : "v", - "type" : { - "array" : { - "_0" : { - "swiftStruct" : { - "_0" : "DataPoint" - } - } - } - } - } - ], - "returnType" : { - "array" : { + "isReadonly" : false, + "isStatic" : false, + "name" : "nullableGreeter", + "type" : { + "nullable" : { "_0" : { - "swiftStruct" : { - "_0" : "DataPoint" + "swiftHeapObject" : { + "_0" : "Greeter" } - } - } - }, - "staticContext" : { - "namespaceEnum" : { - "_0" : "ArraySupportExports" + }, + "_1" : "null" } } }, { - "abiName" : "bjs_ArraySupportExports_static_roundTripSwiftClassArray", - "effects" : { - "isAsync" : false, - "isStatic" : true, - "isThrows" : false - }, - "name" : "roundTripSwiftClassArray", - "namespace" : [ - "ArraySupportExports" - ], - "parameters" : [ - { - "label" : "_", - "name" : "v", - "type" : { - "array" : { - "_0" : { - "swiftHeapObject" : { - "_0" : "Greeter" - } - } - } - } - } - ], - "returnType" : { - "array" : { + "isReadonly" : false, + "isStatic" : false, + "name" : "undefinedNumber", + "type" : { + "nullable" : { "_0" : { - "swiftHeapObject" : { - "_0" : "Greeter" + "double" : { + } - } - } - }, - "staticContext" : { - "namespaceEnum" : { - "_0" : "ArraySupportExports" + }, + "_1" : "undefined" } } + } + ], + "swiftCallName" : "OptionalHolder" + }, + { + "constructor" : { + "abiName" : "bjs_OptionalPropertyHolder_init", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false }, - { - "abiName" : "bjs_ArraySupportExports_static_roundTripNamespacedSwiftClassArray", - "effects" : { - "isAsync" : false, - "isStatic" : true, - "isThrows" : false - }, - "name" : "roundTripNamespacedSwiftClassArray", - "namespace" : [ - "ArraySupportExports" - ], - "parameters" : [ - { - "label" : "_", - "name" : "v", - "type" : { - "array" : { - "_0" : { - "swiftHeapObject" : { - "_0" : "Utils.Converter" - } + "parameters" : [ + { + "label" : "optionalName", + "name" : "optionalName", + "type" : { + "nullable" : { + "_0" : { + "string" : { + } - } + }, + "_1" : "null" } } - ], - "returnType" : { - "array" : { + } + ] + }, + "methods" : [ + + ], + "name" : "OptionalPropertyHolder", + "properties" : [ + { + "isReadonly" : false, + "isStatic" : false, + "name" : "optionalName", + "type" : { + "nullable" : { "_0" : { - "swiftHeapObject" : { - "_0" : "Utils.Converter" + "string" : { + } - } - } - }, - "staticContext" : { - "namespaceEnum" : { - "_0" : "ArraySupportExports" + }, + "_1" : "null" } } }, { - "abiName" : "bjs_ArraySupportExports_static_roundTripProtocolArray", - "effects" : { - "isAsync" : false, - "isStatic" : true, - "isThrows" : false - }, - "name" : "roundTripProtocolArray", - "namespace" : [ - "ArraySupportExports" - ], - "parameters" : [ - { - "label" : "_", - "name" : "v", - "type" : { - "array" : { + "isReadonly" : false, + "isStatic" : false, + "name" : "optionalAge", + "type" : { + "nullable" : { + "_0" : { + "integer" : { "_0" : { - "swiftProtocol" : { - "_0" : "ArrayElementProtocol" - } + "isSigned" : true, + "width" : "word" } } - } + }, + "_1" : "null" } - ], - "returnType" : { - "array" : { + } + }, + { + "isReadonly" : false, + "isStatic" : false, + "name" : "optionalGreeter", + "type" : { + "nullable" : { "_0" : { - "swiftProtocol" : { - "_0" : "ArrayElementProtocol" + "swiftHeapObject" : { + "_0" : "Greeter" } + }, + "_1" : "null" + } + } + } + ], + "swiftCallName" : "OptionalPropertyHolder" + }, + { + "constructor" : { + "abiName" : "bjs_Container_init", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "parameters" : [ + { + "label" : "location", + "name" : "location", + "type" : { + "swiftStruct" : { + "_0" : "DataPoint" } } }, - "staticContext" : { - "namespaceEnum" : { - "_0" : "ArraySupportExports" + { + "label" : "config", + "name" : "config", + "type" : { + "nullable" : { + "_0" : { + "swiftStruct" : { + "_0" : "Config" + } + }, + "_1" : "null" + } } } - }, + ] + }, + "methods" : [ + + ], + "name" : "Container", + "properties" : [ { - "abiName" : "bjs_ArraySupportExports_static_roundTripJSClassArray", - "effects" : { - "isAsync" : false, + "isReadonly" : false, + "isStatic" : false, + "name" : "location", + "type" : { + "swiftStruct" : { + "_0" : "DataPoint" + } + } + }, + { + "isReadonly" : false, + "isStatic" : false, + "name" : "config", + "type" : { + "nullable" : { + "_0" : { + "swiftStruct" : { + "_0" : "Config" + } + }, + "_1" : "null" + } + } + } + ], + "swiftCallName" : "Container" + }, + { + "constructor" : { + "abiName" : "bjs_LeakCheck_init", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "parameters" : [ + + ] + }, + "explicitAccessControl" : "public", + "methods" : [ + + ], + "name" : "LeakCheck", + "properties" : [ + + ], + "swiftCallName" : "LeakCheck" + } + ], + "enums" : [ + { + "cases" : [ + { + "associatedValues" : [ + + ], + "name" : "notice" + }, + { + "associatedValues" : [ + + ], + "name" : "warning" + }, + { + "associatedValues" : [ + + ], + "name" : "error" + } + ], + "emitStyle" : "const", + "name" : "Severity", + "staticMethods" : [ + + ], + "staticProperties" : [ + + ], + "swiftCallName" : "Severity", + "tsFullPath" : "Severity" + }, + { + "cases" : [ + { + "associatedValues" : [ + { + "type" : { + "alias" : { + "name" : "Polygon", + "underlying" : { + "swiftHeapObject" : { + "_0" : "PolygonReference" + } + } + } + } + } + ], + "name" : "polygon" + }, + { + "associatedValues" : [ + + ], + "name" : "empty" + } + ], + "emitStyle" : "const", + "name" : "Shape", + "staticMethods" : [ + + ], + "staticProperties" : [ + + ], + "swiftCallName" : "Shape", + "tsFullPath" : "Shape" + }, + { + "cases" : [ + { + "associatedValues" : [ + { + "type" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + } + } + ], + "name" : "payload" + }, + { + "associatedValues" : [ + + ], + "name" : "empty" + } + ], + "emitStyle" : "const", + "name" : "InnerTag", + "staticMethods" : [ + + ], + "staticProperties" : [ + + ], + "swiftCallName" : "InnerTag", + "tsFullPath" : "InnerTag" + }, + { + "cases" : [ + + ], + "emitStyle" : "const", + "name" : "ArraySupportExports", + "staticMethods" : [ + { + "abiName" : "bjs_ArraySupportExports_static_roundTripIntArray", + "effects" : { + "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "roundTripJSClassArray", + "name" : "roundTripIntArray", "namespace" : [ "ArraySupportExports" ], @@ -5292,8 +5091,11 @@ "type" : { "array" : { "_0" : { - "jsObject" : { - "_0" : "ArrayElementObject" + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } } } } @@ -5303,8 +5105,11 @@ "returnType" : { "array" : { "_0" : { - "jsObject" : { - "_0" : "ArrayElementObject" + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } } } } @@ -5316,13 +5121,13 @@ } }, { - "abiName" : "bjs_ArraySupportExports_static_roundTripOptionalIntArray", + "abiName" : "bjs_ArraySupportExports_static_roundTripStringArray", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "roundTripOptionalIntArray", + "name" : "roundTripStringArray", "namespace" : [ "ArraySupportExports" ], @@ -5333,16 +5138,8 @@ "type" : { "array" : { "_0" : { - "nullable" : { - "_0" : { - "integer" : { - "_0" : { - "isSigned" : true, - "width" : "word" - } - } - }, - "_1" : "null" + "string" : { + } } } @@ -5352,16 +5149,8 @@ "returnType" : { "array" : { "_0" : { - "nullable" : { - "_0" : { - "integer" : { - "_0" : { - "isSigned" : true, - "width" : "word" - } - } - }, - "_1" : "null" + "string" : { + } } } @@ -5373,13 +5162,13 @@ } }, { - "abiName" : "bjs_ArraySupportExports_static_roundTripOptionalStringArray", + "abiName" : "bjs_ArraySupportExports_static_roundTripDoubleArray", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "roundTripOptionalStringArray", + "name" : "roundTripDoubleArray", "namespace" : [ "ArraySupportExports" ], @@ -5390,13 +5179,8 @@ "type" : { "array" : { "_0" : { - "nullable" : { - "_0" : { - "string" : { + "double" : { - } - }, - "_1" : "null" } } } @@ -5406,13 +5190,8 @@ "returnType" : { "array" : { "_0" : { - "nullable" : { - "_0" : { - "string" : { + "double" : { - } - }, - "_1" : "null" } } } @@ -5424,13 +5203,13 @@ } }, { - "abiName" : "bjs_ArraySupportExports_static_roundTripOptionalJSObjectArray", + "abiName" : "bjs_ArraySupportExports_static_roundTripBoolArray", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "roundTripOptionalJSObjectArray", + "name" : "roundTripBoolArray", "namespace" : [ "ArraySupportExports" ], @@ -5441,13 +5220,8 @@ "type" : { "array" : { "_0" : { - "nullable" : { - "_0" : { - "jsObject" : { + "bool" : { - } - }, - "_1" : "null" } } } @@ -5457,13 +5231,8 @@ "returnType" : { "array" : { "_0" : { - "nullable" : { - "_0" : { - "jsObject" : { + "bool" : { - } - }, - "_1" : "null" } } } @@ -5475,13 +5244,13 @@ } }, { - "abiName" : "bjs_ArraySupportExports_static_roundTripOptionalCaseEnumArray", + "abiName" : "bjs_ArraySupportExports_static_roundTripUnsafeRawPointerArray", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "roundTripOptionalCaseEnumArray", + "name" : "roundTripUnsafeRawPointerArray", "namespace" : [ "ArraySupportExports" ], @@ -5492,13 +5261,10 @@ "type" : { "array" : { "_0" : { - "nullable" : { + "unsafePointer" : { "_0" : { - "caseEnum" : { - "_0" : "Direction" - } - }, - "_1" : "null" + "kind" : "unsafeRawPointer" + } } } } @@ -5508,13 +5274,10 @@ "returnType" : { "array" : { "_0" : { - "nullable" : { + "unsafePointer" : { "_0" : { - "caseEnum" : { - "_0" : "Direction" - } - }, - "_1" : "null" + "kind" : "unsafeRawPointer" + } } } } @@ -5526,13 +5289,13 @@ } }, { - "abiName" : "bjs_ArraySupportExports_static_roundTripOptionalStringRawValueEnumArray", + "abiName" : "bjs_ArraySupportExports_static_roundTripUnsafeMutableRawPointerArray", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "roundTripOptionalStringRawValueEnumArray", + "name" : "roundTripUnsafeMutableRawPointerArray", "namespace" : [ "ArraySupportExports" ], @@ -5543,14 +5306,10 @@ "type" : { "array" : { "_0" : { - "nullable" : { + "unsafePointer" : { "_0" : { - "rawValueEnum" : { - "_0" : "Theme", - "_1" : "String" - } - }, - "_1" : "null" + "kind" : "unsafeMutableRawPointer" + } } } } @@ -5560,14 +5319,10 @@ "returnType" : { "array" : { "_0" : { - "nullable" : { + "unsafePointer" : { "_0" : { - "rawValueEnum" : { - "_0" : "Theme", - "_1" : "String" - } - }, - "_1" : "null" + "kind" : "unsafeMutableRawPointer" + } } } } @@ -5579,13 +5334,13 @@ } }, { - "abiName" : "bjs_ArraySupportExports_static_roundTripOptionalIntRawValueEnumArray", + "abiName" : "bjs_ArraySupportExports_static_roundTripOpaquePointerArray", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "roundTripOptionalIntRawValueEnumArray", + "name" : "roundTripOpaquePointerArray", "namespace" : [ "ArraySupportExports" ], @@ -5596,14 +5351,10 @@ "type" : { "array" : { "_0" : { - "nullable" : { + "unsafePointer" : { "_0" : { - "rawValueEnum" : { - "_0" : "HttpStatus", - "_1" : "Int" - } - }, - "_1" : "null" + "kind" : "opaquePointer" + } } } } @@ -5613,14 +5364,10 @@ "returnType" : { "array" : { "_0" : { - "nullable" : { + "unsafePointer" : { "_0" : { - "rawValueEnum" : { - "_0" : "HttpStatus", - "_1" : "Int" - } - }, - "_1" : "null" + "kind" : "opaquePointer" + } } } } @@ -5632,13 +5379,13 @@ } }, { - "abiName" : "bjs_ArraySupportExports_static_roundTripOptionalInt64RawValueEnumArray", + "abiName" : "bjs_ArraySupportExports_static_roundTripUnsafePointerArray", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "roundTripOptionalInt64RawValueEnumArray", + "name" : "roundTripUnsafePointerArray", "namespace" : [ "ArraySupportExports" ], @@ -5649,14 +5396,11 @@ "type" : { "array" : { "_0" : { - "nullable" : { + "unsafePointer" : { "_0" : { - "rawValueEnum" : { - "_0" : "FileSize", - "_1" : "Int64" - } - }, - "_1" : "null" + "kind" : "unsafePointer", + "pointee" : "UInt8" + } } } } @@ -5666,14 +5410,11 @@ "returnType" : { "array" : { "_0" : { - "nullable" : { + "unsafePointer" : { "_0" : { - "rawValueEnum" : { - "_0" : "FileSize", - "_1" : "Int64" - } - }, - "_1" : "null" + "kind" : "unsafePointer", + "pointee" : "UInt8" + } } } } @@ -5685,13 +5426,13 @@ } }, { - "abiName" : "bjs_ArraySupportExports_static_roundTripOptionalUInt64RawValueEnumArray", + "abiName" : "bjs_ArraySupportExports_static_roundTripUnsafeMutablePointerArray", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "roundTripOptionalUInt64RawValueEnumArray", + "name" : "roundTripUnsafeMutablePointerArray", "namespace" : [ "ArraySupportExports" ], @@ -5702,14 +5443,11 @@ "type" : { "array" : { "_0" : { - "nullable" : { + "unsafePointer" : { "_0" : { - "rawValueEnum" : { - "_0" : "SessionId", - "_1" : "UInt64" - } - }, - "_1" : "null" + "kind" : "unsafeMutablePointer", + "pointee" : "UInt8" + } } } } @@ -5719,14 +5457,11 @@ "returnType" : { "array" : { "_0" : { - "nullable" : { + "unsafePointer" : { "_0" : { - "rawValueEnum" : { - "_0" : "SessionId", - "_1" : "UInt64" - } - }, - "_1" : "null" + "kind" : "unsafeMutablePointer", + "pointee" : "UInt8" + } } } } @@ -5738,13 +5473,13 @@ } }, { - "abiName" : "bjs_ArraySupportExports_static_roundTripOptionalStructArray", + "abiName" : "bjs_ArraySupportExports_static_roundTripJSValueArray", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "roundTripOptionalStructArray", + "name" : "roundTripJSValueArray", "namespace" : [ "ArraySupportExports" ], @@ -5755,13 +5490,8 @@ "type" : { "array" : { "_0" : { - "nullable" : { - "_0" : { - "swiftStruct" : { - "_0" : "DataPoint" - } - }, - "_1" : "null" + "jsValue" : { + } } } @@ -5771,13 +5501,8 @@ "returnType" : { "array" : { "_0" : { - "nullable" : { - "_0" : { - "swiftStruct" : { - "_0" : "DataPoint" - } - }, - "_1" : "null" + "jsValue" : { + } } } @@ -5789,13 +5514,13 @@ } }, { - "abiName" : "bjs_ArraySupportExports_static_roundTripOptionalSwiftClassArray", + "abiName" : "bjs_ArraySupportExports_static_roundTripJSObjectArray", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "roundTripOptionalSwiftClassArray", + "name" : "roundTripJSObjectArray", "namespace" : [ "ArraySupportExports" ], @@ -5806,13 +5531,8 @@ "type" : { "array" : { "_0" : { - "nullable" : { - "_0" : { - "swiftHeapObject" : { - "_0" : "Greeter" - } - }, - "_1" : "null" + "jsObject" : { + } } } @@ -5822,13 +5542,8 @@ "returnType" : { "array" : { "_0" : { - "nullable" : { - "_0" : { - "swiftHeapObject" : { - "_0" : "Greeter" - } - }, - "_1" : "null" + "jsObject" : { + } } } @@ -5840,13 +5555,13 @@ } }, { - "abiName" : "bjs_ArraySupportExports_static_roundTripOptionalJSClassArray", + "abiName" : "bjs_ArraySupportExports_static_roundTripCaseEnumArray", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "roundTripOptionalJSClassArray", + "name" : "roundTripCaseEnumArray", "namespace" : [ "ArraySupportExports" ], @@ -5857,13 +5572,8 @@ "type" : { "array" : { "_0" : { - "nullable" : { - "_0" : { - "jsObject" : { - "_0" : "ArrayElementObject" - } - }, - "_1" : "null" + "caseEnum" : { + "_0" : "Direction" } } } @@ -5873,13 +5583,8 @@ "returnType" : { "array" : { "_0" : { - "nullable" : { - "_0" : { - "jsObject" : { - "_0" : "ArrayElementObject" - } - }, - "_1" : "null" + "caseEnum" : { + "_0" : "Direction" } } } @@ -5891,13 +5596,13 @@ } }, { - "abiName" : "bjs_ArraySupportExports_static_roundTripNestedIntArray", + "abiName" : "bjs_ArraySupportExports_static_roundTripStringRawValueEnumArray", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "roundTripNestedIntArray", + "name" : "roundTripStringRawValueEnumArray", "namespace" : [ "ArraySupportExports" ], @@ -5908,15 +5613,9 @@ "type" : { "array" : { "_0" : { - "array" : { - "_0" : { - "integer" : { - "_0" : { - "isSigned" : true, - "width" : "word" - } - } - } + "rawValueEnum" : { + "_0" : "Theme", + "_1" : "String" } } } @@ -5926,15 +5625,9 @@ "returnType" : { "array" : { "_0" : { - "array" : { - "_0" : { - "integer" : { - "_0" : { - "isSigned" : true, - "width" : "word" - } - } - } + "rawValueEnum" : { + "_0" : "Theme", + "_1" : "String" } } } @@ -5946,13 +5639,13 @@ } }, { - "abiName" : "bjs_ArraySupportExports_static_roundTripNestedStringArray", + "abiName" : "bjs_ArraySupportExports_static_roundTripIntRawValueEnumArray", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "roundTripNestedStringArray", + "name" : "roundTripIntRawValueEnumArray", "namespace" : [ "ArraySupportExports" ], @@ -5963,12 +5656,9 @@ "type" : { "array" : { "_0" : { - "array" : { - "_0" : { - "string" : { - - } - } + "rawValueEnum" : { + "_0" : "HttpStatus", + "_1" : "Int" } } } @@ -5978,12 +5668,9 @@ "returnType" : { "array" : { "_0" : { - "array" : { - "_0" : { - "string" : { - - } - } + "rawValueEnum" : { + "_0" : "HttpStatus", + "_1" : "Int" } } } @@ -5995,13 +5682,13 @@ } }, { - "abiName" : "bjs_ArraySupportExports_static_roundTripNestedDoubleArray", + "abiName" : "bjs_ArraySupportExports_static_roundTripInt64RawValueEnumArray", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "roundTripNestedDoubleArray", + "name" : "roundTripInt64RawValueEnumArray", "namespace" : [ "ArraySupportExports" ], @@ -6012,12 +5699,9 @@ "type" : { "array" : { "_0" : { - "array" : { - "_0" : { - "double" : { - - } - } + "rawValueEnum" : { + "_0" : "FileSize", + "_1" : "Int64" } } } @@ -6027,12 +5711,9 @@ "returnType" : { "array" : { "_0" : { - "array" : { - "_0" : { - "double" : { - - } - } + "rawValueEnum" : { + "_0" : "FileSize", + "_1" : "Int64" } } } @@ -6044,13 +5725,13 @@ } }, { - "abiName" : "bjs_ArraySupportExports_static_roundTripNestedBoolArray", + "abiName" : "bjs_ArraySupportExports_static_roundTripUInt64RawValueEnumArray", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "roundTripNestedBoolArray", + "name" : "roundTripUInt64RawValueEnumArray", "namespace" : [ "ArraySupportExports" ], @@ -6061,12 +5742,9 @@ "type" : { "array" : { "_0" : { - "array" : { - "_0" : { - "bool" : { - - } - } + "rawValueEnum" : { + "_0" : "SessionId", + "_1" : "UInt64" } } } @@ -6076,12 +5754,9 @@ "returnType" : { "array" : { "_0" : { - "array" : { - "_0" : { - "bool" : { - - } - } + "rawValueEnum" : { + "_0" : "SessionId", + "_1" : "UInt64" } } } @@ -6093,13 +5768,13 @@ } }, { - "abiName" : "bjs_ArraySupportExports_static_roundTripNestedStructArray", + "abiName" : "bjs_ArraySupportExports_static_roundTripStructArray", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "roundTripNestedStructArray", + "name" : "roundTripStructArray", "namespace" : [ "ArraySupportExports" ], @@ -6110,12 +5785,8 @@ "type" : { "array" : { "_0" : { - "array" : { - "_0" : { - "swiftStruct" : { - "_0" : "DataPoint" - } - } + "swiftStruct" : { + "_0" : "DataPoint" } } } @@ -6125,12 +5796,8 @@ "returnType" : { "array" : { "_0" : { - "array" : { - "_0" : { - "swiftStruct" : { - "_0" : "DataPoint" - } - } + "swiftStruct" : { + "_0" : "DataPoint" } } } @@ -6142,13 +5809,13 @@ } }, { - "abiName" : "bjs_ArraySupportExports_static_roundTripNestedCaseEnumArray", + "abiName" : "bjs_ArraySupportExports_static_roundTripSwiftClassArray", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "roundTripNestedCaseEnumArray", + "name" : "roundTripSwiftClassArray", "namespace" : [ "ArraySupportExports" ], @@ -6159,12 +5826,8 @@ "type" : { "array" : { "_0" : { - "array" : { - "_0" : { - "caseEnum" : { - "_0" : "Direction" - } - } + "swiftHeapObject" : { + "_0" : "Greeter" } } } @@ -6174,12 +5837,8 @@ "returnType" : { "array" : { "_0" : { - "array" : { - "_0" : { - "caseEnum" : { - "_0" : "Direction" - } - } + "swiftHeapObject" : { + "_0" : "Greeter" } } } @@ -6191,13 +5850,13 @@ } }, { - "abiName" : "bjs_ArraySupportExports_static_roundTripNestedSwiftClassArray", + "abiName" : "bjs_ArraySupportExports_static_roundTripNamespacedSwiftClassArray", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "roundTripNestedSwiftClassArray", + "name" : "roundTripNamespacedSwiftClassArray", "namespace" : [ "ArraySupportExports" ], @@ -6208,12 +5867,8 @@ "type" : { "array" : { "_0" : { - "array" : { - "_0" : { - "swiftHeapObject" : { - "_0" : "Greeter" - } - } + "swiftHeapObject" : { + "_0" : "Utils.Converter" } } } @@ -6223,12 +5878,8 @@ "returnType" : { "array" : { "_0" : { - "array" : { - "_0" : { - "swiftHeapObject" : { - "_0" : "Greeter" - } - } + "swiftHeapObject" : { + "_0" : "Utils.Converter" } } } @@ -6240,41 +5891,25 @@ } }, { - "abiName" : "bjs_ArraySupportExports_static_multiArrayFirst", + "abiName" : "bjs_ArraySupportExports_static_roundTripProtocolArray", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "multiArrayFirst", + "name" : "roundTripProtocolArray", "namespace" : [ "ArraySupportExports" ], "parameters" : [ { "label" : "_", - "name" : "a", - "type" : { - "array" : { - "_0" : { - "integer" : { - "_0" : { - "isSigned" : true, - "width" : "word" - } - } - } - } - } - }, - { - "label" : "_", - "name" : "b", + "name" : "v", "type" : { "array" : { "_0" : { - "string" : { - + "swiftProtocol" : { + "_0" : "ArrayElementProtocol" } } } @@ -6284,11 +5919,8 @@ "returnType" : { "array" : { "_0" : { - "integer" : { - "_0" : { - "isSigned" : true, - "width" : "word" - } + "swiftProtocol" : { + "_0" : "ArrayElementProtocol" } } } @@ -6300,41 +5932,25 @@ } }, { - "abiName" : "bjs_ArraySupportExports_static_multiArraySecond", + "abiName" : "bjs_ArraySupportExports_static_roundTripJSClassArray", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "multiArraySecond", + "name" : "roundTripJSClassArray", "namespace" : [ "ArraySupportExports" ], "parameters" : [ { "label" : "_", - "name" : "a", - "type" : { - "array" : { - "_0" : { - "integer" : { - "_0" : { - "isSigned" : true, - "width" : "word" - } - } - } - } - } - }, - { - "label" : "_", - "name" : "b", + "name" : "v", "type" : { "array" : { "_0" : { - "string" : { - + "jsObject" : { + "_0" : "ArrayElementObject" } } } @@ -6344,8 +5960,8 @@ "returnType" : { "array" : { "_0" : { - "string" : { - + "jsObject" : { + "_0" : "ArrayElementObject" } } } @@ -6357,24 +5973,24 @@ } }, { - "abiName" : "bjs_ArraySupportExports_static_multiOptionalArrayFirst", + "abiName" : "bjs_ArraySupportExports_static_roundTripOptionalIntArray", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "multiOptionalArrayFirst", + "name" : "roundTripOptionalIntArray", "namespace" : [ "ArraySupportExports" ], "parameters" : [ { "label" : "_", - "name" : "a", + "name" : "v", "type" : { - "nullable" : { + "array" : { "_0" : { - "array" : { + "nullable" : { "_0" : { "integer" : { "_0" : { @@ -6382,36 +5998,18 @@ "width" : "word" } } - } - } - }, - "_1" : "null" - } - } - }, - { - "label" : "_", - "name" : "b", - "type" : { - "nullable" : { - "_0" : { - "array" : { - "_0" : { - "string" : { - - } - } + }, + "_1" : "null" } - }, - "_1" : "null" + } } } } ], "returnType" : { - "nullable" : { + "array" : { "_0" : { - "array" : { + "nullable" : { "_0" : { "integer" : { "_0" : { @@ -6419,10 +6017,10 @@ "width" : "word" } } - } + }, + "_1" : "null" } - }, - "_1" : "null" + } } }, "staticContext" : { @@ -6432,69 +6030,48 @@ } }, { - "abiName" : "bjs_ArraySupportExports_static_multiOptionalArraySecond", + "abiName" : "bjs_ArraySupportExports_static_roundTripOptionalStringArray", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "multiOptionalArraySecond", + "name" : "roundTripOptionalStringArray", "namespace" : [ "ArraySupportExports" ], "parameters" : [ { "label" : "_", - "name" : "a", - "type" : { - "nullable" : { - "_0" : { - "array" : { - "_0" : { - "integer" : { - "_0" : { - "isSigned" : true, - "width" : "word" - } - } - } - } - }, - "_1" : "null" - } - } - }, - { - "label" : "_", - "name" : "b", + "name" : "v", "type" : { - "nullable" : { + "array" : { "_0" : { - "array" : { + "nullable" : { "_0" : { "string" : { } - } + }, + "_1" : "null" } - }, - "_1" : "null" + } } } } ], "returnType" : { - "nullable" : { + "array" : { "_0" : { - "array" : { + "nullable" : { "_0" : { "string" : { } - } + }, + "_1" : "null" } - }, - "_1" : "null" + } } }, "staticContext" : { @@ -6502,639 +6079,699 @@ "_0" : "ArraySupportExports" } } - } - ], - "staticProperties" : [ - - ], - "swiftCallName" : "ArraySupportExports", - "tsFullPath" : "ArraySupportExports" - }, - { - "cases" : [ - - ], - "emitStyle" : "const", - "name" : "DefaultArgumentExports", - "staticMethods" : [ + }, { - "abiName" : "bjs_DefaultArgumentExports_static_testStringDefault", + "abiName" : "bjs_ArraySupportExports_static_roundTripOptionalJSObjectArray", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "testStringDefault", + "name" : "roundTripOptionalJSObjectArray", "namespace" : [ - "DefaultArgumentExports" + "ArraySupportExports" ], "parameters" : [ { - "defaultValue" : { - "string" : { - "_0" : "Hello World" - } - }, - "label" : "message", - "name" : "message", + "label" : "_", + "name" : "v", "type" : { - "string" : { + "array" : { + "_0" : { + "nullable" : { + "_0" : { + "jsObject" : { + } + }, + "_1" : "null" + } + } } } } ], "returnType" : { - "string" : { + "array" : { + "_0" : { + "nullable" : { + "_0" : { + "jsObject" : { + } + }, + "_1" : "null" + } + } } }, "staticContext" : { "namespaceEnum" : { - "_0" : "DefaultArgumentExports" + "_0" : "ArraySupportExports" } } }, { - "abiName" : "bjs_DefaultArgumentExports_static_testIntDefault", + "abiName" : "bjs_ArraySupportExports_static_roundTripOptionalCaseEnumArray", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "testIntDefault", + "name" : "roundTripOptionalCaseEnumArray", "namespace" : [ - "DefaultArgumentExports" + "ArraySupportExports" ], "parameters" : [ { - "defaultValue" : { - "int" : { - "_0" : 42 - } - }, - "label" : "count", - "name" : "count", + "label" : "_", + "name" : "v", "type" : { - "integer" : { + "array" : { "_0" : { - "isSigned" : true, - "width" : "word" + "nullable" : { + "_0" : { + "caseEnum" : { + "_0" : "Direction" + } + }, + "_1" : "null" + } } } } } ], "returnType" : { - "integer" : { + "array" : { "_0" : { - "isSigned" : true, - "width" : "word" + "nullable" : { + "_0" : { + "caseEnum" : { + "_0" : "Direction" + } + }, + "_1" : "null" + } } } }, "staticContext" : { "namespaceEnum" : { - "_0" : "DefaultArgumentExports" + "_0" : "ArraySupportExports" } } }, { - "abiName" : "bjs_DefaultArgumentExports_static_testBoolDefault", + "abiName" : "bjs_ArraySupportExports_static_roundTripOptionalStringRawValueEnumArray", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "testBoolDefault", + "name" : "roundTripOptionalStringRawValueEnumArray", "namespace" : [ - "DefaultArgumentExports" + "ArraySupportExports" ], "parameters" : [ { - "defaultValue" : { - "bool" : { - "_0" : true - } - }, - "label" : "flag", - "name" : "flag", + "label" : "_", + "name" : "v", "type" : { - "bool" : { - + "array" : { + "_0" : { + "nullable" : { + "_0" : { + "rawValueEnum" : { + "_0" : "Theme", + "_1" : "String" + } + }, + "_1" : "null" + } + } } } } ], "returnType" : { - "bool" : { - + "array" : { + "_0" : { + "nullable" : { + "_0" : { + "rawValueEnum" : { + "_0" : "Theme", + "_1" : "String" + } + }, + "_1" : "null" + } + } } }, "staticContext" : { "namespaceEnum" : { - "_0" : "DefaultArgumentExports" + "_0" : "ArraySupportExports" } } }, { - "abiName" : "bjs_DefaultArgumentExports_static_testOptionalDefault", + "abiName" : "bjs_ArraySupportExports_static_roundTripOptionalIntRawValueEnumArray", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "testOptionalDefault", + "name" : "roundTripOptionalIntRawValueEnumArray", "namespace" : [ - "DefaultArgumentExports" + "ArraySupportExports" ], "parameters" : [ { - "defaultValue" : { - "null" : { - - } - }, - "label" : "name", - "name" : "name", + "label" : "_", + "name" : "v", "type" : { - "nullable" : { + "array" : { "_0" : { - "string" : { - + "nullable" : { + "_0" : { + "rawValueEnum" : { + "_0" : "HttpStatus", + "_1" : "Int" + } + }, + "_1" : "null" } - }, - "_1" : "null" + } } } } ], "returnType" : { - "nullable" : { + "array" : { "_0" : { - "string" : { - + "nullable" : { + "_0" : { + "rawValueEnum" : { + "_0" : "HttpStatus", + "_1" : "Int" + } + }, + "_1" : "null" } - }, - "_1" : "null" + } } }, "staticContext" : { "namespaceEnum" : { - "_0" : "DefaultArgumentExports" + "_0" : "ArraySupportExports" } } }, { - "abiName" : "bjs_DefaultArgumentExports_static_testMultipleDefaults", + "abiName" : "bjs_ArraySupportExports_static_roundTripOptionalInt64RawValueEnumArray", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "testMultipleDefaults", + "name" : "roundTripOptionalInt64RawValueEnumArray", "namespace" : [ - "DefaultArgumentExports" + "ArraySupportExports" ], "parameters" : [ { - "defaultValue" : { - "string" : { - "_0" : "Default Title" - } - }, - "label" : "title", - "name" : "title", - "type" : { - "string" : { - - } - } - }, - { - "defaultValue" : { - "int" : { - "_0" : -10 - } - }, - "label" : "count", - "name" : "count", + "label" : "_", + "name" : "v", "type" : { - "integer" : { + "array" : { "_0" : { - "isSigned" : true, - "width" : "word" + "nullable" : { + "_0" : { + "rawValueEnum" : { + "_0" : "FileSize", + "_1" : "Int64" + } + }, + "_1" : "null" + } } } } - }, - { - "defaultValue" : { - "bool" : { - "_0" : false - } - }, - "label" : "enabled", - "name" : "enabled", - "type" : { - "bool" : { - - } - } } ], "returnType" : { - "string" : { - + "array" : { + "_0" : { + "nullable" : { + "_0" : { + "rawValueEnum" : { + "_0" : "FileSize", + "_1" : "Int64" + } + }, + "_1" : "null" + } + } } }, "staticContext" : { "namespaceEnum" : { - "_0" : "DefaultArgumentExports" + "_0" : "ArraySupportExports" } } }, { - "abiName" : "bjs_DefaultArgumentExports_static_testSimpleEnumDefault", + "abiName" : "bjs_ArraySupportExports_static_roundTripOptionalUInt64RawValueEnumArray", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "testSimpleEnumDefault", + "name" : "roundTripOptionalUInt64RawValueEnumArray", "namespace" : [ - "DefaultArgumentExports" + "ArraySupportExports" ], "parameters" : [ { - "defaultValue" : { - "enumCase" : { - "_0" : "Status", - "_1" : "success" - } - }, - "label" : "status", - "name" : "status", + "label" : "_", + "name" : "v", "type" : { - "caseEnum" : { - "_0" : "Status" + "array" : { + "_0" : { + "nullable" : { + "_0" : { + "rawValueEnum" : { + "_0" : "SessionId", + "_1" : "UInt64" + } + }, + "_1" : "null" + } + } } } } ], "returnType" : { - "caseEnum" : { - "_0" : "Status" - } - }, - "staticContext" : { - "namespaceEnum" : { - "_0" : "DefaultArgumentExports" - } - } + "array" : { + "_0" : { + "nullable" : { + "_0" : { + "rawValueEnum" : { + "_0" : "SessionId", + "_1" : "UInt64" + } + }, + "_1" : "null" + } + } + } + }, + "staticContext" : { + "namespaceEnum" : { + "_0" : "ArraySupportExports" + } + } }, { - "abiName" : "bjs_DefaultArgumentExports_static_testDirectionDefault", + "abiName" : "bjs_ArraySupportExports_static_roundTripOptionalStructArray", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "testDirectionDefault", + "name" : "roundTripOptionalStructArray", "namespace" : [ - "DefaultArgumentExports" + "ArraySupportExports" ], "parameters" : [ { - "defaultValue" : { - "enumCase" : { - "_0" : "Direction", - "_1" : "north" - } - }, - "label" : "direction", - "name" : "direction", + "label" : "_", + "name" : "v", "type" : { - "caseEnum" : { - "_0" : "Direction" + "array" : { + "_0" : { + "nullable" : { + "_0" : { + "swiftStruct" : { + "_0" : "DataPoint" + } + }, + "_1" : "null" + } + } } } } ], "returnType" : { - "caseEnum" : { - "_0" : "Direction" + "array" : { + "_0" : { + "nullable" : { + "_0" : { + "swiftStruct" : { + "_0" : "DataPoint" + } + }, + "_1" : "null" + } + } } }, "staticContext" : { "namespaceEnum" : { - "_0" : "DefaultArgumentExports" + "_0" : "ArraySupportExports" } } }, { - "abiName" : "bjs_DefaultArgumentExports_static_testRawStringEnumDefault", + "abiName" : "bjs_ArraySupportExports_static_roundTripOptionalSwiftClassArray", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "testRawStringEnumDefault", + "name" : "roundTripOptionalSwiftClassArray", "namespace" : [ - "DefaultArgumentExports" + "ArraySupportExports" ], "parameters" : [ { - "defaultValue" : { - "enumCase" : { - "_0" : "Theme", - "_1" : "light" - } - }, - "label" : "theme", - "name" : "theme", + "label" : "_", + "name" : "v", "type" : { - "rawValueEnum" : { - "_0" : "Theme", - "_1" : "String" + "array" : { + "_0" : { + "nullable" : { + "_0" : { + "swiftHeapObject" : { + "_0" : "Greeter" + } + }, + "_1" : "null" + } + } } } } ], "returnType" : { - "rawValueEnum" : { - "_0" : "Theme", - "_1" : "String" + "array" : { + "_0" : { + "nullable" : { + "_0" : { + "swiftHeapObject" : { + "_0" : "Greeter" + } + }, + "_1" : "null" + } + } } }, "staticContext" : { "namespaceEnum" : { - "_0" : "DefaultArgumentExports" + "_0" : "ArraySupportExports" } } }, { - "abiName" : "bjs_DefaultArgumentExports_static_testComplexInit", + "abiName" : "bjs_ArraySupportExports_static_roundTripOptionalJSClassArray", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "testComplexInit", + "name" : "roundTripOptionalJSClassArray", "namespace" : [ - "DefaultArgumentExports" + "ArraySupportExports" ], "parameters" : [ { - "defaultValue" : { - "objectWithArguments" : { - "_0" : "Greeter", - "_1" : [ - { - "string" : { - "_0" : "DefaultGreeter" - } - } - ] - } - }, - "label" : "greeter", - "name" : "greeter", + "label" : "_", + "name" : "v", "type" : { - "swiftHeapObject" : { - "_0" : "Greeter" + "array" : { + "_0" : { + "nullable" : { + "_0" : { + "jsObject" : { + "_0" : "ArrayElementObject" + } + }, + "_1" : "null" + } + } } } } ], "returnType" : { - "string" : { - + "array" : { + "_0" : { + "nullable" : { + "_0" : { + "jsObject" : { + "_0" : "ArrayElementObject" + } + }, + "_1" : "null" + } + } } }, "staticContext" : { "namespaceEnum" : { - "_0" : "DefaultArgumentExports" + "_0" : "ArraySupportExports" } } }, { - "abiName" : "bjs_DefaultArgumentExports_static_testEmptyInit", + "abiName" : "bjs_ArraySupportExports_static_roundTripNestedIntArray", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "testEmptyInit", + "name" : "roundTripNestedIntArray", "namespace" : [ - "DefaultArgumentExports" + "ArraySupportExports" ], "parameters" : [ { - "defaultValue" : { - "object" : { - "_0" : "StaticPropertyHolder" - } - }, "label" : "_", - "name" : "object", + "name" : "v", "type" : { - "swiftHeapObject" : { - "_0" : "StaticPropertyHolder" + "array" : { + "_0" : { + "array" : { + "_0" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + } + } + } } } } ], "returnType" : { - "swiftHeapObject" : { - "_0" : "StaticPropertyHolder" + "array" : { + "_0" : { + "array" : { + "_0" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + } + } + } } }, "staticContext" : { "namespaceEnum" : { - "_0" : "DefaultArgumentExports" + "_0" : "ArraySupportExports" } } }, { - "abiName" : "bjs_DefaultArgumentExports_static_createConstructorDefaults", + "abiName" : "bjs_ArraySupportExports_static_roundTripNestedStringArray", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "createConstructorDefaults", + "name" : "roundTripNestedStringArray", "namespace" : [ - "DefaultArgumentExports" + "ArraySupportExports" ], "parameters" : [ { - "defaultValue" : { - "string" : { - "_0" : "Default" - } - }, - "label" : "name", - "name" : "name", + "label" : "_", + "name" : "v", "type" : { - "string" : { + "array" : { + "_0" : { + "array" : { + "_0" : { + "string" : { + } + } + } + } } } - }, - { - "defaultValue" : { - "int" : { - "_0" : 42 - } - }, - "label" : "count", - "name" : "count", - "type" : { - "integer" : { + } + ], + "returnType" : { + "array" : { + "_0" : { + "array" : { "_0" : { - "isSigned" : true, - "width" : "word" + "string" : { + + } } } } - }, - { - "defaultValue" : { - "bool" : { - "_0" : true - } - }, - "label" : "enabled", - "name" : "enabled", - "type" : { - "bool" : { - - } - } - }, - { - "defaultValue" : { - "enumCase" : { - "_0" : "Status", - "_1" : "success" - } - }, - "label" : "status", - "name" : "status", - "type" : { - "caseEnum" : { - "_0" : "Status" - } - } - }, + } + }, + "staticContext" : { + "namespaceEnum" : { + "_0" : "ArraySupportExports" + } + } + }, + { + "abiName" : "bjs_ArraySupportExports_static_roundTripNestedDoubleArray", + "effects" : { + "isAsync" : false, + "isStatic" : true, + "isThrows" : false + }, + "name" : "roundTripNestedDoubleArray", + "namespace" : [ + "ArraySupportExports" + ], + "parameters" : [ { - "defaultValue" : { - "null" : { - - } - }, - "label" : "tag", - "name" : "tag", + "label" : "_", + "name" : "v", "type" : { - "nullable" : { + "array" : { "_0" : { - "string" : { + "array" : { + "_0" : { + "double" : { + } + } } - }, - "_1" : "null" + } } } } ], "returnType" : { - "swiftHeapObject" : { - "_0" : "DefaultArgumentConstructorDefaults" + "array" : { + "_0" : { + "array" : { + "_0" : { + "double" : { + + } + } + } + } } }, "staticContext" : { "namespaceEnum" : { - "_0" : "DefaultArgumentExports" + "_0" : "ArraySupportExports" } } }, { - "abiName" : "bjs_DefaultArgumentExports_static_describeConstructorDefaults", + "abiName" : "bjs_ArraySupportExports_static_roundTripNestedBoolArray", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "describeConstructorDefaults", + "name" : "roundTripNestedBoolArray", "namespace" : [ - "DefaultArgumentExports" + "ArraySupportExports" ], "parameters" : [ { "label" : "_", - "name" : "value", + "name" : "v", "type" : { - "swiftHeapObject" : { - "_0" : "DefaultArgumentConstructorDefaults" + "array" : { + "_0" : { + "array" : { + "_0" : { + "bool" : { + + } + } + } + } } } } ], "returnType" : { - "string" : { + "array" : { + "_0" : { + "array" : { + "_0" : { + "bool" : { + } + } + } + } } }, "staticContext" : { "namespaceEnum" : { - "_0" : "DefaultArgumentExports" + "_0" : "ArraySupportExports" } } }, { - "abiName" : "bjs_DefaultArgumentExports_static_arrayWithDefault", + "abiName" : "bjs_ArraySupportExports_static_roundTripNestedStructArray", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "arrayWithDefault", + "name" : "roundTripNestedStructArray", "namespace" : [ - "DefaultArgumentExports" + "ArraySupportExports" ], "parameters" : [ { - "defaultValue" : { - "array" : { - "_0" : [ - { - "int" : { - "_0" : 1 - } - }, - { - "int" : { - "_0" : 2 - } - }, - { - "int" : { - "_0" : 3 - } - } - ] - } - }, "label" : "_", - "name" : "values", + "name" : "v", "type" : { "array" : { "_0" : { - "integer" : { + "array" : { "_0" : { - "isSigned" : true, - "width" : "word" + "swiftStruct" : { + "_0" : "DataPoint" + } } } } @@ -7143,636 +6780,1656 @@ } ], "returnType" : { - "integer" : { + "array" : { "_0" : { - "isSigned" : true, - "width" : "word" + "array" : { + "_0" : { + "swiftStruct" : { + "_0" : "DataPoint" + } + } + } } } }, "staticContext" : { "namespaceEnum" : { - "_0" : "DefaultArgumentExports" + "_0" : "ArraySupportExports" } } }, { - "abiName" : "bjs_DefaultArgumentExports_static_arrayWithOptionalDefault", + "abiName" : "bjs_ArraySupportExports_static_roundTripNestedCaseEnumArray", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "arrayWithOptionalDefault", + "name" : "roundTripNestedCaseEnumArray", "namespace" : [ - "DefaultArgumentExports" + "ArraySupportExports" ], "parameters" : [ { - "defaultValue" : { - "null" : { - - } - }, "label" : "_", - "name" : "values", + "name" : "v", "type" : { - "nullable" : { + "array" : { "_0" : { "array" : { "_0" : { - "integer" : { - "_0" : { - "isSigned" : true, - "width" : "word" - } + "caseEnum" : { + "_0" : "Direction" } } } - }, - "_1" : "null" + } } } } ], "returnType" : { - "integer" : { + "array" : { "_0" : { - "isSigned" : true, - "width" : "word" + "array" : { + "_0" : { + "caseEnum" : { + "_0" : "Direction" + } + } + } } } }, "staticContext" : { "namespaceEnum" : { - "_0" : "DefaultArgumentExports" + "_0" : "ArraySupportExports" } } }, { - "abiName" : "bjs_DefaultArgumentExports_static_arrayMixedDefaults", + "abiName" : "bjs_ArraySupportExports_static_roundTripNestedSwiftClassArray", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "arrayMixedDefaults", + "name" : "roundTripNestedSwiftClassArray", "namespace" : [ - "DefaultArgumentExports" + "ArraySupportExports" ], "parameters" : [ { - "defaultValue" : { - "string" : { - "_0" : "Sum" - } - }, - "label" : "prefix", - "name" : "prefix", + "label" : "_", + "name" : "v", "type" : { - "string" : { - - } - } - }, - { - "defaultValue" : { "array" : { - "_0" : [ - { - "int" : { - "_0" : 10 - } - }, - { - "int" : { - "_0" : 20 + "_0" : { + "array" : { + "_0" : { + "swiftHeapObject" : { + "_0" : "Greeter" + } } } - ] + } } - }, - "label" : "values", - "name" : "values", - "type" : { + } + } + ], + "returnType" : { + "array" : { + "_0" : { "array" : { "_0" : { - "integer" : { - "_0" : { - "isSigned" : true, - "width" : "word" - } + "swiftHeapObject" : { + "_0" : "Greeter" } } } } - }, - { - "defaultValue" : { - "string" : { - "_0" : "!" + } + }, + "staticContext" : { + "namespaceEnum" : { + "_0" : "ArraySupportExports" + } + } + }, + { + "abiName" : "bjs_ArraySupportExports_static_multiArrayFirst", + "effects" : { + "isAsync" : false, + "isStatic" : true, + "isThrows" : false + }, + "name" : "multiArrayFirst", + "namespace" : [ + "ArraySupportExports" + ], + "parameters" : [ + { + "label" : "_", + "name" : "a", + "type" : { + "array" : { + "_0" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + } } - }, - "label" : "suffix", - "name" : "suffix", + } + }, + { + "label" : "_", + "name" : "b", "type" : { - "string" : { + "array" : { + "_0" : { + "string" : { + } + } } } } ], "returnType" : { - "string" : { - + "array" : { + "_0" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + } } }, "staticContext" : { "namespaceEnum" : { - "_0" : "DefaultArgumentExports" + "_0" : "ArraySupportExports" } } - } - ], - "staticProperties" : [ - - ], - "swiftCallName" : "DefaultArgumentExports", - "tsFullPath" : "DefaultArgumentExports" - }, - { - "cases" : [ - { - "associatedValues" : [ - - ], - "name" : "north" - }, - { - "associatedValues" : [ - - ], - "name" : "south" }, { - "associatedValues" : [ - + "abiName" : "bjs_ArraySupportExports_static_multiArraySecond", + "effects" : { + "isAsync" : false, + "isStatic" : true, + "isThrows" : false + }, + "name" : "multiArraySecond", + "namespace" : [ + "ArraySupportExports" ], - "name" : "east" - }, - { - "associatedValues" : [ + "parameters" : [ + { + "label" : "_", + "name" : "a", + "type" : { + "array" : { + "_0" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + } + } + } + }, + { + "label" : "_", + "name" : "b", + "type" : { + "array" : { + "_0" : { + "string" : { + } + } + } + } + } ], - "name" : "west" - } - ], - "emitStyle" : "const", - "explicitAccessControl" : "public", - "name" : "Direction", - "staticMethods" : [ - - ], - "staticProperties" : [ - - ], - "swiftCallName" : "Direction", - "tsFullPath" : "Direction" - }, - { - "cases" : [ - { - "associatedValues" : [ + "returnType" : { + "array" : { + "_0" : { + "string" : { - ], - "name" : "loading" + } + } + } + }, + "staticContext" : { + "namespaceEnum" : { + "_0" : "ArraySupportExports" + } + } }, { - "associatedValues" : [ + "abiName" : "bjs_ArraySupportExports_static_multiOptionalArrayFirst", + "effects" : { + "isAsync" : false, + "isStatic" : true, + "isThrows" : false + }, + "name" : "multiOptionalArrayFirst", + "namespace" : [ + "ArraySupportExports" + ], + "parameters" : [ + { + "label" : "_", + "name" : "a", + "type" : { + "nullable" : { + "_0" : { + "array" : { + "_0" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + } + } + }, + "_1" : "null" + } + } + }, + { + "label" : "_", + "name" : "b", + "type" : { + "nullable" : { + "_0" : { + "array" : { + "_0" : { + "string" : { + } + } + } + }, + "_1" : "null" + } + } + } ], - "name" : "success" + "returnType" : { + "nullable" : { + "_0" : { + "array" : { + "_0" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + } + } + }, + "_1" : "null" + } + }, + "staticContext" : { + "namespaceEnum" : { + "_0" : "ArraySupportExports" + } + } }, { - "associatedValues" : [ - + "abiName" : "bjs_ArraySupportExports_static_multiOptionalArraySecond", + "effects" : { + "isAsync" : false, + "isStatic" : true, + "isThrows" : false + }, + "name" : "multiOptionalArraySecond", + "namespace" : [ + "ArraySupportExports" ], - "name" : "error" - } - ], - "emitStyle" : "const", - "name" : "Status", - "staticMethods" : [ - - ], - "staticProperties" : [ - - ], - "swiftCallName" : "Status", - "tsFullPath" : "Status" - }, - { - "cases" : [ - { - "associatedValues" : [ - - ], - "name" : "light", - "rawValue" : "light" - }, - { - "associatedValues" : [ + "parameters" : [ + { + "label" : "_", + "name" : "a", + "type" : { + "nullable" : { + "_0" : { + "array" : { + "_0" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + } + } + }, + "_1" : "null" + } + } + }, + { + "label" : "_", + "name" : "b", + "type" : { + "nullable" : { + "_0" : { + "array" : { + "_0" : { + "string" : { + } + } + } + }, + "_1" : "null" + } + } + } ], - "name" : "dark", - "rawValue" : "dark" - }, - { - "associatedValues" : [ + "returnType" : { + "nullable" : { + "_0" : { + "array" : { + "_0" : { + "string" : { - ], - "name" : "auto", - "rawValue" : "auto" + } + } + } + }, + "_1" : "null" + } + }, + "staticContext" : { + "namespaceEnum" : { + "_0" : "ArraySupportExports" + } + } } - ], - "emitStyle" : "const", - "name" : "Theme", - "rawType" : "String", - "staticMethods" : [ - ], "staticProperties" : [ ], - "swiftCallName" : "Theme", - "tsFullPath" : "Theme" + "swiftCallName" : "ArraySupportExports", + "tsFullPath" : "ArraySupportExports" }, { "cases" : [ - { - "associatedValues" : [ - - ], - "name" : "ok", - "rawValue" : "200" - }, - { - "associatedValues" : [ - - ], - "name" : "notFound", - "rawValue" : "404" - }, - { - "associatedValues" : [ - - ], - "name" : "serverError", - "rawValue" : "500" - }, - { - "associatedValues" : [ - ], - "name" : "unknown", - "rawValue" : "-1" - } ], "emitStyle" : "const", - "name" : "HttpStatus", - "rawType" : "Int", + "name" : "DefaultArgumentExports", "staticMethods" : [ - - ], - "staticProperties" : [ - - ], - "swiftCallName" : "HttpStatus", - "tsFullPath" : "HttpStatus" - }, - { - "cases" : [ { - "associatedValues" : [ - + "abiName" : "bjs_DefaultArgumentExports_static_testStringDefault", + "effects" : { + "isAsync" : false, + "isStatic" : true, + "isThrows" : false + }, + "name" : "testStringDefault", + "namespace" : [ + "DefaultArgumentExports" ], - "name" : "tiny", - "rawValue" : "1024" - }, - { - "associatedValues" : [ + "parameters" : [ + { + "defaultValue" : { + "string" : { + "_0" : "Hello World" + } + }, + "label" : "message", + "name" : "message", + "type" : { + "string" : { + } + } + } ], - "name" : "small", - "rawValue" : "10240" - }, - { - "associatedValues" : [ + "returnType" : { + "string" : { - ], - "name" : "medium", - "rawValue" : "102400" + } + }, + "staticContext" : { + "namespaceEnum" : { + "_0" : "DefaultArgumentExports" + } + } }, { - "associatedValues" : [ - + "abiName" : "bjs_DefaultArgumentExports_static_testIntDefault", + "effects" : { + "isAsync" : false, + "isStatic" : true, + "isThrows" : false + }, + "name" : "testIntDefault", + "namespace" : [ + "DefaultArgumentExports" ], - "name" : "large", - "rawValue" : "1048576" - } - ], - "emitStyle" : "const", - "name" : "FileSize", - "rawType" : "Int64", - "staticMethods" : [ - - ], - "staticProperties" : [ - - ], - "swiftCallName" : "FileSize", - "tsFullPath" : "FileSize" - }, - { - "cases" : [ - { - "associatedValues" : [ - + "parameters" : [ + { + "defaultValue" : { + "int" : { + "_0" : 42 + } + }, + "label" : "count", + "name" : "count", + "type" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + } + } ], - "name" : "none", - "rawValue" : "0" + "returnType" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + }, + "staticContext" : { + "namespaceEnum" : { + "_0" : "DefaultArgumentExports" + } + } }, { - "associatedValues" : [ - - ], - "name" : "active", - "rawValue" : "9876543210" - }, - { - "associatedValues" : [ - - ], - "name" : "expired", - "rawValue" : "1234567890" - } - ], - "emitStyle" : "const", - "name" : "SessionId", - "rawType" : "UInt64", - "staticMethods" : [ - - ], - "staticProperties" : [ - - ], - "swiftCallName" : "SessionId", - "tsFullPath" : "SessionId" - }, - { - "cases" : [ - { - "associatedValues" : [ - - ], - "name" : "rough", - "rawValue" : "0.1" - }, - { - "associatedValues" : [ - - ], - "name" : "normal", - "rawValue" : "0.01" - }, - { - "associatedValues" : [ - - ], - "name" : "fine", - "rawValue" : "0.001" - } - ], - "emitStyle" : "const", - "name" : "Precision", - "rawType" : "Float", - "staticMethods" : [ - - ], - "staticProperties" : [ - - ], - "swiftCallName" : "Precision", - "tsFullPath" : "Precision" - }, - { - "cases" : [ - { - "associatedValues" : [ - - ], - "name" : "quarter", - "rawValue" : "0.25" - }, - { - "associatedValues" : [ - - ], - "name" : "half", - "rawValue" : "0.5" - }, - { - "associatedValues" : [ - - ], - "name" : "golden", - "rawValue" : "1.618" - } - ], - "emitStyle" : "const", - "name" : "Ratio", - "rawType" : "Double", - "staticMethods" : [ - - ], - "staticProperties" : [ - - ], - "swiftCallName" : "Ratio", - "tsFullPath" : "Ratio" - }, - { - "cases" : [ - { - "associatedValues" : [ - - ], - "name" : "north" - }, - { - "associatedValues" : [ - - ], - "name" : "south" - }, - { - "associatedValues" : [ - - ], - "name" : "east" - }, - { - "associatedValues" : [ - - ], - "name" : "west" - } - ], - "emitStyle" : "tsEnum", - "name" : "TSDirection", - "staticMethods" : [ - - ], - "staticProperties" : [ - - ], - "swiftCallName" : "TSDirection", - "tsFullPath" : "TSDirection" - }, - { - "cases" : [ - { - "associatedValues" : [ - - ], - "name" : "light", - "rawValue" : "light" - }, - { - "associatedValues" : [ - - ], - "name" : "dark", - "rawValue" : "dark" - }, - { - "associatedValues" : [ - - ], - "name" : "auto", - "rawValue" : "auto" - } - ], - "emitStyle" : "tsEnum", - "name" : "TSTheme", - "rawType" : "String", - "staticMethods" : [ - - ], - "staticProperties" : [ - - ], - "swiftCallName" : "TSTheme", - "tsFullPath" : "TSTheme" - }, - { - "cases" : [ - - ], - "emitStyle" : "const", - "name" : "Utils", - "staticMethods" : [ - - ], - "staticProperties" : [ - - ], - "swiftCallName" : "Utils", - "tsFullPath" : "Utils" - }, - { - "cases" : [ - - ], - "emitStyle" : "const", - "name" : "StringUtils", - "namespace" : [ - "Utils" - ], - "staticMethods" : [ - { - "abiName" : "bjs_Utils_StringUtils_static_uppercase", - "effects" : { - "isAsync" : false, - "isStatic" : true, - "isThrows" : false - }, - "name" : "uppercase", - "namespace" : [ - "Utils", - "StringUtils" + "abiName" : "bjs_DefaultArgumentExports_static_testBoolDefault", + "effects" : { + "isAsync" : false, + "isStatic" : true, + "isThrows" : false + }, + "name" : "testBoolDefault", + "namespace" : [ + "DefaultArgumentExports" ], "parameters" : [ { - "label" : "_", - "name" : "text", + "defaultValue" : { + "bool" : { + "_0" : true + } + }, + "label" : "flag", + "name" : "flag", "type" : { - "string" : { + "bool" : { } } } ], "returnType" : { - "string" : { + "bool" : { } }, "staticContext" : { "namespaceEnum" : { - "_0" : "Utils.StringUtils" + "_0" : "DefaultArgumentExports" } } }, { - "abiName" : "bjs_Utils_StringUtils_static_lowercase", + "abiName" : "bjs_DefaultArgumentExports_static_testOptionalDefault", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "lowercase", + "name" : "testOptionalDefault", "namespace" : [ - "Utils", - "StringUtils" + "DefaultArgumentExports" ], "parameters" : [ { - "label" : "_", - "name" : "text", + "defaultValue" : { + "null" : { + + } + }, + "label" : "name", + "name" : "name", "type" : { - "string" : { + "nullable" : { + "_0" : { + "string" : { + } + }, + "_1" : "null" } } } ], "returnType" : { - "string" : { + "nullable" : { + "_0" : { + "string" : { + } + }, + "_1" : "null" } }, "staticContext" : { "namespaceEnum" : { - "_0" : "Utils.StringUtils" + "_0" : "DefaultArgumentExports" } } - } - ], - "staticProperties" : [ - - ], - "swiftCallName" : "Utils.StringUtils", + }, + { + "abiName" : "bjs_DefaultArgumentExports_static_testMultipleDefaults", + "effects" : { + "isAsync" : false, + "isStatic" : true, + "isThrows" : false + }, + "name" : "testMultipleDefaults", + "namespace" : [ + "DefaultArgumentExports" + ], + "parameters" : [ + { + "defaultValue" : { + "string" : { + "_0" : "Default Title" + } + }, + "label" : "title", + "name" : "title", + "type" : { + "string" : { + + } + } + }, + { + "defaultValue" : { + "int" : { + "_0" : -10 + } + }, + "label" : "count", + "name" : "count", + "type" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + } + }, + { + "defaultValue" : { + "bool" : { + "_0" : false + } + }, + "label" : "enabled", + "name" : "enabled", + "type" : { + "bool" : { + + } + } + } + ], + "returnType" : { + "string" : { + + } + }, + "staticContext" : { + "namespaceEnum" : { + "_0" : "DefaultArgumentExports" + } + } + }, + { + "abiName" : "bjs_DefaultArgumentExports_static_testSimpleEnumDefault", + "effects" : { + "isAsync" : false, + "isStatic" : true, + "isThrows" : false + }, + "name" : "testSimpleEnumDefault", + "namespace" : [ + "DefaultArgumentExports" + ], + "parameters" : [ + { + "defaultValue" : { + "enumCase" : { + "_0" : "Status", + "_1" : "success" + } + }, + "label" : "status", + "name" : "status", + "type" : { + "caseEnum" : { + "_0" : "Status" + } + } + } + ], + "returnType" : { + "caseEnum" : { + "_0" : "Status" + } + }, + "staticContext" : { + "namespaceEnum" : { + "_0" : "DefaultArgumentExports" + } + } + }, + { + "abiName" : "bjs_DefaultArgumentExports_static_testDirectionDefault", + "effects" : { + "isAsync" : false, + "isStatic" : true, + "isThrows" : false + }, + "name" : "testDirectionDefault", + "namespace" : [ + "DefaultArgumentExports" + ], + "parameters" : [ + { + "defaultValue" : { + "enumCase" : { + "_0" : "Direction", + "_1" : "north" + } + }, + "label" : "direction", + "name" : "direction", + "type" : { + "caseEnum" : { + "_0" : "Direction" + } + } + } + ], + "returnType" : { + "caseEnum" : { + "_0" : "Direction" + } + }, + "staticContext" : { + "namespaceEnum" : { + "_0" : "DefaultArgumentExports" + } + } + }, + { + "abiName" : "bjs_DefaultArgumentExports_static_testRawStringEnumDefault", + "effects" : { + "isAsync" : false, + "isStatic" : true, + "isThrows" : false + }, + "name" : "testRawStringEnumDefault", + "namespace" : [ + "DefaultArgumentExports" + ], + "parameters" : [ + { + "defaultValue" : { + "enumCase" : { + "_0" : "Theme", + "_1" : "light" + } + }, + "label" : "theme", + "name" : "theme", + "type" : { + "rawValueEnum" : { + "_0" : "Theme", + "_1" : "String" + } + } + } + ], + "returnType" : { + "rawValueEnum" : { + "_0" : "Theme", + "_1" : "String" + } + }, + "staticContext" : { + "namespaceEnum" : { + "_0" : "DefaultArgumentExports" + } + } + }, + { + "abiName" : "bjs_DefaultArgumentExports_static_testComplexInit", + "effects" : { + "isAsync" : false, + "isStatic" : true, + "isThrows" : false + }, + "name" : "testComplexInit", + "namespace" : [ + "DefaultArgumentExports" + ], + "parameters" : [ + { + "defaultValue" : { + "objectWithArguments" : { + "_0" : "Greeter", + "_1" : [ + { + "string" : { + "_0" : "DefaultGreeter" + } + } + ] + } + }, + "label" : "greeter", + "name" : "greeter", + "type" : { + "swiftHeapObject" : { + "_0" : "Greeter" + } + } + } + ], + "returnType" : { + "string" : { + + } + }, + "staticContext" : { + "namespaceEnum" : { + "_0" : "DefaultArgumentExports" + } + } + }, + { + "abiName" : "bjs_DefaultArgumentExports_static_testEmptyInit", + "effects" : { + "isAsync" : false, + "isStatic" : true, + "isThrows" : false + }, + "name" : "testEmptyInit", + "namespace" : [ + "DefaultArgumentExports" + ], + "parameters" : [ + { + "defaultValue" : { + "object" : { + "_0" : "StaticPropertyHolder" + } + }, + "label" : "_", + "name" : "object", + "type" : { + "swiftHeapObject" : { + "_0" : "StaticPropertyHolder" + } + } + } + ], + "returnType" : { + "swiftHeapObject" : { + "_0" : "StaticPropertyHolder" + } + }, + "staticContext" : { + "namespaceEnum" : { + "_0" : "DefaultArgumentExports" + } + } + }, + { + "abiName" : "bjs_DefaultArgumentExports_static_createConstructorDefaults", + "effects" : { + "isAsync" : false, + "isStatic" : true, + "isThrows" : false + }, + "name" : "createConstructorDefaults", + "namespace" : [ + "DefaultArgumentExports" + ], + "parameters" : [ + { + "defaultValue" : { + "string" : { + "_0" : "Default" + } + }, + "label" : "name", + "name" : "name", + "type" : { + "string" : { + + } + } + }, + { + "defaultValue" : { + "int" : { + "_0" : 42 + } + }, + "label" : "count", + "name" : "count", + "type" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + } + }, + { + "defaultValue" : { + "bool" : { + "_0" : true + } + }, + "label" : "enabled", + "name" : "enabled", + "type" : { + "bool" : { + + } + } + }, + { + "defaultValue" : { + "enumCase" : { + "_0" : "Status", + "_1" : "success" + } + }, + "label" : "status", + "name" : "status", + "type" : { + "caseEnum" : { + "_0" : "Status" + } + } + }, + { + "defaultValue" : { + "null" : { + + } + }, + "label" : "tag", + "name" : "tag", + "type" : { + "nullable" : { + "_0" : { + "string" : { + + } + }, + "_1" : "null" + } + } + } + ], + "returnType" : { + "swiftHeapObject" : { + "_0" : "DefaultArgumentConstructorDefaults" + } + }, + "staticContext" : { + "namespaceEnum" : { + "_0" : "DefaultArgumentExports" + } + } + }, + { + "abiName" : "bjs_DefaultArgumentExports_static_describeConstructorDefaults", + "effects" : { + "isAsync" : false, + "isStatic" : true, + "isThrows" : false + }, + "name" : "describeConstructorDefaults", + "namespace" : [ + "DefaultArgumentExports" + ], + "parameters" : [ + { + "label" : "_", + "name" : "value", + "type" : { + "swiftHeapObject" : { + "_0" : "DefaultArgumentConstructorDefaults" + } + } + } + ], + "returnType" : { + "string" : { + + } + }, + "staticContext" : { + "namespaceEnum" : { + "_0" : "DefaultArgumentExports" + } + } + }, + { + "abiName" : "bjs_DefaultArgumentExports_static_arrayWithDefault", + "effects" : { + "isAsync" : false, + "isStatic" : true, + "isThrows" : false + }, + "name" : "arrayWithDefault", + "namespace" : [ + "DefaultArgumentExports" + ], + "parameters" : [ + { + "defaultValue" : { + "array" : { + "_0" : [ + { + "int" : { + "_0" : 1 + } + }, + { + "int" : { + "_0" : 2 + } + }, + { + "int" : { + "_0" : 3 + } + } + ] + } + }, + "label" : "_", + "name" : "values", + "type" : { + "array" : { + "_0" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + } + } + } + } + ], + "returnType" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + }, + "staticContext" : { + "namespaceEnum" : { + "_0" : "DefaultArgumentExports" + } + } + }, + { + "abiName" : "bjs_DefaultArgumentExports_static_arrayWithOptionalDefault", + "effects" : { + "isAsync" : false, + "isStatic" : true, + "isThrows" : false + }, + "name" : "arrayWithOptionalDefault", + "namespace" : [ + "DefaultArgumentExports" + ], + "parameters" : [ + { + "defaultValue" : { + "null" : { + + } + }, + "label" : "_", + "name" : "values", + "type" : { + "nullable" : { + "_0" : { + "array" : { + "_0" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + } + } + }, + "_1" : "null" + } + } + } + ], + "returnType" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + }, + "staticContext" : { + "namespaceEnum" : { + "_0" : "DefaultArgumentExports" + } + } + }, + { + "abiName" : "bjs_DefaultArgumentExports_static_arrayMixedDefaults", + "effects" : { + "isAsync" : false, + "isStatic" : true, + "isThrows" : false + }, + "name" : "arrayMixedDefaults", + "namespace" : [ + "DefaultArgumentExports" + ], + "parameters" : [ + { + "defaultValue" : { + "string" : { + "_0" : "Sum" + } + }, + "label" : "prefix", + "name" : "prefix", + "type" : { + "string" : { + + } + } + }, + { + "defaultValue" : { + "array" : { + "_0" : [ + { + "int" : { + "_0" : 10 + } + }, + { + "int" : { + "_0" : 20 + } + } + ] + } + }, + "label" : "values", + "name" : "values", + "type" : { + "array" : { + "_0" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + } + } + } + }, + { + "defaultValue" : { + "string" : { + "_0" : "!" + } + }, + "label" : "suffix", + "name" : "suffix", + "type" : { + "string" : { + + } + } + } + ], + "returnType" : { + "string" : { + + } + }, + "staticContext" : { + "namespaceEnum" : { + "_0" : "DefaultArgumentExports" + } + } + } + ], + "staticProperties" : [ + + ], + "swiftCallName" : "DefaultArgumentExports", + "tsFullPath" : "DefaultArgumentExports" + }, + { + "cases" : [ + { + "associatedValues" : [ + + ], + "name" : "north" + }, + { + "associatedValues" : [ + + ], + "name" : "south" + }, + { + "associatedValues" : [ + + ], + "name" : "east" + }, + { + "associatedValues" : [ + + ], + "name" : "west" + } + ], + "emitStyle" : "const", + "explicitAccessControl" : "public", + "name" : "Direction", + "staticMethods" : [ + + ], + "staticProperties" : [ + + ], + "swiftCallName" : "Direction", + "tsFullPath" : "Direction" + }, + { + "cases" : [ + { + "associatedValues" : [ + + ], + "name" : "loading" + }, + { + "associatedValues" : [ + + ], + "name" : "success" + }, + { + "associatedValues" : [ + + ], + "name" : "error" + } + ], + "emitStyle" : "const", + "name" : "Status", + "staticMethods" : [ + + ], + "staticProperties" : [ + + ], + "swiftCallName" : "Status", + "tsFullPath" : "Status" + }, + { + "cases" : [ + { + "associatedValues" : [ + + ], + "name" : "light", + "rawValue" : "light" + }, + { + "associatedValues" : [ + + ], + "name" : "dark", + "rawValue" : "dark" + }, + { + "associatedValues" : [ + + ], + "name" : "auto", + "rawValue" : "auto" + } + ], + "emitStyle" : "const", + "name" : "Theme", + "rawType" : "String", + "staticMethods" : [ + + ], + "staticProperties" : [ + + ], + "swiftCallName" : "Theme", + "tsFullPath" : "Theme" + }, + { + "cases" : [ + { + "associatedValues" : [ + + ], + "name" : "ok", + "rawValue" : "200" + }, + { + "associatedValues" : [ + + ], + "name" : "notFound", + "rawValue" : "404" + }, + { + "associatedValues" : [ + + ], + "name" : "serverError", + "rawValue" : "500" + }, + { + "associatedValues" : [ + + ], + "name" : "unknown", + "rawValue" : "-1" + } + ], + "emitStyle" : "const", + "name" : "HttpStatus", + "rawType" : "Int", + "staticMethods" : [ + + ], + "staticProperties" : [ + + ], + "swiftCallName" : "HttpStatus", + "tsFullPath" : "HttpStatus" + }, + { + "cases" : [ + { + "associatedValues" : [ + + ], + "name" : "tiny", + "rawValue" : "1024" + }, + { + "associatedValues" : [ + + ], + "name" : "small", + "rawValue" : "10240" + }, + { + "associatedValues" : [ + + ], + "name" : "medium", + "rawValue" : "102400" + }, + { + "associatedValues" : [ + + ], + "name" : "large", + "rawValue" : "1048576" + } + ], + "emitStyle" : "const", + "name" : "FileSize", + "rawType" : "Int64", + "staticMethods" : [ + + ], + "staticProperties" : [ + + ], + "swiftCallName" : "FileSize", + "tsFullPath" : "FileSize" + }, + { + "cases" : [ + { + "associatedValues" : [ + + ], + "name" : "none", + "rawValue" : "0" + }, + { + "associatedValues" : [ + + ], + "name" : "active", + "rawValue" : "9876543210" + }, + { + "associatedValues" : [ + + ], + "name" : "expired", + "rawValue" : "1234567890" + } + ], + "emitStyle" : "const", + "name" : "SessionId", + "rawType" : "UInt64", + "staticMethods" : [ + + ], + "staticProperties" : [ + + ], + "swiftCallName" : "SessionId", + "tsFullPath" : "SessionId" + }, + { + "cases" : [ + { + "associatedValues" : [ + + ], + "name" : "rough", + "rawValue" : "0.1" + }, + { + "associatedValues" : [ + + ], + "name" : "normal", + "rawValue" : "0.01" + }, + { + "associatedValues" : [ + + ], + "name" : "fine", + "rawValue" : "0.001" + } + ], + "emitStyle" : "const", + "name" : "Precision", + "rawType" : "Float", + "staticMethods" : [ + + ], + "staticProperties" : [ + + ], + "swiftCallName" : "Precision", + "tsFullPath" : "Precision" + }, + { + "cases" : [ + { + "associatedValues" : [ + + ], + "name" : "quarter", + "rawValue" : "0.25" + }, + { + "associatedValues" : [ + + ], + "name" : "half", + "rawValue" : "0.5" + }, + { + "associatedValues" : [ + + ], + "name" : "golden", + "rawValue" : "1.618" + } + ], + "emitStyle" : "const", + "name" : "Ratio", + "rawType" : "Double", + "staticMethods" : [ + + ], + "staticProperties" : [ + + ], + "swiftCallName" : "Ratio", + "tsFullPath" : "Ratio" + }, + { + "cases" : [ + { + "associatedValues" : [ + + ], + "name" : "north" + }, + { + "associatedValues" : [ + + ], + "name" : "south" + }, + { + "associatedValues" : [ + + ], + "name" : "east" + }, + { + "associatedValues" : [ + + ], + "name" : "west" + } + ], + "emitStyle" : "tsEnum", + "name" : "TSDirection", + "staticMethods" : [ + + ], + "staticProperties" : [ + + ], + "swiftCallName" : "TSDirection", + "tsFullPath" : "TSDirection" + }, + { + "cases" : [ + { + "associatedValues" : [ + + ], + "name" : "light", + "rawValue" : "light" + }, + { + "associatedValues" : [ + + ], + "name" : "dark", + "rawValue" : "dark" + }, + { + "associatedValues" : [ + + ], + "name" : "auto", + "rawValue" : "auto" + } + ], + "emitStyle" : "tsEnum", + "name" : "TSTheme", + "rawType" : "String", + "staticMethods" : [ + + ], + "staticProperties" : [ + + ], + "swiftCallName" : "TSTheme", + "tsFullPath" : "TSTheme" + }, + { + "cases" : [ + + ], + "emitStyle" : "const", + "name" : "Utils", + "staticMethods" : [ + + ], + "staticProperties" : [ + + ], + "swiftCallName" : "Utils", + "tsFullPath" : "Utils" + }, + { + "cases" : [ + + ], + "emitStyle" : "const", + "name" : "StringUtils", + "namespace" : [ + "Utils" + ], + "staticMethods" : [ + { + "abiName" : "bjs_Utils_StringUtils_static_uppercase", + "effects" : { + "isAsync" : false, + "isStatic" : true, + "isThrows" : false + }, + "name" : "uppercase", + "namespace" : [ + "Utils", + "StringUtils" + ], + "parameters" : [ + { + "label" : "_", + "name" : "text", + "type" : { + "string" : { + + } + } + } + ], + "returnType" : { + "string" : { + + } + }, + "staticContext" : { + "namespaceEnum" : { + "_0" : "Utils.StringUtils" + } + } + }, + { + "abiName" : "bjs_Utils_StringUtils_static_lowercase", + "effects" : { + "isAsync" : false, + "isStatic" : true, + "isThrows" : false + }, + "name" : "lowercase", + "namespace" : [ + "Utils", + "StringUtils" + ], + "parameters" : [ + { + "label" : "_", + "name" : "text", + "type" : { + "string" : { + + } + } + } + ], + "returnType" : { + "string" : { + + } + }, + "staticContext" : { + "namespaceEnum" : { + "_0" : "Utils.StringUtils" + } + } + } + ], + "staticProperties" : [ + + ], + "swiftCallName" : "Utils.StringUtils", "tsFullPath" : "Utils.StringUtils" }, { @@ -7795,9 +8452,201 @@ ], "emitStyle" : "const", - "name" : "API", + "name" : "API", + "namespace" : [ + "Networking" + ], + "staticMethods" : [ + + ], + "staticProperties" : [ + + ], + "swiftCallName" : "Networking.API", + "tsFullPath" : "Networking.API" + }, + { + "cases" : [ + { + "associatedValues" : [ + + ], + "name" : "get" + }, + { + "associatedValues" : [ + + ], + "name" : "post" + }, + { + "associatedValues" : [ + + ], + "name" : "put" + }, + { + "associatedValues" : [ + + ], + "name" : "delete" + } + ], + "emitStyle" : "const", + "name" : "Method", + "namespace" : [ + "Networking", + "API" + ], + "staticMethods" : [ + + ], + "staticProperties" : [ + + ], + "swiftCallName" : "Networking.API.Method", + "tsFullPath" : "Networking.API.Method" + }, + { + "cases" : [ + + ], + "emitStyle" : "const", + "name" : "Configuration", + "staticMethods" : [ + + ], + "staticProperties" : [ + + ], + "swiftCallName" : "Configuration", + "tsFullPath" : "Configuration" + }, + { + "cases" : [ + { + "associatedValues" : [ + + ], + "name" : "debug", + "rawValue" : "debug" + }, + { + "associatedValues" : [ + + ], + "name" : "info", + "rawValue" : "info" + }, + { + "associatedValues" : [ + + ], + "name" : "warning", + "rawValue" : "warning" + }, + { + "associatedValues" : [ + + ], + "name" : "error", + "rawValue" : "error" + } + ], + "emitStyle" : "const", + "name" : "LogLevel", + "namespace" : [ + "Configuration" + ], + "rawType" : "String", + "staticMethods" : [ + + ], + "staticProperties" : [ + + ], + "swiftCallName" : "Configuration.LogLevel", + "tsFullPath" : "Configuration.LogLevel" + }, + { + "cases" : [ + { + "associatedValues" : [ + + ], + "name" : "http", + "rawValue" : "80" + }, + { + "associatedValues" : [ + + ], + "name" : "https", + "rawValue" : "443" + }, + { + "associatedValues" : [ + + ], + "name" : "development", + "rawValue" : "3000" + } + ], + "emitStyle" : "const", + "name" : "Port", + "namespace" : [ + "Configuration" + ], + "rawType" : "Int", + "staticMethods" : [ + + ], + "staticProperties" : [ + + ], + "swiftCallName" : "Configuration.Port", + "tsFullPath" : "Configuration.Port" + }, + { + "cases" : [ + + ], + "emitStyle" : "const", + "name" : "Internal", + "namespace" : [ + "Networking", + "APIV2" + ], + "staticMethods" : [ + + ], + "staticProperties" : [ + + ], + "swiftCallName" : "Internal", + "tsFullPath" : "Networking.APIV2.Internal" + }, + { + "cases" : [ + { + "associatedValues" : [ + + ], + "name" : "get" + }, + { + "associatedValues" : [ + + ], + "name" : "post" + } + ], + "emitStyle" : "const", + "name" : "SupportedMethod", "namespace" : [ - "Networking" + "Networking", + "APIV2", + "Internal" ], "staticMethods" : [ @@ -7805,191 +8654,452 @@ "staticProperties" : [ ], - "swiftCallName" : "Networking.API", - "tsFullPath" : "Networking.API" + "swiftCallName" : "Internal.SupportedMethod", + "tsFullPath" : "Networking.APIV2.Internal.SupportedMethod" }, { "cases" : [ { "associatedValues" : [ + { + "type" : { + "string" : { + } + } + } ], - "name" : "get" + "name" : "success" + }, + { + "associatedValues" : [ + { + "type" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + } + } + ], + "name" : "failure" }, { "associatedValues" : [ + { + "type" : { + "bool" : { + } + } + } ], - "name" : "post" + "name" : "flag" }, { "associatedValues" : [ + { + "type" : { + "float" : { + } + } + } ], - "name" : "put" + "name" : "rate" }, { "associatedValues" : [ + { + "type" : { + "double" : { + } + } + } ], - "name" : "delete" + "name" : "precise" + }, + { + "associatedValues" : [ + + ], + "name" : "info" } ], "emitStyle" : "const", - "name" : "Method", - "namespace" : [ - "Networking", - "API" - ], + "name" : "APIResult", "staticMethods" : [ ], "staticProperties" : [ ], - "swiftCallName" : "Networking.API.Method", - "tsFullPath" : "Networking.API.Method" + "swiftCallName" : "APIResult", + "tsFullPath" : "APIResult" }, { "cases" : [ + { + "associatedValues" : [ + { + "type" : { + "string" : { - ], - "emitStyle" : "const", - "name" : "Configuration", - "staticMethods" : [ + } + } + } + ], + "name" : "success" + }, + { + "associatedValues" : [ + { + "type" : { + "string" : { - ], - "staticProperties" : [ + } + } + }, + { + "type" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + } + } + ], + "name" : "error" + }, + { + "associatedValues" : [ + { + "type" : { + "double" : { - ], - "swiftCallName" : "Configuration", - "tsFullPath" : "Configuration" - }, - { - "cases" : [ + } + } + }, + { + "type" : { + "double" : { + + } + } + }, + { + "type" : { + "string" : { + + } + } + } + ], + "name" : "location" + }, { "associatedValues" : [ + { + "type" : { + "bool" : { + + } + } + }, + { + "type" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + } + }, + { + "type" : { + "string" : { + } + } + } ], - "name" : "debug", - "rawValue" : "debug" + "name" : "status" }, { "associatedValues" : [ + { + "type" : { + "double" : { + + } + } + }, + { + "type" : { + "double" : { + + } + } + }, + { + "type" : { + "double" : { + } + } + } ], - "name" : "info", - "rawValue" : "info" + "name" : "coordinates" }, { "associatedValues" : [ + { + "type" : { + "bool" : { + + } + } + }, + { + "type" : { + "bool" : { + + } + } + }, + { + "type" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + } + }, + { + "type" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + } + }, + { + "type" : { + "double" : { + + } + } + }, + { + "type" : { + "double" : { + + } + } + }, + { + "type" : { + "string" : { + + } + } + }, + { + "type" : { + "string" : { + + } + } + }, + { + "type" : { + "string" : { + } + } + } ], - "name" : "warning", - "rawValue" : "warning" + "name" : "comprehensive" }, { "associatedValues" : [ ], - "name" : "error", - "rawValue" : "error" + "name" : "info" } ], "emitStyle" : "const", - "name" : "LogLevel", - "namespace" : [ - "Configuration" + "name" : "ComplexResult", + "staticMethods" : [ + ], - "rawType" : "String", + "staticProperties" : [ + + ], + "swiftCallName" : "ComplexResult", + "tsFullPath" : "ComplexResult" + }, + { + "cases" : [ + + ], + "emitStyle" : "const", + "name" : "Utilities", "staticMethods" : [ ], "staticProperties" : [ ], - "swiftCallName" : "Configuration.LogLevel", - "tsFullPath" : "Configuration.LogLevel" + "swiftCallName" : "Utilities", + "tsFullPath" : "Utilities" }, { "cases" : [ { "associatedValues" : [ + { + "type" : { + "string" : { + } + } + } ], - "name" : "http", - "rawValue" : "80" + "name" : "success" }, { "associatedValues" : [ + { + "type" : { + "string" : { + } + } + }, + { + "type" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + } + } ], - "name" : "https", - "rawValue" : "443" + "name" : "failure" }, { "associatedValues" : [ + { + "type" : { + "bool" : { + + } + } + }, + { + "type" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + } + }, + { + "type" : { + "string" : { + } + } + } ], - "name" : "development", - "rawValue" : "3000" + "name" : "status" } ], "emitStyle" : "const", - "name" : "Port", + "name" : "Result", "namespace" : [ - "Configuration" + "Utilities" ], - "rawType" : "Int", "staticMethods" : [ ], "staticProperties" : [ ], - "swiftCallName" : "Configuration.Port", - "tsFullPath" : "Configuration.Port" + "swiftCallName" : "Utilities.Result", + "tsFullPath" : "Utilities.Result" }, { "cases" : [ ], "emitStyle" : "const", - "name" : "Internal", - "namespace" : [ - "Networking", - "APIV2" - ], + "name" : "API", "staticMethods" : [ ], "staticProperties" : [ ], - "swiftCallName" : "Internal", - "tsFullPath" : "Networking.APIV2.Internal" + "swiftCallName" : "API", + "tsFullPath" : "API" }, { "cases" : [ { "associatedValues" : [ + { + "type" : { + "string" : { + } + } + } ], - "name" : "get" + "name" : "success" }, { "associatedValues" : [ + { + "type" : { + "string" : { + } + } + }, + { + "type" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + } + } ], - "name" : "post" + "name" : "failure" } ], "emitStyle" : "const", - "name" : "SupportedMethod", + "name" : "NetworkingResult", "namespace" : [ - "Networking", - "APIV2", - "Internal" + "API" ], "staticMethods" : [ @@ -7997,8 +9107,8 @@ "staticProperties" : [ ], - "swiftCallName" : "Internal.SupportedMethod", - "tsFullPath" : "Networking.APIV2.Internal.SupportedMethod" + "swiftCallName" : "API.NetworkingResult", + "tsFullPath" : "API.NetworkingResult" }, { "cases" : [ @@ -8006,82 +9116,98 @@ "associatedValues" : [ { "type" : { - "string" : { - + "swiftStruct" : { + "_0" : "Address" } } } ], - "name" : "success" + "name" : "structPayload" }, { "associatedValues" : [ { "type" : { - "integer" : { - "_0" : { - "isSigned" : true, - "width" : "word" - } + "swiftHeapObject" : { + "_0" : "Greeter" } } } ], - "name" : "failure" + "name" : "classPayload" }, { "associatedValues" : [ { "type" : { - "bool" : { + "jsObject" : { } } } ], - "name" : "flag" + "name" : "jsObjectPayload" }, { "associatedValues" : [ { "type" : { - "float" : { - + "associatedValueEnum" : { + "_0" : "APIResult" } } } ], - "name" : "rate" + "name" : "nestedEnum" }, { "associatedValues" : [ { "type" : { - "double" : { - + "array" : { + "_0" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + } } } } ], - "name" : "precise" + "name" : "arrayPayload" + }, + { + "associatedValues" : [ + { + "type" : { + "jsObject" : { + "_0" : "Foo" + } + } + } + ], + "name" : "jsClassPayload" }, { "associatedValues" : [ ], - "name" : "info" + "name" : "empty" } ], "emitStyle" : "const", - "name" : "APIResult", + "name" : "AllTypesResult", "staticMethods" : [ ], "staticProperties" : [ ], - "swiftCallName" : "APIResult", - "tsFullPath" : "APIResult" + "swiftCallName" : "AllTypesResult", + "tsFullPath" : "AllTypesResult" }, { "cases" : [ @@ -8089,134 +9215,110 @@ "associatedValues" : [ { "type" : { - "string" : { - - } - } - } - ], - "name" : "success" - }, - { - "associatedValues" : [ - { - "type" : { - "string" : { - - } - } - }, - { - "type" : { - "integer" : { - "_0" : { - "isSigned" : true, - "width" : "word" - } - } - } - } - ], - "name" : "error" - }, - { - "associatedValues" : [ - { - "type" : { - "double" : { - - } - } - }, - { - "type" : { - "double" : { - - } - } - }, - { - "type" : { - "string" : { - + "rawValueEnum" : { + "_0" : "Precision", + "_1" : "Float" } } } ], - "name" : "location" + "name" : "precision" }, { "associatedValues" : [ { "type" : { - "bool" : { - + "caseEnum" : { + "_0" : "Direction" } } - }, + } + ], + "name" : "direction" + }, + { + "associatedValues" : [ { "type" : { - "integer" : { + "nullable" : { "_0" : { - "isSigned" : true, - "width" : "word" - } + "rawValueEnum" : { + "_0" : "Precision", + "_1" : "Float" + } + }, + "_1" : "null" } } - }, + } + ], + "name" : "optPrecision" + }, + { + "associatedValues" : [ { "type" : { - "string" : { - + "nullable" : { + "_0" : { + "caseEnum" : { + "_0" : "Direction" + } + }, + "_1" : "null" } } } ], - "name" : "status" + "name" : "optDirection" }, { "associatedValues" : [ - { - "type" : { - "double" : { - } - } - }, - { - "type" : { - "double" : { + ], + "name" : "empty" + } + ], + "emitStyle" : "const", + "name" : "TypedPayloadResult", + "staticMethods" : [ - } - } - }, - { - "type" : { - "double" : { + ], + "staticProperties" : [ + + ], + "swiftCallName" : "TypedPayloadResult", + "tsFullPath" : "TypedPayloadResult" + }, + { + "cases" : [ + { + "associatedValues" : [ - } - } - } ], - "name" : "coordinates" + "name" : "scientific" }, { "associatedValues" : [ - { - "type" : { - "bool" : { - - } - } - }, - { - "type" : { - "bool" : { - } - } - }, + ], + "name" : "basic" + } + ], + "emitStyle" : "const", + "name" : "StaticCalculator", + "staticMethods" : [ + { + "abiName" : "bjs_StaticCalculator_static_roundtrip", + "effects" : { + "isAsync" : false, + "isStatic" : true, + "isThrows" : false + }, + "name" : "roundtrip", + "parameters" : [ { + "label" : "_", + "name" : "value", "type" : { "integer" : { "_0" : { @@ -8225,8 +9327,34 @@ } } } - }, + } + ], + "returnType" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + }, + "staticContext" : { + "enumName" : { + "_0" : "StaticCalculator" + } + } + }, + { + "abiName" : "bjs_StaticCalculator_static_doubleValue", + "effects" : { + "isAsync" : false, + "isStatic" : true, + "isThrows" : false + }, + "name" : "doubleValue", + "parameters" : [ { + "label" : "_", + "name" : "value", "type" : { "integer" : { "_0" : { @@ -8235,102 +9363,137 @@ } } } - }, - { - "type" : { - "double" : { - - } - } - }, - { - "type" : { - "double" : { - - } - } - }, - { - "type" : { - "string" : { - - } - } - }, - { - "type" : { - "string" : { - - } - } - }, - { - "type" : { - "string" : { - - } - } } ], - "name" : "comprehensive" - }, + "returnType" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + }, + "staticContext" : { + "enumName" : { + "_0" : "StaticCalculator" + } + } + } + ], + "staticProperties" : [ { - "associatedValues" : [ + "isReadonly" : true, + "isStatic" : true, + "name" : "version", + "staticContext" : { + "enumName" : { + "_0" : "StaticCalculator" + } + }, + "type" : { + "string" : { - ], - "name" : "info" + } + } } + ], + "swiftCallName" : "StaticCalculator", + "tsFullPath" : "StaticCalculator" + }, + { + "cases" : [ + ], "emitStyle" : "const", - "name" : "ComplexResult", + "name" : "StaticUtils", "staticMethods" : [ ], "staticProperties" : [ ], - "swiftCallName" : "ComplexResult", - "tsFullPath" : "ComplexResult" + "swiftCallName" : "StaticUtils", + "tsFullPath" : "StaticUtils" }, { "cases" : [ ], "emitStyle" : "const", - "name" : "Utilities", + "name" : "Nested", + "namespace" : [ + "StaticUtils" + ], "staticMethods" : [ + { + "abiName" : "bjs_StaticUtils_Nested_static_roundtrip", + "effects" : { + "isAsync" : false, + "isStatic" : true, + "isThrows" : false + }, + "name" : "roundtrip", + "namespace" : [ + "StaticUtils", + "Nested" + ], + "parameters" : [ + { + "label" : "_", + "name" : "value", + "type" : { + "string" : { + + } + } + } + ], + "returnType" : { + "string" : { + } + }, + "staticContext" : { + "namespaceEnum" : { + "_0" : "StaticUtils.Nested" + } + } + } ], "staticProperties" : [ ], - "swiftCallName" : "Utilities", - "tsFullPath" : "Utilities" + "swiftCallName" : "StaticUtils.Nested", + "tsFullPath" : "StaticUtils.Nested" }, { "cases" : [ - { - "associatedValues" : [ - { - "type" : { - "string" : { - } - } - } - ], - "name" : "success" - }, + ], + "emitStyle" : "const", + "name" : "GraphOperations", + "namespace" : [ + "Services", + "Graph" + ], + "staticMethods" : [ { - "associatedValues" : [ - { - "type" : { - "string" : { - - } - } - }, + "abiName" : "bjs_Services_Graph_GraphOperations_static_createGraph", + "effects" : { + "isAsync" : false, + "isStatic" : true, + "isThrows" : false + }, + "name" : "createGraph", + "namespace" : [ + "Services", + "Graph", + "GraphOperations" + ], + "parameters" : [ { + "label" : "rootId", + "name" : "rootId", "type" : { "integer" : { "_0" : { @@ -8341,18 +9504,37 @@ } } ], - "name" : "failure" + "returnType" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + }, + "staticContext" : { + "namespaceEnum" : { + "_0" : "GraphOperations" + } + } }, { - "associatedValues" : [ - { - "type" : { - "bool" : { - - } - } - }, + "abiName" : "bjs_Services_Graph_GraphOperations_static_nodeCount", + "effects" : { + "isAsync" : false, + "isStatic" : true, + "isThrows" : false + }, + "name" : "nodeCount", + "namespace" : [ + "Services", + "Graph", + "GraphOperations" + ], + "parameters" : [ { + "label" : "graphId", + "name" : "graphId", "type" : { "integer" : { "_0" : { @@ -8361,307 +9543,396 @@ } } } - }, - { - "type" : { - "string" : { - - } - } } ], - "name" : "status" + "returnType" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + }, + "staticContext" : { + "namespaceEnum" : { + "_0" : "GraphOperations" + } + } } - ], - "emitStyle" : "const", - "name" : "Result", - "namespace" : [ - "Utilities" - ], - "staticMethods" : [ - ], "staticProperties" : [ ], - "swiftCallName" : "Utilities.Result", - "tsFullPath" : "Utilities.Result" + "swiftCallName" : "GraphOperations", + "tsFullPath" : "Services.Graph.GraphOperations" }, { "cases" : [ + { + "associatedValues" : [ + ], + "name" : "option1" + }, + { + "associatedValues" : [ + + ], + "name" : "option2" + } ], "emitStyle" : "const", - "name" : "API", + "name" : "StaticPropertyEnum", "staticMethods" : [ ], "staticProperties" : [ + { + "isReadonly" : false, + "isStatic" : true, + "name" : "enumProperty", + "staticContext" : { + "enumName" : { + "_0" : "StaticPropertyEnum" + } + }, + "type" : { + "string" : { + + } + } + }, + { + "isReadonly" : true, + "isStatic" : true, + "name" : "enumConstant", + "staticContext" : { + "enumName" : { + "_0" : "StaticPropertyEnum" + } + }, + "type" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + } + }, + { + "isReadonly" : false, + "isStatic" : true, + "name" : "enumBool", + "staticContext" : { + "enumName" : { + "_0" : "StaticPropertyEnum" + } + }, + "type" : { + "bool" : { + + } + } + }, + { + "isReadonly" : false, + "isStatic" : true, + "name" : "enumVariable", + "staticContext" : { + "enumName" : { + "_0" : "StaticPropertyEnum" + } + }, + "type" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + } + }, + { + "isReadonly" : true, + "isStatic" : true, + "name" : "computedReadonly", + "staticContext" : { + "enumName" : { + "_0" : "StaticPropertyEnum" + } + }, + "type" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + } + }, + { + "isReadonly" : false, + "isStatic" : true, + "name" : "computedReadWrite", + "staticContext" : { + "enumName" : { + "_0" : "StaticPropertyEnum" + } + }, + "type" : { + "string" : { + } + } + } ], - "swiftCallName" : "API", - "tsFullPath" : "API" + "swiftCallName" : "StaticPropertyEnum", + "tsFullPath" : "StaticPropertyEnum" }, { "cases" : [ + + ], + "emitStyle" : "const", + "name" : "StaticPropertyNamespace", + "staticMethods" : [ + + ], + "staticProperties" : [ { - "associatedValues" : [ - { - "type" : { - "string" : { + "isReadonly" : false, + "isStatic" : true, + "name" : "namespaceProperty", + "namespace" : [ + "StaticPropertyNamespace" + ], + "staticContext" : { + "namespaceEnum" : { + "_0" : "StaticPropertyNamespace" + } + }, + "type" : { + "string" : { - } - } } - ], - "name" : "success" + } }, { - "associatedValues" : [ - { - "type" : { - "string" : { + "isReadonly" : true, + "isStatic" : true, + "name" : "namespaceConstant", + "namespace" : [ + "StaticPropertyNamespace" + ], + "staticContext" : { + "namespaceEnum" : { + "_0" : "StaticPropertyNamespace" + } + }, + "type" : { + "string" : { - } - } - }, - { - "type" : { - "integer" : { - "_0" : { - "isSigned" : true, - "width" : "word" - } - } - } } - ], - "name" : "failure" + } } + ], + "swiftCallName" : "StaticPropertyNamespace", + "tsFullPath" : "StaticPropertyNamespace" + }, + { + "cases" : [ + ], "emitStyle" : "const", - "name" : "NetworkingResult", + "name" : "NestedProperties", "namespace" : [ - "API" + "StaticPropertyNamespace" ], "staticMethods" : [ ], "staticProperties" : [ - - ], - "swiftCallName" : "API.NetworkingResult", - "tsFullPath" : "API.NetworkingResult" - }, - { - "cases" : [ { - "associatedValues" : [ - { - "type" : { - "swiftStruct" : { - "_0" : "Address" - } - } - } + "isReadonly" : false, + "isStatic" : true, + "name" : "nestedProperty", + "namespace" : [ + "StaticPropertyNamespace", + "NestedProperties" ], - "name" : "structPayload" - }, - { - "associatedValues" : [ - { - "type" : { - "swiftHeapObject" : { - "_0" : "Greeter" - } - } + "staticContext" : { + "namespaceEnum" : { + "_0" : "StaticPropertyNamespace.NestedProperties" } - ], - "name" : "classPayload" - }, - { - "associatedValues" : [ - { - "type" : { - "jsObject" : { - - } + }, + "type" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" } } - ], - "name" : "jsObjectPayload" + } }, { - "associatedValues" : [ - { - "type" : { - "associatedValueEnum" : { - "_0" : "APIResult" - } - } - } + "isReadonly" : true, + "isStatic" : true, + "name" : "nestedConstant", + "namespace" : [ + "StaticPropertyNamespace", + "NestedProperties" ], - "name" : "nestedEnum" - }, - { - "associatedValues" : [ - { - "type" : { - "array" : { - "_0" : { - "integer" : { - "_0" : { - "isSigned" : true, - "width" : "word" - } - } - } - } - } + "staticContext" : { + "namespaceEnum" : { + "_0" : "StaticPropertyNamespace.NestedProperties" } - ], - "name" : "arrayPayload" - }, - { - "associatedValues" : [ - { - "type" : { - "jsObject" : { - "_0" : "Foo" - } - } + }, + "type" : { + "string" : { + } - ], - "name" : "jsClassPayload" + } }, { - "associatedValues" : [ - + "isReadonly" : false, + "isStatic" : true, + "name" : "nestedDouble", + "namespace" : [ + "StaticPropertyNamespace", + "NestedProperties" ], - "name" : "empty" - } - ], - "emitStyle" : "const", - "name" : "AllTypesResult", - "staticMethods" : [ - - ], - "staticProperties" : [ + "staticContext" : { + "namespaceEnum" : { + "_0" : "StaticPropertyNamespace.NestedProperties" + } + }, + "type" : { + "double" : { + } + } + } ], - "swiftCallName" : "AllTypesResult", - "tsFullPath" : "AllTypesResult" + "swiftCallName" : "StaticPropertyNamespace.NestedProperties", + "tsFullPath" : "StaticPropertyNamespace.NestedProperties" }, { "cases" : [ + + ], + "emitStyle" : "const", + "name" : "NestedStructGroupA", + "staticMethods" : [ { - "associatedValues" : [ - { - "type" : { - "rawValueEnum" : { - "_0" : "Precision", - "_1" : "Float" - } - } - } + "abiName" : "bjs_NestedStructGroupA_static_roundtripMetadata", + "effects" : { + "isAsync" : false, + "isStatic" : true, + "isThrows" : false + }, + "name" : "roundtripMetadata", + "namespace" : [ + "NestedStructGroupA" ], - "name" : "precision" - }, - { - "associatedValues" : [ + "parameters" : [ { + "label" : "_", + "name" : "m", "type" : { - "caseEnum" : { - "_0" : "Direction" + "swiftStruct" : { + "_0" : "NestedStructGroupA.Metadata" } } } ], - "name" : "direction" - }, - { - "associatedValues" : [ - { - "type" : { - "nullable" : { - "_0" : { - "rawValueEnum" : { - "_0" : "Precision", - "_1" : "Float" - } - }, - "_1" : "null" - } - } + "returnType" : { + "swiftStruct" : { + "_0" : "NestedStructGroupA.Metadata" } - ], - "name" : "optPrecision" - }, + }, + "staticContext" : { + "namespaceEnum" : { + "_0" : "NestedStructGroupA" + } + } + } + ], + "staticProperties" : [ + + ], + "swiftCallName" : "NestedStructGroupA", + "tsFullPath" : "NestedStructGroupA" + }, + { + "cases" : [ + + ], + "emitStyle" : "const", + "name" : "NestedStructGroupB", + "staticMethods" : [ { - "associatedValues" : [ + "abiName" : "bjs_NestedStructGroupB_static_roundtripMetadata", + "effects" : { + "isAsync" : false, + "isStatic" : true, + "isThrows" : false + }, + "name" : "roundtripMetadata", + "namespace" : [ + "NestedStructGroupB" + ], + "parameters" : [ { + "label" : "_", + "name" : "m", "type" : { - "nullable" : { - "_0" : { - "caseEnum" : { - "_0" : "Direction" - } - }, - "_1" : "null" + "swiftStruct" : { + "_0" : "NestedStructGroupB.Metadata" } } } ], - "name" : "optDirection" - }, - { - "associatedValues" : [ - - ], - "name" : "empty" + "returnType" : { + "swiftStruct" : { + "_0" : "NestedStructGroupB.Metadata" + } + }, + "staticContext" : { + "namespaceEnum" : { + "_0" : "NestedStructGroupB" + } + } } - ], - "emitStyle" : "const", - "name" : "TypedPayloadResult", - "staticMethods" : [ - ], "staticProperties" : [ ], - "swiftCallName" : "TypedPayloadResult", - "tsFullPath" : "TypedPayloadResult" + "swiftCallName" : "NestedStructGroupB", + "tsFullPath" : "NestedStructGroupB" }, { "cases" : [ - { - "associatedValues" : [ - - ], - "name" : "scientific" - }, - { - "associatedValues" : [ - ], - "name" : "basic" - } ], "emitStyle" : "const", - "name" : "StaticCalculator", + "name" : "IntegerTypesSupportExports", "staticMethods" : [ { - "abiName" : "bjs_StaticCalculator_static_roundtrip", + "abiName" : "bjs_IntegerTypesSupportExports_static_roundTripInt", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "roundtrip", + "name" : "roundTripInt", + "namespace" : [ + "IntegerTypesSupportExports" + ], "parameters" : [ { "label" : "_", - "name" : "value", + "name" : "v", "type" : { "integer" : { "_0" : { @@ -8681,27 +9952,30 @@ } }, "staticContext" : { - "enumName" : { - "_0" : "StaticCalculator" + "namespaceEnum" : { + "_0" : "IntegerTypesSupportExports" } } }, { - "abiName" : "bjs_StaticCalculator_static_doubleValue", + "abiName" : "bjs_IntegerTypesSupportExports_static_roundTripUInt", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "doubleValue", + "name" : "roundTripUInt", + "namespace" : [ + "IntegerTypesSupportExports" + ], "parameters" : [ { "label" : "_", - "name" : "value", + "name" : "v", "type" : { "integer" : { "_0" : { - "isSigned" : true, + "isSigned" : false, "width" : "word" } } @@ -8711,137 +9985,154 @@ "returnType" : { "integer" : { "_0" : { - "isSigned" : true, + "isSigned" : false, "width" : "word" } } }, "staticContext" : { - "enumName" : { - "_0" : "StaticCalculator" + "namespaceEnum" : { + "_0" : "IntegerTypesSupportExports" } } - } - ], - "staticProperties" : [ + }, { - "isReadonly" : true, - "isStatic" : true, - "name" : "version", - "staticContext" : { - "enumName" : { - "_0" : "StaticCalculator" + "abiName" : "bjs_IntegerTypesSupportExports_static_roundTripInt8", + "effects" : { + "isAsync" : false, + "isStatic" : true, + "isThrows" : false + }, + "name" : "roundTripInt8", + "namespace" : [ + "IntegerTypesSupportExports" + ], + "parameters" : [ + { + "label" : "_", + "name" : "v", + "type" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "w8" + } + } + } + } + ], + "returnType" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "w8" + } } }, - "type" : { - "string" : { - + "staticContext" : { + "namespaceEnum" : { + "_0" : "IntegerTypesSupportExports" } } - } - ], - "swiftCallName" : "StaticCalculator", - "tsFullPath" : "StaticCalculator" - }, - { - "cases" : [ - - ], - "emitStyle" : "const", - "name" : "StaticUtils", - "staticMethods" : [ - - ], - "staticProperties" : [ - - ], - "swiftCallName" : "StaticUtils", - "tsFullPath" : "StaticUtils" - }, - { - "cases" : [ - - ], - "emitStyle" : "const", - "name" : "Nested", - "namespace" : [ - "StaticUtils" - ], - "staticMethods" : [ + }, { - "abiName" : "bjs_StaticUtils_Nested_static_roundtrip", + "abiName" : "bjs_IntegerTypesSupportExports_static_roundTripUInt8", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "roundtrip", + "name" : "roundTripUInt8", "namespace" : [ - "StaticUtils", - "Nested" + "IntegerTypesSupportExports" ], "parameters" : [ { "label" : "_", - "name" : "value", + "name" : "v", "type" : { - "string" : { - + "integer" : { + "_0" : { + "isSigned" : false, + "width" : "w8" + } } } } ], "returnType" : { - "string" : { - + "integer" : { + "_0" : { + "isSigned" : false, + "width" : "w8" + } } }, "staticContext" : { "namespaceEnum" : { - "_0" : "StaticUtils.Nested" + "_0" : "IntegerTypesSupportExports" } } - } - ], - "staticProperties" : [ - - ], - "swiftCallName" : "StaticUtils.Nested", - "tsFullPath" : "StaticUtils.Nested" - }, - { - "cases" : [ - - ], - "emitStyle" : "const", - "name" : "GraphOperations", - "namespace" : [ - "Services", - "Graph" - ], - "staticMethods" : [ + }, + { + "abiName" : "bjs_IntegerTypesSupportExports_static_roundTripInt16", + "effects" : { + "isAsync" : false, + "isStatic" : true, + "isThrows" : false + }, + "name" : "roundTripInt16", + "namespace" : [ + "IntegerTypesSupportExports" + ], + "parameters" : [ + { + "label" : "_", + "name" : "v", + "type" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "w16" + } + } + } + } + ], + "returnType" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "w16" + } + } + }, + "staticContext" : { + "namespaceEnum" : { + "_0" : "IntegerTypesSupportExports" + } + } + }, { - "abiName" : "bjs_Services_Graph_GraphOperations_static_createGraph", + "abiName" : "bjs_IntegerTypesSupportExports_static_roundTripUInt16", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "createGraph", + "name" : "roundTripUInt16", "namespace" : [ - "Services", - "Graph", - "GraphOperations" + "IntegerTypesSupportExports" ], "parameters" : [ { - "label" : "rootId", - "name" : "rootId", + "label" : "_", + "name" : "v", "type" : { "integer" : { "_0" : { - "isSigned" : true, - "width" : "word" + "isSigned" : false, + "width" : "w16" } } } @@ -8850,39 +10141,37 @@ "returnType" : { "integer" : { "_0" : { - "isSigned" : true, - "width" : "word" + "isSigned" : false, + "width" : "w16" } } }, "staticContext" : { "namespaceEnum" : { - "_0" : "GraphOperations" + "_0" : "IntegerTypesSupportExports" } } }, { - "abiName" : "bjs_Services_Graph_GraphOperations_static_nodeCount", + "abiName" : "bjs_IntegerTypesSupportExports_static_roundTripInt32", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "nodeCount", + "name" : "roundTripInt32", "namespace" : [ - "Services", - "Graph", - "GraphOperations" + "IntegerTypesSupportExports" ], "parameters" : [ { - "label" : "graphId", - "name" : "graphId", + "label" : "_", + "name" : "v", "type" : { "integer" : { "_0" : { "isSigned" : true, - "width" : "word" + "width" : "w32" } } } @@ -8892,358 +10181,276 @@ "integer" : { "_0" : { "isSigned" : true, - "width" : "word" + "width" : "w32" } } }, "staticContext" : { "namespaceEnum" : { - "_0" : "GraphOperations" + "_0" : "IntegerTypesSupportExports" } } - } - ], - "staticProperties" : [ - - ], - "swiftCallName" : "GraphOperations", - "tsFullPath" : "Services.Graph.GraphOperations" - }, - { - "cases" : [ - { - "associatedValues" : [ - - ], - "name" : "option1" }, { - "associatedValues" : [ - - ], - "name" : "option2" - } - ], - "emitStyle" : "const", - "name" : "StaticPropertyEnum", - "staticMethods" : [ - - ], - "staticProperties" : [ - { - "isReadonly" : false, - "isStatic" : true, - "name" : "enumProperty", - "staticContext" : { - "enumName" : { - "_0" : "StaticPropertyEnum" - } + "abiName" : "bjs_IntegerTypesSupportExports_static_roundTripUInt32", + "effects" : { + "isAsync" : false, + "isStatic" : true, + "isThrows" : false }, - "type" : { - "string" : { - - } - } - }, - { - "isReadonly" : true, - "isStatic" : true, - "name" : "enumConstant", - "staticContext" : { - "enumName" : { - "_0" : "StaticPropertyEnum" + "name" : "roundTripUInt32", + "namespace" : [ + "IntegerTypesSupportExports" + ], + "parameters" : [ + { + "label" : "_", + "name" : "v", + "type" : { + "integer" : { + "_0" : { + "isSigned" : false, + "width" : "w32" + } + } + } } - }, - "type" : { + ], + "returnType" : { "integer" : { "_0" : { - "isSigned" : true, - "width" : "word" + "isSigned" : false, + "width" : "w32" } } - } - }, - { - "isReadonly" : false, - "isStatic" : true, - "name" : "enumBool", - "staticContext" : { - "enumName" : { - "_0" : "StaticPropertyEnum" - } }, - "type" : { - "bool" : { - + "staticContext" : { + "namespaceEnum" : { + "_0" : "IntegerTypesSupportExports" } } }, { - "isReadonly" : false, - "isStatic" : true, - "name" : "enumVariable", - "staticContext" : { - "enumName" : { - "_0" : "StaticPropertyEnum" - } + "abiName" : "bjs_IntegerTypesSupportExports_static_roundTripInt64", + "effects" : { + "isAsync" : false, + "isStatic" : true, + "isThrows" : false }, - "type" : { - "integer" : { - "_0" : { - "isSigned" : true, - "width" : "word" + "name" : "roundTripInt64", + "namespace" : [ + "IntegerTypesSupportExports" + ], + "parameters" : [ + { + "label" : "_", + "name" : "v", + "type" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "w64" + } + } } } - } - }, - { - "isReadonly" : true, - "isStatic" : true, - "name" : "computedReadonly", - "staticContext" : { - "enumName" : { - "_0" : "StaticPropertyEnum" - } - }, - "type" : { + ], + "returnType" : { "integer" : { "_0" : { "isSigned" : true, - "width" : "word" + "width" : "w64" } } - } - }, - { - "isReadonly" : false, - "isStatic" : true, - "name" : "computedReadWrite", - "staticContext" : { - "enumName" : { - "_0" : "StaticPropertyEnum" - } }, - "type" : { - "string" : { - - } - } - } - ], - "swiftCallName" : "StaticPropertyEnum", - "tsFullPath" : "StaticPropertyEnum" - }, - { - "cases" : [ - - ], - "emitStyle" : "const", - "name" : "StaticPropertyNamespace", - "staticMethods" : [ - - ], - "staticProperties" : [ - { - "isReadonly" : false, - "isStatic" : true, - "name" : "namespaceProperty", - "namespace" : [ - "StaticPropertyNamespace" - ], "staticContext" : { "namespaceEnum" : { - "_0" : "StaticPropertyNamespace" - } - }, - "type" : { - "string" : { - + "_0" : "IntegerTypesSupportExports" } } }, { - "isReadonly" : true, - "isStatic" : true, - "name" : "namespaceConstant", + "abiName" : "bjs_IntegerTypesSupportExports_static_roundTripUInt64", + "effects" : { + "isAsync" : false, + "isStatic" : true, + "isThrows" : false + }, + "name" : "roundTripUInt64", "namespace" : [ - "StaticPropertyNamespace" + "IntegerTypesSupportExports" ], - "staticContext" : { - "namespaceEnum" : { - "_0" : "StaticPropertyNamespace" + "parameters" : [ + { + "label" : "_", + "name" : "v", + "type" : { + "integer" : { + "_0" : { + "isSigned" : false, + "width" : "w64" + } + } + } + } + ], + "returnType" : { + "integer" : { + "_0" : { + "isSigned" : false, + "width" : "w64" + } } }, - "type" : { - "string" : { - + "staticContext" : { + "namespaceEnum" : { + "_0" : "IntegerTypesSupportExports" } } } ], - "swiftCallName" : "StaticPropertyNamespace", - "tsFullPath" : "StaticPropertyNamespace" + "staticProperties" : [ + + ], + "swiftCallName" : "IntegerTypesSupportExports", + "tsFullPath" : "IntegerTypesSupportExports" }, { "cases" : [ ], "emitStyle" : "const", - "name" : "NestedProperties", - "namespace" : [ - "StaticPropertyNamespace" - ], + "name" : "JSTypedArrayExports", "staticMethods" : [ - - ], - "staticProperties" : [ { - "isReadonly" : false, - "isStatic" : true, - "name" : "nestedProperty", + "abiName" : "bjs_JSTypedArrayExports_static_roundTripUint8Array", + "effects" : { + "isAsync" : false, + "isStatic" : true, + "isThrows" : false + }, + "name" : "roundTripUint8Array", "namespace" : [ - "StaticPropertyNamespace", - "NestedProperties" + "JSTypedArrayExports" ], - "staticContext" : { - "namespaceEnum" : { - "_0" : "StaticPropertyNamespace.NestedProperties" - } - }, - "type" : { - "integer" : { - "_0" : { - "isSigned" : true, - "width" : "word" + "parameters" : [ + { + "label" : "_", + "name" : "v", + "type" : { + "jsObject" : { + "_0" : "JSUint8Array" + } } } - } - }, - { - "isReadonly" : true, - "isStatic" : true, - "name" : "nestedConstant", - "namespace" : [ - "StaticPropertyNamespace", - "NestedProperties" ], - "staticContext" : { - "namespaceEnum" : { - "_0" : "StaticPropertyNamespace.NestedProperties" + "returnType" : { + "jsObject" : { + "_0" : "JSUint8Array" } }, - "type" : { - "string" : { - + "staticContext" : { + "namespaceEnum" : { + "_0" : "JSTypedArrayExports" } } }, { - "isReadonly" : false, - "isStatic" : true, - "name" : "nestedDouble", + "abiName" : "bjs_JSTypedArrayExports_static_roundTripFloat32Array", + "effects" : { + "isAsync" : false, + "isStatic" : true, + "isThrows" : false + }, + "name" : "roundTripFloat32Array", "namespace" : [ - "StaticPropertyNamespace", - "NestedProperties" + "JSTypedArrayExports" ], - "staticContext" : { - "namespaceEnum" : { - "_0" : "StaticPropertyNamespace.NestedProperties" + "parameters" : [ + { + "label" : "_", + "name" : "v", + "type" : { + "jsObject" : { + "_0" : "JSFloat32Array" + } + } + } + ], + "returnType" : { + "jsObject" : { + "_0" : "JSFloat32Array" } }, - "type" : { - "double" : { - + "staticContext" : { + "namespaceEnum" : { + "_0" : "JSTypedArrayExports" } } - } - ], - "swiftCallName" : "StaticPropertyNamespace.NestedProperties", - "tsFullPath" : "StaticPropertyNamespace.NestedProperties" - }, - { - "cases" : [ - - ], - "emitStyle" : "const", - "name" : "NestedStructGroupA", - "staticMethods" : [ + }, { - "abiName" : "bjs_NestedStructGroupA_static_roundtripMetadata", + "abiName" : "bjs_JSTypedArrayExports_static_roundTripFloat64Array", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "roundtripMetadata", + "name" : "roundTripFloat64Array", "namespace" : [ - "NestedStructGroupA" + "JSTypedArrayExports" ], "parameters" : [ { "label" : "_", - "name" : "m", + "name" : "v", "type" : { - "swiftStruct" : { - "_0" : "NestedStructGroupA.Metadata" + "jsObject" : { + "_0" : "JSFloat64Array" } } } ], "returnType" : { - "swiftStruct" : { - "_0" : "NestedStructGroupA.Metadata" + "jsObject" : { + "_0" : "JSFloat64Array" } }, "staticContext" : { "namespaceEnum" : { - "_0" : "NestedStructGroupA" + "_0" : "JSTypedArrayExports" } } - } - ], - "staticProperties" : [ - - ], - "swiftCallName" : "NestedStructGroupA", - "tsFullPath" : "NestedStructGroupA" - }, - { - "cases" : [ - - ], - "emitStyle" : "const", - "name" : "NestedStructGroupB", - "staticMethods" : [ + }, { - "abiName" : "bjs_NestedStructGroupB_static_roundtripMetadata", + "abiName" : "bjs_JSTypedArrayExports_static_roundTripInt32Array", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "roundtripMetadata", + "name" : "roundTripInt32Array", "namespace" : [ - "NestedStructGroupB" + "JSTypedArrayExports" ], "parameters" : [ { "label" : "_", - "name" : "m", + "name" : "v", "type" : { - "swiftStruct" : { - "_0" : "NestedStructGroupB.Metadata" + "jsObject" : { + "_0" : "JSInt32Array" } } } ], "returnType" : { - "swiftStruct" : { - "_0" : "NestedStructGroupB.Metadata" + "jsObject" : { + "_0" : "JSInt32Array" } }, "staticContext" : { "namespaceEnum" : { - "_0" : "NestedStructGroupB" + "_0" : "JSTypedArrayExports" } } } @@ -9251,574 +10458,642 @@ "staticProperties" : [ ], - "swiftCallName" : "NestedStructGroupB", - "tsFullPath" : "NestedStructGroupB" + "swiftCallName" : "JSTypedArrayExports", + "tsFullPath" : "JSTypedArrayExports" }, { "cases" : [ ], "emitStyle" : "const", - "name" : "IntegerTypesSupportExports", + "name" : "OptionalSupportExports", "staticMethods" : [ { - "abiName" : "bjs_IntegerTypesSupportExports_static_roundTripInt", + "abiName" : "bjs_OptionalSupportExports_static_roundTripOptionalString", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "roundTripInt", + "name" : "roundTripOptionalString", "namespace" : [ - "IntegerTypesSupportExports" + "OptionalSupportExports" ], "parameters" : [ { "label" : "_", "name" : "v", "type" : { - "integer" : { + "nullable" : { "_0" : { - "isSigned" : true, - "width" : "word" - } + "string" : { + + } + }, + "_1" : "null" } } } ], "returnType" : { - "integer" : { + "nullable" : { "_0" : { - "isSigned" : true, - "width" : "word" - } + "string" : { + + } + }, + "_1" : "null" } }, "staticContext" : { "namespaceEnum" : { - "_0" : "IntegerTypesSupportExports" + "_0" : "OptionalSupportExports" } } }, { - "abiName" : "bjs_IntegerTypesSupportExports_static_roundTripUInt", + "abiName" : "bjs_OptionalSupportExports_static_roundTripOptionalInt", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "roundTripUInt", + "name" : "roundTripOptionalInt", "namespace" : [ - "IntegerTypesSupportExports" + "OptionalSupportExports" ], "parameters" : [ { "label" : "_", "name" : "v", "type" : { - "integer" : { + "nullable" : { "_0" : { - "isSigned" : false, - "width" : "word" - } + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + }, + "_1" : "null" } } } ], "returnType" : { - "integer" : { + "nullable" : { "_0" : { - "isSigned" : false, - "width" : "word" - } + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + }, + "_1" : "null" } }, "staticContext" : { "namespaceEnum" : { - "_0" : "IntegerTypesSupportExports" + "_0" : "OptionalSupportExports" } } }, { - "abiName" : "bjs_IntegerTypesSupportExports_static_roundTripInt8", + "abiName" : "bjs_OptionalSupportExports_static_roundTripOptionalBool", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "roundTripInt8", + "name" : "roundTripOptionalBool", "namespace" : [ - "IntegerTypesSupportExports" + "OptionalSupportExports" ], "parameters" : [ { "label" : "_", "name" : "v", "type" : { - "integer" : { + "nullable" : { "_0" : { - "isSigned" : true, - "width" : "w8" - } + "bool" : { + + } + }, + "_1" : "null" } } } ], "returnType" : { - "integer" : { + "nullable" : { "_0" : { - "isSigned" : true, - "width" : "w8" - } + "bool" : { + + } + }, + "_1" : "null" } }, "staticContext" : { "namespaceEnum" : { - "_0" : "IntegerTypesSupportExports" + "_0" : "OptionalSupportExports" } } }, { - "abiName" : "bjs_IntegerTypesSupportExports_static_roundTripUInt8", + "abiName" : "bjs_OptionalSupportExports_static_roundTripOptionalFloat", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "roundTripUInt8", + "name" : "roundTripOptionalFloat", "namespace" : [ - "IntegerTypesSupportExports" + "OptionalSupportExports" ], "parameters" : [ { "label" : "_", "name" : "v", "type" : { - "integer" : { + "nullable" : { "_0" : { - "isSigned" : false, - "width" : "w8" - } + "float" : { + + } + }, + "_1" : "null" } } } ], "returnType" : { - "integer" : { + "nullable" : { "_0" : { - "isSigned" : false, - "width" : "w8" - } + "float" : { + + } + }, + "_1" : "null" } }, "staticContext" : { "namespaceEnum" : { - "_0" : "IntegerTypesSupportExports" + "_0" : "OptionalSupportExports" } } }, { - "abiName" : "bjs_IntegerTypesSupportExports_static_roundTripInt16", + "abiName" : "bjs_OptionalSupportExports_static_roundTripOptionalDouble", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "roundTripInt16", + "name" : "roundTripOptionalDouble", "namespace" : [ - "IntegerTypesSupportExports" + "OptionalSupportExports" ], "parameters" : [ { "label" : "_", "name" : "v", "type" : { - "integer" : { + "nullable" : { "_0" : { - "isSigned" : true, - "width" : "w16" - } + "double" : { + + } + }, + "_1" : "null" } } } ], "returnType" : { - "integer" : { + "nullable" : { "_0" : { - "isSigned" : true, - "width" : "w16" - } + "double" : { + + } + }, + "_1" : "null" } }, "staticContext" : { "namespaceEnum" : { - "_0" : "IntegerTypesSupportExports" + "_0" : "OptionalSupportExports" } } }, { - "abiName" : "bjs_IntegerTypesSupportExports_static_roundTripUInt16", + "abiName" : "bjs_OptionalSupportExports_static_roundTripOptionalSyntax", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "roundTripUInt16", + "name" : "roundTripOptionalSyntax", "namespace" : [ - "IntegerTypesSupportExports" + "OptionalSupportExports" ], "parameters" : [ { "label" : "_", "name" : "v", "type" : { - "integer" : { + "nullable" : { "_0" : { - "isSigned" : false, - "width" : "w16" - } + "string" : { + + } + }, + "_1" : "null" } } } ], "returnType" : { - "integer" : { + "nullable" : { "_0" : { - "isSigned" : false, - "width" : "w16" - } + "string" : { + + } + }, + "_1" : "null" } }, "staticContext" : { "namespaceEnum" : { - "_0" : "IntegerTypesSupportExports" + "_0" : "OptionalSupportExports" } } }, { - "abiName" : "bjs_IntegerTypesSupportExports_static_roundTripInt32", + "abiName" : "bjs_OptionalSupportExports_static_roundTripOptionalCaseEnum", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "roundTripInt32", + "name" : "roundTripOptionalCaseEnum", "namespace" : [ - "IntegerTypesSupportExports" + "OptionalSupportExports" ], "parameters" : [ { "label" : "_", "name" : "v", "type" : { - "integer" : { + "nullable" : { "_0" : { - "isSigned" : true, - "width" : "w32" - } + "caseEnum" : { + "_0" : "Status" + } + }, + "_1" : "null" } } } ], "returnType" : { - "integer" : { + "nullable" : { "_0" : { - "isSigned" : true, - "width" : "w32" - } + "caseEnum" : { + "_0" : "Status" + } + }, + "_1" : "null" } }, "staticContext" : { "namespaceEnum" : { - "_0" : "IntegerTypesSupportExports" + "_0" : "OptionalSupportExports" } } }, { - "abiName" : "bjs_IntegerTypesSupportExports_static_roundTripUInt32", + "abiName" : "bjs_OptionalSupportExports_static_roundTripOptionalStringRawValueEnum", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "roundTripUInt32", + "name" : "roundTripOptionalStringRawValueEnum", "namespace" : [ - "IntegerTypesSupportExports" + "OptionalSupportExports" ], "parameters" : [ { "label" : "_", "name" : "v", "type" : { - "integer" : { + "nullable" : { "_0" : { - "isSigned" : false, - "width" : "w32" - } + "rawValueEnum" : { + "_0" : "Theme", + "_1" : "String" + } + }, + "_1" : "null" } } } ], "returnType" : { - "integer" : { + "nullable" : { "_0" : { - "isSigned" : false, - "width" : "w32" - } + "rawValueEnum" : { + "_0" : "Theme", + "_1" : "String" + } + }, + "_1" : "null" } }, "staticContext" : { "namespaceEnum" : { - "_0" : "IntegerTypesSupportExports" + "_0" : "OptionalSupportExports" } } }, { - "abiName" : "bjs_IntegerTypesSupportExports_static_roundTripInt64", + "abiName" : "bjs_OptionalSupportExports_static_roundTripOptionalIntRawValueEnum", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "roundTripInt64", + "name" : "roundTripOptionalIntRawValueEnum", "namespace" : [ - "IntegerTypesSupportExports" + "OptionalSupportExports" ], "parameters" : [ { "label" : "_", "name" : "v", "type" : { - "integer" : { + "nullable" : { "_0" : { - "isSigned" : true, - "width" : "w64" - } + "rawValueEnum" : { + "_0" : "HttpStatus", + "_1" : "Int" + } + }, + "_1" : "null" } } } ], "returnType" : { - "integer" : { + "nullable" : { "_0" : { - "isSigned" : true, - "width" : "w64" - } + "rawValueEnum" : { + "_0" : "HttpStatus", + "_1" : "Int" + } + }, + "_1" : "null" } }, "staticContext" : { "namespaceEnum" : { - "_0" : "IntegerTypesSupportExports" + "_0" : "OptionalSupportExports" } } }, { - "abiName" : "bjs_IntegerTypesSupportExports_static_roundTripUInt64", + "abiName" : "bjs_OptionalSupportExports_static_roundTripOptionalInt64RawValueEnum", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "roundTripUInt64", + "name" : "roundTripOptionalInt64RawValueEnum", "namespace" : [ - "IntegerTypesSupportExports" + "OptionalSupportExports" ], "parameters" : [ { "label" : "_", "name" : "v", "type" : { - "integer" : { + "nullable" : { "_0" : { - "isSigned" : false, - "width" : "w64" - } + "rawValueEnum" : { + "_0" : "FileSize", + "_1" : "Int64" + } + }, + "_1" : "null" } } } ], "returnType" : { - "integer" : { + "nullable" : { "_0" : { - "isSigned" : false, - "width" : "w64" - } + "rawValueEnum" : { + "_0" : "FileSize", + "_1" : "Int64" + } + }, + "_1" : "null" } }, "staticContext" : { "namespaceEnum" : { - "_0" : "IntegerTypesSupportExports" + "_0" : "OptionalSupportExports" } } - } - ], - "staticProperties" : [ - - ], - "swiftCallName" : "IntegerTypesSupportExports", - "tsFullPath" : "IntegerTypesSupportExports" - }, - { - "cases" : [ - - ], - "emitStyle" : "const", - "name" : "JSTypedArrayExports", - "staticMethods" : [ + }, { - "abiName" : "bjs_JSTypedArrayExports_static_roundTripUint8Array", + "abiName" : "bjs_OptionalSupportExports_static_roundTripOptionalUInt64RawValueEnum", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "roundTripUint8Array", + "name" : "roundTripOptionalUInt64RawValueEnum", "namespace" : [ - "JSTypedArrayExports" + "OptionalSupportExports" ], "parameters" : [ { "label" : "_", "name" : "v", "type" : { - "jsObject" : { - "_0" : "JSUint8Array" + "nullable" : { + "_0" : { + "rawValueEnum" : { + "_0" : "SessionId", + "_1" : "UInt64" + } + }, + "_1" : "null" } } } ], "returnType" : { - "jsObject" : { - "_0" : "JSUint8Array" + "nullable" : { + "_0" : { + "rawValueEnum" : { + "_0" : "SessionId", + "_1" : "UInt64" + } + }, + "_1" : "null" } }, "staticContext" : { "namespaceEnum" : { - "_0" : "JSTypedArrayExports" + "_0" : "OptionalSupportExports" } } }, { - "abiName" : "bjs_JSTypedArrayExports_static_roundTripFloat32Array", + "abiName" : "bjs_OptionalSupportExports_static_roundTripOptionalTSEnum", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "roundTripFloat32Array", + "name" : "roundTripOptionalTSEnum", "namespace" : [ - "JSTypedArrayExports" + "OptionalSupportExports" ], "parameters" : [ { "label" : "_", "name" : "v", "type" : { - "jsObject" : { - "_0" : "JSFloat32Array" + "nullable" : { + "_0" : { + "caseEnum" : { + "_0" : "TSDirection" + } + }, + "_1" : "null" } } } ], "returnType" : { - "jsObject" : { - "_0" : "JSFloat32Array" + "nullable" : { + "_0" : { + "caseEnum" : { + "_0" : "TSDirection" + } + }, + "_1" : "null" } }, "staticContext" : { "namespaceEnum" : { - "_0" : "JSTypedArrayExports" + "_0" : "OptionalSupportExports" } } }, { - "abiName" : "bjs_JSTypedArrayExports_static_roundTripFloat64Array", + "abiName" : "bjs_OptionalSupportExports_static_roundTripOptionalTSStringEnum", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "roundTripFloat64Array", + "name" : "roundTripOptionalTSStringEnum", "namespace" : [ - "JSTypedArrayExports" + "OptionalSupportExports" ], "parameters" : [ { "label" : "_", "name" : "v", "type" : { - "jsObject" : { - "_0" : "JSFloat64Array" + "nullable" : { + "_0" : { + "rawValueEnum" : { + "_0" : "TSTheme", + "_1" : "String" + } + }, + "_1" : "null" } } } ], "returnType" : { - "jsObject" : { - "_0" : "JSFloat64Array" + "nullable" : { + "_0" : { + "rawValueEnum" : { + "_0" : "TSTheme", + "_1" : "String" + } + }, + "_1" : "null" } }, "staticContext" : { "namespaceEnum" : { - "_0" : "JSTypedArrayExports" + "_0" : "OptionalSupportExports" } } }, { - "abiName" : "bjs_JSTypedArrayExports_static_roundTripInt32Array", + "abiName" : "bjs_OptionalSupportExports_static_roundTripOptionalNamespacedEnum", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "roundTripInt32Array", + "name" : "roundTripOptionalNamespacedEnum", "namespace" : [ - "JSTypedArrayExports" + "OptionalSupportExports" ], "parameters" : [ { "label" : "_", "name" : "v", "type" : { - "jsObject" : { - "_0" : "JSInt32Array" + "nullable" : { + "_0" : { + "caseEnum" : { + "_0" : "Networking.API.Method" + } + }, + "_1" : "null" } } } ], "returnType" : { - "jsObject" : { - "_0" : "JSInt32Array" + "nullable" : { + "_0" : { + "caseEnum" : { + "_0" : "Networking.API.Method" + } + }, + "_1" : "null" } }, "staticContext" : { "namespaceEnum" : { - "_0" : "JSTypedArrayExports" + "_0" : "OptionalSupportExports" } } - } - ], - "staticProperties" : [ - - ], - "swiftCallName" : "JSTypedArrayExports", - "tsFullPath" : "JSTypedArrayExports" - }, - { - "cases" : [ - - ], - "emitStyle" : "const", - "name" : "OptionalSupportExports", - "staticMethods" : [ + }, { - "abiName" : "bjs_OptionalSupportExports_static_roundTripOptionalString", + "abiName" : "bjs_OptionalSupportExports_static_roundTripOptionalSwiftClass", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "roundTripOptionalString", + "name" : "roundTripOptionalSwiftClass", "namespace" : [ "OptionalSupportExports" ], @@ -9829,8 +11104,8 @@ "type" : { "nullable" : { "_0" : { - "string" : { - + "swiftHeapObject" : { + "_0" : "Greeter" } }, "_1" : "null" @@ -9841,8 +11116,8 @@ "returnType" : { "nullable" : { "_0" : { - "string" : { - + "swiftHeapObject" : { + "_0" : "Greeter" } }, "_1" : "null" @@ -9855,13 +11130,13 @@ } }, { - "abiName" : "bjs_OptionalSupportExports_static_roundTripOptionalInt", + "abiName" : "bjs_OptionalSupportExports_static_roundTripOptionalIntArray", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "roundTripOptionalInt", + "name" : "roundTripOptionalIntArray", "namespace" : [ "OptionalSupportExports" ], @@ -9872,10 +11147,14 @@ "type" : { "nullable" : { "_0" : { - "integer" : { + "array" : { "_0" : { - "isSigned" : true, - "width" : "word" + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } } } }, @@ -9887,10 +11166,14 @@ "returnType" : { "nullable" : { "_0" : { - "integer" : { + "array" : { "_0" : { - "isSigned" : true, - "width" : "word" + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } } } }, @@ -9904,13 +11187,13 @@ } }, { - "abiName" : "bjs_OptionalSupportExports_static_roundTripOptionalBool", + "abiName" : "bjs_OptionalSupportExports_static_roundTripOptionalStringArray", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "roundTripOptionalBool", + "name" : "roundTripOptionalStringArray", "namespace" : [ "OptionalSupportExports" ], @@ -9921,8 +11204,12 @@ "type" : { "nullable" : { "_0" : { - "bool" : { + "array" : { + "_0" : { + "string" : { + } + } } }, "_1" : "null" @@ -9933,8 +11220,12 @@ "returnType" : { "nullable" : { "_0" : { - "bool" : { + "array" : { + "_0" : { + "string" : { + } + } } }, "_1" : "null" @@ -9947,13 +11238,13 @@ } }, { - "abiName" : "bjs_OptionalSupportExports_static_roundTripOptionalFloat", + "abiName" : "bjs_OptionalSupportExports_static_roundTripOptionalSwiftClassArray", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "roundTripOptionalFloat", + "name" : "roundTripOptionalSwiftClassArray", "namespace" : [ "OptionalSupportExports" ], @@ -9964,8 +11255,12 @@ "type" : { "nullable" : { "_0" : { - "float" : { - + "array" : { + "_0" : { + "swiftHeapObject" : { + "_0" : "Greeter" + } + } } }, "_1" : "null" @@ -9976,8 +11271,12 @@ "returnType" : { "nullable" : { "_0" : { - "float" : { - + "array" : { + "_0" : { + "swiftHeapObject" : { + "_0" : "Greeter" + } + } } }, "_1" : "null" @@ -9990,13 +11289,13 @@ } }, { - "abiName" : "bjs_OptionalSupportExports_static_roundTripOptionalDouble", + "abiName" : "bjs_OptionalSupportExports_static_roundTripOptionalAPIResult", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "roundTripOptionalDouble", + "name" : "roundTripOptionalAPIResult", "namespace" : [ "OptionalSupportExports" ], @@ -10007,8 +11306,8 @@ "type" : { "nullable" : { "_0" : { - "double" : { - + "associatedValueEnum" : { + "_0" : "APIResult" } }, "_1" : "null" @@ -10019,8 +11318,8 @@ "returnType" : { "nullable" : { "_0" : { - "double" : { - + "associatedValueEnum" : { + "_0" : "APIResult" } }, "_1" : "null" @@ -10033,13 +11332,13 @@ } }, { - "abiName" : "bjs_OptionalSupportExports_static_roundTripOptionalSyntax", + "abiName" : "bjs_OptionalSupportExports_static_roundTripOptionalTypedPayloadResult", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "roundTripOptionalSyntax", + "name" : "roundTripOptionalTypedPayloadResult", "namespace" : [ "OptionalSupportExports" ], @@ -10050,8 +11349,8 @@ "type" : { "nullable" : { "_0" : { - "string" : { - + "associatedValueEnum" : { + "_0" : "TypedPayloadResult" } }, "_1" : "null" @@ -10062,8 +11361,8 @@ "returnType" : { "nullable" : { "_0" : { - "string" : { - + "associatedValueEnum" : { + "_0" : "TypedPayloadResult" } }, "_1" : "null" @@ -10076,13 +11375,13 @@ } }, { - "abiName" : "bjs_OptionalSupportExports_static_roundTripOptionalCaseEnum", + "abiName" : "bjs_OptionalSupportExports_static_roundTripOptionalComplexResult", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "roundTripOptionalCaseEnum", + "name" : "roundTripOptionalComplexResult", "namespace" : [ "OptionalSupportExports" ], @@ -10093,8 +11392,8 @@ "type" : { "nullable" : { "_0" : { - "caseEnum" : { - "_0" : "Status" + "associatedValueEnum" : { + "_0" : "ComplexResult" } }, "_1" : "null" @@ -10105,8 +11404,8 @@ "returnType" : { "nullable" : { "_0" : { - "caseEnum" : { - "_0" : "Status" + "associatedValueEnum" : { + "_0" : "ComplexResult" } }, "_1" : "null" @@ -10119,13 +11418,13 @@ } }, { - "abiName" : "bjs_OptionalSupportExports_static_roundTripOptionalStringRawValueEnum", + "abiName" : "bjs_OptionalSupportExports_static_roundTripOptionalAllTypesResult", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "roundTripOptionalStringRawValueEnum", + "name" : "roundTripOptionalAllTypesResult", "namespace" : [ "OptionalSupportExports" ], @@ -10136,9 +11435,8 @@ "type" : { "nullable" : { "_0" : { - "rawValueEnum" : { - "_0" : "Theme", - "_1" : "String" + "associatedValueEnum" : { + "_0" : "AllTypesResult" } }, "_1" : "null" @@ -10149,9 +11447,8 @@ "returnType" : { "nullable" : { "_0" : { - "rawValueEnum" : { - "_0" : "Theme", - "_1" : "String" + "associatedValueEnum" : { + "_0" : "AllTypesResult" } }, "_1" : "null" @@ -10164,13 +11461,13 @@ } }, { - "abiName" : "bjs_OptionalSupportExports_static_roundTripOptionalIntRawValueEnum", + "abiName" : "bjs_OptionalSupportExports_static_roundTripOptionalPayloadResult", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "roundTripOptionalIntRawValueEnum", + "name" : "roundTripOptionalPayloadResult", "namespace" : [ "OptionalSupportExports" ], @@ -10179,27 +11476,15 @@ "label" : "_", "name" : "v", "type" : { - "nullable" : { - "_0" : { - "rawValueEnum" : { - "_0" : "HttpStatus", - "_1" : "Int" - } - }, - "_1" : "null" - } - } - } - ], - "returnType" : { - "nullable" : { - "_0" : { - "rawValueEnum" : { - "_0" : "HttpStatus", - "_1" : "Int" + "associatedValueEnum" : { + "_0" : "OptionalAllTypesResult" } - }, - "_1" : "null" + } + } + ], + "returnType" : { + "associatedValueEnum" : { + "_0" : "OptionalAllTypesResult" } }, "staticContext" : { @@ -10209,13 +11494,13 @@ } }, { - "abiName" : "bjs_OptionalSupportExports_static_roundTripOptionalInt64RawValueEnum", + "abiName" : "bjs_OptionalSupportExports_static_roundTripOptionalPayloadResultOpt", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "roundTripOptionalInt64RawValueEnum", + "name" : "roundTripOptionalPayloadResultOpt", "namespace" : [ "OptionalSupportExports" ], @@ -10226,9 +11511,8 @@ "type" : { "nullable" : { "_0" : { - "rawValueEnum" : { - "_0" : "FileSize", - "_1" : "Int64" + "associatedValueEnum" : { + "_0" : "OptionalAllTypesResult" } }, "_1" : "null" @@ -10239,9 +11523,8 @@ "returnType" : { "nullable" : { "_0" : { - "rawValueEnum" : { - "_0" : "FileSize", - "_1" : "Int64" + "associatedValueEnum" : { + "_0" : "OptionalAllTypesResult" } }, "_1" : "null" @@ -10254,13 +11537,13 @@ } }, { - "abiName" : "bjs_OptionalSupportExports_static_roundTripOptionalUInt64RawValueEnum", + "abiName" : "bjs_OptionalSupportExports_static_roundTripOptionalAPIOptionalResult", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "roundTripOptionalUInt64RawValueEnum", + "name" : "roundTripOptionalAPIOptionalResult", "namespace" : [ "OptionalSupportExports" ], @@ -10271,9 +11554,8 @@ "type" : { "nullable" : { "_0" : { - "rawValueEnum" : { - "_0" : "SessionId", - "_1" : "UInt64" + "associatedValueEnum" : { + "_0" : "APIOptionalResult" } }, "_1" : "null" @@ -10284,9 +11566,8 @@ "returnType" : { "nullable" : { "_0" : { - "rawValueEnum" : { - "_0" : "SessionId", - "_1" : "UInt64" + "associatedValueEnum" : { + "_0" : "APIOptionalResult" } }, "_1" : "null" @@ -10299,25 +11580,25 @@ } }, { - "abiName" : "bjs_OptionalSupportExports_static_roundTripOptionalTSEnum", + "abiName" : "bjs_OptionalSupportExports_static_takeOptionalJSObject", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "roundTripOptionalTSEnum", + "name" : "takeOptionalJSObject", "namespace" : [ "OptionalSupportExports" ], "parameters" : [ { "label" : "_", - "name" : "v", + "name" : "value", "type" : { "nullable" : { "_0" : { - "caseEnum" : { - "_0" : "TSDirection" + "jsObject" : { + } }, "_1" : "null" @@ -10326,13 +11607,8 @@ } ], "returnType" : { - "nullable" : { - "_0" : { - "caseEnum" : { - "_0" : "TSDirection" - } - }, - "_1" : "null" + "void" : { + } }, "staticContext" : { @@ -10342,39 +11618,75 @@ } }, { - "abiName" : "bjs_OptionalSupportExports_static_roundTripOptionalTSStringEnum", + "abiName" : "bjs_OptionalSupportExports_static_applyOptionalGreeter", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "roundTripOptionalTSStringEnum", + "name" : "applyOptionalGreeter", "namespace" : [ "OptionalSupportExports" ], "parameters" : [ { "label" : "_", - "name" : "v", + "name" : "value", "type" : { "nullable" : { "_0" : { - "rawValueEnum" : { - "_0" : "TSTheme", - "_1" : "String" + "swiftHeapObject" : { + "_0" : "Greeter" } }, "_1" : "null" } } + }, + { + "label" : "_", + "name" : "transform", + "type" : { + "closure" : { + "_0" : { + "isAsync" : false, + "isThrows" : false, + "mangleName" : "20BridgeJSRuntimeTestsSq7GreeterC_Sq7GreeterC", + "moduleName" : "BridgeJSRuntimeTests", + "parameters" : [ + { + "nullable" : { + "_0" : { + "swiftHeapObject" : { + "_0" : "Greeter" + } + }, + "_1" : "null" + } + } + ], + "returnType" : { + "nullable" : { + "_0" : { + "swiftHeapObject" : { + "_0" : "Greeter" + } + }, + "_1" : "null" + } + }, + "sendingParameters" : false + }, + "useJSTypedClosure" : false + } + } } ], "returnType" : { "nullable" : { "_0" : { - "rawValueEnum" : { - "_0" : "TSTheme", - "_1" : "String" + "swiftHeapObject" : { + "_0" : "Greeter" } }, "_1" : "null" @@ -10387,40 +11699,49 @@ } }, { - "abiName" : "bjs_OptionalSupportExports_static_roundTripOptionalNamespacedEnum", + "abiName" : "bjs_OptionalSupportExports_static_makeOptionalHolder", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "roundTripOptionalNamespacedEnum", + "name" : "makeOptionalHolder", "namespace" : [ "OptionalSupportExports" ], "parameters" : [ { - "label" : "_", - "name" : "v", + "label" : "nullableGreeter", + "name" : "nullableGreeter", "type" : { "nullable" : { "_0" : { - "caseEnum" : { - "_0" : "Networking.API.Method" + "swiftHeapObject" : { + "_0" : "Greeter" } }, "_1" : "null" } } + }, + { + "label" : "undefinedNumber", + "name" : "undefinedNumber", + "type" : { + "nullable" : { + "_0" : { + "double" : { + + } + }, + "_1" : "undefined" + } + } } ], "returnType" : { - "nullable" : { - "_0" : { - "caseEnum" : { - "_0" : "Networking.API.Method" - } - }, - "_1" : "null" + "swiftHeapObject" : { + "_0" : "OptionalHolder" } }, "staticContext" : { @@ -10430,25 +11751,39 @@ } }, { - "abiName" : "bjs_OptionalSupportExports_static_roundTripOptionalSwiftClass", + "abiName" : "bjs_OptionalSupportExports_static_compareAPIResults", "effects" : { "isAsync" : false, "isStatic" : true, "isThrows" : false }, - "name" : "roundTripOptionalSwiftClass", + "name" : "compareAPIResults", "namespace" : [ "OptionalSupportExports" ], "parameters" : [ { "label" : "_", - "name" : "v", + "name" : "r1", "type" : { "nullable" : { "_0" : { - "swiftHeapObject" : { - "_0" : "Greeter" + "associatedValueEnum" : { + "_0" : "APIResult" + } + }, + "_1" : "null" + } + } + }, + { + "label" : "_", + "name" : "r2", + "type" : { + "nullable" : { + "_0" : { + "associatedValueEnum" : { + "_0" : "APIResult" } }, "_1" : "null" @@ -10457,13 +11792,8 @@ } ], "returnType" : { - "nullable" : { - "_0" : { - "swiftHeapObject" : { - "_0" : "Greeter" - } - }, - "_1" : "null" + "string" : { + } }, "staticContext" : { @@ -10471,22 +11801,87 @@ "_0" : "OptionalSupportExports" } } + } + ], + "staticProperties" : [ + + ], + "swiftCallName" : "OptionalSupportExports", + "tsFullPath" : "OptionalSupportExports" + }, + { + "cases" : [ + { + "associatedValues" : [ + { + "type" : { + "nullable" : { + "_0" : { + "swiftStruct" : { + "_0" : "Address" + } + }, + "_1" : "null" + } + } + } + ], + "name" : "optStruct" }, { - "abiName" : "bjs_OptionalSupportExports_static_roundTripOptionalIntArray", - "effects" : { - "isAsync" : false, - "isStatic" : true, - "isThrows" : false - }, - "name" : "roundTripOptionalIntArray", - "namespace" : [ - "OptionalSupportExports" + "associatedValues" : [ + { + "type" : { + "nullable" : { + "_0" : { + "swiftHeapObject" : { + "_0" : "Greeter" + } + }, + "_1" : "null" + } + } + } + ], + "name" : "optClass" + }, + { + "associatedValues" : [ + { + "type" : { + "nullable" : { + "_0" : { + "jsObject" : { + + } + }, + "_1" : "null" + } + } + } + ], + "name" : "optJSObject" + }, + { + "associatedValues" : [ + { + "type" : { + "nullable" : { + "_0" : { + "associatedValueEnum" : { + "_0" : "APIResult" + } + }, + "_1" : "null" + } + } + } ], - "parameters" : [ + "name" : "optNestedEnum" + }, + { + "associatedValues" : [ { - "label" : "_", - "name" : "v", "type" : { "nullable" : { "_0" : { @@ -10506,53 +11901,16 @@ } } ], - "returnType" : { - "nullable" : { - "_0" : { - "array" : { - "_0" : { - "integer" : { - "_0" : { - "isSigned" : true, - "width" : "word" - } - } - } - } - }, - "_1" : "null" - } - }, - "staticContext" : { - "namespaceEnum" : { - "_0" : "OptionalSupportExports" - } - } + "name" : "optArray" }, { - "abiName" : "bjs_OptionalSupportExports_static_roundTripOptionalStringArray", - "effects" : { - "isAsync" : false, - "isStatic" : true, - "isThrows" : false - }, - "name" : "roundTripOptionalStringArray", - "namespace" : [ - "OptionalSupportExports" - ], - "parameters" : [ + "associatedValues" : [ { - "label" : "_", - "name" : "v", "type" : { "nullable" : { "_0" : { - "array" : { - "_0" : { - "string" : { - - } - } + "jsObject" : { + "_0" : "Foo" } }, "_1" : "null" @@ -10560,50 +11918,36 @@ } } ], - "returnType" : { - "nullable" : { - "_0" : { - "array" : { - "_0" : { - "string" : { - - } - } - } - }, - "_1" : "null" - } - }, - "staticContext" : { - "namespaceEnum" : { - "_0" : "OptionalSupportExports" - } - } + "name" : "optJsClass" }, { - "abiName" : "bjs_OptionalSupportExports_static_roundTripOptionalSwiftClassArray", - "effects" : { - "isAsync" : false, - "isStatic" : true, - "isThrows" : false - }, - "name" : "roundTripOptionalSwiftClassArray", - "namespace" : [ - "OptionalSupportExports" + "associatedValues" : [ + ], - "parameters" : [ + "name" : "empty" + } + ], + "emitStyle" : "const", + "name" : "OptionalAllTypesResult", + "staticMethods" : [ + + ], + "staticProperties" : [ + + ], + "swiftCallName" : "OptionalAllTypesResult", + "tsFullPath" : "OptionalAllTypesResult" + }, + { + "cases" : [ + { + "associatedValues" : [ { - "label" : "_", - "name" : "v", "type" : { "nullable" : { "_0" : { - "array" : { - "_0" : { - "swiftHeapObject" : { - "_0" : "Greeter" - } - } + "string" : { + } }, "_1" : "null" @@ -10611,89 +11955,31 @@ } } ], - "returnType" : { - "nullable" : { - "_0" : { - "array" : { - "_0" : { - "swiftHeapObject" : { - "_0" : "Greeter" - } - } - } - }, - "_1" : "null" - } - }, - "staticContext" : { - "namespaceEnum" : { - "_0" : "OptionalSupportExports" - } - } + "name" : "success" }, { - "abiName" : "bjs_OptionalSupportExports_static_roundTripOptionalAPIResult", - "effects" : { - "isAsync" : false, - "isStatic" : true, - "isThrows" : false - }, - "name" : "roundTripOptionalAPIResult", - "namespace" : [ - "OptionalSupportExports" - ], - "parameters" : [ + "associatedValues" : [ { - "label" : "_", - "name" : "v", "type" : { "nullable" : { "_0" : { - "associatedValueEnum" : { - "_0" : "APIResult" + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } } }, "_1" : "null" } } - } - ], - "returnType" : { - "nullable" : { - "_0" : { - "associatedValueEnum" : { - "_0" : "APIResult" - } - }, - "_1" : "null" - } - }, - "staticContext" : { - "namespaceEnum" : { - "_0" : "OptionalSupportExports" - } - } - }, - { - "abiName" : "bjs_OptionalSupportExports_static_roundTripOptionalTypedPayloadResult", - "effects" : { - "isAsync" : false, - "isStatic" : true, - "isThrows" : false - }, - "name" : "roundTripOptionalTypedPayloadResult", - "namespace" : [ - "OptionalSupportExports" - ], - "parameters" : [ + }, { - "label" : "_", - "name" : "v", "type" : { "nullable" : { "_0" : { - "associatedValueEnum" : { - "_0" : "TypedPayloadResult" + "bool" : { + } }, "_1" : "null" @@ -10701,85 +11987,43 @@ } } ], - "returnType" : { - "nullable" : { - "_0" : { - "associatedValueEnum" : { - "_0" : "TypedPayloadResult" - } - }, - "_1" : "null" - } - }, - "staticContext" : { - "namespaceEnum" : { - "_0" : "OptionalSupportExports" - } - } + "name" : "failure" }, { - "abiName" : "bjs_OptionalSupportExports_static_roundTripOptionalComplexResult", - "effects" : { - "isAsync" : false, - "isStatic" : true, - "isThrows" : false - }, - "name" : "roundTripOptionalComplexResult", - "namespace" : [ - "OptionalSupportExports" - ], - "parameters" : [ + "associatedValues" : [ { - "label" : "_", - "name" : "v", "type" : { "nullable" : { "_0" : { - "associatedValueEnum" : { - "_0" : "ComplexResult" + "bool" : { + } }, "_1" : "null" } - } - } - ], - "returnType" : { - "nullable" : { - "_0" : { - "associatedValueEnum" : { - "_0" : "ComplexResult" - } - }, - "_1" : "null" - } - }, - "staticContext" : { - "namespaceEnum" : { - "_0" : "OptionalSupportExports" - } - } - }, - { - "abiName" : "bjs_OptionalSupportExports_static_roundTripOptionalAllTypesResult", - "effects" : { - "isAsync" : false, - "isStatic" : true, - "isThrows" : false - }, - "name" : "roundTripOptionalAllTypesResult", - "namespace" : [ - "OptionalSupportExports" - ], - "parameters" : [ + } + }, { - "label" : "_", - "name" : "v", "type" : { "nullable" : { "_0" : { - "associatedValueEnum" : { - "_0" : "AllTypesResult" + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + }, + "_1" : "null" + } + } + }, + { + "type" : { + "nullable" : { + "_0" : { + "string" : { + } }, "_1" : "null" @@ -10787,610 +12031,875 @@ } } ], - "returnType" : { - "nullable" : { - "_0" : { - "associatedValueEnum" : { - "_0" : "AllTypesResult" - } - }, - "_1" : "null" + "name" : "status" + } + ], + "emitStyle" : "const", + "name" : "APIOptionalResult", + "staticMethods" : [ + + ], + "staticProperties" : [ + + ], + "swiftCallName" : "APIOptionalResult", + "tsFullPath" : "APIOptionalResult" + } + ], + "exposeToGlobal" : false, + "functions" : [ + { + "abiName" : "bjs_makeTag", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "name" : "makeTag", + "parameters" : [ + { + "label" : "_", + "name" : "name", + "type" : { + "string" : { + } - }, - "staticContext" : { - "namespaceEnum" : { - "_0" : "OptionalSupportExports" + } + } + ], + "returnType" : { + "alias" : { + "name" : "Tag", + "underlying" : { + "swiftHeapObject" : { + "_0" : "TagReference" } } - }, + } + } + }, + { + "abiName" : "bjs_roundTripPolygon", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "name" : "roundTripPolygon", + "parameters" : [ { - "abiName" : "bjs_OptionalSupportExports_static_roundTripOptionalPayloadResult", - "effects" : { - "isAsync" : false, - "isStatic" : true, - "isThrows" : false - }, - "name" : "roundTripOptionalPayloadResult", - "namespace" : [ - "OptionalSupportExports" - ], - "parameters" : [ - { - "label" : "_", - "name" : "v", - "type" : { - "associatedValueEnum" : { - "_0" : "OptionalAllTypesResult" + "label" : "_", + "name" : "polygon", + "type" : { + "alias" : { + "name" : "Polygon", + "underlying" : { + "swiftHeapObject" : { + "_0" : "PolygonReference" } } } - ], - "returnType" : { - "associatedValueEnum" : { - "_0" : "OptionalAllTypesResult" - } - }, - "staticContext" : { - "namespaceEnum" : { - "_0" : "OptionalSupportExports" + } + } + ], + "returnType" : { + "alias" : { + "name" : "Polygon", + "underlying" : { + "swiftHeapObject" : { + "_0" : "PolygonReference" } } - }, + } + } + }, + { + "abiName" : "bjs_appendVertex", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "name" : "appendVertex", + "parameters" : [ { - "abiName" : "bjs_OptionalSupportExports_static_roundTripOptionalPayloadResultOpt", - "effects" : { - "isAsync" : false, - "isStatic" : true, - "isThrows" : false - }, - "name" : "roundTripOptionalPayloadResultOpt", - "namespace" : [ - "OptionalSupportExports" - ], - "parameters" : [ - { - "label" : "_", - "name" : "v", - "type" : { - "nullable" : { - "_0" : { - "associatedValueEnum" : { - "_0" : "OptionalAllTypesResult" - } - }, - "_1" : "null" + "label" : "_", + "name" : "polygon", + "type" : { + "alias" : { + "name" : "Polygon", + "underlying" : { + "swiftHeapObject" : { + "_0" : "PolygonReference" } } } - ], - "returnType" : { + } + }, + { + "label" : "_", + "name" : "value", + "type" : { + "double" : { + + } + } + } + ], + "returnType" : { + "alias" : { + "name" : "Polygon", + "underlying" : { + "swiftHeapObject" : { + "_0" : "PolygonReference" + } + } + } + } + }, + { + "abiName" : "bjs_optionalRoundTripPolygon", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "name" : "optionalRoundTripPolygon", + "parameters" : [ + { + "label" : "_", + "name" : "polygon", + "type" : { "nullable" : { "_0" : { - "associatedValueEnum" : { - "_0" : "OptionalAllTypesResult" + "alias" : { + "name" : "Polygon", + "underlying" : { + "swiftHeapObject" : { + "_0" : "PolygonReference" + } + } } }, "_1" : "null" } + } + } + ], + "returnType" : { + "nullable" : { + "_0" : { + "alias" : { + "name" : "Polygon", + "underlying" : { + "swiftHeapObject" : { + "_0" : "PolygonReference" + } + } + } }, - "staticContext" : { - "namespaceEnum" : { - "_0" : "OptionalSupportExports" + "_1" : "null" + } + } + }, + { + "abiName" : "bjs_polygonVertexCount", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "name" : "polygonVertexCount", + "parameters" : [ + { + "label" : "_", + "name" : "polygon", + "type" : { + "alias" : { + "name" : "Polygon", + "underlying" : { + "swiftHeapObject" : { + "_0" : "PolygonReference" + } + } } } - }, + } + ], + "returnType" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + } + }, + { + "abiName" : "bjs_roundTripPolygonArray", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "name" : "roundTripPolygonArray", + "parameters" : [ { - "abiName" : "bjs_OptionalSupportExports_static_roundTripOptionalAPIOptionalResult", - "effects" : { - "isAsync" : false, - "isStatic" : true, - "isThrows" : false - }, - "name" : "roundTripOptionalAPIOptionalResult", - "namespace" : [ - "OptionalSupportExports" - ], - "parameters" : [ - { - "label" : "_", - "name" : "v", - "type" : { - "nullable" : { - "_0" : { - "associatedValueEnum" : { - "_0" : "APIOptionalResult" + "label" : "_", + "name" : "polygons", + "type" : { + "array" : { + "_0" : { + "alias" : { + "name" : "Polygon", + "underlying" : { + "swiftHeapObject" : { + "_0" : "PolygonReference" } - }, - "_1" : "null" + } } } } - ], - "returnType" : { - "nullable" : { - "_0" : { - "associatedValueEnum" : { - "_0" : "APIOptionalResult" + } + } + ], + "returnType" : { + "array" : { + "_0" : { + "alias" : { + "name" : "Polygon", + "underlying" : { + "swiftHeapObject" : { + "_0" : "PolygonReference" } - }, - "_1" : "null" - } - }, - "staticContext" : { - "namespaceEnum" : { - "_0" : "OptionalSupportExports" + } } } - }, + } + } + }, + { + "abiName" : "bjs_concatPolygons", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "name" : "concatPolygons", + "parameters" : [ { - "abiName" : "bjs_OptionalSupportExports_static_takeOptionalJSObject", - "effects" : { - "isAsync" : false, - "isStatic" : true, - "isThrows" : false - }, - "name" : "takeOptionalJSObject", - "namespace" : [ - "OptionalSupportExports" - ], - "parameters" : [ - { - "label" : "_", - "name" : "value", - "type" : { - "nullable" : { - "_0" : { - "jsObject" : { - + "label" : "_", + "name" : "polygons", + "type" : { + "array" : { + "_0" : { + "alias" : { + "name" : "Polygon", + "underlying" : { + "swiftHeapObject" : { + "_0" : "PolygonReference" } - }, - "_1" : "null" + } } } } - ], - "returnType" : { - "void" : { - - } - }, - "staticContext" : { - "namespaceEnum" : { - "_0" : "OptionalSupportExports" + } + } + ], + "returnType" : { + "alias" : { + "name" : "Polygon", + "underlying" : { + "swiftHeapObject" : { + "_0" : "PolygonReference" } } - }, + } + } + }, + { + "abiName" : "bjs_validatePolygon", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : true + }, + "name" : "validatePolygon", + "parameters" : [ { - "abiName" : "bjs_OptionalSupportExports_static_applyOptionalGreeter", - "effects" : { - "isAsync" : false, - "isStatic" : true, - "isThrows" : false - }, - "name" : "applyOptionalGreeter", - "namespace" : [ - "OptionalSupportExports" - ], - "parameters" : [ - { - "label" : "_", - "name" : "value", - "type" : { - "nullable" : { - "_0" : { - "swiftHeapObject" : { - "_0" : "Greeter" - } - }, - "_1" : "null" + "label" : "_", + "name" : "polygon", + "type" : { + "alias" : { + "name" : "Polygon", + "underlying" : { + "swiftHeapObject" : { + "_0" : "PolygonReference" } } - }, - { - "label" : "_", - "name" : "transform", - "type" : { - "closure" : { - "_0" : { - "isAsync" : false, - "isThrows" : false, - "mangleName" : "20BridgeJSRuntimeTestsSq7GreeterC_Sq7GreeterC", - "moduleName" : "BridgeJSRuntimeTests", - "parameters" : [ - { - "nullable" : { - "_0" : { - "swiftHeapObject" : { - "_0" : "Greeter" - } - }, - "_1" : "null" - } - } - ], - "returnType" : { - "nullable" : { - "_0" : { - "swiftHeapObject" : { - "_0" : "Greeter" - } - }, - "_1" : "null" - } - }, - "sendingParameters" : false - }, - "useJSTypedClosure" : false + } + } + } + ], + "returnType" : { + "alias" : { + "name" : "Polygon", + "underlying" : { + "swiftHeapObject" : { + "_0" : "PolygonReference" + } + } + } + } + }, + { + "abiName" : "bjs_splitPolygon", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "name" : "splitPolygon", + "parameters" : [ + { + "label" : "_", + "name" : "polygon", + "type" : { + "alias" : { + "name" : "Polygon", + "underlying" : { + "swiftHeapObject" : { + "_0" : "PolygonReference" } } } - ], - "returnType" : { - "nullable" : { - "_0" : { + } + } + ], + "returnType" : { + "array" : { + "_0" : { + "alias" : { + "name" : "Polygon", + "underlying" : { "swiftHeapObject" : { - "_0" : "Greeter" + "_0" : "PolygonReference" } - }, - "_1" : "null" - } - }, - "staticContext" : { - "namespaceEnum" : { - "_0" : "OptionalSupportExports" + } } } - }, + } + } + }, + { + "abiName" : "bjs_incrementToken", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "name" : "incrementToken", + "parameters" : [ { - "abiName" : "bjs_OptionalSupportExports_static_makeOptionalHolder", - "effects" : { - "isAsync" : false, - "isStatic" : true, - "isThrows" : false - }, - "name" : "makeOptionalHolder", - "namespace" : [ - "OptionalSupportExports" - ], - "parameters" : [ - { - "label" : "nullableGreeter", - "name" : "nullableGreeter", - "type" : { - "nullable" : { - "_0" : { - "swiftHeapObject" : { - "_0" : "Greeter" - } - }, - "_1" : "null" + "label" : "_", + "name" : "token", + "type" : { + "alias" : { + "name" : "Token", + "underlying" : { + "swiftHeapObject" : { + "_0" : "TokenReference" } } - }, - { - "label" : "undefinedNumber", - "name" : "undefinedNumber", - "type" : { - "nullable" : { - "_0" : { - "double" : { - - } - }, - "_1" : "undefined" - } + } + } + } + ], + "returnType" : { + "alias" : { + "name" : "Token", + "underlying" : { + "swiftHeapObject" : { + "_0" : "TokenReference" + } + } + } + } + }, + { + "abiName" : "bjs_makeToken", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "name" : "makeToken", + "parameters" : [ + { + "label" : "_", + "name" : "value", + "type" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" } } - ], - "returnType" : { + } + } + ], + "returnType" : { + "alias" : { + "name" : "Token", + "underlying" : { "swiftHeapObject" : { - "_0" : "OptionalHolder" - } - }, - "staticContext" : { - "namespaceEnum" : { - "_0" : "OptionalSupportExports" + "_0" : "TokenReference" } } - }, - { - "abiName" : "bjs_OptionalSupportExports_static_compareAPIResults", - "effects" : { + } + } + }, + { + "abiName" : "bjs_makePolygonInspector", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "name" : "makePolygonInspector", + "parameters" : [ + + ], + "returnType" : { + "closure" : { + "_0" : { "isAsync" : false, - "isStatic" : true, - "isThrows" : false - }, - "name" : "compareAPIResults", - "namespace" : [ - "OptionalSupportExports" - ], - "parameters" : [ - { - "label" : "_", - "name" : "r1", - "type" : { - "nullable" : { - "_0" : { - "associatedValueEnum" : { - "_0" : "APIResult" + "isThrows" : false, + "mangleName" : "20BridgeJSRuntimeTestsAl7Polygon_Si", + "moduleName" : "BridgeJSRuntimeTests", + "parameters" : [ + { + "alias" : { + "name" : "Polygon", + "underlying" : { + "swiftHeapObject" : { + "_0" : "PolygonReference" } - }, - "_1" : "null" + } } } - }, - { - "label" : "_", - "name" : "r2", - "type" : { - "nullable" : { - "_0" : { - "associatedValueEnum" : { - "_0" : "APIResult" - } - }, - "_1" : "null" + ], + "returnType" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" } } - } - ], - "returnType" : { + }, + "sendingParameters" : false + }, + "useJSTypedClosure" : false + } + } + }, + { + "abiName" : "bjs_asyncMakePolygon", + "effects" : { + "isAsync" : true, + "isStatic" : false, + "isThrows" : false + }, + "name" : "asyncMakePolygon", + "parameters" : [ + { + "label" : "_", + "name" : "label", + "type" : { "string" : { } - }, - "staticContext" : { - "namespaceEnum" : { - "_0" : "OptionalSupportExports" - } } } ], - "staticProperties" : [ - - ], - "swiftCallName" : "OptionalSupportExports", - "tsFullPath" : "OptionalSupportExports" + "returnType" : { + "alias" : { + "name" : "Polygon", + "underlying" : { + "swiftHeapObject" : { + "_0" : "PolygonReference" + } + } + } + } }, { - "cases" : [ + "abiName" : "bjs_roundTripOptionalPolygonArray", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "name" : "roundTripOptionalPolygonArray", + "parameters" : [ { - "associatedValues" : [ - { - "type" : { + "label" : "_", + "name" : "polygons", + "type" : { + "array" : { + "_0" : { "nullable" : { "_0" : { - "swiftStruct" : { - "_0" : "Address" + "alias" : { + "name" : "Polygon", + "underlying" : { + "swiftHeapObject" : { + "_0" : "PolygonReference" + } + } } }, "_1" : "null" } } } - ], - "name" : "optStruct" - }, - { - "associatedValues" : [ - { - "type" : { - "nullable" : { - "_0" : { + } + } + ], + "returnType" : { + "array" : { + "_0" : { + "nullable" : { + "_0" : { + "alias" : { + "name" : "Polygon", + "underlying" : { "swiftHeapObject" : { - "_0" : "Greeter" + "_0" : "PolygonReference" } - }, - "_1" : "null" + } } - } + }, + "_1" : "null" } - ], - "name" : "optClass" - }, + } + } + } + }, + { + "abiName" : "bjs_makeTagHolder", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "name" : "makeTagHolder", + "parameters" : [ { - "associatedValues" : [ - { - "type" : { - "nullable" : { - "_0" : { - "jsObject" : { + "label" : "_", + "name" : "name", + "type" : { + "string" : { - } - }, - "_1" : "null" - } - } } - ], - "name" : "optJSObject" + } }, { - "associatedValues" : [ - { - "type" : { - "nullable" : { - "_0" : { - "associatedValueEnum" : { - "_0" : "APIResult" - } - }, - "_1" : "null" + "label" : "_", + "name" : "version", + "type" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + } + } + ], + "returnType" : { + "alias" : { + "name" : "TagHolder", + "underlying" : { + "swiftHeapObject" : { + "_0" : "TagHolderReference" + } + } + } + } + }, + { + "abiName" : "bjs_roundTripCoordinate", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "name" : "roundTripCoordinate", + "parameters" : [ + { + "label" : "_", + "name" : "coordinate", + "type" : { + "alias" : { + "name" : "Coordinate", + "underlying" : { + "swiftStruct" : { + "_0" : "JSCoordinate" } } } - ], - "name" : "optNestedEnum" - }, + } + } + ], + "returnType" : { + "alias" : { + "name" : "Coordinate", + "underlying" : { + "swiftStruct" : { + "_0" : "JSCoordinate" + } + } + } + } + }, + { + "abiName" : "bjs_roundTripPriority", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "name" : "roundTripPriority", + "parameters" : [ { - "associatedValues" : [ - { - "type" : { - "nullable" : { - "_0" : { - "array" : { - "_0" : { - "integer" : { - "_0" : { - "isSigned" : true, - "width" : "word" - } - } - } - } - }, - "_1" : "null" + "label" : "_", + "name" : "priority", + "type" : { + "alias" : { + "name" : "Priority", + "underlying" : { + "swiftHeapObject" : { + "_0" : "PriorityReference" } } } - ], - "name" : "optArray" - }, + } + } + ], + "returnType" : { + "alias" : { + "name" : "Priority", + "underlying" : { + "swiftHeapObject" : { + "_0" : "PriorityReference" + } + } + } + } + }, + { + "abiName" : "bjs_roundTripAlert", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "name" : "roundTripAlert", + "parameters" : [ { - "associatedValues" : [ - { - "type" : { - "nullable" : { - "_0" : { - "jsObject" : { - "_0" : "Foo" - } - }, - "_1" : "null" + "label" : "_", + "name" : "alert", + "type" : { + "alias" : { + "name" : "Alert", + "underlying" : { + "caseEnum" : { + "_0" : "Severity" } } } - ], - "name" : "optJsClass" - }, - { - "associatedValues" : [ - - ], - "name" : "empty" + } } ], - "emitStyle" : "const", - "name" : "OptionalAllTypesResult", - "staticMethods" : [ - - ], - "staticProperties" : [ - + "returnType" : { + "alias" : { + "name" : "Alert", + "underlying" : { + "caseEnum" : { + "_0" : "Severity" + } + } + } + } + }, + { + "abiName" : "bjs_makeAlert", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "name" : "makeAlert", + "parameters" : [ + { + "label" : "_", + "name" : "level", + "type" : { + "caseEnum" : { + "_0" : "Severity" + } + } + } ], - "swiftCallName" : "OptionalAllTypesResult", - "tsFullPath" : "OptionalAllTypesResult" + "returnType" : { + "alias" : { + "name" : "Alert", + "underlying" : { + "caseEnum" : { + "_0" : "Severity" + } + } + } + } }, { - "cases" : [ + "abiName" : "bjs_roundTripSession", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "name" : "roundTripSession", + "parameters" : [ { - "associatedValues" : [ - { - "type" : { - "nullable" : { - "_0" : { - "string" : { - - } - }, - "_1" : "null" + "label" : "_", + "name" : "session", + "type" : { + "alias" : { + "name" : "Session", + "underlying" : { + "swiftStruct" : { + "_0" : "SessionState" } } } - ], - "name" : "success" - }, + } + } + ], + "returnType" : { + "alias" : { + "name" : "Session", + "underlying" : { + "swiftStruct" : { + "_0" : "SessionState" + } + } + } + } + }, + { + "abiName" : "bjs_makeSession", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "name" : "makeSession", + "parameters" : [ { - "associatedValues" : [ - { - "type" : { - "nullable" : { - "_0" : { - "integer" : { - "_0" : { - "isSigned" : true, - "width" : "word" - } - } - }, - "_1" : "null" - } - } - }, - { - "type" : { - "nullable" : { - "_0" : { - "bool" : { + "label" : "_", + "name" : "token", + "type" : { + "string" : { - } - }, - "_1" : "null" - } - } } - ], - "name" : "failure" - }, + } + } + ], + "returnType" : { + "alias" : { + "name" : "Session", + "underlying" : { + "swiftStruct" : { + "_0" : "SessionState" + } + } + } + } + }, + { + "abiName" : "bjs_roundTripShape", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "name" : "roundTripShape", + "parameters" : [ { - "associatedValues" : [ - { - "type" : { - "nullable" : { - "_0" : { - "bool" : { - - } - }, - "_1" : "null" - } - } - }, - { - "type" : { - "nullable" : { - "_0" : { - "integer" : { - "_0" : { - "isSigned" : true, - "width" : "word" - } - } - }, - "_1" : "null" - } - } - }, - { - "type" : { - "nullable" : { - "_0" : { - "string" : { - - } - }, - "_1" : "null" - } - } + "label" : "_", + "name" : "s", + "type" : { + "associatedValueEnum" : { + "_0" : "Shape" } - ], - "name" : "status" + } } ], - "emitStyle" : "const", - "name" : "APIOptionalResult", - "staticMethods" : [ - + "returnType" : { + "associatedValueEnum" : { + "_0" : "Shape" + } + } + }, + { + "abiName" : "bjs_makeShapePolygon", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "name" : "makeShapePolygon", + "parameters" : [ + { + "label" : "_", + "name" : "polygon", + "type" : { + "alias" : { + "name" : "Polygon", + "underlying" : { + "swiftHeapObject" : { + "_0" : "PolygonReference" + } + } + } + } + } ], - "staticProperties" : [ + "returnType" : { + "associatedValueEnum" : { + "_0" : "Shape" + } + } + }, + { + "abiName" : "bjs_makeShapeEmpty", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "name" : "makeShapeEmpty", + "parameters" : [ ], - "swiftCallName" : "APIOptionalResult", - "tsFullPath" : "APIOptionalResult" - } - ], - "exposeToGlobal" : false, - "functions" : [ + "returnType" : { + "associatedValueEnum" : { + "_0" : "Shape" + } + } + }, { "abiName" : "bjs_roundTripVoid", "effects" : { @@ -15130,6 +16639,101 @@ } ], "structs" : [ + { + "constructor" : { + "abiName" : "bjs_JSCoordinate_init", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "parameters" : [ + { + "label" : "latitude", + "name" : "latitude", + "type" : { + "double" : { + + } + } + }, + { + "label" : "longitude", + "name" : "longitude", + "type" : { + "double" : { + + } + } + } + ] + }, + "methods" : [ + + ], + "name" : "JSCoordinate", + "properties" : [ + { + "isReadonly" : true, + "isStatic" : false, + "name" : "latitude", + "type" : { + "double" : { + + } + } + }, + { + "isReadonly" : true, + "isStatic" : false, + "name" : "longitude", + "type" : { + "double" : { + + } + } + } + ], + "swiftCallName" : "JSCoordinate" + }, + { + "constructor" : { + "abiName" : "bjs_SessionState_init", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "parameters" : [ + { + "label" : "token", + "name" : "token", + "type" : { + "string" : { + + } + } + } + ] + }, + "methods" : [ + + ], + "name" : "SessionState", + "properties" : [ + { + "isReadonly" : true, + "isStatic" : false, + "name" : "token", + "type" : { + "string" : { + + } + } + } + ], + "swiftCallName" : "SessionState" + }, { "methods" : [ @@ -16724,98 +18328,394 @@ } } } - } - } - ], - "returnType" : { - "integer" : { - "_0" : { - "isSigned" : true, - "width" : "word" - } - } - } - }, - { - "abiName" : "bjs_ArrayMembers_firstString", - "effects" : { - "isAsync" : false, - "isStatic" : false, - "isThrows" : false - }, - "name" : "firstString", - "parameters" : [ - { - "label" : "_", - "name" : "values", - "type" : { - "array" : { - "_0" : { + } + } + ], + "returnType" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + } + }, + { + "abiName" : "bjs_ArrayMembers_firstString", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : false + }, + "name" : "firstString", + "parameters" : [ + { + "label" : "_", + "name" : "values", + "type" : { + "array" : { + "_0" : { + "string" : { + + } + } + } + } + } + ], + "returnType" : { + "nullable" : { + "_0" : { + "string" : { + + } + }, + "_1" : "null" + } + } + } + ], + "name" : "ArrayMembers", + "properties" : [ + { + "isReadonly" : true, + "isStatic" : false, + "name" : "ints", + "type" : { + "array" : { + "_0" : { + "integer" : { + "_0" : { + "isSigned" : true, + "width" : "word" + } + } + } + } + } + }, + { + "isReadonly" : true, + "isStatic" : false, + "name" : "optStrings", + "type" : { + "nullable" : { + "_0" : { + "array" : { + "_0" : { + "string" : { + + } + } + } + }, + "_1" : "null" + } + } + } + ], + "swiftCallName" : "ArrayMembers" + } + ] + }, + "imported" : { + "children" : [ + { + "functions" : [ + + ], + "types" : [ + { + "accessLevel" : "internal", + "constructor" : { + "accessLevel" : "internal", + "parameters" : [ + { + "name" : "label", + "type" : { + "string" : { + + } + } + } + ] + }, + "getters" : [ + { + "accessLevel" : "internal", + "name" : "label", + "type" : { + "string" : { + + } + } + } + ], + "methods" : [ + + ], + "name" : "Surface", + "setters" : [ + + ], + "staticMethods" : [ + + ] + }, + { + "accessLevel" : "internal", + "getters" : [ + + ], + "methods" : [ + + ], + "name" : "AliasImports", + "setters" : [ + + ], + "staticMethods" : [ + { + "accessLevel" : "internal", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : true + }, + "name" : "jsRoundTripTagged", + "parameters" : [ + { + "name" : "value", + "type" : { + "alias" : { + "name" : "Tagged", + "underlying" : { + "string" : { + + } + } + } + } + } + ], + "returnType" : { + "alias" : { + "name" : "Tagged", + "underlying" : { "string" : { } } } } - } - ], - "returnType" : { - "nullable" : { - "_0" : { - "string" : { + }, + { + "accessLevel" : "internal", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : true + }, + "name" : "jsRoundTripOptionalTagged", + "parameters" : [ + { + "name" : "value", + "type" : { + "nullable" : { + "_0" : { + "alias" : { + "name" : "Tagged", + "underlying" : { + "string" : { + + } + } + } + }, + "_1" : "null" + } + } + } + ], + "returnType" : { + "nullable" : { + "_0" : { + "alias" : { + "name" : "Tagged", + "underlying" : { + "string" : { + } + } + } + }, + "_1" : "null" } + } + }, + { + "accessLevel" : "internal", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : true }, - "_1" : "null" - } - } - } - ], - "name" : "ArrayMembers", - "properties" : [ - { - "isReadonly" : true, - "isStatic" : false, - "name" : "ints", - "type" : { - "array" : { - "_0" : { - "integer" : { - "_0" : { - "isSigned" : true, - "width" : "word" + "name" : "jsProduceOptionalCanvas", + "parameters" : [ + { + "name" : "label", + "type" : { + "nullable" : { + "_0" : { + "string" : { + + } + }, + "_1" : "null" + } } } + ], + "returnType" : { + "nullable" : { + "_0" : { + "alias" : { + "name" : "Canvas", + "underlying" : { + "jsObject" : { + "_0" : "Surface" + } + } + } + }, + "_1" : "null" + } } - } - } - }, - { - "isReadonly" : true, - "isStatic" : false, - "name" : "optStrings", - "type" : { - "nullable" : { - "_0" : { + }, + { + "accessLevel" : "internal", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : true + }, + "name" : "jsRoundTripAliasedTags", + "parameters" : [ + { + "name" : "values", + "type" : { + "array" : { + "_0" : { + "nullable" : { + "_0" : { + "alias" : { + "name" : "AliasedTag", + "underlying" : { + "associatedValueEnum" : { + "_0" : "InnerTag" + } + } + } + }, + "_1" : "null" + } + } + } + } + } + ], + "returnType" : { "array" : { "_0" : { - "string" : { - + "nullable" : { + "_0" : { + "alias" : { + "name" : "AliasedTag", + "underlying" : { + "associatedValueEnum" : { + "_0" : "InnerTag" + } + } + } + }, + "_1" : "null" } } } + } + }, + { + "accessLevel" : "internal", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : true }, - "_1" : "null" + "name" : "jsRoundTripPolygon", + "parameters" : [ + { + "name" : "value", + "type" : { + "alias" : { + "name" : "Polygon", + "underlying" : { + "swiftHeapObject" : { + "_0" : "PolygonReference" + } + } + } + } + } + ], + "returnType" : { + "alias" : { + "name" : "Polygon", + "underlying" : { + "swiftHeapObject" : { + "_0" : "PolygonReference" + } + } + } + } + }, + { + "accessLevel" : "internal", + "effects" : { + "isAsync" : false, + "isStatic" : false, + "isThrows" : true + }, + "name" : "jsRoundTripCoordinate", + "parameters" : [ + { + "name" : "value", + "type" : { + "alias" : { + "name" : "Coordinate", + "underlying" : { + "swiftStruct" : { + "_0" : "JSCoordinate" + } + } + } + } + } + ], + "returnType" : { + "alias" : { + "name" : "Coordinate", + "underlying" : { + "swiftStruct" : { + "_0" : "JSCoordinate" + } + } + } + } } - } + ] } - ], - "swiftCallName" : "ArrayMembers" - } - ] - }, - "imported" : { - "children" : [ + ] + }, { "functions" : [ @@ -19147,6 +21047,23 @@ } } }, + { + "accessLevel" : "internal", + "effects" : { + "isAsync" : true, + "isStatic" : false, + "isThrows" : true + }, + "name" : "runAliasAsyncWorks", + "parameters" : [ + + ], + "returnType" : { + "void" : { + + } + } + }, { "accessLevel" : "internal", "effects" : { diff --git a/Tests/BridgeJSRuntimeTests/JavaScript/AliasTests.mjs b/Tests/BridgeJSRuntimeTests/JavaScript/AliasTests.mjs new file mode 100644 index 000000000..db6225b21 --- /dev/null +++ b/Tests/BridgeJSRuntimeTests/JavaScript/AliasTests.mjs @@ -0,0 +1,357 @@ +// @ts-check +import assert from "node:assert"; + +export class Surface { + constructor(label) { + this.label = label; + } +}; + +/** + * @returns {import('../../../.build/plugins/PackageToJS/outputs/PackageTests/bridge-js.d.ts').Imports["AliasImports"]} + */ +export function getImports(importsContext) { + return { + jsRoundTripTagged: (value) => { + return value; + }, + jsRoundTripOptionalTagged: (value) => { + return value ?? null; + }, + jsProduceOptionalCanvas: (label) => { + if (label === null || label === undefined) return null; + return new Surface(label); + }, + jsRoundTripAliasedTags: (values) => { + return values.map((tag) => tag ?? null); + }, + jsRoundTripPolygon: (value) => { + return value; + }, + jsRoundTripCoordinate: (value) => { + return { ...value }; + }, + }; +} + +/** + * @param {import('../../../.build/plugins/PackageToJS/outputs/PackageTests/bridge-js.d.ts').Exports} exports + */ +export function runAliasWorks(exports) { + runBasicRoundTrip(exports); + runOptional(exports); + runMethodsOnTarget(exports); + runStaticReturn(exports); + runMultipleAliases(exports); + runArrays(exports); + runThrows(exports); + runNonCopyable(exports); + runClosureWithAliasParameter(exports); + runOptionalInArray(exports); + runClassPropertyAndInitWithAlias(exports); + runAssociatedValueEnumPayload(exports); + runStructToStructAlias(exports); + runStructToEnumAlias(exports); + runClassToStructAlias(exports); + runEnumToClassAlias(exports); +} + +export async function runAliasAsyncWorks(exports) { + await runAsyncReturningAlias(exports); +} + +/** + * @param {import('../../../.build/plugins/PackageToJS/outputs/PackageTests/bridge-js.d.ts').Exports} exports + */ +function runBasicRoundTrip(exports) { + const seed = new exports.PolygonReference([1, 2, 3], "seed"); + assert.equal(seed.vertexCount(), 3); + assert.equal(seed.summary(), "seed(3)"); + + const roundtrip = exports.roundTripPolygon(seed); + assert.equal(roundtrip.vertexCount(), 3); + assert.equal(roundtrip.summary(), "seed(3)"); + + assert.equal(exports.polygonVertexCount(seed), 3); + + const appended = exports.appendVertex(seed, 4); + assert.equal(appended.vertexCount(), 4); + assert.equal(appended.summary(), "seed(4)"); + + seed.release(); + roundtrip.release(); + appended.release(); +} + +/** + * @param {import('../../../.build/plugins/PackageToJS/outputs/PackageTests/bridge-js.d.ts').Exports} exports + */ +function runOptional(exports) { + assert.equal(exports.optionalRoundTripPolygon(null), null); + + const original = new exports.PolygonReference([7, 8, 9], "opt"); + const echoed = exports.optionalRoundTripPolygon(original); + assert.notEqual(echoed, null); + if (echoed) { + assert.equal(echoed.vertexCount(), 3); + echoed.release(); + } + original.release(); +} + +/** + * @param {import('../../../.build/plugins/PackageToJS/outputs/PackageTests/bridge-js.d.ts').Exports} exports + */ +function runMethodsOnTarget(exports) { + const a = new exports.PolygonReference([1, 2], "a"); + + const snap = a.snapshot(); + assert.equal(snap.summary(), "a(2)"); + + const b = new exports.PolygonReference([3, 4, 5], "b"); + const merged = a.merge(b); + assert.equal(merged.vertexCount(), 5); + assert.equal(merged.summary(), "a(5)"); + + a.release(); + b.release(); + snap.release(); + merged.release(); +} + +/** + * @param {import('../../../.build/plugins/PackageToJS/outputs/PackageTests/bridge-js.d.ts').Exports} exports + */ +function runStaticReturn(exports) { + const o = exports.PolygonReference.origin("o"); + assert.equal(o.vertexCount(), 0); + assert.equal(o.summary(), "o(0)"); + o.release(); +} + +/** + * @param {import('../../../.build/plugins/PackageToJS/outputs/PackageTests/bridge-js.d.ts').Exports} exports + */ +function runMultipleAliases(exports) { + const tag = exports.makeTag("hello"); + assert.equal(tag.describe(), "tag:hello"); + tag.release(); +} + +/** + * @param {import('../../../.build/plugins/PackageToJS/outputs/PackageTests/bridge-js.d.ts').Exports} exports + */ +function runArrays(exports) { + const a = new exports.PolygonReference([1], "a"); + const b = new exports.PolygonReference([2, 3], "b"); + const c = new exports.PolygonReference([4, 5, 6], "c"); + + const roundtripped = exports.roundTripPolygonArray([a, b, c]); + assert.equal(roundtripped.length, 3); + assert.equal(roundtripped[0].vertexCount(), 1); + assert.equal(roundtripped[1].vertexCount(), 2); + assert.equal(roundtripped[2].vertexCount(), 3); + assert.equal(roundtripped[0].summary(), "a(1)"); + assert.equal(roundtripped[1].summary(), "b(2)"); + assert.equal(roundtripped[2].summary(), "c(3)"); + + const combined = exports.concatPolygons([a, b, c]); + assert.equal(combined.vertexCount(), 6); + assert.equal(combined.summary(), "concat(6)"); + + const empty = exports.roundTripPolygonArray([]); + assert.equal(empty.length, 0); + + const split = exports.splitPolygon(combined); + assert.equal(split.length, 6); + for (const piece of split) { + assert.equal(piece.vertexCount(), 1); + piece.release(); + } + + a.release(); + b.release(); + c.release(); + combined.release(); + for (const r of roundtripped) r.release(); +} + +/** + * @param {import('../../../.build/plugins/PackageToJS/outputs/PackageTests/bridge-js.d.ts').Exports} exports + */ +function runThrows(exports) { + const valid = new exports.PolygonReference([1, 2], "v"); + const echoed = exports.validatePolygon(valid); + assert.equal(echoed.summary(), "v(2)"); + echoed.release(); + valid.release(); + + const empty = new exports.PolygonReference([], "empty"); + assert.throws(() => exports.validatePolygon(empty), /empty polygon/); + empty.release(); +} + +/** + * @param {import('../../../.build/plugins/PackageToJS/outputs/PackageTests/bridge-js.d.ts').Exports} exports + */ +function runNonCopyable(exports) { + const seed = exports.makeToken(7); + assert.equal(seed.read(), 7); + + const next = exports.incrementToken(seed); + assert.equal(next.read(), 8); + + next.release(); + seed.release(); +} + +/** + * @param {import('../../../.build/plugins/PackageToJS/outputs/PackageTests/bridge-js.d.ts').Exports} exports + */ +function runClosureWithAliasParameter(exports) { + const inspector = exports.makePolygonInspector(); + const poly = new exports.PolygonReference([10, 20, 30, 40], "inspect"); + assert.equal(inspector(poly), 4); + poly.release(); +} + +/** + * @param {import('../../../.build/plugins/PackageToJS/outputs/PackageTests/bridge-js.d.ts').Exports} exports + */ +function runOptionalInArray(exports) { + const a = new exports.PolygonReference([1], "a"); + const b = new exports.PolygonReference([2, 3], "b"); + + const echoed = exports.roundTripOptionalPolygonArray([a, null, b, null]); + assert.equal(echoed.length, 4); + assert.notEqual(echoed[0], null); + assert.equal(echoed[1], null); + assert.notEqual(echoed[2], null); + assert.equal(echoed[3], null); + if (echoed[0]) { + assert.equal(echoed[0].vertexCount(), 1); + } + if (echoed[2]) { + assert.equal(echoed[2].vertexCount(), 2); + } + + a.release(); + b.release(); + for (const e of echoed) { + if (e) { + e.release(); + } + } +} + +/** + * @param {import('../../../.build/plugins/PackageToJS/outputs/PackageTests/bridge-js.d.ts').Exports} exports + */ +function runClassPropertyAndInitWithAlias(exports) { + const made = exports.makeTagHolder("origin", 1); + assert.equal(made.describe(), "holder(origin, v1)"); + const initial = made.tag; + assert.equal(initial.describe(), "tag:origin"); + + const replacement = exports.makeTag("renamed"); + made.tag = replacement; + assert.equal(made.describe(), "holder(renamed, v1)"); + made.version = 7; + assert.equal(made.describe(), "holder(renamed, v7)"); + + const fresh = exports.makeTag("constructed"); + const ctor = new exports.TagHolderReference(fresh, 99); + assert.equal(ctor.describe(), "holder(constructed, v99)"); + + initial.release(); + replacement.release(); + fresh.release(); + made.release(); + ctor.release(); +} + +/** + * @param {import('../../../.build/plugins/PackageToJS/outputs/PackageTests/bridge-js.d.ts').Exports} exports + */ +function runAssociatedValueEnumPayload(exports) { + const poly = new exports.PolygonReference([1, 2, 3], "shape"); + const wrapped = exports.makeShapePolygon(poly); + assert.equal(wrapped.tag, exports.Shape.Tag.Polygon); + if (wrapped.tag === exports.Shape.Tag.Polygon) { + assert.equal(wrapped.param0.vertexCount(), 3); + } + + const echoed = exports.roundTripShape(wrapped); + assert.equal(echoed.tag, exports.Shape.Tag.Polygon); + if (echoed.tag === exports.Shape.Tag.Polygon) { + assert.equal(echoed.param0.vertexCount(), 3); + echoed.param0.release(); + } + + const empty = exports.makeShapeEmpty(); + assert.equal(empty.tag, exports.Shape.Tag.Empty); + const emptyEcho = exports.roundTripShape(empty); + assert.equal(emptyEcho.tag, exports.Shape.Tag.Empty); + + if (wrapped.tag === exports.Shape.Tag.Polygon) { + wrapped.param0.release(); + } + poly.release(); +} + +/** + * @param {import('../../../.build/plugins/PackageToJS/outputs/PackageTests/bridge-js.d.ts').Exports} exports + */ +function runStructToStructAlias(exports) { + const seed = { latitude: 45.5, longitude: -73.5 }; + const echoed = exports.roundTripCoordinate(seed); + assert.deepStrictEqual(echoed, seed); +} + +/** + * @param {import('../../../.build/plugins/PackageToJS/outputs/PackageTests/bridge-js.d.ts').Exports} exports + */ +function runStructToEnumAlias(exports) { + const made = exports.makeAlert(exports.Severity.Warning); + assert.equal(made, exports.Severity.Warning); + + const echoed = exports.roundTripAlert(exports.Severity.Error); + assert.equal(echoed, exports.Severity.Error); +} + +/** + * @param {import('../../../.build/plugins/PackageToJS/outputs/PackageTests/bridge-js.d.ts').Exports} exports + */ +function runClassToStructAlias(exports) { + const made = exports.makeSession("hello"); + assert.deepStrictEqual(made, { token: "hello" }); + + const echoed = exports.roundTripSession({ token: "world" }); + assert.deepStrictEqual(echoed, { token: "world" }); +} + +/** + * @param {import('../../../.build/plugins/PackageToJS/outputs/PackageTests/bridge-js.d.ts').Exports} exports + */ +function runEnumToClassAlias(exports) { + const seed = exports.PriorityReference.medium(); + assert.equal(seed.describe(), "medium"); + assert.equal(seed.weight(), 5); + + const echoed = exports.roundTripPriority(seed); + assert.equal(echoed.describe(), "medium"); + assert.equal(echoed.weight(), 5); + + seed.release(); + echoed.release(); +} + +/** + * @param {import('../../../.build/plugins/PackageToJS/outputs/PackageTests/bridge-js.d.ts').Exports} exports + */ +async function runAsyncReturningAlias(exports) { + const result = await exports.asyncMakePolygon("async"); + assert.equal(result.vertexCount(), 2); + assert.equal(result.summary(), "async(2)"); + result.release(); +} diff --git a/Tests/BridgeJSRuntimeTests/bridge-js.d.ts b/Tests/BridgeJSRuntimeTests/bridge-js.d.ts index 9fef391c1..582113df1 100644 --- a/Tests/BridgeJSRuntimeTests/bridge-js.d.ts +++ b/Tests/BridgeJSRuntimeTests/bridge-js.d.ts @@ -26,6 +26,8 @@ export class JsGreeter { export function runAsyncWorks(): Promise; +export function runAliasAsyncWorks(): Promise; + export interface WeatherData { temperature: number; description: string; diff --git a/Tests/prelude.mjs b/Tests/prelude.mjs index 2c922dbe2..2ca4a62d7 100644 --- a/Tests/prelude.mjs +++ b/Tests/prelude.mjs @@ -5,6 +5,7 @@ import { } from '../.build/plugins/PackageToJS/outputs/PackageTests/bridge-js.js'; import { ImportedFoo } from './BridgeJSRuntimeTests/JavaScript/Types.mjs'; import { runJsOptionalSupportTests } from './BridgeJSRuntimeTests/JavaScript/OptionalSupportTests.mjs'; +import { runAliasWorks, runAliasAsyncWorks, getImports as getAliasImports, Surface } from './BridgeJSRuntimeTests/JavaScript/AliasTests.mjs'; import { getImports as getClosureSupportImports } from './BridgeJSRuntimeTests/JavaScript/ClosureSupportTests.mjs'; import { getImports as getSwiftClassSupportImports } from './BridgeJSRuntimeTests/JavaScript/SwiftClassSupportTests.mjs'; import { getImports as getOptionalSupportImports } from './BridgeJSRuntimeTests/JavaScript/OptionalSupportTests.mjs'; @@ -96,6 +97,7 @@ export async function setupOptions(options, context) { }, ArrayElementObject, JSClassWithArrayMembers, + Surface, JsGreeter: class { /** * @param {string} name @@ -130,6 +132,14 @@ export async function setupOptions(options, context) { await runAsyncWorksTests(exports); return; }, + runAliasAsyncWorks: async () => { + const exports = importsContext.getExports(); + if (!exports) { + throw new Error("No exports!?"); + } + await runAliasAsyncWorks(exports); + return; + }, AsyncImportImports: getAsyncImportImports(importsContext), fetchWeatherData: (city) => { return Promise.resolve({ @@ -159,6 +169,7 @@ export async function setupOptions(options, context) { IntegerTypesSupportImports: getIntegerTypesSupportImports(importsContext), JSTypedArrayImports: getJSTypedArrayImports(importsContext), IdentityModeTestImports: getIdentityModeTestImports(importsContext), + AliasImports: getAliasImports(importsContext), }; }, addToCoreImports(importObject, importsContext) { @@ -182,6 +193,13 @@ export async function setupOptions(options, context) { } return BridgeJSRuntimeTests_runJsStructWorks(exports); } + bridgeJSRuntimeTests["runAliasWorks"] = () => { + const exports = getExports(); + if (!exports) { + throw new Error("No exports!?"); + } + runAliasWorks(exports); + } const bridgeJSGlobalTests = importObject["BridgeJSGlobalTests"] || {}; bridgeJSGlobalTests["runJsWorksGlobal"] = () => { return BridgeJSGlobalTests_runJsWorksGlobal();