hunk.code_window:   public var resolver: ResolveClosure
     public var rejecter: RejectClosure
     public func resolve(_ value: Any? = nil) -> Void {
       resolver(value)
     }
  
hunk.labels: keep keep add keep keep keep keep
hunk.after_edit:   /**
      The rejecter that is compatible with the legacy `EXPromiseRejectBlock`.
      Necessary in some places not converted to Swift, such as `EXPermissionsMethodsDelegate`.
      */
     public var legacyRejecter: EXPromiseRejectBlock {
       return { code, description, error in
         reject(code ?? "", description ?? "")
       }
     }
  
hunk.file_path: packages/expo-modules-core/ios/Swift/Promise.swift
hunk.type: add
file: // Copyright 2018-present 650 Industries. All rights reserved.
  
  #import <objc/runtime.h>
  
  #import <ExpoModulesCore/EXViewManagerAdapterClassesRegistry.h>
  #import <ExpoModulesCore/EXViewManagerAdapter.h>
  
  static const NSString *viewManagerAdapterModuleNamePrefix = @"ViewManagerAdapter_";
  
  static IMP directEventBlockImplementation = nil;
  static dispatch_once_t directEventBlockImplementationOnceToken;
  
  @interface EXViewManagerAdapterClassesRegistry ()
  
  @property (nonatomic, strong) NSMutableDictionary<Class, Class> *viewManagerAdaptersClasses;
  
  @end
  
  @implementation EXViewManagerAdapterClassesRegistry
  
  - (instancetype)init
  {
    if (self = [super init]) {
      _viewManagerAdaptersClasses = [NSMutableDictionary dictionary];
    }
    return self;
  }
  
  - (Class)viewManagerAdapterClassForViewManager:(EXViewManager *)viewManager
  {
    Class viewManagerClass = [viewManager class];
    if (_viewManagerAdaptersClasses[viewManagerClass] == nil) {
      _viewManagerAdaptersClasses[(id <NSCopying>)viewManagerClass] = [self _createViewManagerAdapterClassForViewManager:viewManager];
    }
    return _viewManagerAdaptersClasses[viewManagerClass];
  }
  
  - (Class)_createViewManagerAdapterClassForViewManager:(EXViewManager *)viewManager
  {
    const char *viewManagerClassName = [[viewManagerAdapterModuleNamePrefix stringByAppendingString:[viewManager viewName]] UTF8String];
    Class viewManagerAdapterClass = objc_allocateClassPair([EXViewManagerAdapter class], viewManagerClassName, 0);
    [self _ensureDirectEventBlockImplementationIsPresent];
    for (NSString *eventName in [viewManager supportedEvents]) {
      class_addMethod(object_getClass(viewManagerAdapterClass), NSSelectorFromString([@"propConfig_" stringByAppendingString:eventName]), directEventBlockImplementation, "@@:");
    }
    return viewManagerAdapterClass;
  }
  
  - (void)_ensureDirectEventBlockImplementationIsPresent
  {
    dispatch_once(&directEventBlockImplementationOnceToken, ^{
      directEventBlockImplementation = imp_implementationWithBlock(^{
        return @[@"RCTDirectEventBlock"];
      });
    });
  }
  
  @end
  