react-native-tapline 0.0.0-stage → 1.0.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.
Files changed (85) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +86 -2
  3. package/TaplineNative.podspec +14 -0
  4. package/dist/actions.d.ts +160 -0
  5. package/dist/actions.js +1883 -0
  6. package/dist/actions.js.map +1 -0
  7. package/dist/agent.d.ts +79 -0
  8. package/dist/agent.js +255 -0
  9. package/dist/agent.js.map +1 -0
  10. package/dist/alerts.d.ts +35 -0
  11. package/dist/alerts.js +437 -0
  12. package/dist/alerts.js.map +1 -0
  13. package/dist/awake.d.ts +2 -0
  14. package/dist/awake.js +53 -0
  15. package/dist/awake.js.map +1 -0
  16. package/dist/checks.d.ts +19 -0
  17. package/dist/checks.js +318 -0
  18. package/dist/checks.js.map +1 -0
  19. package/dist/client.d.ts +111 -0
  20. package/dist/client.js +446 -0
  21. package/dist/client.js.map +1 -0
  22. package/dist/commands.d.ts +24 -0
  23. package/dist/commands.js +111 -0
  24. package/dist/commands.js.map +1 -0
  25. package/dist/events.d.ts +5 -0
  26. package/dist/events.js +22 -0
  27. package/dist/events.js.map +1 -0
  28. package/dist/feed.d.ts +117 -0
  29. package/dist/feed.js +440 -0
  30. package/dist/feed.js.map +1 -0
  31. package/dist/fiber.d.ts +43 -0
  32. package/dist/fiber.js +100 -0
  33. package/dist/fiber.js.map +1 -0
  34. package/dist/index.d.ts +50 -0
  35. package/dist/index.js +133 -0
  36. package/dist/index.js.map +1 -0
  37. package/dist/inspect.d.ts +245 -0
  38. package/dist/inspect.js +1343 -0
  39. package/dist/inspect.js.map +1 -0
  40. package/dist/keyboard.d.ts +10 -0
  41. package/dist/keyboard.js +63 -0
  42. package/dist/keyboard.js.map +1 -0
  43. package/dist/link.d.ts +21 -0
  44. package/dist/link.js +63 -0
  45. package/dist/link.js.map +1 -0
  46. package/dist/live.d.ts +30 -0
  47. package/dist/live.js +279 -0
  48. package/dist/live.js.map +1 -0
  49. package/dist/logs.d.ts +16 -0
  50. package/dist/logs.js +171 -0
  51. package/dist/logs.js.map +1 -0
  52. package/dist/methods.d.ts +3 -0
  53. package/dist/methods.js +47 -0
  54. package/dist/methods.js.map +1 -0
  55. package/dist/native.d.ts +34 -0
  56. package/dist/native.js +63 -0
  57. package/dist/native.js.map +1 -0
  58. package/dist/network.d.ts +27 -0
  59. package/dist/network.js +238 -0
  60. package/dist/network.js.map +1 -0
  61. package/dist/register.d.ts +24 -0
  62. package/dist/register.js +180 -0
  63. package/dist/register.js.map +1 -0
  64. package/dist/settle.d.ts +27 -0
  65. package/dist/settle.js +70 -0
  66. package/dist/settle.js.map +1 -0
  67. package/dist/storage.d.ts +10 -0
  68. package/dist/storage.js +45 -0
  69. package/dist/storage.js.map +1 -0
  70. package/dist/touches.d.ts +15 -0
  71. package/dist/touches.js +89 -0
  72. package/dist/touches.js.map +1 -0
  73. package/dist/types.d.ts +168 -0
  74. package/dist/types.js +32 -0
  75. package/dist/types.js.map +1 -0
  76. package/dist/wait.d.ts +8 -0
  77. package/dist/wait.js +99 -0
  78. package/dist/wait.js.map +1 -0
  79. package/expo-module.config.json +7 -0
  80. package/ios/TaplineNativeModule.swift +79 -0
  81. package/metro.d.ts +10 -0
  82. package/metro.js +40 -0
  83. package/package.json +100 -4
  84. package/register.d.ts +1 -0
  85. package/register.js +3 -0
