RNViewShotPackage.cs 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using ReactNative.Bridge;
  2. using ReactNative.Modules.Core;
  3. using ReactNative.UIManager;
  4. using System;
  5. using System.Collections.Generic;
  6. namespace RNViewShot
  7. {
  8. /// <summary>
  9. /// Package defining core framework modules (e.g., <see cref="UIManagerModule"/>).
  10. /// It should be used for modules that require special integration with
  11. /// other framework parts (e.g., with the list of packages to load view
  12. /// managers from).
  13. /// </summary>
  14. public class RNViewShotPackage : IReactPackage
  15. {
  16. /// <summary>
  17. /// Creates the list of native modules to register with the react
  18. /// instance.
  19. /// </summary>
  20. /// <param name="reactContext">The react application context.</param>
  21. /// <returns>The list of native modules.</returns>
  22. public IReadOnlyList<INativeModule> CreateNativeModules(ReactContext reactContext)
  23. {
  24. return new List<INativeModule>
  25. {
  26. new RNViewShotModule(reactContext),
  27. };
  28. }
  29. /// <summary>
  30. /// Creates the list of JavaScript modules to register with the
  31. /// react instance.
  32. /// </summary>
  33. /// <returns>The list of JavaScript modules.</returns>
  34. public IReadOnlyList<Type> CreateJavaScriptModulesConfig()
  35. {
  36. return new List<Type>(0);
  37. }
  38. /// <summary>
  39. /// Creates the list of view managers that should be registered with
  40. /// the <see cref="UIManagerModule"/>.
  41. /// </summary>
  42. /// <param name="reactContext">The react application context.</param>
  43. /// <returns>The list of view managers.</returns>
  44. public IReadOnlyList<IViewManager> CreateViewManagers(
  45. ReactContext reactContext)
  46. {
  47. return new List<IViewManager>(0);
  48. }
  49. }
  50. }