@symbiote-native/contacts 0.1.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 (117) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +174 -0
  3. package/build/angular/contact-access-button/index.d.ts +18 -0
  4. package/build/angular/contact-access-button/index.js +123 -0
  5. package/build/angular/index.d.ts +2 -0
  6. package/build/angular/index.js +3 -0
  7. package/build/core/contact-access-button.d.ts +29 -0
  8. package/build/core/contact-access-button.js +27 -0
  9. package/build/core/contact.d.ts +3 -0
  10. package/build/core/contact.js +3 -0
  11. package/build/core/container.d.ts +5 -0
  12. package/build/core/container.js +5 -0
  13. package/build/core/enums.d.ts +53 -0
  14. package/build/core/enums.js +56 -0
  15. package/build/core/group.d.ts +5 -0
  16. package/build/core/group.js +4 -0
  17. package/build/core/index.d.ts +8 -0
  18. package/build/core/index.js +7 -0
  19. package/build/core/listeners.d.ts +3 -0
  20. package/build/core/listeners.js +11 -0
  21. package/build/core/native-module.d.ts +177 -0
  22. package/build/core/native-module.js +63 -0
  23. package/build/core/permissions.d.ts +3 -0
  24. package/build/core/permissions.js +7 -0
  25. package/build/core/types.d.ts +244 -0
  26. package/build/core/types.js +1 -0
  27. package/build/legacy/contacts.d.ts +30 -0
  28. package/build/legacy/contacts.js +177 -0
  29. package/build/legacy/enums.d.ts +68 -0
  30. package/build/legacy/enums.js +73 -0
  31. package/build/legacy/index.d.ts +3 -0
  32. package/build/legacy/index.js +3 -0
  33. package/build/legacy/native-module.d.ts +30 -0
  34. package/build/legacy/native-module.js +4 -0
  35. package/build/legacy/types.d.ts +158 -0
  36. package/build/legacy/types.js +1 -0
  37. package/build/react/contact-access-button.d.ts +10 -0
  38. package/build/react/contact-access-button.js +11 -0
  39. package/build/react/index.d.ts +2 -0
  40. package/build/react/index.js +2 -0
  41. package/build/solid/contact-access-button.d.ts +10 -0
  42. package/build/solid/contact-access-button.js +15 -0
  43. package/build/solid/index.d.ts +2 -0
  44. package/build/solid/index.js +2 -0
  45. package/build/svelte/contact-access-button.svelte +18 -0
  46. package/build/svelte/contact-access-button.svelte.d.ts +4 -0
  47. package/build/svelte/index.d.ts +7 -0
  48. package/build/svelte/index.js +8 -0
  49. package/build/vue/contact-access-button.d.ts +19 -0
  50. package/build/vue/contact-access-button.js +19 -0
  51. package/build/vue/index.d.ts +2 -0
  52. package/build/vue/index.js +2 -0
  53. package/build-ngc/angular/contact-access-button/index.d.ts +21 -0
  54. package/build-ngc/angular/contact-access-button/index.js +59 -0
  55. package/build-ngc/angular/contact-access-button/index.js.map +1 -0
  56. package/build-ngc/angular/index.d.ts +2 -0
  57. package/build-ngc/angular/index.js +4 -0
  58. package/build-ngc/angular/index.js.map +1 -0
  59. package/build-ngc/core/contact-access-button.d.ts +29 -0
  60. package/build-ngc/core/contact-access-button.js +28 -0
  61. package/build-ngc/core/contact-access-button.js.map +1 -0
  62. package/build-ngc/core/contact.d.ts +3 -0
  63. package/build-ngc/core/contact.js +4 -0
  64. package/build-ngc/core/contact.js.map +1 -0
  65. package/build-ngc/core/container.d.ts +5 -0
  66. package/build-ngc/core/container.js +6 -0
  67. package/build-ngc/core/container.js.map +1 -0
  68. package/build-ngc/core/enums.d.ts +53 -0
  69. package/build-ngc/core/enums.js +57 -0
  70. package/build-ngc/core/enums.js.map +1 -0
  71. package/build-ngc/core/group.d.ts +5 -0
  72. package/build-ngc/core/group.js +5 -0
  73. package/build-ngc/core/group.js.map +1 -0
  74. package/build-ngc/core/index.d.ts +8 -0
  75. package/build-ngc/core/index.js +8 -0
  76. package/build-ngc/core/index.js.map +1 -0
  77. package/build-ngc/core/listeners.d.ts +3 -0
  78. package/build-ngc/core/listeners.js +12 -0
  79. package/build-ngc/core/listeners.js.map +1 -0
  80. package/build-ngc/core/native-module.d.ts +177 -0
  81. package/build-ngc/core/native-module.js +64 -0
  82. package/build-ngc/core/native-module.js.map +1 -0
  83. package/build-ngc/core/permissions.d.ts +3 -0
  84. package/build-ngc/core/permissions.js +8 -0
  85. package/build-ngc/core/permissions.js.map +1 -0
  86. package/build-ngc/core/types.d.ts +244 -0
  87. package/build-ngc/core/types.js +2 -0
  88. package/build-ngc/core/types.js.map +1 -0
  89. package/native-link.json +26 -0
  90. package/package.json +152 -0
  91. package/src/angular/contact-access-button/index.ts +45 -0
  92. package/src/angular/index.ts +3 -0
  93. package/src/core/contact-access-button.ts +83 -0
  94. package/src/core/contact.ts +3 -0
  95. package/src/core/container.ts +5 -0
  96. package/src/core/enums.ts +55 -0
  97. package/src/core/group.ts +4 -0
  98. package/src/core/index.ts +14 -0
  99. package/src/core/listeners.ts +19 -0
  100. package/src/core/native-module.ts +281 -0
  101. package/src/core/permissions.ts +10 -0
  102. package/src/core/types.ts +220 -0
  103. package/src/legacy/contacts.ts +274 -0
  104. package/src/legacy/enums.ts +72 -0
  105. package/src/legacy/index.ts +3 -0
  106. package/src/legacy/native-module.ts +66 -0
  107. package/src/legacy/types.ts +159 -0
  108. package/src/react/contact-access-button.ts +20 -0
  109. package/src/react/index.ts +2 -0
  110. package/src/solid/contact-access-button.ts +24 -0
  111. package/src/solid/index.ts +2 -0
  112. package/src/svelte/contact-access-button.svelte +18 -0
  113. package/src/svelte/index.ts +10 -0
  114. package/src/svelte/svelte-ambient.d.ts +3 -0
  115. package/src/svelte/svelte-compile.test-helper.ts +7 -0
  116. package/src/vue/contact-access-button.ts +24 -0
  117. package/src/vue/index.ts +2 -0
