1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee
react-native-pushy/src/NativePushy.ts
2024-03-20 21:37:59 +08:00

43 lines
1.2 KiB
TypeScript

import { TurboModule, TurboModuleRegistry } from 'react-native';
export interface Spec extends TurboModule {
getConstants: () => {
downloadRootDir: string;
packageVersion: string;
currentVersion: string;
isFirstTime: boolean;
rolledBackVersion: string;
buildTime: string;
uuid: string;
isUsingBundleUrl: boolean;
};
setLocalHashInfo(hash: string, info: string): Promise<void>;
getLocalHashInfo(hash: string): Promise<string>;
setUuid(uuid: string): 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;
}): Promise<void>;
downloadPatchFromPackage(options: {
updateUrl: string;
hash: string;
}): Promise<void>;
downloadFullUpdate(options: {
updateUrl: string;
hash: string;
}): Promise<void>;
downloadAndInstallApk(options: {
url: string;
target: string;
hash: string;
}): Promise<void>;
addListener(eventName: string): void;
removeListeners(count: number): void;
}
export default TurboModuleRegistry.get<Spec>('Pushy') as Spec | null;