1*ea3f1d02STomasz Sapeta // Copyright © 2018 650 Industries. All rights reserved.
2*ea3f1d02STomasz Sapeta 
3*ea3f1d02STomasz Sapeta #import <Foundation/Foundation.h>
4*ea3f1d02STomasz Sapeta 
5*ea3f1d02STomasz Sapeta #import <ExpoModulesCore/EXInternalModule.h>
6*ea3f1d02STomasz Sapeta #import <ExpoModulesCore/EXExportedModule.h>
7*ea3f1d02STomasz Sapeta #import <ExpoModulesCore/EXModuleRegistryDelegate.h>
8*ea3f1d02STomasz Sapeta 
9*ea3f1d02STomasz Sapeta NS_ASSUME_NONNULL_BEGIN
10*ea3f1d02STomasz Sapeta 
11*ea3f1d02STomasz Sapeta @interface EXModuleRegistry : NSObject
12*ea3f1d02STomasz Sapeta 
13*ea3f1d02STomasz Sapeta - (instancetype)initWithInternalModules:(NSSet<id<EXInternalModule>> *)internalModules
14*ea3f1d02STomasz Sapeta                         exportedModules:(NSSet<EXExportedModule *> *)exportedModules
15*ea3f1d02STomasz Sapeta                        singletonModules:(NSSet *)singletonModules;
16*ea3f1d02STomasz Sapeta 
17*ea3f1d02STomasz Sapeta - (void)registerInternalModule:(id<EXInternalModule>)internalModule;
18*ea3f1d02STomasz Sapeta - (void)registerExportedModule:(EXExportedModule *)exportedModule;
19*ea3f1d02STomasz Sapeta 
20*ea3f1d02STomasz Sapeta - (void)setDelegate:(id<EXModuleRegistryDelegate>)delegate;
21*ea3f1d02STomasz Sapeta 
22*ea3f1d02STomasz Sapeta // Call this method once all the modules are set up and registered in the registry.
23*ea3f1d02STomasz Sapeta - (void)initialize;
24*ea3f1d02STomasz Sapeta 
25*ea3f1d02STomasz Sapeta - (EXExportedModule *)getExportedModuleForName:(NSString *)name;
26*ea3f1d02STomasz Sapeta - (EXExportedModule *)getExportedModuleOfClass:(Class)moduleClass;
27*ea3f1d02STomasz Sapeta - (id)getModuleImplementingProtocol:(Protocol *)protocol;
28*ea3f1d02STomasz Sapeta - (id)getSingletonModuleForName:(NSString *)singletonModuleName;
29*ea3f1d02STomasz Sapeta 
30*ea3f1d02STomasz Sapeta - (NSArray<id<EXInternalModule>> *)getAllInternalModules;
31*ea3f1d02STomasz Sapeta - (NSArray<EXExportedModule *> *)getAllExportedModules;
32*ea3f1d02STomasz Sapeta - (NSArray *)getAllSingletonModules;
33*ea3f1d02STomasz Sapeta 
34*ea3f1d02STomasz Sapeta @end
35*ea3f1d02STomasz Sapeta 
36*ea3f1d02STomasz Sapeta NS_ASSUME_NONNULL_END
37