react-native-tapline 1.3.0 → 1.4.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.
- package/dist/actions.d.ts +21 -1
- package/dist/actions.js +364 -47
- package/dist/actions.js.map +1 -1
- package/dist/client.js +7 -0
- package/dist/client.js.map +1 -1
- package/dist/closest.d.ts +30 -0
- package/dist/closest.js +101 -0
- package/dist/closest.js.map +1 -0
- package/dist/commands.d.ts +9 -0
- package/dist/commands.js +135 -2
- package/dist/commands.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +8 -1
- package/dist/index.js.map +1 -1
- package/dist/inspect.js +4 -2
- package/dist/inspect.js.map +1 -1
- package/dist/locale.d.ts +67 -0
- package/dist/locale.js +224 -0
- package/dist/locale.js.map +1 -0
- package/dist/logs.d.ts +2 -0
- package/dist/logs.js +7 -0
- package/dist/logs.js.map +1 -1
- package/dist/network.d.ts +20 -2
- package/dist/network.js +731 -3
- package/dist/network.js.map +1 -1
- package/dist/types.d.ts +3 -2
- package/package.json +1 -1
package/dist/network.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Network tracking: counts requests in flight (so an agent can wait for loading to finish)
|
|
3
|
-
* and reports failed ones. React Native's fetch is built on XMLHttpRequest,
|
|
4
|
-
*
|
|
3
|
+
* and reports failed ones. React Native's fetch is built on XMLHttpRequest, but Expo SDK 58's
|
|
4
|
+
* expo/fetch is native, so both XMLHttpRequest.prototype and the global fetch are wrapped (a
|
|
5
|
+
* request is counted once). Nothing here may ever throw into the app.
|
|
5
6
|
*/
|
|
6
7
|
export interface NetworkFailure {
|
|
7
8
|
method: string;
|
|
@@ -17,8 +18,25 @@ export interface NetworkOptions {
|
|
|
17
18
|
};
|
|
18
19
|
ignore?: (url: string) => boolean;
|
|
19
20
|
}
|
|
21
|
+
/** What Tapline can make the app's requests behave like (`network` app command). */
|
|
22
|
+
export type NetworkMode = 'offline' | '3g' | 'lossy' | 'normal';
|
|
23
|
+
export declare const NETWORK_MODES: readonly NetworkMode[];
|
|
20
24
|
/** scheme://host[:port]/path, query replaced by "?…", no fragment or credentials. */
|
|
21
25
|
export declare function redactUrl(raw: string): string;
|
|
26
|
+
/**
|
|
27
|
+
* Wraps the app's global fetch, once per function: a fetch replaced after Tapline started (Expo installs its own
|
|
28
|
+
* lazily) is wrapped when this runs next. Called on install, on each condition change and whenever requests are
|
|
29
|
+
* counted. Never throws into the app.
|
|
30
|
+
*/
|
|
31
|
+
export declare function ensureFetchWrapped(given?: Record<string, unknown>): void;
|
|
32
|
+
/** The mode the app's requests are in now. */
|
|
33
|
+
export declare function networkCondition(): NetworkMode;
|
|
34
|
+
/** Puts the app's requests into a mode; `normal` restores them. Requests already sent are not touched. */
|
|
35
|
+
export declare function setNetworkCondition(mode: NetworkMode): void;
|
|
36
|
+
/** Back to normal; safe to call any time (host gone, Tapline stopped). */
|
|
37
|
+
export declare function resetNetworkCondition(): void;
|
|
38
|
+
/** A seeded random source for `lossy` (tests); `null` goes back to Math.random. */
|
|
39
|
+
export declare function seedNetworkRandom(seed: number | null): void;
|
|
22
40
|
export declare function installNetworkTracking(options?: NetworkOptions): void;
|
|
23
41
|
export declare function uninstallNetworkTracking(): void;
|
|
24
42
|
/** Requests that have been sent and not yet finished (dev-server traffic excluded). */
|