|
| 1 | +#import <Foundation/NSArray.h> |
| 2 | +#import <Foundation/NSDictionary.h> |
| 3 | +#import <Foundation/NSError.h> |
| 4 | +#import <Foundation/NSObject.h> |
| 5 | +#import <Foundation/NSSet.h> |
| 6 | +#import <Foundation/NSString.h> |
| 7 | +#import <Foundation/NSValue.h> |
| 8 | + |
| 9 | +@class SharedCalculatorCompanion; |
| 10 | + |
| 11 | +NS_ASSUME_NONNULL_BEGIN |
| 12 | +#pragma clang diagnostic push |
| 13 | +#pragma clang diagnostic ignored "-Wunknown-warning-option" |
| 14 | +#pragma clang diagnostic ignored "-Wincompatible-property-type" |
| 15 | +#pragma clang diagnostic ignored "-Wnullability" |
| 16 | + |
| 17 | +#pragma push_macro("_Nullable_result") |
| 18 | +#if !__has_feature(nullability_nullable_result) |
| 19 | +#undef _Nullable_result |
| 20 | +#define _Nullable_result _Nullable |
| 21 | +#endif |
| 22 | + |
| 23 | +__attribute__((swift_name("KotlinBase"))) |
| 24 | +@interface SharedBase : NSObject |
| 25 | +- (instancetype)init __attribute__((unavailable)); |
| 26 | ++ (instancetype)new __attribute__((unavailable)); |
| 27 | ++ (void)initialize __attribute__((objc_requires_super)); |
| 28 | +@end |
| 29 | + |
| 30 | +@interface SharedBase (SharedBaseCopying) <NSCopying> |
| 31 | +@end |
| 32 | + |
| 33 | +__attribute__((swift_name("KotlinMutableSet"))) |
| 34 | +@interface SharedMutableSet<ObjectType> : NSMutableSet<ObjectType> |
| 35 | +@end |
| 36 | + |
| 37 | +__attribute__((swift_name("KotlinMutableDictionary"))) |
| 38 | +@interface SharedMutableDictionary<KeyType, ObjectType> : NSMutableDictionary<KeyType, ObjectType> |
| 39 | +@end |
| 40 | + |
| 41 | +@interface NSError (NSErrorSharedKotlinException) |
| 42 | +@property (readonly) id _Nullable kotlinException; |
| 43 | +@end |
| 44 | + |
| 45 | +__attribute__((swift_name("KotlinNumber"))) |
| 46 | +@interface SharedNumber : NSNumber |
| 47 | +- (instancetype)initWithChar:(char)value __attribute__((unavailable)); |
| 48 | +- (instancetype)initWithUnsignedChar:(unsigned char)value __attribute__((unavailable)); |
| 49 | +- (instancetype)initWithShort:(short)value __attribute__((unavailable)); |
| 50 | +- (instancetype)initWithUnsignedShort:(unsigned short)value __attribute__((unavailable)); |
| 51 | +- (instancetype)initWithInt:(int)value __attribute__((unavailable)); |
| 52 | +- (instancetype)initWithUnsignedInt:(unsigned int)value __attribute__((unavailable)); |
| 53 | +- (instancetype)initWithLong:(long)value __attribute__((unavailable)); |
| 54 | +- (instancetype)initWithUnsignedLong:(unsigned long)value __attribute__((unavailable)); |
| 55 | +- (instancetype)initWithLongLong:(long long)value __attribute__((unavailable)); |
| 56 | +- (instancetype)initWithUnsignedLongLong:(unsigned long long)value __attribute__((unavailable)); |
| 57 | +- (instancetype)initWithFloat:(float)value __attribute__((unavailable)); |
| 58 | +- (instancetype)initWithDouble:(double)value __attribute__((unavailable)); |
| 59 | +- (instancetype)initWithBool:(BOOL)value __attribute__((unavailable)); |
| 60 | +- (instancetype)initWithInteger:(NSInteger)value __attribute__((unavailable)); |
| 61 | +- (instancetype)initWithUnsignedInteger:(NSUInteger)value __attribute__((unavailable)); |
| 62 | ++ (instancetype)numberWithChar:(char)value __attribute__((unavailable)); |
| 63 | ++ (instancetype)numberWithUnsignedChar:(unsigned char)value __attribute__((unavailable)); |
| 64 | ++ (instancetype)numberWithShort:(short)value __attribute__((unavailable)); |
| 65 | ++ (instancetype)numberWithUnsignedShort:(unsigned short)value __attribute__((unavailable)); |
| 66 | ++ (instancetype)numberWithInt:(int)value __attribute__((unavailable)); |
| 67 | ++ (instancetype)numberWithUnsignedInt:(unsigned int)value __attribute__((unavailable)); |
| 68 | ++ (instancetype)numberWithLong:(long)value __attribute__((unavailable)); |
| 69 | ++ (instancetype)numberWithUnsignedLong:(unsigned long)value __attribute__((unavailable)); |
| 70 | ++ (instancetype)numberWithLongLong:(long long)value __attribute__((unavailable)); |
| 71 | ++ (instancetype)numberWithUnsignedLongLong:(unsigned long long)value __attribute__((unavailable)); |
| 72 | ++ (instancetype)numberWithFloat:(float)value __attribute__((unavailable)); |
| 73 | ++ (instancetype)numberWithDouble:(double)value __attribute__((unavailable)); |
| 74 | ++ (instancetype)numberWithBool:(BOOL)value __attribute__((unavailable)); |
| 75 | ++ (instancetype)numberWithInteger:(NSInteger)value __attribute__((unavailable)); |
| 76 | ++ (instancetype)numberWithUnsignedInteger:(NSUInteger)value __attribute__((unavailable)); |
| 77 | +@end |
| 78 | + |
| 79 | +__attribute__((swift_name("KotlinByte"))) |
| 80 | +@interface SharedByte : SharedNumber |
| 81 | +- (instancetype)initWithChar:(char)value; |
| 82 | ++ (instancetype)numberWithChar:(char)value; |
| 83 | +@end |
| 84 | + |
| 85 | +__attribute__((swift_name("KotlinUByte"))) |
| 86 | +@interface SharedUByte : SharedNumber |
| 87 | +- (instancetype)initWithUnsignedChar:(unsigned char)value; |
| 88 | ++ (instancetype)numberWithUnsignedChar:(unsigned char)value; |
| 89 | +@end |
| 90 | + |
| 91 | +__attribute__((swift_name("KotlinShort"))) |
| 92 | +@interface SharedShort : SharedNumber |
| 93 | +- (instancetype)initWithShort:(short)value; |
| 94 | ++ (instancetype)numberWithShort:(short)value; |
| 95 | +@end |
| 96 | + |
| 97 | +__attribute__((swift_name("KotlinUShort"))) |
| 98 | +@interface SharedUShort : SharedNumber |
| 99 | +- (instancetype)initWithUnsignedShort:(unsigned short)value; |
| 100 | ++ (instancetype)numberWithUnsignedShort:(unsigned short)value; |
| 101 | +@end |
| 102 | + |
| 103 | +__attribute__((swift_name("KotlinInt"))) |
| 104 | +@interface SharedInt : SharedNumber |
| 105 | +- (instancetype)initWithInt:(int)value; |
| 106 | ++ (instancetype)numberWithInt:(int)value; |
| 107 | +@end |
| 108 | + |
| 109 | +__attribute__((swift_name("KotlinUInt"))) |
| 110 | +@interface SharedUInt : SharedNumber |
| 111 | +- (instancetype)initWithUnsignedInt:(unsigned int)value; |
| 112 | ++ (instancetype)numberWithUnsignedInt:(unsigned int)value; |
| 113 | +@end |
| 114 | + |
| 115 | +__attribute__((swift_name("KotlinLong"))) |
| 116 | +@interface SharedLong : SharedNumber |
| 117 | +- (instancetype)initWithLongLong:(long long)value; |
| 118 | ++ (instancetype)numberWithLongLong:(long long)value; |
| 119 | +@end |
| 120 | + |
| 121 | +__attribute__((swift_name("KotlinULong"))) |
| 122 | +@interface SharedULong : SharedNumber |
| 123 | +- (instancetype)initWithUnsignedLongLong:(unsigned long long)value; |
| 124 | ++ (instancetype)numberWithUnsignedLongLong:(unsigned long long)value; |
| 125 | +@end |
| 126 | + |
| 127 | +__attribute__((swift_name("KotlinFloat"))) |
| 128 | +@interface SharedFloat : SharedNumber |
| 129 | +- (instancetype)initWithFloat:(float)value; |
| 130 | ++ (instancetype)numberWithFloat:(float)value; |
| 131 | +@end |
| 132 | + |
| 133 | +__attribute__((swift_name("KotlinDouble"))) |
| 134 | +@interface SharedDouble : SharedNumber |
| 135 | +- (instancetype)initWithDouble:(double)value; |
| 136 | ++ (instancetype)numberWithDouble:(double)value; |
| 137 | +@end |
| 138 | + |
| 139 | +__attribute__((swift_name("KotlinBoolean"))) |
| 140 | +@interface SharedBoolean : SharedNumber |
| 141 | +- (instancetype)initWithBool:(BOOL)value; |
| 142 | ++ (instancetype)numberWithBool:(BOOL)value; |
| 143 | +@end |
| 144 | + |
| 145 | +__attribute__((objc_subclassing_restricted)) |
| 146 | +__attribute__((swift_name("Calculator"))) |
| 147 | +@interface SharedCalculator : SharedBase |
| 148 | +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); |
| 149 | ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); |
| 150 | +@property (class, readonly, getter=companion) SharedCalculatorCompanion *companion __attribute__((swift_name("companion"))); |
| 151 | +@end |
| 152 | + |
| 153 | +__attribute__((objc_subclassing_restricted)) |
| 154 | +__attribute__((swift_name("Calculator.Companion"))) |
| 155 | +@interface SharedCalculatorCompanion : SharedBase |
| 156 | ++ (instancetype)alloc __attribute__((unavailable)); |
| 157 | ++ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable)); |
| 158 | ++ (instancetype)companion __attribute__((swift_name("init()"))); |
| 159 | +@property (class, readonly, getter=shared) SharedCalculatorCompanion *shared __attribute__((swift_name("shared"))); |
| 160 | +- (int32_t)sumA:(int32_t)a b:(int32_t)b __attribute__((swift_name("sum(a:b:)"))); |
| 161 | +@end |
| 162 | + |
| 163 | +__attribute__((objc_subclassing_restricted)) |
| 164 | +__attribute__((swift_name("Greeting"))) |
| 165 | +@interface SharedGreeting : SharedBase |
| 166 | +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); |
| 167 | ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); |
| 168 | +- (NSString *)greeting __attribute__((swift_name("greeting()"))); |
| 169 | +@end |
| 170 | + |
| 171 | +__attribute__((objc_subclassing_restricted)) |
| 172 | +__attribute__((swift_name("Platform"))) |
| 173 | +@interface SharedPlatform : SharedBase |
| 174 | +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); |
| 175 | ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); |
| 176 | +@property (readonly) NSString *platform __attribute__((swift_name("platform"))); |
| 177 | +@end |
| 178 | + |
| 179 | +#pragma pop_macro("_Nullable_result") |
| 180 | +#pragma clang diagnostic pop |
| 181 | +NS_ASSUME_NONNULL_END |
0 commit comments