forked from mauritsd/react-native-dynamic-bundle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
40 lines (35 loc) · 1.54 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
declare module 'react-native-dynamic-bundle' {
/**
* Set the active Javascript bundle to the bundle with the given bundle ID in
* the registry. This will cause the given bundle to be loaded on the next app
* startup or invocation of `reloadBundle()`.
*/
export function setActiveBundle(bundleId: string | null): void
/**
* Register a Javascript bundle in the bundle registry. The path to the bundle
* should be relative to the documents directory on iOS and to the internal app
* storage directory on Android, i.e. the directory returned by `getFilesDir()`.
*/
export function registerBundle(bundleId: string, relativePath: string): void
/**
* Unregister a bundle from the bundle registry.
*/
export function unregisterBundle(bundleId: string): void
/**
* Reload the bundle that is used by the app immediately. This can be used to
* apply a new bundle that was set by `setActiveBundle()` immediately.
*/
export function reloadBundle(): void
/**
* Returns a promise that resolves to the currently active bundle identifier.
* if the default bundle (i.e. the bundle that was packaged into the native app)
* is active this method will resolve to `null`.
*/
export function getActiveBundle(): Promise<string>
/**
* Returns a promise that resolves to the currently active bundle identifier.
* if the default bundle (i.e. the bundle that was packaged into the native app)
* is active this method will resolve to `null`.
*/
export function getBundles(): Promise<{ [key: string]: string }>
}