package/dist/fiber.js ADDED
@@ -0,0 +1,100 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SimpleMemoComponent = exports.MemoComponent = exports.ForwardRef = exports.HostText = exports.HostComponent = exports.HostRoot = exports.IndeterminateComponent = exports.ClassComponent = exports.FunctionComponent = void 0;
4
+ exports.isFiber = isFiber;
5
+ exports.isFiberRoot = isFiberRoot;
6
+ exports.isCompositeTag = isCompositeTag;
7
+ exports.propsOf = propsOf;
8
+ exports.firstHostChild = firstHostChild;
9
+ exports.hostChildren = hostChildren;
10
+ exports.componentName = componentName;
11
+ exports.fiberName = fiberName;
12
+ exports.sameFiber = sameFiber;
13
+ const types_1 = require("./types");
14
+ // Fiber tags (stable across React 17-19).
15
+ exports.FunctionComponent = 0;
16
+ exports.ClassComponent = 1;
17
+ exports.IndeterminateComponent = 2;
18
+ exports.HostRoot = 3;
19
+ exports.HostComponent = 5;
20
+ exports.HostText = 6;
21
+ exports.ForwardRef = 11;
22
+ exports.MemoComponent = 14;
23
+ exports.SimpleMemoComponent = 15;
24
+ function isFiber(value) {
25
+ return ((0, types_1.isRecord)(value) &&
26
+ typeof value.tag === 'number' &&
27
+ 'memoizedProps' in value &&
28
+ 'child' in value &&
29
+ 'sibling' in value);
30
+ }
31
+ function isFiberRoot(value) {
32
+ return (0, types_1.isRecord)(value) && isFiber(value.current);
33
+ }
34
+ function isCompositeTag(tag) {
35
+ return (tag === exports.FunctionComponent ||
36
+ tag === exports.ClassComponent ||
37
+ tag === exports.IndeterminateComponent ||
38
+ tag === exports.ForwardRef ||
39
+ tag === exports.MemoComponent ||
40
+ tag === exports.SimpleMemoComponent);
41
+ }
42
+ /** Props of a fiber as a plain record ({} when absent or a text string). */
43
+ function propsOf(fiber) {
44
+ return (0, types_1.isRecord)(fiber.memoizedProps) ? fiber.memoizedProps : {};
45
+ }
46
+ /** The first host fiber below `fiber` in tree order (a scroll view's content container); null when none. */
47
+ function firstHostChild(fiber) {
48
+ for (let child = fiber.child; child; child = child.sibling) {
49
+ if (child.tag === exports.HostComponent)
50
+ return child;
51
+ const nested = firstHostChild(child);
52
+ if (nested)
53
+ return nested;
54
+ }
55
+ return null;
56
+ }
57
+ /** The host fibers directly below `fiber`, looking through non-host wrappers but not into hosts. */
58
+ function hostChildren(fiber) {
59
+ const found = [];
60
+ const visit = (first) => {
61
+ for (let child = first; child; child = child.sibling) {
62
+ if (child.tag === exports.HostComponent)
63
+ found.push(child);
64
+ else
65
+ visit(child.child);
66
+ }
67
+ };
68
+ visit(fiber.child);
69
+ return found;
70
+ }
71
+ /** Best-effort display name of a component type; null when anonymous. */
72
+ function componentName(type, depth = 0) {
73
+ if (depth > 4 || type == null)
74
+ return null;
75
+ if (typeof type === 'string')
76
+ return type;
77
+ if (typeof type === 'function') {
78
+ const named = type;
79
+ if (typeof named.displayName === 'string' && named.displayName)
80
+ return named.displayName;
81
+ if (typeof named.name === 'string' && named.name)
82
+ return named.name;
83
+ return null;
84
+ }
85
+ if ((0, types_1.isRecord)(type)) {
86
+ if (typeof type.displayName === 'string' && type.displayName)
87
+ return type.displayName;
88
+ // forwardRef({render}) / memo({type}) wrappers
89
+ return componentName(type.render, depth + 1) ?? componentName(type.type, depth + 1);
90
+ }
91
+ return null;
92
+ }
93
+ function fiberName(fiber) {
94
+ return componentName(fiber.type) ?? componentName(fiber.elementType);
95
+ }
96
+ /** Whether `fiber` is `other` or its alternate (the same logical fiber). */
97
+ function sameFiber(fiber, other) {
98
+ return fiber === other || fiber === other.alternate || fiber.alternate === other;
99
+ }
100
+ //# sourceMappingURL=fiber.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fiber.js","sourceRoot":"","sources":["../src/fiber.ts"],"names":[],"mappings":";;;AAkCA,0BAQC;AAED,kCAEC;AAED,wCASC;AAGD,0BAEC;AAGD,wCAOC;AAGD,oCAUC;AAGD,sCAeC;AAED,8BAEC;AAGD,8BAEC;AAhHD,mCAAuD;AAuBvD,0CAA0C;AAC7B,QAAA,iBAAiB,GAAG,CAAC,CAAC;AACtB,QAAA,cAAc,GAAG,CAAC,CAAC;AACnB,QAAA,sBAAsB,GAAG,CAAC,CAAC;AAC3B,QAAA,QAAQ,GAAG,CAAC,CAAC;AACb,QAAA,aAAa,GAAG,CAAC,CAAC;AAClB,QAAA,QAAQ,GAAG,CAAC,CAAC;AACb,QAAA,UAAU,GAAG,EAAE,CAAC;AAChB,QAAA,aAAa,GAAG,EAAE,CAAC;AACnB,QAAA,mBAAmB,GAAG,EAAE,CAAC;AAEtC,SAAgB,OAAO,CAAC,KAAc;IACpC,OAAO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AO,IAAI,CAAC;AACd,CAAC;AAED,SAAgB,SAAS,CAAC,KAAY;IACpC,OAAO,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,aAAa,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;AACvE,CAAC;AAED,4EAA4E;AAC5E,SAAgB,SAAS,CAAC,KAAY,EAAE,KAAY;IAClD,OAAO,KAAK,KAAK,KAAK,IAAI,KAAK,KAAK,KAAK,CAAC,SAAS,IAAI,KAAK,CAAC,SAAS,KAAK,KAAK,CAAC;AACnF,CAAC"}
@@ -0,0 +1,50 @@
1
+ import { type TaplineStorage } from './storage';
2
+ import type { AppInfo } from './types';
3
+ export interface TaplineOptions {
4
+ /**
5
+ * The on switch: Tapline does nothing at all unless this is true. Turn it on in development
6
+ * and test builds only, e.g. `enabled: process.env.EXPO_PUBLIC_TAPLINE_ENABLED === '1'`.
7
+ * The build carries no address or token: a phone connects by scanning a pairing code.
8
+ */
9
+ enabled: boolean;
10
+ app?: AppInfo;
11
+ /**
12
+ * Where the paired computer is remembered. Default: expo-secure-store when the app has it,
13
+ * else memory (pair again after each restart).
14
+ */
15
+ storage?: TaplineStorage;
16
+ /** Connect straight to this host instead of pairing (e.g. a simulator on the same computer). Needs `token`. */
17
+ url?: string;
18
+ /** The host's token, for `url` (`tapline token`). Keep it out of source files. */
19
+ token?: string;
20
+ /**
21
+ * Alerts (Alert.alert / Alert.prompt): 'record' (default) shows them as usual and tells the
22
+ * agent what is open; 'stand-in' shows Tapline's own in-app version instead, whose buttons an
23
+ * agent can press. Tapline's own prompts always stay native.
24
+ */
25
+ alerts?: 'record' | 'stand-in';
26
+ }
27
+ /**
28
+ * Start the in-app agent: it reconnects to the computer this app was paired with, and pairs
29
+ * when a Tapline pairing link opens the app. Safe to call more than once; never throws.
30
+ */
31
+ export declare function startTapline(options: TaplineOptions): void;
32
+ export declare function stopTapline(): void;
33
+ export { registerTaplineCommand } from './commands';
34
+ export type { TaplineCommand } from './commands';
35
+ export { isTaplineLink, parseTaplineLink } from './link';
36
+ export type { TaplineLink } from './link';
37
+ export { memoryStorage, secureStoreStorage } from './storage';
38
+ export type { TaplineStorage } from './storage';
39
+ export { TaplineAgent } from './agent';
40
+ export type { AgentDeps, AgentOptions, LinkingLike, Pairing } from './agent';
41
+ export { TaplineClient, collectDeviceInfo, defaultCapabilities, backoffDelay } from './client';
42
+ export type { ClientOptions, ClientDeps, WebSocketLike } from './client';
43
+ export { methods } from './methods';
44
+ export { press, longPress, typeText, scroll, toggle, openURL, getLogs, reload, screenshot, resolveTarget, configureActions, } from './actions';
45
+ export { tree, setMeasurer, defaultMeasurer } from './inspect';
46
+ export type { Measurer } from './inspect';
47
+ export { getRoots } from './register';
48
+ export { getLogEntries, installLogs, uninstallLogs } from './logs';
49
+ export { TaplineError, PROTOCOL_VERSION } from './types';
50
+ export type { Action, AppInfo, DeviceInfo, ErrorCode, Frame, LogEntry, ScreenInfo, Target, TaplineElement, TreeResult, } from './types';
package/dist/index.js ADDED
@@ -0,0 +1,133 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PROTOCOL_VERSION = exports.TaplineError = exports.uninstallLogs = exports.installLogs = exports.getLogEntries = exports.getRoots = exports.defaultMeasurer = exports.setMeasurer = exports.tree = exports.configureActions = exports.resolveTarget = exports.screenshot = exports.reload = exports.getLogs = exports.openURL = exports.toggle = exports.scroll = exports.typeText = exports.longPress = exports.press = exports.methods = exports.backoffDelay = exports.defaultCapabilities = exports.collectDeviceInfo = exports.TaplineClient = exports.TaplineAgent = exports.secureStoreStorage = exports.memoryStorage = exports.parseTaplineLink = exports.isTaplineLink = exports.registerTaplineCommand = void 0;
4
+ exports.startTapline = startTapline;
5
+ exports.stopTapline = stopTapline;
6
+ const react_native_1 = require("react-native");
7
+ const agent_1 = require("./agent");
8
+ const alerts_1 = require("./alerts");
9
+ const logs_1 = require("./logs");
10
+ const network_1 = require("./network");
11
+ const wait_1 = require("./wait");
12
+ const storage_1 = require("./storage");
13
+ let agent = null;
14
+ let stopNetworkLog = null;
15
+ /** Failed requests go into the app's logs, so `logs` explains a broken screen. */
16
+ function watchNetwork() {
17
+ (0, network_1.installNetworkTracking)();
18
+ (0, wait_1.setNetworkIdleProvider)(() => (0, network_1.inFlight)() === 0);
19
+ stopNetworkLog?.();
20
+ stopNetworkLog = (0, network_1.onNetworkFailure)((failure) => {
21
+ const outcome = failure.status ?? failure.error ?? 'failed';
22
+ const level = failure.status !== null && failure.status < 500 ? 'warn' : 'error';
23
+ (0, logs_1.addLog)(level, `[network] ${failure.method} ${failure.url} → ${outcome}`);
24
+ });
25
+ }
26
+ function unwatchNetwork() {
27
+ stopNetworkLog?.();
28
+ stopNetworkLog = null;
29
+ (0, wait_1.setNetworkIdleProvider)(null);
30
+ (0, network_1.uninstallNetworkTracking)();
31
+ }
32
+ function trimmed(value) {
33
+ return typeof value === 'string' ? value.trim() : '';
34
+ }
35
+ function confirmWithAlert(title, message, ok) {
36
+ return new Promise((resolve) => {
37
+ (0, alerts_1.nativeAlert)(title, message, [
38
+ { text: 'Cancel', style: 'cancel', onPress: () => resolve(false) },
39
+ { text: ok, onPress: () => resolve(true) },
40
+ ], { cancelable: true, onDismiss: () => resolve(false) });
41
+ });
42
+ }
43
+ function notifyWithAlert(title, message) {
44
+ (0, alerts_1.nativeAlert)(title, message);
45
+ }
46
+ /**
47
+ * Start the in-app agent: it reconnects to the computer this app was paired with, and pairs
48
+ * when a Tapline pairing link opens the app. Safe to call more than once; never throws.
49
+ */
50
+ function startTapline(options) {
51
+ if (options?.enabled !== true)
52
+ return;
53
+ try {
54
+ stopTapline();
55
+ const url = trimmed(options.url);
56
+ const token = trimmed(options.token);
57
+ if ((url === '') !== (token === '')) {
58
+ (0, logs_1.originalLog)(`[tapline] url and token go together; ignoring the ${url ? 'url' : 'token'} and waiting for a pairing link`);
59
+ }
60
+ let storage = options.storage ?? (0, storage_1.secureStoreStorage)();
61
+ if (storage === null) {
62
+ (0, logs_1.originalLog)('[tapline] expo-secure-store is not installed, so a pairing lasts until the app restarts (or pass `storage`)');
63
+ storage = (0, storage_1.memoryStorage)();
64
+ }
65
+ (0, logs_1.installLogs)();
66
+ (0, alerts_1.installAlertTracking)({ standIn: options.alerts === 'stand-in' });
67
+ watchNetwork();
68
+ const next = new agent_1.TaplineAgent({ app: options.app, ...(url !== '' && token !== '' ? { direct: { url, token } } : {}) }, { storage, linking: react_native_1.Linking, confirm: confirmWithAlert, notify: notifyWithAlert });
69
+ agent = next;
70
+ void next.start();
71
+ }
72
+ catch {
73
+ // never throw into the app
74
+ }
75
+ }
76
+ function stopTapline() {
77
+ const current = agent;
78
+ agent = null;
79
+ try {
80
+ current?.stop();
81
+ if (current) {
82
+ (0, logs_1.uninstallLogs)();
83
+ (0, alerts_1.uninstallAlertTracking)();
84
+ unwatchNetwork();
85
+ }
86
+ }
87
+ catch {
88
+ // ignore
89
+ }
90
+ }
91
+ var commands_1 = require("./commands");
92
+ Object.defineProperty(exports, "registerTaplineCommand", { enumerable: true, get: function () { return commands_1.registerTaplineCommand; } });
93
+ var link_1 = require("./link");
94
+ Object.defineProperty(exports, "isTaplineLink", { enumerable: true, get: function () { return link_1.isTaplineLink; } });
95
+ Object.defineProperty(exports, "parseTaplineLink", { enumerable: true, get: function () { return link_1.parseTaplineLink; } });
96
+ var storage_2 = require("./storage");
97
+ Object.defineProperty(exports, "memoryStorage", { enumerable: true, get: function () { return storage_2.memoryStorage; } });
98
+ Object.defineProperty(exports, "secureStoreStorage", { enumerable: true, get: function () { return storage_2.secureStoreStorage; } });
99
+ var agent_2 = require("./agent");
100
+ Object.defineProperty(exports, "TaplineAgent", { enumerable: true, get: function () { return agent_2.TaplineAgent; } });
101
+ var client_1 = require("./client");
102
+ Object.defineProperty(exports, "TaplineClient", { enumerable: true, get: function () { return client_1.TaplineClient; } });
103
+ Object.defineProperty(exports, "collectDeviceInfo", { enumerable: true, get: function () { return client_1.collectDeviceInfo; } });
104
+ Object.defineProperty(exports, "defaultCapabilities", { enumerable: true, get: function () { return client_1.defaultCapabilities; } });
105
+ Object.defineProperty(exports, "backoffDelay", { enumerable: true, get: function () { return client_1.backoffDelay; } });
106
+ var methods_1 = require("./methods");
107
+ Object.defineProperty(exports, "methods", { enumerable: true, get: function () { return methods_1.methods; } });
108
+ var actions_1 = require("./actions");
109
+ Object.defineProperty(exports, "press", { enumerable: true, get: function () { return actions_1.press; } });
110
+ Object.defineProperty(exports, "longPress", { enumerable: true, get: function () { return actions_1.longPress; } });
111
+ Object.defineProperty(exports, "typeText", { enumerable: true, get: function () { return actions_1.typeText; } });
112
+ Object.defineProperty(exports, "scroll", { enumerable: true, get: function () { return actions_1.scroll; } });
113
+ Object.defineProperty(exports, "toggle", { enumerable: true, get: function () { return actions_1.toggle; } });
114
+ Object.defineProperty(exports, "openURL", { enumerable: true, get: function () { return actions_1.openURL; } });
115
+ Object.defineProperty(exports, "getLogs", { enumerable: true, get: function () { return actions_1.getLogs; } });
116
+ Object.defineProperty(exports, "reload", { enumerable: true, get: function () { return actions_1.reload; } });
117
+ Object.defineProperty(exports, "screenshot", { enumerable: true, get: function () { return actions_1.screenshot; } });
118
+ Object.defineProperty(exports, "resolveTarget", { enumerable: true, get: function () { return actions_1.resolveTarget; } });
119
+ Object.defineProperty(exports, "configureActions", { enumerable: true, get: function () { return actions_1.configureActions; } });
120
+ var inspect_1 = require("./inspect");
121
+ Object.defineProperty(exports, "tree", { enumerable: true, get: function () { return inspect_1.tree; } });
122
+ Object.defineProperty(exports, "setMeasurer", { enumerable: true, get: function () { return inspect_1.setMeasurer; } });
123
+ Object.defineProperty(exports, "defaultMeasurer", { enumerable: true, get: function () { return inspect_1.defaultMeasurer; } });
124
+ var register_1 = require("./register");
125
+ Object.defineProperty(exports, "getRoots", { enumerable: true, get: function () { return register_1.getRoots; } });
126
+ var logs_2 = require("./logs");
127
+ Object.defineProperty(exports, "getLogEntries", { enumerable: true, get: function () { return logs_2.getLogEntries; } });
128
+ Object.defineProperty(exports, "installLogs", { enumerable: true, get: function () { return logs_2.installLogs; } });
129
+ Object.defineProperty(exports, "uninstallLogs", { enumerable: true, get: function () { return logs_2.uninstallLogs; } });
130
+ var types_1 = require("./types");
131
+ Object.defineProperty(exports, "TaplineError", { enumerable: true, get: function () { return types_1.TaplineError; } });
132
+ Object.defineProperty(exports, "PROTOCOL_VERSION", { enumerable: true, get: function () { return types_1.PROTOCOL_VERSION; } });
133
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAkFA,oCA0BC;AAED,kCAaC;AA3HD,+CAAuC;AACvC,mCAAuC;AACvC,qCAAqF;AACrF,iCAAyE;AACzE,uCAAyG;AACzG,iCAAgD;AAChD,uCAAmF;AA4BnF,IAAI,KAAK,GAAwB,IAAI,CAAC;AACtC,IAAI,cAAc,GAAwB,IAAI,CAAC;AAE/C,kFAAkF;AAClF,SAAS,YAAY;IACnB,IAAA,gCAAsB,GAAE,CAAC;IACzB,IAAA,6BAAsB,EAAC,GAAG,EAAE,CAAC,IAAA,kBAAQ,GAAE,KAAK,CAAC,CAAC,CAAC;IAC/C,cAAc,EAAE,EAAE,CAAC;IACnB,cAAc,GAAG,IAAA,0BAAgB,EAAC,CAAC,OAAO,EAAE,EAAE;QAC5C,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,KAAK,IAAI,QAAQ,CAAC;QAC5D,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,KAAK,IAAI,IAAI,OAAO,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;QACjF,IAAA,aAAM,EAAC,KAAK,EAAE,aAAa,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,GAAG,MAAM,OAAO,EAAE,CAAC,CAAC;IAC3E,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,cAAc;IACrB,cAAc,EA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AChB,IAAA,+BAAsB,GAAE,CAAC;YACzB,cAAc,EAAE,CAAC;QACnB,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,SAAS;IACX,CAAC;AACH,CAAC;AAED,uCAAoD;AAA3C,kHAAA,sBAAsB,OAAA;AAE/B,+BAAyD;AAAhD,qGAAA,aAAa,OAAA;AAAE,wGAAA,gBAAgB,OAAA;AAExC,qCAA8D;AAArD,wGAAA,aAAa,OAAA;AAAE,6GAAA,kBAAkB,OAAA;AAE1C,iCAAuC;AAA9B,qGAAA,YAAY,OAAA;AAErB,mCAA+F;AAAtF,uGAAA,aAAa,OAAA;AAAE,2GAAA,iBAAiB,OAAA;AAAE,6GAAA,mBAAmB,OAAA;AAAE,sGAAA,YAAY,OAAA;AAE5E,qCAAoC;AAA3B,kGAAA,OAAO,OAAA;AAChB,qCAYmB;AAXjB,gGAAA,KAAK,OAAA;AACL,oGAAA,SAAS,OAAA;AACT,mGAAA,QAAQ,OAAA;AACR,iGAAA,MAAM,OAAA;AACN,iGAAA,MAAM,OAAA;AACN,kGAAA,OAAO,OAAA;AACP,kGAAA,OAAO,OAAA;AACP,iGAAA,MAAM,OAAA;AACN,qGAAA,UAAU,OAAA;AACV,wGAAA,aAAa,OAAA;AACb,2GAAA,gBAAgB,OAAA;AAElB,qCAA+D;AAAtD,+FAAA,IAAI,OAAA;AAAE,sGAAA,WAAW,OAAA;AAAE,0GAAA,eAAe,OAAA;AAE3C,uCAAsC;AAA7B,oGAAA,QAAQ,OAAA;AACjB,+BAAmE;AAA1D,qGAAA,aAAa,OAAA;AAAE,mGAAA,WAAW,OAAA;AAAE,qGAAA,aAAa,OAAA;AAClD,iCAAyD;AAAhD,qGAAA,YAAY,OAAA;AAAE,yGAAA,gBAAgB,OAAA"}
@@ -0,0 +1,245 @@
1
+ import { type Fiber, type FiberRootLike } from './fiber';
2
+ import { type Action, type Frame, type ScreenInfo, type TaplineElement, type TreeResult } from './types';
3
+ /** How much of an element's text a line shows (AGENT-TOOLS v1.5); a cut ends with `…(+N)`, the count left out. */
4
+ export declare const MAX_TEXT = 200;
5
+ /**
6
+ * How much text a container keeps for matching, and how much of any text goes over the wire. A Text
7
+ * host keeps all of its own text, so `wait_for` and `{text}` targets check all of it.
8
+ */
9
+ export declare const MAX_KEPT_TEXT = 2000;
10
+ /** The first `max` UTF-16 units of a text, one fewer when that would cut a character (an emoji) in half. */
11
+ export declare function sliceWhole(text: string, max: number): string;
12
+ /** Text as a line quotes it: whitespace flattened, cut at `max` with `…(+N)` (N counts `more` too: what was cut off before). */
13
+ export declare function cutText(raw: string, more?: number, max?: number): string;
14
+ /** One host component (View, Text, TextInput, ...) in the current fiber tree. */
15
+ export interface HostNode {
16
+ /** Position in document order. */
17
+ index: number;
18
+ /** Index of the nearest host ancestor, -1 for top-level. */
19
+ parent: number;
20
+ fiber: Fiber;
21
+ hostType: string;
22
+ /** Composite fibers between this host and the previous host, innermost first. */
23
+ owners: Fiber[];
24
+ /** Descendant text, whitespace-collapsed and trimmed: all of it for a Text host, at most MAX_KEPT_TEXT chars otherwise. */
25
+ text: string;
26
+ isText: boolean;
27
+ insideText: boolean;
28
+ }
29
+ /** Text as an agent sees and matches it: without the invisible direction marks. */
30
+ export declare function displayText(raw: string): string;
31
+ /**
32
+ * Whether a host element and everything inside it is out of the user's reach, so Tapline leaves
33
+ * it out: hidden from accessibility (React Native Screens marks a screen covered by another this
34
+ * way, React Navigation its unfocused screens), not displayed, an inactive screen, or a tab that
35
+ * isn't selected (native tabs keep every tab mounted and turn off touches on the hidden ones).
36
+ */
37
+ export declare function hidesSubtree(hostType: string, props: Record<string, unknown>): boolean;
38
+ /** The navigation object React Navigation hands each screen (only what Tapline calls). */
39
+ export interface NavigationLike {
40
+ isFocused?: () => boolean;
41
+ canGoBack?: () => boolean;
42
+ goBack?: () => void;
43
+ navigate?: (name: string) => void;
44
+ getState?: () => unknown;
45
+ }
46
+ /** A visible screen component that received React Navigation's `route` and `navigation` props. */
47
+ export interface RouteFound {
48
+ key: string;
49
+ name: string;
50
+ params: unknown;
51
+ navigation: NavigationLike;
52
+ focused: boolean;
53
+ /** Route names from the outermost navigator to this one. */
54
+ chain: string[];
55
+ }
56
+ /** One tab of a native tab bar (drawn by the OS, so not in the host tree as a button). */
57
+ export interface TabFound {
58
+ fiber: Fiber;
59
+ title: string;
60
+ screenKey: string | null;
61
+ selected: boolean;
62
+ }
63
+ export declare function collectNodes(roots?: FiberRootLike[]): HostNode[];
64
+ /** The focused screen: the deepest focused route, the last one on ties (drawn on top). */
65
+ export declare function currentRoute(routes: RouteFound[]): RouteFound | null;
66
+ /** First defined prop `key` on the host fiber, then on its owners (innermost first). */
67
+ export declare function findProp(node: HostNode, key: string): unknown;
68
+ export declare function findHandler(node: HostNode, key: string): ((...args: unknown[]) => unknown) | null;
69
+ export declare function isScrollNode(node: HostNode): boolean;
70
+ export declare function isInputNode(node: HostNode): boolean;
71
+ export declare function isSwitchNode(node: HostNode): boolean;
72
+ export declare function rememberTyped(node: HostNode, text: string): void;
73
+ export declare function currentInputValue(node: HostNode): string;
74
+ export declare function roleName(info: Pick<Entry['info'], 'role' | 'type' | 'actions'>): string;
75
+ export interface NodeInfo {
76
+ type: string;
77
+ role: string | null;
78
+ testID: string | null;
79
+ label: string | null;
80
+ text: string;
81
+ value: string | null;
82
+ /** An empty input's placeholder, else null. */
83
+ placeholder: string | null;
84
+ actions: Action[];
85
+ disabled: boolean;
86
+ selected: boolean;
87
+ checked: boolean | 'mixed' | null;
88
+ /** Shown in `tree` without `all`. */
89
+ interesting: boolean;
90
+ }
91
+ export declare function describeNodes(nodes: HostNode[]): NodeInfo[];
92
+ export type Measurer = (fiber: Fiber) => Promise<Frame | null>;
93
+ /**
94
+ * Public instances of a host fiber, in preference order:
95
+ * - old architecture: `stateNode` itself
96
+ * - Fabric: `stateNode.canonical.publicInstance` (null until a ref was requested)
97
+ */
98
+ export declare function publicInstancesOf(fiber: Fiber): unknown[];
99
+ export declare const defaultMeasurer: Measurer;
100
+ /** Inject a measuring function (tests); pass null to restore the default. */
101
+ export declare function setMeasurer(next: Measurer | null): void;
102
+ export declare function measureFiber(fiber: Fiber): Promise<Frame | null>;
103
+ /**
104
+ * The host fiber a real touch at window point (x, y) would land on: null when nothing there
105
+ * takes touches, undefined when this can't be told (old architecture, tests, a timeout).
106
+ */
107
+ export type HitTester = (x: number, y: number) => Promise<Fiber | null | undefined>;
108
+ /**
109
+ * The host fibers of mounted `Modal`s, in tree order. A closed `Modal` renders nothing, but one
110
+ * that is being dismissed stays mounted (with `visible` false) until iOS ends the animation; it
111
+ * still covers the screen, so it is listed here too (see `closingModalHosts`).
112
+ */
113
+ export declare function openModalHosts(): Fiber[];
114
+ /** The mounted modal hosts that are on their way out: `visible` is false while the dismiss animation runs. */
115
+ export declare function closingModalHosts(): Fiber[];
116
+ /** Whether a `Modal` is open: its window covers the whole app, the native tab bar included. */
117
+ export declare function modalOpen(): boolean;
118
+ /**
119
+ * Fabric's own hit test (`findNodeAtPoint`, as React Native's element inspector uses): open modals
120
+ * first (a modal's window covers the whole screen, so a touch never reaches what's behind it),
121
+ * then the roots, topmost first.
122
+ */
123
+ export declare const defaultHitTester: HitTester;
124
+ /** Inject a hit tester (tests); pass null to restore the default. */
125
+ export declare function setHitTester(next: HitTester | null): void;
126
+ export declare function hitTest(x: number, y: number): Promise<Fiber | null | undefined>;
127
+ /** Whether `inner` is `outer` or inside it (following `return` links). */
128
+ export declare function isWithin(inner: Fiber, outer: Fiber): boolean;
129
+ export declare function getScreen(): ScreenInfo;
130
+ export declare function isOnScreen(frame: Frame, screen: ScreenInfo): boolean;
131
+ export declare function frameContains(frame: Frame, x: number, y: number): boolean;
132
+ export interface Entry {
133
+ node: HostNode;
134
+ info: NodeInfo;
135
+ /** Set for a tab of a native tab bar: pressing it switches tabs through navigation. */
136
+ tab?: TabFound;
137
+ /** Set for the back button of the native navigation bar: pressing it goes back. */
138
+ navBack?: true;
139
+ }
140
+ export interface Snapshot {
141
+ nodes: HostNode[];
142
+ entries: Entry[];
143
+ screen: ScreenInfo;
144
+ /** Visible screens that got React Navigation's props, in tree order. */
145
+ routes: RouteFound[];
146
+ /**
147
+ * Set while a modal (a sheet) is open: what the open sheet hides, worked out on first call. The
148
+ * look leaves the screen behind a sheet out, so `entries` don't hold it; this does, with the
149
+ * `nodes` they index into (the sheet's own elements are among them, in tree order).
150
+ */
151
+ behind?: () => BehindSheet;
152
+ }
153
+ /** The screen behind the topmost open modal, which the element list leaves out. */
154
+ export interface BehindSheet {
155
+ /** The topmost modal's host fiber. */
156
+ sheet: Fiber;
157
+ /** Everything walked (behind and inside the sheet); `entries[i]` describes `nodes[i]`. */
158
+ nodes: HostNode[];
159
+ entries: Entry[];
160
+ /** Only the elements outside the sheet: what it covers. */
161
+ hidden: Entry[];
162
+ }
163
+ /**
164
+ * An object that stays the same for a host element across re-renders: Fabric clones `stateNode`
165
+ * on every update but keeps its `canonical`; elsewhere the stateNode, else the fiber itself.
166
+ */
167
+ export declare function stableObjectKey(fiber: Fiber): object;
168
+ /** Take a fresh view of the current fiber tree (no measuring). */
169
+ export declare function takeSnapshot(): Snapshot;
170
+ /** Where iOS draws the native tab bar: from `top` to the bottom of the screen, `tabs` spread evenly. */
171
+ export interface NativeTabBar {
172
+ top: number;
173
+ tabs: Entry[];
174
+ }
175
+ /**
176
+ * The native tab bar, which iOS draws outside React's tree: on an iPhone in portrait, 49 points
177
+ * above the home-indicator inset, its items spread evenly across the width (the classic and the
178
+ * iOS 26 bars alike). Null without native tabs, on other platforms, in landscape, and while a
179
+ * modal's window covers it.
180
+ */
181
+ export declare function nativeTabBar(snapshot: Snapshot): NativeTabBar | null;
182
+ /** The tab under x on the bar. */
183
+ export declare function tabAt(bar: NativeTabBar, x: number, width: number): Entry | undefined;
184
+ /** Where iOS draws the native navigation bar: from the top of the screen to `bottom`. */
185
+ export interface NativeNavBar {
186
+ top: 0;
187
+ bottom: number;
188
+ title?: string;
189
+ canGoBack: boolean;
190
+ /** The header config fiber; what is inside it is drawn in the bar and stays reachable. */
191
+ header: Fiber;
192
+ }
193
+ /**
194
+ * The native navigation bar react-native-screens draws for the visible screen, outside React's
195
+ * layout. The visible header is the deepest `RNSScreenStackHeaderConfig` reached by walking each
196
+ * root and, at an `RNSScreenStack`, descending only into its last (top) `RNSScreen`. Null without
197
+ * one, with `hidden` set, on other platforms, in landscape, and while a modal's window covers it.
198
+ */
199
+ export declare function nativeNavBar(snapshot: Snapshot): NativeNavBar | null;
200
+ /** Whether a fiber is drawn inside the navigation bar (a custom header item): it stays reachable. */
201
+ export declare function inNavBarHeader(bar: NativeNavBar, fiber: Fiber): boolean;
202
+ export declare function resetRefs(): void;
203
+ /** The ref for a fiber in the remembered snapshot, allocating a new one when unseen. */
204
+ export declare function refFor(fiber: Fiber): string;
205
+ export interface OverlayElement {
206
+ ref: string | null;
207
+ type: string;
208
+ label: string | null;
209
+ id: string | null;
210
+ frame: Frame;
211
+ }
212
+ /**
213
+ * `overlay`: the elements on screen with their frames and the UI revision, for the live
214
+ * viewer's boxes. Unlike `tree` it leaves refs and the change baseline alone.
215
+ */
216
+ export declare function overlay(): Promise<{
217
+ rev: number;
218
+ screen: ScreenInfo;
219
+ elements: OverlayElement[];
220
+ }>;
221
+ export declare function fiberForRef(ref: string): Fiber | null;
222
+ /** An entry as an element. `ref` is the fiber's ref unless one is passed ('' for an element that isn't listed). */
223
+ export declare function toElement(entry: Entry, frame: Frame | null, ref?: string): TaplineElement;
224
+ /** Forget the previous tree (tests; a new connection). */
225
+ export declare function forgetLastTree(): void;
226
+ /** An entry about to be listed, with its measured frame. */
227
+ export interface Listed {
228
+ entry: Entry;
229
+ frame: Frame | null;
230
+ }
231
+ /**
232
+ * AGENT-TOOLS v1.3 "Duplicates": when an element and its nearest listed ancestor have the same
233
+ * quoted text and the same rect (within 1 pt), only one is listed: the one that takes an action,
234
+ * else (both or neither do) the ancestor. Roles may differ: a labelled wrapper around an input
235
+ * lists only the input. Elements are in tree order, so an ancestor comes before its descendants.
236
+ */
237
+ export declare function foldDuplicates(snapshot: Snapshot, listed: Listed[]): Listed[];
238
+ /**
239
+ * `tree`: the screen as elements. A look (no `changes`) starts the refs at e1 again. With
240
+ * `changes: true`, which the host asks for in an action's answer, elements still on screen keep
241
+ * their refs and new ones count on from the highest ref handed out since the last look, so an old
242
+ * ref never lands on another element; it also reports what changed since the previous call. A new
243
+ * host session has no previous call (`forgetLastTree`), so its first list starts over like a look.
244
+ */
245
+ export declare function tree(params?: unknown): Promise<TreeResult>;