Hyperloop 没有为@protocol header 生成javascript 绑定

Hyperloop not generating javascript binding for @protocol header

我的 shared.h 文件中包含以下定义,该文件包含在我正在开发的自定义框架中。

__attribute__((swift_name("FivestarsPayEventListener")))
@protocol SharedFivestarsPayEventListener
@required
- (void)onFivestarsPayEventFivestarsPayEvent:(SharedFivestarsPayEvent *)fivestarsPayEvent __attribute__((swift_name("onFivestarsPayEvent(fivestarsPayEvent:)")));
@end;

当我构建项目时,生成了大部分绑定(它们被注释为@interface)。

为什么 appcelerator 不为 @protocol 注释的 header 生成绑定?

您可以看到生成了许多其他 javascript 绑定。例如,sharedaction 是这样定义的

__attribute__((objc_subclassing_restricted))
__attribute__((swift_name("Action")))
@interface SharedAction : SharedKotlinEnum<SharedAction *>
+ (instancetype)alloc __attribute__((unavailable));
+ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable));
- (instancetype)initWithName:(NSString *)name ordinal:(int32_t)ordinal __attribute__((swift_name("init(name:ordinal:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable));
@property (class, readonly) SharedAction *getFullPath __attribute__((swift_name("getFullPath")));
@property (class, readonly) SharedAction *removeFile __attribute__((swift_name("removeFile")));
@property (class, readonly) SharedAction *writeToFile __attribute__((swift_name("writeToFile")));
@property (class, readonly) SharedAction *writeBytesToFile __attribute__((swift_name("writeBytesToFile")));
@property (class, readonly) SharedAction *readFile __attribute__((swift_name("readFile")));
@property (class, readonly) SharedAction *readFileCompressed __attribute__((swift_name("readFileCompressed")));
@property (class, readonly) SharedAction *getFiles __attribute__((swift_name("getFiles")));
@end;

接口是您定义 class 的成员和方法的地方。您也必须负责实施。 协议就像 java.

的接口

@dazza5000 添加的其他信息:

The protocol definition could still be generated by Hyperloop, but it is not. I had manually create the interface implementation and then I could use them with the rest of the hyperloop generated bindings.