MCPcopy Index your code
hub / github.com/callstack/agent-device / createSystemBackend

Function createSystemBackend

src/commands/system/runtime/system.test.ts:81–116  ·  view source on GitHub ↗
(calls: unknown[])

Source from the content-addressed store, hash-verified

79});
80
81function createSystemBackend(calls: unknown[]): AgentDeviceBackend {
82 return {
83 platform: 'ios',
84 pressBack: async (context, options) => {
85 calls.push({ command: 'pressBack', mode: options?.mode, session: context.session });
86 return { ok: true };
87 },
88 pressHome: async (context) => {
89 calls.push({ command: 'pressHome', session: context.session });
90 },
91 rotate: async (_context, orientation) => {
92 calls.push({ command: 'rotate', orientation });
93 },
94 setKeyboard: async (_context, options) => {
95 calls.push({ command: 'setKeyboard', options });
96 return { action: options.action, dismissed: true, visible: false };
97 },
98 getClipboard: async () => {
99 calls.push({ command: 'getClipboard' });
100 return { text: 'copied' };
101 },
102 setClipboard: async (_context, text) => {
103 calls.push({ command: 'setClipboard', text });
104 },
105 openSettings: async (_context, target) => {
106 calls.push({ command: 'openSettings', target });
107 },
108 handleAlert: async (_context, action, options) => {
109 calls.push({ command: 'handleAlert', action, timeoutMs: options?.timeoutMs });
110 return { kind: 'alertHandled', handled: true, button: 'OK' };
111 },
112 openAppSwitcher: async () => {
113 calls.push({ command: 'openAppSwitcher' });
114 },
115 };
116}

Callers 1

system.test.tsFile · 0.85

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected