RCTInspectorPackagerConnection.h 916 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Copyright (c) Facebook, Inc. and its affiliates.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. */
  7. #import <Foundation/Foundation.h>
  8. #import <React/RCTDefines.h>
  9. #if RCT_DEV
  10. @interface RCTBundleStatus : NSObject
  11. @property (atomic, assign) BOOL isLastBundleDownloadSuccess;
  12. @property (atomic, assign) NSTimeInterval bundleUpdateTimestamp;
  13. @end
  14. typedef RCTBundleStatus * (^RCTBundleStatusProvider)(void);
  15. @interface RCTInspectorPackagerConnection : NSObject
  16. - (instancetype)initWithURL:(NSURL *)url;
  17. - (bool)isConnected;
  18. - (void)connect;
  19. - (void)closeQuietly;
  20. - (void)sendEventToAllConnections:(NSString *)event;
  21. - (void)setBundleStatusProvider:(RCTBundleStatusProvider)bundleStatusProvider;
  22. @end
  23. @interface RCTInspectorRemoteConnection : NSObject
  24. - (void)onMessage:(NSString *)message;
  25. - (void)onDisconnect;
  26. @end
  27. #endif