@@ -0,0 +1,177 @@
1
+ import type { EventSubscription } from 'expo-modules-core';
2
+ import type { ContactDate, ContactPatch, ContactQueryOptions, ContactsPermissionResponse, CreateContactRecord, CreateFormOptions, ExistingAddress, ExistingDate, ExistingEmail, ExistingExtraName, ExistingImAddress, ExistingPhone, ExistingRelation, ExistingSocialProfile, ExistingUrlAddress, FormOptions, NewAddress, NewDate, NewEmail, NewExtraName, NewImAddress, NewPhone, NewRelation, NewSocialProfile, NewUrlAddress, NonGregorianBirthday, PartialContactDetails } from './types';
3
+ import type { ContactField } from './enums';
4
+ export declare const ON_CONTACTS_CHANGE_EVENT_NAME = "contactsDidChange";
5
+ export declare class NativeContact {
6
+ constructor(id: string);
7
+ readonly id: string;
8
+ delete(): Promise<void>;
9
+ patch(contact: ContactPatch): Promise<void>;
10
+ update(contact: CreateContactRecord): Promise<void>;
11
+ getDetails<T extends readonly ContactField[]>(fields?: T): Promise<PartialContactDetails<T>>;
12
+ addEmail(email: NewEmail): Promise<string>;
13
+ getEmails(): Promise<ExistingEmail[]>;
14
+ deleteEmail(email: ExistingEmail): Promise<void>;
15
+ updateEmail(updatedEmail: ExistingEmail): Promise<void>;
16
+ addPhone(phone: NewPhone): Promise<string>;
17
+ getPhones(): Promise<ExistingPhone[]>;
18
+ deletePhone(phone: ExistingPhone): Promise<void>;
19
+ updatePhone(updatedPhone: ExistingPhone): Promise<void>;
20
+ addDate(date: NewDate): Promise<string>;
21
+ getDates(): Promise<ExistingDate[]>;
22
+ deleteDate(date: ExistingDate): Promise<void>;
23
+ updateDate(updatedDate: ExistingDate): Promise<void>;
24
+ /** @platform android */
25
+ addExtraName(extraName: NewExtraName): Promise<string>;
26
+ /** @platform android */
27
+ getExtraNames(): Promise<ExistingExtraName[]>;
28
+ /** @platform android */
29
+ deleteExtraName(extraName: ExistingExtraName | string): Promise<void>;
30
+ /** @platform android */
31
+ updateExtraName(updatedExtraName: ExistingExtraName): Promise<void>;
32
+ addAddress(address: NewAddress): Promise<string>;
33
+ getAddresses(): Promise<ExistingAddress[]>;
34
+ deleteAddress(address: ExistingAddress): Promise<void>;
35
+ updateAddress(updatedAddress: ExistingAddress): Promise<void>;
36
+ addRelation(relation: NewRelation): Promise<string>;
37
+ getRelations(): Promise<ExistingRelation[]>;
38
+ deleteRelation(relation: ExistingRelation | string): Promise<void>;
39
+ updateRelation(updatedRelation: ExistingRelation): Promise<void>;
40
+ addUrlAddress(urlAddress: NewUrlAddress): Promise<string>;
41
+ getUrlAddresses(): Promise<ExistingUrlAddress[]>;
42
+ deleteUrlAddress(urlAddress: ExistingUrlAddress): Promise<void>;
43
+ updateUrlAddress(updatedUrlAddress: ExistingUrlAddress): Promise<void>;
44
+ /** @platform ios */
45
+ addSocialProfile?(socialProfile: NewSocialProfile): Promise<string>;
46
+ /** @platform ios */
47
+ getSocialProfiles?(): Promise<ExistingSocialProfile[]>;
48
+ /** @platform ios */
49
+ deleteSocialProfile?(socialProfile: ExistingSocialProfile): Promise<void>;
50
+ /** @platform ios */
51
+ updateSocialProfile?(updatedSocialProfile: ExistingSocialProfile): Promise<void>;
52
+ /** @platform ios */
53
+ addImAddress?(imAddress: NewImAddress): Promise<string>;
54
+ /** @platform ios */
55
+ getImAddresses?(): Promise<ExistingImAddress[]>;
56
+ /** @platform ios */
57
+ deleteImAddress?(imAddress: ExistingImAddress): Promise<void>;
58
+ /** @platform ios */
59
+ updateImAddress?(updatedImAddress: ExistingImAddress): Promise<void>;
60
+ editWithForm(options?: FormOptions): Promise<boolean>;
61
+ getFullName(): Promise<string>;
62
+ /** @platform android */
63
+ getIsFavourite?(): Promise<boolean>;
64
+ /** @platform android */
65
+ setIsFavourite?(isFavourite: boolean): Promise<boolean>;
66
+ getGivenName(): Promise<string | null>;
67
+ setGivenName(givenName: string | null): Promise<boolean>;
68
+ getFamilyName(): Promise<string | null>;
69
+ setFamilyName(familyName: string | null): Promise<boolean>;
70
+ getMiddleName(): Promise<string | null>;
71
+ setMiddleName(middleName: string | null): Promise<boolean>;
72
+ /** @platform ios */
73
+ getMaidenName?(): Promise<string | null>;
74
+ /** @platform ios */
75
+ setMaidenName?(maidenName: string | null): Promise<boolean>;
76
+ /** @platform ios */
77
+ getNickname?(): Promise<string | null>;
78
+ /** @platform ios */
79
+ setNickname?(nickname: string | null): Promise<boolean>;
80
+ getPrefix(): Promise<string | null>;
81
+ setPrefix(prefix: string | null): Promise<boolean>;
82
+ getSuffix(): Promise<string | null>;
83
+ setSuffix(suffix: string | null): Promise<boolean>;
84
+ getPhoneticGivenName(): Promise<string | null>;
85
+ setPhoneticGivenName(phoneticGivenName: string | null): Promise<boolean>;
86
+ getPhoneticMiddleName(): Promise<string | null>;
87
+ setPhoneticMiddleName(phoneticMiddleName: string | null): Promise<boolean>;
88
+ getPhoneticFamilyName(): Promise<string | null>;
89
+ setPhoneticFamilyName(phoneticFamilyName: string | null): Promise<boolean>;
90
+ getCompany(): Promise<string | null>;
91
+ setCompany(company: string | null): Promise<boolean>;
92
+ getDepartment(): Promise<string | null>;
93
+ setDepartment(department: string | null): Promise<boolean>;
94
+ getJobTitle(): Promise<string | null>;
95
+ setJobTitle(jobTitle: string | null): Promise<boolean>;
96
+ getPhoneticCompanyName(): Promise<string | null>;
97
+ setPhoneticCompanyName(phoneticCompanyName: string | null): Promise<boolean>;
98
+ getNote(): Promise<string | null>;
99
+ setNote(note: string | null): Promise<boolean>;
100
+ getImage(): Promise<string | null>;
101
+ setImage(imageUri: string | null): Promise<boolean>;
102
+ getThumbnail(): Promise<string | null>;
103
+ /** @platform ios */
104
+ getBirthday?(): Promise<ContactDate | null>;
105
+ /** @platform ios */
106
+ setBirthday?(birthday: ContactDate | null): Promise<boolean>;
107
+ /** @platform ios */
108
+ getNonGregorianBirthday?(): Promise<NonGregorianBirthday | null>;
109
+ /** @platform ios */
110
+ setNonGregorianBirthday?(nonGregorianBirthday: NonGregorianBirthday | null): Promise<boolean>;
111
+ static getAll(options?: ContactQueryOptions): Promise<NativeContact[]>;
112
+ static create(contact: CreateContactRecord): Promise<NativeContact>;
113
+ static presentCreateForm(contact?: CreateContactRecord, options?: CreateFormOptions): Promise<boolean>;
114
+ static getCount(): Promise<number>;
115
+ static hasAny(): Promise<boolean>;
116
+ static presentPicker(): Promise<NativeContact | null>;
117
+ /** @platform ios */
118
+ static presentAccessPicker?(): Promise<NativeContact[]>;
119
+ static getAllDetails<T extends readonly ContactField[]>(fields: T, options?: ContactQueryOptions): Promise<PartialContactDetails<T>[]>;
120
+ }
121
+ /** @platform ios - Android has no Group concept in expo-contacts. */
122
+ export declare class NativeGroup {
123
+ constructor(id: string);
124
+ readonly id: string;
125
+ getName(): Promise<string | null>;
126
+ setName(name: string): Promise<void>;
127
+ addContact(contact: NativeContact): Promise<void>;
128
+ removeContact(contact: NativeContact): Promise<void>;
129
+ getContacts(options?: ContactQueryOptions): Promise<NativeContact[]>;
130
+ delete(): Promise<void>;
131
+ static create(name: string, containerId?: string): Promise<NativeGroup>;
132
+ static getAll(containerId?: string): Promise<NativeGroup[]>;
133
+ }
134
+ /** @platform ios - Android has no Container concept in expo-contacts. */
135
+ export declare class NativeContainer {
136
+ constructor(id: string);
137
+ readonly id: string;
138
+ getName(): Promise<string | null>;
139
+ getType(): Promise<string | null>;
140
+ getGroups(): Promise<NativeGroup[]>;
141
+ getContacts(): Promise<NativeContact[]>;
142
+ static getAll(): Promise<NativeContainer[]>;
143
+ static getDefault(): Promise<NativeContainer | null>;
144
+ }
145
+ export declare class FallbackGroup {
146
+ readonly id: string;
147
+ constructor(id: string);
148
+ getName(): Promise<string | null>;
149
+ setName(_name: string): Promise<void>;
150
+ addContact(_contact: NativeContact): Promise<void>;
151
+ removeContact(_contact: NativeContact): Promise<void>;
152
+ getContacts(): Promise<NativeContact[]>;
153
+ delete(): Promise<void>;
154
+ static create(_name: string, _containerId?: string): Promise<FallbackGroup>;
155
+ static getAll(_containerId?: string): Promise<FallbackGroup[]>;
156
+ }
157
+ export declare class FallbackContainer {
158
+ readonly id: string;
159
+ constructor(id: string);
160
+ getName(): Promise<string | null>;
161
+ getType(): Promise<string | null>;
162
+ getGroups(): Promise<FallbackGroup[]>;
163
+ getContacts(): Promise<NativeContact[]>;
164
+ static getAll(): Promise<FallbackContainer[]>;
165
+ static getDefault(): Promise<FallbackContainer | null>;
166
+ }
167
+ export type INativeContactsNextModule = {
168
+ ContactNext?: typeof NativeContact;
169
+ Contact: typeof NativeContact;
170
+ Group?: typeof NativeGroup;
171
+ Container?: typeof NativeContainer;
172
+ getPermissionsAsync(): Promise<ContactsPermissionResponse>;
173
+ requestPermissionsAsync(): Promise<ContactsPermissionResponse>;
174
+ addListener?(eventName: typeof ON_CONTACTS_CHANGE_EVENT_NAME, listener: () => void): EventSubscription;
175
+ removeAllListeners?(eventName: typeof ON_CONTACTS_CHANGE_EVENT_NAME): void;
176
+ };
177
+ export declare const expoContactsNext: INativeContactsNextModule;
@@ -0,0 +1,63 @@
1
+ import { Platform, requireNativeModule } from 'expo-modules-core';
2
+ const EXPO_CONTACTS_NEXT_MODULE_NAME = 'ExpoContactsNext';
3
+ export const ON_CONTACTS_CHANGE_EVENT_NAME = 'contactsDidChange';
4
+ export class FallbackGroup {
5
+ id;
6
+ constructor(id) {
7
+ this.id = id;
8
+ }
9
+ getName() {
10
+ throw new Error('Not implemented');
11
+ }
12
+ setName(_name) {
13
+ throw new Error('Not implemented');
14
+ }
15
+ addContact(_contact) {
16
+ throw new Error('Not implemented');
17
+ }
18
+ removeContact(_contact) {
19
+ throw new Error('Not implemented');
20
+ }
21
+ getContacts() {
22
+ throw new Error('Not implemented');
23
+ }
24
+ delete() {
25
+ throw new Error('Not implemented');
26
+ }
27
+ static create(_name, _containerId) {
28
+ throw new Error('Not implemented');
29
+ }
30
+ static getAll(_containerId) {
31
+ throw new Error('Not implemented');
32
+ }
33
+ }
34
+ export class FallbackContainer {
35
+ id;
36
+ constructor(id) {
37
+ this.id = id;
38
+ }
39
+ getName() {
40
+ throw new Error('Not implemented');
41
+ }
42
+ getType() {
43
+ throw new Error('Not implemented');
44
+ }
45
+ getGroups() {
46
+ throw new Error('Not implemented');
47
+ }
48
+ getContacts() {
49
+ throw new Error('Not implemented');
50
+ }
51
+ static getAll() {
52
+ throw new Error('Not implemented');
53
+ }
54
+ static getDefault() {
55
+ throw new Error('Not implemented');
56
+ }
57
+ }
58
+ export const expoContactsNext = requireNativeModule(EXPO_CONTACTS_NEXT_MODULE_NAME);
59
+ // iOS registers the class as `ContactNext` (distinct from the deprecated legacy `Contact` JS
60
+ // class); Android registers it directly as `Contact`. Alias so both platforms expose `.Contact`.
61
+ if (Platform.OS === 'ios' && expoContactsNext.ContactNext) {
62
+ expoContactsNext.Contact = expoContactsNext.ContactNext;
63
+ }
@@ -0,0 +1,3 @@
1
+ import type { ContactsPermissionResponse } from './types';
2
+ export declare function getPermissionsAsync(): Promise<ContactsPermissionResponse>;
3
+ export declare function requestPermissionsAsync(): Promise<ContactsPermissionResponse>;
@@ -0,0 +1,7 @@
1
+ import { expoContactsNext } from './native-module.js';
2
+ export async function getPermissionsAsync() {
3
+ return expoContactsNext.getPermissionsAsync();
4
+ }
5
+ export async function requestPermissionsAsync() {
6
+ return expoContactsNext.requestPermissionsAsync();
7
+ }
@@ -0,0 +1,244 @@
1
+ import type { PermissionResponse } from 'expo-modules-core';
2
+ import type { ContactField, ContactsSortOrder, NonGregorianCalendar } from './enums';
3
+ export type ContactsPermissionResponse = PermissionResponse & {
4
+ accessPrivileges?: 'all' | 'limited' | 'none';
5
+ };
6
+ export type ContactQueryOptions = {
7
+ limit?: number;
8
+ offset?: number;
9
+ sortOrder?: ContactsSortOrder;
10
+ name?: string;
11
+ /** @platform ios */
12
+ rawContacts?: boolean;
13
+ };
14
+ export type FormOptions = {
15
+ displayedPropertyKeys?: ContactField[];
16
+ message?: string;
17
+ alternateName?: string;
18
+ allowsEditing?: boolean;
19
+ allowsActions?: boolean;
20
+ shouldShowLinkedContacts?: boolean;
21
+ isNew?: boolean;
22
+ cancelButtonTitle?: string;
23
+ showsCancelButton?: boolean;
24
+ preventAnimation?: boolean;
25
+ groupId?: string;
26
+ };
27
+ export type CreateFormOptions = {
28
+ cancelButtonTitle?: string;
29
+ showsCancelButton?: boolean;
30
+ preventAnimation?: boolean;
31
+ };
32
+ export type NewEmail = {
33
+ label?: string;
34
+ address?: string;
35
+ };
36
+ export type ExistingEmail = NewEmail & {
37
+ id: string;
38
+ };
39
+ export type NewPhone = {
40
+ label?: string;
41
+ number?: string;
42
+ };
43
+ export type ExistingPhone = NewPhone & {
44
+ id: string;
45
+ };
46
+ export type NewDate = {
47
+ label?: string;
48
+ date?: ContactDate;
49
+ };
50
+ export type ExistingDate = NewDate & {
51
+ id: string;
52
+ };
53
+ export type NewExtraName = {
54
+ label?: string;
55
+ name?: string;
56
+ };
57
+ export type ExistingExtraName = NewExtraName & {
58
+ id: string;
59
+ };
60
+ export type NewAddress = {
61
+ label?: string;
62
+ street?: string;
63
+ city?: string;
64
+ state?: string;
65
+ postcode?: string;
66
+ region?: string;
67
+ country?: string;
68
+ };
69
+ export type ExistingAddress = NewAddress & {
70
+ id: string;
71
+ };
72
+ export type NewRelation = {
73
+ label?: string;
74
+ name?: string;
75
+ };
76
+ export type ExistingRelation = NewRelation & {
77
+ id: string;
78
+ };
79
+ export type NewUrlAddress = {
80
+ label?: string;
81
+ url?: string;
82
+ };
83
+ export type ExistingUrlAddress = NewUrlAddress & {
84
+ id: string;
85
+ };
86
+ export type NewImAddress = {
87
+ label?: string;
88
+ username?: string;
89
+ service?: string;
90
+ };
91
+ export type ExistingImAddress = NewImAddress & {
92
+ id: string;
93
+ };
94
+ export type NewSocialProfile = {
95
+ label?: string;
96
+ username?: string;
97
+ service?: string;
98
+ url?: string;
99
+ userId?: string;
100
+ };
101
+ export type ExistingSocialProfile = NewSocialProfile & {
102
+ id: string;
103
+ };
104
+ export type ContactDate = {
105
+ year?: number;
106
+ month: number;
107
+ day: number;
108
+ };
109
+ /** @platform ios */
110
+ export type NonGregorianBirthday = {
111
+ year?: number;
112
+ month: number;
113
+ day: number;
114
+ calendar: NonGregorianCalendar;
115
+ };
116
+ export type ContactPatch = {
117
+ isFavourite?: boolean | null;
118
+ givenName?: string | null;
119
+ middleName?: string | null;
120
+ familyName?: string | null;
121
+ nickname?: string | null;
122
+ maidenName?: string | null;
123
+ prefix?: string | null;
124
+ suffix?: string | null;
125
+ phoneticGivenName?: string | null;
126
+ phoneticMiddleName?: string | null;
127
+ phoneticFamilyName?: string | null;
128
+ company?: string | null;
129
+ department?: string | null;
130
+ jobTitle?: string | null;
131
+ phoneticCompanyName?: string | null;
132
+ note?: string | null;
133
+ image?: string | null;
134
+ birthday?: ContactDate | null;
135
+ nonGregorianBirthday?: NonGregorianBirthday | null;
136
+ emails?: (ExistingEmail | NewEmail)[];
137
+ phones?: (ExistingPhone | NewPhone)[];
138
+ dates?: (ExistingDate | NewDate)[];
139
+ extraNames?: (ExistingExtraName | NewExtraName)[];
140
+ addresses?: (ExistingAddress | NewAddress)[];
141
+ relations?: (ExistingRelation | NewRelation)[];
142
+ urlAddresses?: (ExistingUrlAddress | NewUrlAddress)[];
143
+ socialProfiles?: (ExistingSocialProfile | NewSocialProfile)[];
144
+ imAddresses?: (ExistingImAddress | NewImAddress)[];
145
+ };
146
+ export type CreateContactRecord = {
147
+ isFavourite?: boolean;
148
+ givenName?: string;
149
+ middleName?: string;
150
+ familyName?: string;
151
+ maidenName?: string;
152
+ nickname?: string;
153
+ prefix?: string;
154
+ suffix?: string;
155
+ phoneticGivenName?: string;
156
+ phoneticMiddleName?: string;
157
+ phoneticFamilyName?: string;
158
+ company?: string;
159
+ department?: string;
160
+ jobTitle?: string;
161
+ phoneticCompanyName?: string;
162
+ note?: string;
163
+ image?: string;
164
+ birthday?: ContactDate;
165
+ nonGregorianBirthday?: NonGregorianBirthday;
166
+ emails?: NewEmail[];
167
+ dates?: NewDate[];
168
+ phones?: NewPhone[];
169
+ addresses?: NewAddress[];
170
+ relations?: NewRelation[];
171
+ urlAddresses?: NewUrlAddress[];
172
+ imAddresses?: NewImAddress[];
173
+ socialProfiles?: NewSocialProfile[];
174
+ extraNames?: NewExtraName[];
175
+ };
176
+ export type ContactDetails = {
177
+ isFavourite: boolean;
178
+ fullName: string | null;
179
+ givenName: string | null;
180
+ middleName: string | null;
181
+ familyName: string | null;
182
+ maidenName?: string | null;
183
+ nickname?: string | null;
184
+ prefix: string | null;
185
+ suffix: string | null;
186
+ phoneticGivenName: string | null;
187
+ phoneticMiddleName: string | null;
188
+ phoneticFamilyName: string | null;
189
+ company: string | null;
190
+ department: string | null;
191
+ jobTitle?: string;
192
+ phoneticCompanyName?: string;
193
+ note: string | null;
194
+ image: string | null;
195
+ thumbnail: string | null;
196
+ birthday?: ContactDate | null;
197
+ nonGregorianBirthday?: NonGregorianBirthday | null;
198
+ emails: ExistingEmail[];
199
+ dates: ExistingDate[];
200
+ phones: ExistingPhone[];
201
+ extraNames: ExistingExtraName[];
202
+ addresses: ExistingAddress[];
203
+ relations: ExistingRelation[];
204
+ urlAddresses: ExistingUrlAddress[];
205
+ socialProfiles: ExistingSocialProfile[];
206
+ imAddresses: ExistingImAddress[];
207
+ };
208
+ export type ContactFieldKey = {
209
+ [ContactField.IS_FAVOURITE]: 'isFavourite';
210
+ [ContactField.FULL_NAME]: 'fullName';
211
+ [ContactField.GIVEN_NAME]: 'givenName';
212
+ [ContactField.MIDDLE_NAME]: 'middleName';
213
+ [ContactField.FAMILY_NAME]: 'familyName';
214
+ [ContactField.MAIDEN_NAME]: 'maidenName';
215
+ [ContactField.NICKNAME]: 'nickname';
216
+ [ContactField.PREFIX]: 'prefix';
217
+ [ContactField.SUFFIX]: 'suffix';
218
+ [ContactField.PHONETIC_GIVEN_NAME]: 'phoneticGivenName';
219
+ [ContactField.PHONETIC_MIDDLE_NAME]: 'phoneticMiddleName';
220
+ [ContactField.PHONETIC_FAMILY_NAME]: 'phoneticFamilyName';
221
+ [ContactField.COMPANY]: 'company';
222
+ [ContactField.PHONETIC_COMPANY_NAME]: 'phoneticCompanyName';
223
+ [ContactField.DEPARTMENT]: 'department';
224
+ [ContactField.JOB_TITLE]: 'jobTitle';
225
+ [ContactField.NOTE]: 'note';
226
+ [ContactField.IMAGE]: 'image';
227
+ [ContactField.THUMBNAIL]: 'thumbnail';
228
+ [ContactField.BIRTHDAY]: 'birthday';
229
+ [ContactField.NON_GREGORIAN_BIRTHDAY]: 'nonGregorianBirthday';
230
+ [ContactField.EMAILS]: 'emails';
231
+ [ContactField.PHONES]: 'phones';
232
+ [ContactField.ADDRESSES]: 'addresses';
233
+ [ContactField.DATES]: 'dates';
234
+ [ContactField.EXTRA_NAMES]: 'extraNames';
235
+ [ContactField.RELATIONS]: 'relations';
236
+ [ContactField.URL_ADDRESSES]: 'urlAddresses';
237
+ [ContactField.SOCIAL_PROFILES]: 'socialProfiles';
238
+ [ContactField.IM_ADDRESSES]: 'imAddresses';
239
+ };
240
+ export type PartialContactDetails<T extends readonly ContactField[]> = {
241
+ id: string;
242
+ } & {
243
+ [K in T[number]]: ContactDetails[K];
244
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,30 @@
1
+ import type { EventSubscription } from 'expo-modules-core';
2
+ import type { ShareOptions } from 'react-native';
3
+ import type { Contact, ContactQuery, ContactResponse, Container, ContainerQuery, ContactsPermissionResponse, ExistingContact, FieldType, FormOptions, Group, GroupQuery } from './types';
4
+ export declare function isAvailableAsync(): Promise<boolean>;
5
+ export declare function hasContactsAsync(): Promise<boolean>;
6
+ export declare function writeContactToFileAsync(contactQuery?: ContactQuery): Promise<string | undefined>;
7
+ export declare function shareContactAsync(contactId: string, message: string, shareOptions?: ShareOptions): Promise<unknown>;
8
+ export declare function getContactsAsync(contactQuery?: ContactQuery): Promise<ContactResponse>;
9
+ export declare function getPagedContactsAsync(contactQuery?: ContactQuery): Promise<ContactResponse>;
10
+ export declare function getContactByIdAsync(id: string, fields?: FieldType[]): Promise<ExistingContact | undefined>;
11
+ export declare function addContactAsync(contact: Contact, containerId?: string): Promise<string>;
12
+ export declare function updateContactAsync(contact: {
13
+ id: string;
14
+ } & Partial<ExistingContact>): Promise<string>;
15
+ export declare function removeContactAsync(contactId: string): Promise<unknown>;
16
+ export declare function presentFormAsync(contactId?: string | null, contact?: Contact | null, formOptions?: FormOptions): Promise<unknown>;
17
+ export declare function addExistingGroupToContainerAsync(groupId: string, containerId: string): Promise<unknown>;
18
+ export declare function getDefaultContainerIdAsync(): Promise<string>;
19
+ export declare function createGroupAsync(name?: string, containerId?: string): Promise<string>;
20
+ export declare function updateGroupNameAsync(groupName: string, groupId: string): Promise<unknown>;
21
+ export declare function removeGroupAsync(groupId: string): Promise<unknown>;
22
+ export declare function addExistingContactToGroupAsync(contactId: string, groupId: string): Promise<unknown>;
23
+ export declare function removeContactFromGroupAsync(contactId: string, groupId: string): Promise<unknown>;
24
+ export declare function getGroupsAsync(groupQuery: GroupQuery): Promise<Group[]>;
25
+ export declare function presentContactPickerAsync(): Promise<ExistingContact | null>;
26
+ export declare function getContainersAsync(containerQuery: ContainerQuery): Promise<Container[]>;
27
+ export declare function presentAccessPickerAsync(): Promise<string[]>;
28
+ export declare function getPermissionsAsync(): Promise<ContactsPermissionResponse>;
29
+ export declare function requestPermissionsAsync(): Promise<ContactsPermissionResponse>;
30
+ export declare function addContactsChangeListener(listener: () => void): EventSubscription;