@vexor-push/react-native-code-push 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +61 -0
  3. package/android/build.gradle +129 -0
  4. package/android/generated/java/com/vexorpush/codepush/NativeVexorCodePushSpec.java +91 -0
  5. package/android/generated/jni/CMakeLists.txt +36 -0
  6. package/android/generated/jni/RNVexorCodePushSpec-generated.cpp +110 -0
  7. package/android/generated/jni/RNVexorCodePushSpec.h +31 -0
  8. package/android/generated/jni/react/renderer/components/RNVexorCodePushSpec/ComponentDescriptors.cpp +22 -0
  9. package/android/generated/jni/react/renderer/components/RNVexorCodePushSpec/ComponentDescriptors.h +24 -0
  10. package/android/generated/jni/react/renderer/components/RNVexorCodePushSpec/EventEmitters.cpp +16 -0
  11. package/android/generated/jni/react/renderer/components/RNVexorCodePushSpec/EventEmitters.h +17 -0
  12. package/android/generated/jni/react/renderer/components/RNVexorCodePushSpec/Props.cpp +19 -0
  13. package/android/generated/jni/react/renderer/components/RNVexorCodePushSpec/Props.h +18 -0
  14. package/android/generated/jni/react/renderer/components/RNVexorCodePushSpec/RNVexorCodePushSpecJSI-generated.cpp +129 -0
  15. package/android/generated/jni/react/renderer/components/RNVexorCodePushSpec/RNVexorCodePushSpecJSI.h +184 -0
  16. package/android/generated/jni/react/renderer/components/RNVexorCodePushSpec/ShadowNodes.cpp +17 -0
  17. package/android/generated/jni/react/renderer/components/RNVexorCodePushSpec/ShadowNodes.h +23 -0
  18. package/android/generated/jni/react/renderer/components/RNVexorCodePushSpec/States.cpp +16 -0
  19. package/android/generated/jni/react/renderer/components/RNVexorCodePushSpec/States.h +19 -0
  20. package/android/gradle.properties +5 -0
  21. package/android/src/main/AndroidManifest.xml +3 -0
  22. package/android/src/main/AndroidManifestNew.xml +2 -0
  23. package/android/src/main/java/com/vexorpush/codepush/CrashHandler.kt +78 -0
  24. package/android/src/main/java/com/vexorpush/codepush/SharedPrefs.kt +60 -0
  25. package/android/src/main/java/com/vexorpush/codepush/Utils.kt +105 -0
  26. package/android/src/main/java/com/vexorpush/codepush/VexorCodePush.kt +100 -0
  27. package/android/src/main/java/com/vexorpush/codepush/VexorCodePushModule.kt +698 -0
  28. package/android/src/newarch/VexorCodePushSpec.kt +7 -0
  29. package/android/src/oldarch/VexorCodePushSpec.kt +24 -0
  30. package/app.plugin.js +1 -0
  31. package/current-version.js +27 -0
  32. package/deployment-state.js +33 -0
  33. package/index.d.ts +101 -0
  34. package/index.js +535 -0
  35. package/ios/VexorCodePush.h +13 -0
  36. package/ios/VexorCodePush.mm +949 -0
  37. package/ios/generated/RNVexorCodePushSpec/ComponentDescriptors.cpp +22 -0
  38. package/ios/generated/RNVexorCodePushSpec/ComponentDescriptors.h +24 -0
  39. package/ios/generated/RNVexorCodePushSpec/EventEmitters.cpp +16 -0
  40. package/ios/generated/RNVexorCodePushSpec/EventEmitters.h +17 -0
  41. package/ios/generated/RNVexorCodePushSpec/Props.cpp +19 -0
  42. package/ios/generated/RNVexorCodePushSpec/Props.h +18 -0
  43. package/ios/generated/RNVexorCodePushSpec/RCTComponentViewHelpers.h +18 -0
  44. package/ios/generated/RNVexorCodePushSpec/RNVexorCodePushSpec-generated.mm +130 -0
  45. package/ios/generated/RNVexorCodePushSpec/RNVexorCodePushSpec.h +109 -0
  46. package/ios/generated/RNVexorCodePushSpec/ShadowNodes.cpp +17 -0
  47. package/ios/generated/RNVexorCodePushSpec/ShadowNodes.h +23 -0
  48. package/ios/generated/RNVexorCodePushSpec/States.cpp +16 -0
  49. package/ios/generated/RNVexorCodePushSpec/States.h +19 -0
  50. package/ios/generated/RNVexorCodePushSpecJSI-generated.cpp +129 -0
  51. package/ios/generated/RNVexorCodePushSpecJSI.h +184 -0
  52. package/package.json +51 -0
  53. package/plugin/src/index.ts +92 -0
  54. package/plugin/tsconfig.json +9 -0
  55. package/react-native-code-push.podspec +48 -0
  56. package/react-native.config.js +13 -0
  57. package/src/NativeVexorCodePush.ts +21 -0
@@ -0,0 +1,184 @@
1
+ /**
2
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
3
+ *
4
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
5
+ * once the code is regenerated.
6
+ *
7
+ * @generated by codegen project: GenerateModuleH.js
8
+ */
9
+
10
+ #pragma once
11
+
12
+ #include <ReactCommon/TurboModule.h>
13
+ #include <react/bridging/Bridging.h>
14
+
15
+ namespace facebook::react {
16
+
17
+
18
+ class JSI_EXPORT NativeVexorCodePushCxxSpecJSI : public TurboModule {
19
+ protected:
20
+ NativeVexorCodePushCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker);
21
+
22
+ public:
23
+ virtual jsi::Value setupBundlePath(jsi::Runtime &rt, jsi::String path, jsi::String extension, std::optional<double> version, std::optional<double> maxVersions, std::optional<jsi::String> metadata) = 0;
24
+ virtual jsi::Value downloadAndInstallBundle(jsi::Runtime &rt, jsi::String url, jsi::String headersJson, jsi::String extension, std::optional<double> version, std::optional<double> maxVersions, std::optional<jsi::String> metadata) = 0;
25
+ virtual jsi::Value setExactBundlePath(jsi::Runtime &rt, jsi::String path) = 0;
26
+ virtual jsi::Value deleteBundle(jsi::Runtime &rt, double i) = 0;
27
+ virtual void restart(jsi::Runtime &rt) = 0;
28
+ virtual jsi::Value getCurrentVersion(jsi::Runtime &rt, double a) = 0;
29
+ virtual jsi::Value getUpdateMetadata(jsi::Runtime &rt, double a) = 0;
30
+ virtual jsi::Value setCurrentVersion(jsi::Runtime &rt, jsi::String version) = 0;
31
+ virtual jsi::Value setUpdateMetadata(jsi::Runtime &rt, jsi::String metadata) = 0;
32
+ virtual jsi::Value rollbackToPreviousBundle(jsi::Runtime &rt, double a) = 0;
33
+ virtual jsi::Value getBundleList(jsi::Runtime &rt, double a) = 0;
34
+ virtual jsi::Value deleteBundleById(jsi::Runtime &rt, jsi::String id) = 0;
35
+ virtual jsi::Value clearAllBundles(jsi::Runtime &rt, double a) = 0;
36
+ virtual jsi::Value writeFile(jsi::Runtime &rt, jsi::String path, jsi::String base64Content, jsi::String encoding) = 0;
37
+
38
+ };
39
+
40
+ template <typename T>
41
+ class JSI_EXPORT NativeVexorCodePushCxxSpec : public TurboModule {
42
+ public:
43
+ jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override {
44
+ return delegate_.get(rt, propName);
45
+ }
46
+
47
+ static constexpr std::string_view kModuleName = "VexorCodePush";
48
+
49
+ protected:
50
+ NativeVexorCodePushCxxSpec(std::shared_ptr<CallInvoker> jsInvoker)
51
+ : TurboModule(std::string{NativeVexorCodePushCxxSpec::kModuleName}, jsInvoker),
52
+ delegate_(reinterpret_cast<T*>(this), jsInvoker) {}
53
+
54
+
55
+ private:
56
+ class Delegate : public NativeVexorCodePushCxxSpecJSI {
57
+ public:
58
+ Delegate(T *instance, std::shared_ptr<CallInvoker> jsInvoker) :
59
+ NativeVexorCodePushCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {
60
+
61
+ }
62
+
63
+ jsi::Value setupBundlePath(jsi::Runtime &rt, jsi::String path, jsi::String extension, std::optional<double> version, std::optional<double> maxVersions, std::optional<jsi::String> metadata) override {
64
+ static_assert(
65
+ bridging::getParameterCount(&T::setupBundlePath) == 6,
66
+ "Expected setupBundlePath(...) to have 6 parameters");
67
+
68
+ return bridging::callFromJs<jsi::Value>(
69
+ rt, &T::setupBundlePath, jsInvoker_, instance_, std::move(path), std::move(extension), std::move(version), std::move(maxVersions), std::move(metadata));
70
+ }
71
+ jsi::Value downloadAndInstallBundle(jsi::Runtime &rt, jsi::String url, jsi::String headersJson, jsi::String extension, std::optional<double> version, std::optional<double> maxVersions, std::optional<jsi::String> metadata) override {
72
+ static_assert(
73
+ bridging::getParameterCount(&T::downloadAndInstallBundle) == 7,
74
+ "Expected downloadAndInstallBundle(...) to have 7 parameters");
75
+
76
+ return bridging::callFromJs<jsi::Value>(
77
+ rt, &T::downloadAndInstallBundle, jsInvoker_, instance_, std::move(url), std::move(headersJson), std::move(extension), std::move(version), std::move(maxVersions), std::move(metadata));
78
+ }
79
+ jsi::Value setExactBundlePath(jsi::Runtime &rt, jsi::String path) override {
80
+ static_assert(
81
+ bridging::getParameterCount(&T::setExactBundlePath) == 2,
82
+ "Expected setExactBundlePath(...) to have 2 parameters");
83
+
84
+ return bridging::callFromJs<jsi::Value>(
85
+ rt, &T::setExactBundlePath, jsInvoker_, instance_, std::move(path));
86
+ }
87
+ jsi::Value deleteBundle(jsi::Runtime &rt, double i) override {
88
+ static_assert(
89
+ bridging::getParameterCount(&T::deleteBundle) == 2,
90
+ "Expected deleteBundle(...) to have 2 parameters");
91
+
92
+ return bridging::callFromJs<jsi::Value>(
93
+ rt, &T::deleteBundle, jsInvoker_, instance_, std::move(i));
94
+ }
95
+ void restart(jsi::Runtime &rt) override {
96
+ static_assert(
97
+ bridging::getParameterCount(&T::restart) == 1,
98
+ "Expected restart(...) to have 1 parameters");
99
+
100
+ return bridging::callFromJs<void>(
101
+ rt, &T::restart, jsInvoker_, instance_);
102
+ }
103
+ jsi::Value getCurrentVersion(jsi::Runtime &rt, double a) override {
104
+ static_assert(
105
+ bridging::getParameterCount(&T::getCurrentVersion) == 2,
106
+ "Expected getCurrentVersion(...) to have 2 parameters");
107
+
108
+ return bridging::callFromJs<jsi::Value>(
109
+ rt, &T::getCurrentVersion, jsInvoker_, instance_, std::move(a));
110
+ }
111
+ jsi::Value getUpdateMetadata(jsi::Runtime &rt, double a) override {
112
+ static_assert(
113
+ bridging::getParameterCount(&T::getUpdateMetadata) == 2,
114
+ "Expected getUpdateMetadata(...) to have 2 parameters");
115
+
116
+ return bridging::callFromJs<jsi::Value>(
117
+ rt, &T::getUpdateMetadata, jsInvoker_, instance_, std::move(a));
118
+ }
119
+ jsi::Value setCurrentVersion(jsi::Runtime &rt, jsi::String version) override {
120
+ static_assert(
121
+ bridging::getParameterCount(&T::setCurrentVersion) == 2,
122
+ "Expected setCurrentVersion(...) to have 2 parameters");
123
+
124
+ return bridging::callFromJs<jsi::Value>(
125
+ rt, &T::setCurrentVersion, jsInvoker_, instance_, std::move(version));
126
+ }
127
+ jsi::Value setUpdateMetadata(jsi::Runtime &rt, jsi::String metadata) override {
128
+ static_assert(
129
+ bridging::getParameterCount(&T::setUpdateMetadata) == 2,
130
+ "Expected setUpdateMetadata(...) to have 2 parameters");
131
+
132
+ return bridging::callFromJs<jsi::Value>(
133
+ rt, &T::setUpdateMetadata, jsInvoker_, instance_, std::move(metadata));
134
+ }
135
+ jsi::Value rollbackToPreviousBundle(jsi::Runtime &rt, double a) override {
136
+ static_assert(
137
+ bridging::getParameterCount(&T::rollbackToPreviousBundle) == 2,
138
+ "Expected rollbackToPreviousBundle(...) to have 2 parameters");
139
+
140
+ return bridging::callFromJs<jsi::Value>(
141
+ rt, &T::rollbackToPreviousBundle, jsInvoker_, instance_, std::move(a));
142
+ }
143
+ jsi::Value getBundleList(jsi::Runtime &rt, double a) override {
144
+ static_assert(
145
+ bridging::getParameterCount(&T::getBundleList) == 2,
146
+ "Expected getBundleList(...) to have 2 parameters");
147
+
148
+ return bridging::callFromJs<jsi::Value>(
149
+ rt, &T::getBundleList, jsInvoker_, instance_, std::move(a));
150
+ }
151
+ jsi::Value deleteBundleById(jsi::Runtime &rt, jsi::String id) override {
152
+ static_assert(
153
+ bridging::getParameterCount(&T::deleteBundleById) == 2,
154
+ "Expected deleteBundleById(...) to have 2 parameters");
155
+
156
+ return bridging::callFromJs<jsi::Value>(
157
+ rt, &T::deleteBundleById, jsInvoker_, instance_, std::move(id));
158
+ }
159
+ jsi::Value clearAllBundles(jsi::Runtime &rt, double a) override {
160
+ static_assert(
161
+ bridging::getParameterCount(&T::clearAllBundles) == 2,
162
+ "Expected clearAllBundles(...) to have 2 parameters");
163
+
164
+ return bridging::callFromJs<jsi::Value>(
165
+ rt, &T::clearAllBundles, jsInvoker_, instance_, std::move(a));
166
+ }
167
+ jsi::Value writeFile(jsi::Runtime &rt, jsi::String path, jsi::String base64Content, jsi::String encoding) override {
168
+ static_assert(
169
+ bridging::getParameterCount(&T::writeFile) == 4,
170
+ "Expected writeFile(...) to have 4 parameters");
171
+
172
+ return bridging::callFromJs<jsi::Value>(
173
+ rt, &T::writeFile, jsInvoker_, instance_, std::move(path), std::move(base64Content), std::move(encoding));
174
+ }
175
+
176
+ private:
177
+ friend class NativeVexorCodePushCxxSpec;
178
+ T *instance_;
179
+ };
180
+
181
+ Delegate delegate_;
182
+ };
183
+
184
+ } // namespace facebook::react
package/package.json ADDED
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "@vexor-push/react-native-code-push",
3
+ "version": "0.2.0",
4
+ "description": "Vexor React Native CodePush SDK for self-hosted OTA updates.",
5
+ "main": "index.js",
6
+ "types": "index.d.ts",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/vexorpush/react-native-code-push.git"
10
+ },
11
+ "files": [
12
+ "index.js",
13
+ "index.d.ts",
14
+ "deployment-state.js",
15
+ "current-version.js",
16
+ "src/NativeVexorCodePush.ts",
17
+ "android",
18
+ "ios",
19
+ "cpp",
20
+ "*.podspec",
21
+ "react-native.config.js",
22
+ "app.plugin.js",
23
+ "plugin",
24
+ "!ios/build",
25
+ "!android/build",
26
+ "!android/gradle",
27
+ "!android/gradlew",
28
+ "!android/gradlew.bat",
29
+ "!android/local.properties",
30
+ "!**/__tests__",
31
+ "!**/__fixtures__",
32
+ "!**/__mocks__",
33
+ "!**/.*"
34
+ ],
35
+ "scripts": {
36
+ "build-plugin": "tsc --build plugin",
37
+ "lint": "eslint \"**/*.{js,ts,tsx}\"",
38
+ "test": "jest",
39
+ "typecheck": "tsc"
40
+ },
41
+ "dependencies": {},
42
+ "peerDependencies": {
43
+ "react": "*",
44
+ "react-native": "*"
45
+ },
46
+ "publishConfig": {
47
+ "access": "public",
48
+ "registry": "https://registry.npmjs.org/"
49
+ },
50
+ "license": "MIT"
51
+ }
@@ -0,0 +1,92 @@
1
+ import {
2
+ withMainApplication,
3
+ withAppDelegate,
4
+ IOSConfig,
5
+ } from '@expo/config-plugins';
6
+
7
+ const withAndroidAction: any = (config: any) => {
8
+ return withMainApplication(config, (config) => {
9
+ let content = config.modResults.contents;
10
+
11
+ const isNewReactHost = content.includes('context = applicationContext');
12
+
13
+ if (!content.includes('import com.vexorpush.codepush.VexorCodePush')) {
14
+ content = content.replace(
15
+ /import android.app.Application/g,
16
+ `
17
+ import android.app.Application
18
+ import com.vexorpush.codepush.VexorCodePush`
19
+ );
20
+ }
21
+ if (isNewReactHost) {
22
+ if (!content.includes('VexorCodePush.bundleJS')) {
23
+ content = content.replace(
24
+ /context = applicationContext,/,
25
+ `context = applicationContext,
26
+ jsBundleFilePath = VexorCodePush.bundleJS(applicationContext),`
27
+ );
28
+ }
29
+
30
+ config.modResults.contents = content;
31
+ return config;
32
+ }
33
+
34
+ if (!content.includes('VexorCodePush.bundleJS(this@MainApplication)')) {
35
+ content = content.replace(
36
+ /DefaultReactNativeHost\s*\(this\)\s*\{/,
37
+ `
38
+ DefaultReactNativeHost(this) {
39
+
40
+ override fun getJSBundleFile(): String = VexorCodePush.bundleJS(this@MainApplication)`
41
+ );
42
+ }
43
+
44
+ config.modResults.contents = content;
45
+ return config;
46
+ });
47
+ };
48
+
49
+ const withIosAction: any = (config: any) => {
50
+ return withAppDelegate(config, (config) => {
51
+ const appDelegatePath = config.modRequest.projectRoot + '/ios/' + IOSConfig.Paths.getAppDelegateFilePath(config.modRequest.projectRoot);
52
+ const isSwift = appDelegatePath.endsWith('.swift');
53
+
54
+ if (isSwift) {
55
+ // Swift: AppDelegate.swift
56
+ if (!config.modResults.contents.includes('import react_native_code_push')) {
57
+ config.modResults.contents = `import react_native_code_push\n${config.modResults.contents}`;
58
+ }
59
+
60
+ if (!config.modResults.contents.includes('VexorCodePush.getBundle()')) {
61
+ config.modResults.contents = config.modResults.contents.replace(
62
+ /return Bundle.main.url\(forResource: "main", withExtension: "jsbundle"\)/,
63
+ `return VexorCodePush.getBundle()`
64
+ );
65
+ }
66
+ } else {
67
+ // Objective-C: AppDelegate.mm
68
+ if (!config.modResults.contents.includes('#import "VexorCodePush.h')) {
69
+ config.modResults.contents = config.modResults.contents.replace(
70
+ /#import "AppDelegate.h"/g,
71
+ `#import "AppDelegate.h"
72
+ #import "VexorCodePush.h"`
73
+ );
74
+ }
75
+
76
+ config.modResults.contents = config.modResults.contents.replace(
77
+ /\[\[NSBundle mainBundle\] URLForResource:@\"main\" withExtension:@\"jsbundle\"\]/,
78
+ `[VexorCodePush getBundle]`
79
+ );
80
+ }
81
+
82
+ return config;
83
+ });
84
+ };
85
+
86
+ const withAction: any = (config: any) => {
87
+ config = withAndroidAction(config);
88
+ config = withIosAction(config);
89
+ return config;
90
+ };
91
+
92
+ module.exports = withAction;
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "expo-module-scripts/tsconfig.plugin",
3
+ "compilerOptions": {
4
+ "outDir": "build",
5
+ "rootDir": "src"
6
+ },
7
+ "include": ["./src"],
8
+ "exclude": ["**/__mocks__/*", "**/__tests__/*"]
9
+ }
@@ -0,0 +1,48 @@
1
+ require "json"
2
+
3
+ package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4
+ folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
5
+
6
+ Pod::Spec.new do |s|
7
+ s.name = "react-native-code-push"
8
+ s.version = package["version"]
9
+ s.summary = package["description"]
10
+ s.homepage = "https://github.com/vexorpush/react-native-code-push"
11
+ s.license = package["license"]
12
+ s.authors = { "Vexor Push" => "https://github.com/vexorpush" }
13
+
14
+ s.platforms = { :ios => min_ios_version_supported }
15
+ s.source = { :git => "https://github.com/vexorpush/react-native-code-push.git", :tag => "#{s.version}" }
16
+ s.pod_target_xcconfig = {
17
+ 'SWIFT_VERSION' => '5.0',
18
+ 'DEFINES_MODULE' => 'YES'
19
+ }
20
+ s.public_header_files = "ios/VexorCodePush.h"
21
+ s.source_files = "ios/**/*.{h,m,mm,cpp}"
22
+ s.dependency 'SSZipArchive', '~> 2.4.3'
23
+ if ENV['RCT_NEW_ARCH_ENABLED'] == '0'
24
+ s.exclude_files = "ios/generated"
25
+ end
26
+ # Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
27
+ # See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
28
+ if respond_to?(:install_modules_dependencies, true)
29
+ install_modules_dependencies(s)
30
+ else
31
+ s.dependency "React-Core"
32
+
33
+ # Don't install the dependencies when we run `pod install` in the old architecture.
34
+ if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
35
+ s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
36
+ s.pod_target_xcconfig = {
37
+ "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
38
+ "OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
39
+ "CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
40
+ }
41
+ s.dependency "React-Codegen"
42
+ s.dependency "RCT-Folly"
43
+ s.dependency "RCTRequired"
44
+ s.dependency "RCTTypeSafety"
45
+ s.dependency "ReactCommon/turbomodule/core"
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @type {import('@react-native-community/cli-types').UserDependencyConfig}
3
+ */
4
+ module.exports = {
5
+ dependency: {
6
+ platforms: {
7
+ android: {
8
+ cmakeListsPath: 'generated/jni/CMakeLists.txt',
9
+ packageInstance: 'new VexorCodePush()',
10
+ },
11
+ },
12
+ },
13
+ };
@@ -0,0 +1,21 @@
1
+ import type { TurboModule } from 'react-native';
2
+ import { TurboModuleRegistry } from 'react-native';
3
+
4
+ export interface Spec extends TurboModule {
5
+ setupBundlePath(path: string, extension: string, version?: number, maxVersions?: number, metadata?: string): Promise<boolean>;
6
+ downloadAndInstallBundle(url: string, headersJson: string, extension: string, version?: number, maxVersions?: number, metadata?: string): Promise<boolean>;
7
+ setExactBundlePath(path: string): Promise<boolean>;
8
+ deleteBundle(i: number): Promise<boolean>;
9
+ restart(): void;
10
+ getCurrentVersion(a: number): Promise<string>;
11
+ getUpdateMetadata(a: number): Promise<string>;
12
+ setCurrentVersion(version: string): Promise<boolean>;
13
+ setUpdateMetadata(metadata: string): Promise<boolean>;
14
+ rollbackToPreviousBundle(a: number): Promise<boolean>;
15
+ getBundleList(a: number): Promise<string>;
16
+ deleteBundleById(id: string): Promise<boolean>;
17
+ clearAllBundles(a: number): Promise<boolean>;
18
+ writeFile(path: string, base64Content: string, encoding: string): Promise<boolean>;
19
+ }
20
+
21
+ export default TurboModuleRegistry.getEnforcing<Spec>('VexorCodePush');