mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
extract constants type in BlobModule + add stub impl (#43160)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/43160 ## Changelog: [Internal] - extract constants type in BlobModule Reviewed By: christophpurrer, rshest Differential Revision: D54073162 fbshipit-source-id: ba783fd4592feb7ecd65c65ad646e681b2f26a17
This commit is contained in:
committed by
Facebook GitHub Bot
parent
2584bcb6c8
commit
073ca1aa03
@@ -12,8 +12,10 @@ import type {TurboModule} from '../../../../Libraries/TurboModule/RCTExport';
|
||||
|
||||
import * as TurboModuleRegistry from '../../../../Libraries/TurboModule/TurboModuleRegistry';
|
||||
|
||||
export type Constants = {|BLOB_URI_SCHEME: ?string, BLOB_URI_HOST: ?string|};
|
||||
|
||||
export interface Spec extends TurboModule {
|
||||
+getConstants: () => {|BLOB_URI_SCHEME: ?string, BLOB_URI_HOST: ?string|};
|
||||
+getConstants: () => Constants;
|
||||
+addNetworkingHandler: () => void;
|
||||
+addWebSocketHandler: (id: number) => void;
|
||||
+removeWebSocketHandler: (id: number) => void;
|
||||
@@ -29,7 +31,7 @@ let NativeBlobModule = null;
|
||||
|
||||
if (NativeModule != null) {
|
||||
NativeBlobModule = {
|
||||
getConstants(): {|BLOB_URI_SCHEME: ?string, BLOB_URI_HOST: ?string|} {
|
||||
getConstants(): Constants {
|
||||
if (constants == null) {
|
||||
constants = NativeModule.getConstants();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user