@livx.cc/native-kit 0.19.0 → 0.20.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@livx.cc/native-kit",
3
- "version": "0.19.0",
3
+ "version": "0.20.0",
4
4
  "description": "Isomorphic native-capabilities kit for PWAs — same API in browser and in an appwrap native shell. Zero dependencies.",
5
5
  "license": "MIT",
6
6
  "author": "Elya Livshitz",
@@ -297,6 +297,9 @@ export class WebAdapter implements NativeKitAdapter {
297
297
  return { picked: true, name: c.name?.[0], phones: c.tel, emails: c.email } as T;
298
298
  }
299
299
 
300
+ case 'contacts.getAll':
301
+ throw new KitError('UNSUPPORTED', 'No bulk contacts read on web — use contacts.pick');
302
+
300
303
  case 'calendar.createEvent':
301
304
  throw new KitError('UNSUPPORTED', 'No calendar access on web');
302
305
 
@@ -7,6 +7,12 @@ export interface PickedContact {
7
7
  emails?: string[];
8
8
  }
9
9
 
10
+ export interface Contact {
11
+ name?: string;
12
+ phones?: string[];
13
+ emails?: string[];
14
+ }
15
+
10
16
  /** Contact picker — native: CNContactPicker (no permission needed); web: Contact Picker API where present. */
11
17
  export class ContactsModule {
12
18
  constructor(private kit: NativeKit) {}
@@ -19,4 +25,9 @@ export class ContactsModule {
19
25
  pick(): Promise<PickedContact> {
20
26
  return this.kit.invoke('contacts.pick', undefined, { timeoutMs: 120_000 });
21
27
  }
28
+
29
+ /** Read the full address book; native-only (requires permission), unsupported on web. */
30
+ getAll(): Promise<{ contacts: Contact[] }> {
31
+ return this.kit.invoke('contacts.getAll', undefined, { timeoutMs: 120_000 });
32
+ }
22
33
  }