g***@qq.com
g***@qq.com
  • 发布:2025-03-06 14:20
  • 更新:2025-03-06 15:49
  • 阅读:52

uts插件开发,index.uts里定义的枚举,不能作为公共方法的出入参吗?

分类:uts

在插件的index.uts里定义了如下枚举:

export enum EMMAuthType {  
    trad,  
    reVerify,  
    auto  
}

定义的类和方法:

export class EMMAuthUtil {  
    static setAuthType(type : EMMAuthType) {  
        ESAuthUtil.setAuthType(type.rawValue)  
    }  

    static getAuthType() : EMMAuthType {  
        const rawValue = ESAuthUtil.authType()  
        return EMMAuthType[rawValue]  
    }  
}

编译时报错:

14:15:49.975 error: method cannot be declared public because its parameter uses an internal type  
14:15:49.975 at uni_modules/emm-sdk/utssdk/app-ios/index.uts:72:8  
14:15:49.975 70 |   }  
14:15:49.975 71 |    
14:15:49.975 72 |   static setAuthType(type : EMMAuthType) {  
14:15:49.975    |          ^  
14:15:49.975 73 |    ESAuthUtil.setAuthType(type.rawValue)  
14:15:49.975 74 |   }  
14:15:49.975 method cannot be declared public because its result uses an internal type  
14:15:49.975 at uni_modules/emm-sdk/utssdk/app-ios/index.uts:76:8  
14:15:49.975 74 |   }  
14:15:49.975 75 |    
14:15:49.975 76 |   static getAuthType() : EMMAuthType {  
14:15:49.975    |          ^  
14:15:49.975 77 |    const rawValue = ESAuthUtil.authType()  
14:15:49.975 78 |    return EMMAuthType[rawValue]  
14:15:49.975 uni_modules/emm-sdk/utssdk/app-ios/src/index.swift:108:24: error: method cannot be declared public because its parameter uses an internal type  
14:15:49.975 uni_modules/emm-sdk/utssdk/app-ios/src/index.swift:111:24: error: method cannot be declared public because its result uses an internal type
2025-03-06 14:20 负责人:无 分享
已邀请:
g***@qq.com

g***@qq.com (作者)

  1. 是不是utssdk/app-ios/index.uts会被转义成swift?
  2. 是不是需要给外部*.uvue和这个index.uts调用的并且作为入参和出参的类和interface等,需要放在utssdk/interface.uts里?
    但是我发现在interface.uts里定义的export enum仍然无法被访问。

要回复问题请先登录注册