[ObjCExport] Split ObjCExport into K1 and Analysis Api implementation
FL-23390 ^KT-64168 Fixed
This commit is contained in:
committed by
Space Team
parent
3e57265fcb
commit
e409c60780
+85
@@ -0,0 +1,85 @@
|
||||
#import <Foundation/NSArray.h>
|
||||
#import <Foundation/NSDictionary.h>
|
||||
#import <Foundation/NSError.h>
|
||||
#import <Foundation/NSObject.h>
|
||||
#import <Foundation/NSSet.h>
|
||||
#import <Foundation/NSString.h>
|
||||
#import <Foundation/NSValue.h>
|
||||
|
||||
@class EnumCompanion, Enum<E>, Foo, Array<T>;
|
||||
|
||||
@protocol Comparable, Iterator;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wunknown-warning-option"
|
||||
#pragma clang diagnostic ignored "-Wincompatible-property-type"
|
||||
#pragma clang diagnostic ignored "-Wnullability"
|
||||
|
||||
#pragma push_macro("_Nullable_result")
|
||||
#if !__has_feature(nullability_nullable_result)
|
||||
#undef _Nullable_result
|
||||
#define _Nullable_result _Nullable
|
||||
#endif
|
||||
|
||||
@protocol Comparable
|
||||
@required
|
||||
- (int32_t)compareToOther:(id _Nullable)other __attribute__((swift_name("compareTo(other:)")));
|
||||
@end
|
||||
|
||||
@interface Enum<E> : Base <Comparable>
|
||||
- (instancetype)initWithName:(NSString *)name ordinal:(int32_t)ordinal __attribute__((swift_name("init(name:ordinal:)"))) __attribute__((objc_designated_initializer));
|
||||
@property (class, readonly, getter=companion) EnumCompanion *companion __attribute__((swift_name("companion")));
|
||||
|
||||
/**
|
||||
* @note This method has protected visibility in Kotlin source and is intended only for use by subclasses.
|
||||
*/
|
||||
- (id)clone __attribute__((swift_name("clone()")));
|
||||
- (int32_t)compareToOther:(E)other __attribute__((swift_name("compareTo(other:)")));
|
||||
- (BOOL)isEqual:(id _Nullable)other __attribute__((swift_name("isEqual(_:)")));
|
||||
- (NSUInteger)hash __attribute__((swift_name("hash()")));
|
||||
- (NSString *)description __attribute__((swift_name("description()")));
|
||||
@property (readonly) NSString *name __attribute__((swift_name("name")));
|
||||
@property (readonly) int32_t ordinal __attribute__((swift_name("ordinal")));
|
||||
@end
|
||||
|
||||
__attribute__((objc_subclassing_restricted))
|
||||
@interface Foo : Enum<Foo *>
|
||||
+ (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) Foo *a __attribute__((swift_name("a")));
|
||||
@property (class, readonly) Foo *b __attribute__((swift_name("b")));
|
||||
@property (class, readonly) Foo *c __attribute__((swift_name("c")));
|
||||
+ (Array<Foo *> *)values __attribute__((swift_name("values()")));
|
||||
@property (class, readonly) NSArray<Foo *> *entries __attribute__((swift_name("entries")));
|
||||
@end
|
||||
|
||||
__attribute__((objc_subclassing_restricted))
|
||||
@interface EnumCompanion : Base
|
||||
+ (instancetype)alloc __attribute__((unavailable));
|
||||
+ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable));
|
||||
+ (instancetype)companion __attribute__((swift_name("init()")));
|
||||
@property (class, readonly, getter=shared) EnumCompanion *shared __attribute__((swift_name("shared")));
|
||||
@end
|
||||
|
||||
__attribute__((objc_subclassing_restricted))
|
||||
@interface Array<T> : Base
|
||||
+ (instancetype)arrayWithSize:(int32_t)size init:(T _Nullable (^)(Int *))init __attribute__((swift_name("init(size:init:)")));
|
||||
+ (instancetype)alloc __attribute__((unavailable));
|
||||
+ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable));
|
||||
- (T _Nullable)getIndex:(int32_t)index __attribute__((swift_name("get(index:)")));
|
||||
- (id<Iterator>)iterator __attribute__((swift_name("iterator()")));
|
||||
- (void)setIndex:(int32_t)index value:(T _Nullable)value __attribute__((swift_name("set(index:value:)")));
|
||||
@property (readonly) int32_t size __attribute__((swift_name("size")));
|
||||
@end
|
||||
|
||||
@protocol Iterator
|
||||
@required
|
||||
- (BOOL)hasNext __attribute__((swift_name("hasNext()")));
|
||||
- (id _Nullable)next __attribute__((swift_name("next()")));
|
||||
@end
|
||||
|
||||
#pragma pop_macro("_Nullable_result")
|
||||
#pragma clang diagnostic pop
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,3 @@
|
||||
enum class Foo {
|
||||
A, B, C
|
||||
}
|
||||
Reference in New Issue
Block a user