@appzung/react-native-code-push
Version:
React Native plugin for the CodePush service
29 lines • 1.77 kB
TypeScript
import React from 'react';
import { CheckFrequency } from './enums/CheckFrequency.enum';
import type { SyncOptions } from './types';
export interface CodePushOptions extends SyncOptions {
/**
* Specifies when you would like to synchronize updates with the CodePush server.
*
* Defaults to CheckFrequency.ON_APP_START.
*/
checkFrequency?: CheckFrequency;
}
/**
* Wraps a React component inside a "higher order" React component that knows how to synchronize your app's JavaScript bundle and image assets when it is mounted.
*
* Internally, the higher-order component calls `sync` inside its `componentDidMount` lifecycle handle, which in turns performs an update check, downloads the update if it exists and installs the update for you.
*
* @param component the React Component that will be decorated
*/
export declare function withCodePush<P extends object | Record<string, unknown>>(component: React.ComponentType<P>): React.ComponentType;
/**
* Wraps a React component inside a "higher order" React component that knows how to synchronize your app's JavaScript bundle and image assets when it is mounted.
*
* Internally, the higher-order component calls `sync` inside its `componentDidMount` lifecycle handle, which in turns performs an update check, downloads the update if it exists and installs the update for you.
*
* @param options Options used to configure the end-user sync and update experience (e.g. when to check for updates?, show a prompt?, install the update immediately?).
*/
export declare function withCodePush<P extends object | Record<string, unknown>>(options: CodePushOptions): (component: React.ComponentType<P>) => React.ComponentType;
export default withCodePush;
//# sourceMappingURL=CodePush.d.ts.map