react-native-contacts 8.0.3 → 8.0.5

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
@@ -4,7 +4,7 @@
4
4
  "type": "git",
5
5
  "url": "https://github.com/rt2zz/react-native-contacts.git"
6
6
  },
7
- "version": "8.0.3",
7
+ "version": "8.0.5",
8
8
  "description": "React Native Contacts (android & ios)",
9
9
  "nativePackage": true,
10
10
  "keywords": [
@@ -30,7 +30,7 @@
30
30
  },
31
31
  "homepage": "https://github.com/rt2zz/react-native-contacts",
32
32
  "main": "index.ts",
33
- "types": "index.ts",
33
+ "types": "index.d.ts",
34
34
  "scripts": {
35
35
  "test": "echo \"Error: no test specified\" && exit 1"
36
36
  },
@@ -1,6 +1,6 @@
1
1
  import type { TurboModule } from "react-native/Libraries/TurboModule/RCTExport";
2
2
  import { TurboModuleRegistry } from "react-native";
3
- import { Contact, PermissionType } from "../type";
3
+ import { Contact, Group, PermissionType } from "../type";
4
4
 
5
5
  export interface Spec extends TurboModule {
6
6
  getAll: () => Promise<any>;
@@ -22,6 +22,20 @@ export interface Spec extends TurboModule {
22
22
  requestPermission: () => Promise<PermissionType>;
23
23
  writePhotoToPath: (contactId: string, file: string) => Promise<boolean>;
24
24
  iosEnableNotesUsage: (enabled: boolean) => void;
25
+ getGroups(): Promise<Group[]>;
26
+ getGroup: (identifier: string) => Promise<Group | null>;
27
+ deleteGroup(identifier: string): Promise<boolean>;
28
+ updateGroup(identifier: string, groupData: Object): Promise<Group>;
29
+ addGroup(group: Object): Promise<Group>;
30
+ contactsInGroup(identifier: string): Promise<Contact[]>;
31
+ addContactsToGroup(
32
+ groupIdentifier: string,
33
+ contactIdentifiers: string[]
34
+ ): Promise<boolean>;
35
+ removeContactsFromGroup(
36
+ groupIdentifier: string,
37
+ contactIdentifiers: string[]
38
+ ): Promise<boolean>;
25
39
  }
26
40
 
27
41
  export default TurboModuleRegistry.get<Spec>("RCTContacts");
package/type.ts CHANGED
@@ -61,4 +61,9 @@ export interface Contact {
61
61
  note: string;
62
62
  }
63
63
 
64
- export type PermissionType = 'authorized' | 'limited' | 'denied' | 'undefined'
64
+ export interface Group {
65
+ identifier: string;
66
+ name: string;
67
+ }
68
+
69
+ export type PermissionType = "authorized" | "limited" | "denied" | "undefined";