@corewire/companion-link 0.0.0 → 1.0.0-next.2

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/README.md CHANGED
@@ -1,3 +1,32 @@
1
1
  # @corewire/companion-link
2
2
 
3
- This version reserves the name. The first CoreWire release follows; see https://corewire.dev.
3
+ Companion Link for Node.js: the protocol an iPhone uses to control an Apple TV. A session gives HID keys, touch, text input, power, apps, accounts, media and system controls.
4
+
5
+ Part of [CoreWire](https://corewire.dev). To control a device without handling sessions yourself, use `@corewire/devices`.
6
+
7
+ ## Install
8
+
9
+ ```sh
10
+ npm install @corewire/companion-link@next
11
+ ```
12
+
13
+ Requires Node.js 18.17 or later (20.3 or later on the 20 line).
14
+
15
+ ## Example
16
+
17
+ ```ts
18
+ import { connect, discover, toTarget } from '@corewire/companion-link';
19
+
20
+ const [device] = await discover();
21
+ const session = await connect(toTarget(device), {credentials});
22
+
23
+ const apps = await session.apps.list();
24
+ await session.apps.launch(apps[0].bundleId);
25
+ await session.close();
26
+ ```
27
+
28
+ `credentials` come from a PIN pairing with `pair(target)`.
29
+
30
+ ## License
31
+
32
+ MIT
@@ -0,0 +1,18 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __defProp = Object.defineProperty;
3
+ var __exportAll = (all, no_symbols) => {
4
+ let target = {};
5
+ for (var name in all) {
6
+ __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: true
9
+ });
10
+ }
11
+ if (!no_symbols) {
12
+ __defProp(target, Symbol.toStringTag, { value: "Module" });
13
+ }
14
+ return target;
15
+ };
16
+
17
+ //#endregion
18
+ export { __exportAll as t };