mirror of
https://gitcode.com/gh_mirrors/re/react-native-pushy.git
synced 2025-11-01 13:53:11 +08:00
chore: cleanup
This commit is contained in:
@@ -1,51 +1,45 @@
|
||||
/**
|
||||
* @format
|
||||
* @flow strict-local
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
import type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport';
|
||||
import { TurboModuleRegistry } from 'react-native';
|
||||
|
||||
export interface Spec extends TurboModule {
|
||||
getConstants: () => {
|
||||
downloadRootDir: string,
|
||||
packageVersion: string,
|
||||
currentVersion: string,
|
||||
isFirstTime: boolean,
|
||||
rolledBackVersion: string,
|
||||
buildTime: string,
|
||||
blockUpdate: Object,
|
||||
uuid: string,
|
||||
isUsingBundleUrl: boolean,
|
||||
downloadRootDir: string;
|
||||
packageVersion: string;
|
||||
currentVersion: string;
|
||||
isFirstTime: boolean;
|
||||
rolledBackVersion: string;
|
||||
buildTime: string;
|
||||
blockUpdate: Object;
|
||||
uuid: string;
|
||||
isUsingBundleUrl: boolean;
|
||||
};
|
||||
setLocalHashInfo(hash: string, info: string): Promise<void>;
|
||||
getLocalHashInfo(hash: string): Promise<string>;
|
||||
setUuid(uuid: string): Promise<void>;
|
||||
setBlockUpdate(options: { reason: string, until: number }): Promise<void>;
|
||||
setBlockUpdate(options: { reason: string; until: number }): Promise<void>;
|
||||
reloadUpdate(options: { hash: string }): Promise<void>;
|
||||
setNeedUpdate(options: { hash: string }): Promise<void>;
|
||||
markSuccess(): Promise<void>;
|
||||
downloadPatchFromPpk(options: {
|
||||
updateUrl: string,
|
||||
hash: string,
|
||||
originHash: string,
|
||||
updateUrl: string;
|
||||
hash: string;
|
||||
originHash: string;
|
||||
}): Promise<void>;
|
||||
downloadPatchFromPackage(options: {
|
||||
updateUrl: string,
|
||||
hash: string,
|
||||
updateUrl: string;
|
||||
hash: string;
|
||||
}): Promise<void>;
|
||||
downloadFullUpdate(options: {
|
||||
updateUrl: string,
|
||||
hash: string,
|
||||
updateUrl: string;
|
||||
hash: string;
|
||||
}): Promise<void>;
|
||||
downloadAndInstallApk(options: {
|
||||
url: string,
|
||||
target: string,
|
||||
hash: string,
|
||||
url: string;
|
||||
target: string;
|
||||
hash: string;
|
||||
}): Promise<void>;
|
||||
addListener(eventName: string): void;
|
||||
removeListeners(count: number): void;
|
||||
}
|
||||
|
||||
export default (TurboModuleRegistry.get<Spec>('Pushy'): ?Spec);
|
||||
export default TurboModuleRegistry.get<Spec>('Pushy') as Spec | null;
|
||||
@@ -44,7 +44,7 @@ export const buildTime = PushyConstants.buildTime;
|
||||
let blockUpdate = PushyConstants.blockUpdate;
|
||||
let uuid = PushyConstants.uuid;
|
||||
|
||||
if (Platform.OS === 'android' && !PushyConstants.isUsingBundleUrl) {
|
||||
if (!PushyConstants.isUsingBundleUrl) {
|
||||
throw new Error(
|
||||
'react-native-update模块无法加载,请对照文档检查Bundle URL的配置',
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user