@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 { UnavailabilityError, uuid } from 'expo-modules-core';
2
+ import { Platform, Share } from 'react-native';
3
+ import { expoContacts, ON_CONTACTS_CHANGE_EVENT_NAME } from './native-module.js';
4
+ export async function isAvailableAsync() {
5
+ return !!expoContacts.getContactsAsync;
6
+ }
7
+ export async function hasContactsAsync() {
8
+ if (!expoContacts.hasContactsAsync) {
9
+ throw new UnavailabilityError('Contacts', 'hasContactsAsync');
10
+ }
11
+ return expoContacts.hasContactsAsync();
12
+ }
13
+ export async function writeContactToFileAsync(contactQuery = {}) {
14
+ if (!expoContacts.writeContactToFileAsync) {
15
+ throw new UnavailabilityError('Contacts', 'writeContactToFileAsync');
16
+ }
17
+ return expoContacts.writeContactToFileAsync(contactQuery);
18
+ }
19
+ export async function shareContactAsync(contactId, message, shareOptions = {}) {
20
+ if (Platform.OS === 'ios') {
21
+ const url = await writeContactToFileAsync({ id: contactId });
22
+ return Share.share({ url, message }, shareOptions);
23
+ }
24
+ if (!expoContacts.shareContactAsync) {
25
+ throw new UnavailabilityError('Contacts', 'shareContactAsync');
26
+ }
27
+ return expoContacts.shareContactAsync(contactId, message);
28
+ }
29
+ export async function getContactsAsync(contactQuery = {}) {
30
+ if (!expoContacts.getContactsAsync) {
31
+ throw new UnavailabilityError('Contacts', 'getContactsAsync');
32
+ }
33
+ return expoContacts.getContactsAsync(contactQuery);
34
+ }
35
+ export async function getPagedContactsAsync(contactQuery = {}) {
36
+ const { pageSize, ...rest } = contactQuery;
37
+ if (pageSize != null && pageSize <= 0) {
38
+ throw new Error('Error: Contacts.getPagedContactsAsync: `pageSize` must be greater than 0');
39
+ }
40
+ return getContactsAsync({ ...rest, pageSize });
41
+ }
42
+ export async function getContactByIdAsync(id, fields) {
43
+ if (!expoContacts.getContactsAsync) {
44
+ throw new UnavailabilityError('Contacts', 'getContactsAsync');
45
+ }
46
+ const results = await expoContacts.getContactsAsync({
47
+ pageSize: 1,
48
+ pageOffset: 0,
49
+ fields,
50
+ id,
51
+ });
52
+ return results.data.length > 0 ? results.data[0] : undefined;
53
+ }
54
+ export async function addContactAsync(contact, containerId) {
55
+ if (!expoContacts.addContactAsync) {
56
+ throw new UnavailabilityError('Contacts', 'addContactAsync');
57
+ }
58
+ return expoContacts.addContactAsync(contact, containerId);
59
+ }
60
+ export async function updateContactAsync(contact) {
61
+ if (!expoContacts.updateContactAsync) {
62
+ throw new UnavailabilityError('Contacts', 'updateContactAsync');
63
+ }
64
+ return expoContacts.updateContactAsync(contact);
65
+ }
66
+ export async function removeContactAsync(contactId) {
67
+ if (!expoContacts.removeContactAsync) {
68
+ throw new UnavailabilityError('Contacts', 'removeContactAsync');
69
+ }
70
+ return expoContacts.removeContactAsync(contactId);
71
+ }
72
+ export async function presentFormAsync(contactId, contact, formOptions = {}) {
73
+ if (!expoContacts.presentFormAsync) {
74
+ throw new UnavailabilityError('Contacts', 'presentFormAsync');
75
+ }
76
+ if (Platform.OS !== 'ios') {
77
+ return expoContacts.presentFormAsync(contactId, contact, formOptions);
78
+ }
79
+ let adjustedContact = contact;
80
+ if (contactId) {
81
+ if (adjustedContact) {
82
+ adjustedContact = undefined;
83
+ console.warn('Expo.Contacts.presentFormAsync: You should define either a `contact` or a `contactId` but not both.');
84
+ }
85
+ if (formOptions.isNew !== undefined) {
86
+ console.warn('Expo.Contacts.presentFormAsync: `formOptions.isNew` is not supported with `contactId`');
87
+ }
88
+ }
89
+ return expoContacts.presentFormAsync(contactId, adjustedContact, formOptions);
90
+ }
91
+ export async function addExistingGroupToContainerAsync(groupId, containerId) {
92
+ if (!expoContacts.addExistingGroupToContainerAsync) {
93
+ throw new UnavailabilityError('Contacts', 'addExistingGroupToContainerAsync');
94
+ }
95
+ return expoContacts.addExistingGroupToContainerAsync(groupId, containerId);
96
+ }
97
+ export async function getDefaultContainerIdAsync() {
98
+ if (!expoContacts.getDefaultContainerIdentifierAsync) {
99
+ throw new UnavailabilityError('Contacts', 'getDefaultContainerIdentifierAsync');
100
+ }
101
+ return expoContacts.getDefaultContainerIdentifierAsync();
102
+ }
103
+ export async function createGroupAsync(name, containerId) {
104
+ if (!expoContacts.createGroupAsync) {
105
+ throw new UnavailabilityError('Contacts', 'createGroupAsync');
106
+ }
107
+ const groupName = name ?? uuid.v4();
108
+ const resolvedContainerId = containerId ?? (await getDefaultContainerIdAsync());
109
+ return expoContacts.createGroupAsync(groupName, resolvedContainerId);
110
+ }
111
+ export async function updateGroupNameAsync(groupName, groupId) {
112
+ if (!expoContacts.updateGroupNameAsync) {
113
+ throw new UnavailabilityError('Contacts', 'updateGroupNameAsync');
114
+ }
115
+ return expoContacts.updateGroupNameAsync(groupName, groupId);
116
+ }
117
+ export async function removeGroupAsync(groupId) {
118
+ if (!expoContacts.removeGroupAsync) {
119
+ throw new UnavailabilityError('Contacts', 'removeGroupAsync');
120
+ }
121
+ return expoContacts.removeGroupAsync(groupId);
122
+ }
123
+ export async function addExistingContactToGroupAsync(contactId, groupId) {
124
+ if (!expoContacts.addExistingContactToGroupAsync) {
125
+ throw new UnavailabilityError('Contacts', 'addExistingContactToGroupAsync');
126
+ }
127
+ return expoContacts.addExistingContactToGroupAsync(contactId, groupId);
128
+ }
129
+ export async function removeContactFromGroupAsync(contactId, groupId) {
130
+ if (!expoContacts.removeContactFromGroupAsync) {
131
+ throw new UnavailabilityError('Contacts', 'removeContactFromGroupAsync');
132
+ }
133
+ return expoContacts.removeContactFromGroupAsync(contactId, groupId);
134
+ }
135
+ export async function getGroupsAsync(groupQuery) {
136
+ if (!expoContacts.getGroupsAsync) {
137
+ throw new UnavailabilityError('Contacts', 'getGroupsAsync');
138
+ }
139
+ return expoContacts.getGroupsAsync(groupQuery);
140
+ }
141
+ export async function presentContactPickerAsync() {
142
+ if (!expoContacts.presentContactPickerAsync) {
143
+ throw new UnavailabilityError('Contacts', 'presentContactPickerAsync');
144
+ }
145
+ return expoContacts.presentContactPickerAsync();
146
+ }
147
+ export async function getContainersAsync(containerQuery) {
148
+ if (!expoContacts.getContainersAsync) {
149
+ throw new UnavailabilityError('Contacts', 'getContainersAsync');
150
+ }
151
+ return expoContacts.getContainersAsync(containerQuery);
152
+ }
153
+ export async function presentAccessPickerAsync() {
154
+ if (!expoContacts.presentAccessPickerAsync) {
155
+ throw new UnavailabilityError('Contacts', 'presentAccessPickerAsync');
156
+ }
157
+ return expoContacts.presentAccessPickerAsync();
158
+ }
159
+ export async function getPermissionsAsync() {
160
+ if (!expoContacts.getPermissionsAsync) {
161
+ throw new UnavailabilityError('Contacts', 'getPermissionsAsync');
162
+ }
163
+ return expoContacts.getPermissionsAsync();
164
+ }
165
+ export async function requestPermissionsAsync() {
166
+ if (!expoContacts.requestPermissionsAsync) {
167
+ throw new UnavailabilityError('Contacts', 'requestPermissionsAsync');
168
+ }
169
+ return expoContacts.requestPermissionsAsync();
170
+ }
171
+ export function addContactsChangeListener(listener) {
172
+ if (!expoContacts.addListener) {
173
+ throw new UnavailabilityError('Contacts', 'addContactsChangeListener');
174
+ }
175
+ const subscription = expoContacts.addListener(ON_CONTACTS_CHANGE_EVENT_NAME, listener);
176
+ return { remove: () => subscription.remove() };
177
+ }
@@ -0,0 +1,68 @@
1
+ export declare enum Fields {
2
+ ID = "id",
3
+ ContactType = "contactType",
4
+ Name = "name",
5
+ FirstName = "firstName",
6
+ MiddleName = "middleName",
7
+ LastName = "lastName",
8
+ MaidenName = "maidenName",
9
+ NamePrefix = "namePrefix",
10
+ NameSuffix = "nameSuffix",
11
+ Nickname = "nickname",
12
+ PhoneticFirstName = "phoneticFirstName",
13
+ PhoneticMiddleName = "phoneticMiddleName",
14
+ PhoneticLastName = "phoneticLastName",
15
+ Birthday = "birthday",
16
+ NonGregorianBirthday = "nonGregorianBirthday",
17
+ Emails = "emails",
18
+ PhoneNumbers = "phoneNumbers",
19
+ Addresses = "addresses",
20
+ SocialProfiles = "socialProfiles",
21
+ InstantMessageAddresses = "instantMessageAddresses",
22
+ UrlAddresses = "urlAddresses",
23
+ Company = "company",
24
+ JobTitle = "jobTitle",
25
+ Department = "department",
26
+ ImageAvailable = "imageAvailable",
27
+ Image = "image",
28
+ RawImage = "rawImage",
29
+ ExtraNames = "extraNames",
30
+ Note = "note",
31
+ Dates = "dates",
32
+ Relationships = "relationships",
33
+ IsFavorite = "isFavorite"
34
+ }
35
+ export declare enum CalendarFormats {
36
+ Gregorian = "gregorian",
37
+ Buddhist = "buddhist",
38
+ Chinese = "chinese",
39
+ Coptic = "coptic",
40
+ EthiopicAmeteMihret = "ethiopicAmeteMihret",
41
+ EthiopicAmeteAlem = "ethiopicAmeteAlem",
42
+ Hebrew = "hebrew",
43
+ ISO8601 = "iso8601",
44
+ Indian = "indian",
45
+ Islamic = "islamic",
46
+ IslamicCivil = "islamicCivil",
47
+ Japanese = "japanese",
48
+ Persian = "persian",
49
+ RepublicOfChina = "republicOfChina",
50
+ IslamicTabular = "islamicTabular",
51
+ IslamicUmmAlQura = "islamicUmmAlQura"
52
+ }
53
+ export declare enum ContainerTypes {
54
+ Local = "local",
55
+ Exchange = "exchange",
56
+ CardDAV = "cardDAV",
57
+ Unassigned = "unassigned"
58
+ }
59
+ export declare enum SortTypes {
60
+ UserDefault = "userDefault",
61
+ FirstName = "firstName",
62
+ LastName = "lastName",
63
+ None = "none"
64
+ }
65
+ export declare enum ContactTypes {
66
+ Person = "person",
67
+ Company = "company"
68
+ }
@@ -0,0 +1,73 @@
1
+ export var Fields;
2
+ (function (Fields) {
3
+ Fields["ID"] = "id";
4
+ Fields["ContactType"] = "contactType";
5
+ Fields["Name"] = "name";
6
+ Fields["FirstName"] = "firstName";
7
+ Fields["MiddleName"] = "middleName";
8
+ Fields["LastName"] = "lastName";
9
+ Fields["MaidenName"] = "maidenName";
10
+ Fields["NamePrefix"] = "namePrefix";
11
+ Fields["NameSuffix"] = "nameSuffix";
12
+ Fields["Nickname"] = "nickname";
13
+ Fields["PhoneticFirstName"] = "phoneticFirstName";
14
+ Fields["PhoneticMiddleName"] = "phoneticMiddleName";
15
+ Fields["PhoneticLastName"] = "phoneticLastName";
16
+ Fields["Birthday"] = "birthday";
17
+ Fields["NonGregorianBirthday"] = "nonGregorianBirthday";
18
+ Fields["Emails"] = "emails";
19
+ Fields["PhoneNumbers"] = "phoneNumbers";
20
+ Fields["Addresses"] = "addresses";
21
+ Fields["SocialProfiles"] = "socialProfiles";
22
+ Fields["InstantMessageAddresses"] = "instantMessageAddresses";
23
+ Fields["UrlAddresses"] = "urlAddresses";
24
+ Fields["Company"] = "company";
25
+ Fields["JobTitle"] = "jobTitle";
26
+ Fields["Department"] = "department";
27
+ Fields["ImageAvailable"] = "imageAvailable";
28
+ Fields["Image"] = "image";
29
+ Fields["RawImage"] = "rawImage";
30
+ Fields["ExtraNames"] = "extraNames";
31
+ Fields["Note"] = "note";
32
+ Fields["Dates"] = "dates";
33
+ Fields["Relationships"] = "relationships";
34
+ Fields["IsFavorite"] = "isFavorite";
35
+ })(Fields || (Fields = {}));
36
+ export var CalendarFormats;
37
+ (function (CalendarFormats) {
38
+ CalendarFormats["Gregorian"] = "gregorian";
39
+ CalendarFormats["Buddhist"] = "buddhist";
40
+ CalendarFormats["Chinese"] = "chinese";
41
+ CalendarFormats["Coptic"] = "coptic";
42
+ CalendarFormats["EthiopicAmeteMihret"] = "ethiopicAmeteMihret";
43
+ CalendarFormats["EthiopicAmeteAlem"] = "ethiopicAmeteAlem";
44
+ CalendarFormats["Hebrew"] = "hebrew";
45
+ CalendarFormats["ISO8601"] = "iso8601";
46
+ CalendarFormats["Indian"] = "indian";
47
+ CalendarFormats["Islamic"] = "islamic";
48
+ CalendarFormats["IslamicCivil"] = "islamicCivil";
49
+ CalendarFormats["Japanese"] = "japanese";
50
+ CalendarFormats["Persian"] = "persian";
51
+ CalendarFormats["RepublicOfChina"] = "republicOfChina";
52
+ CalendarFormats["IslamicTabular"] = "islamicTabular";
53
+ CalendarFormats["IslamicUmmAlQura"] = "islamicUmmAlQura";
54
+ })(CalendarFormats || (CalendarFormats = {}));
55
+ export var ContainerTypes;
56
+ (function (ContainerTypes) {
57
+ ContainerTypes["Local"] = "local";
58
+ ContainerTypes["Exchange"] = "exchange";
59
+ ContainerTypes["CardDAV"] = "cardDAV";
60
+ ContainerTypes["Unassigned"] = "unassigned";
61
+ })(ContainerTypes || (ContainerTypes = {}));
62
+ export var SortTypes;
63
+ (function (SortTypes) {
64
+ SortTypes["UserDefault"] = "userDefault";
65
+ SortTypes["FirstName"] = "firstName";
66
+ SortTypes["LastName"] = "lastName";
67
+ SortTypes["None"] = "none";
68
+ })(SortTypes || (SortTypes = {}));
69
+ export var ContactTypes;
70
+ (function (ContactTypes) {
71
+ ContactTypes["Person"] = "person";
72
+ ContactTypes["Company"] = "company";
73
+ })(ContactTypes || (ContactTypes = {}));
@@ -0,0 +1,3 @@
1
+ export * from './enums';
2
+ export * from './types';
3
+ export * from './contacts';
@@ -0,0 +1,3 @@
1
+ export * from './enums.js';
2
+ export * from './types.js';
3
+ export * from './contacts.js';
@@ -0,0 +1,30 @@
1
+ import type { EventSubscription } from 'expo-modules-core';
2
+ import type { Contact, ContactQuery, ContactResponse, Container, ContainerQuery, ContactsPermissionResponse, ExistingContact, FormOptions, Group, GroupQuery } from './types';
3
+ export declare const ON_CONTACTS_CHANGE_EVENT_NAME = "onContactsChange";
4
+ export type INativeContactsModule = {
5
+ hasContactsAsync?(): Promise<boolean>;
6
+ shareContactAsync?(contactId: string, message: string): Promise<unknown>;
7
+ getContactsAsync?(contactQuery: ContactQuery): Promise<ContactResponse>;
8
+ addContactAsync?(contact: Contact, containerId?: string): Promise<string>;
9
+ updateContactAsync?(contact: {
10
+ id: string;
11
+ } & Partial<ExistingContact>): Promise<string>;
12
+ removeContactAsync?(contactId: string): Promise<unknown>;
13
+ writeContactToFileAsync?(contactQuery: ContactQuery): Promise<string | undefined>;
14
+ presentFormAsync?(contactId?: string | null, contact?: Contact | null, formOptions?: FormOptions): Promise<unknown>;
15
+ addExistingGroupToContainerAsync?(groupId: string, containerId: string): Promise<unknown>;
16
+ createGroupAsync?(name: string, containerId?: string): Promise<string>;
17
+ updateGroupNameAsync?(groupName: string, groupId: string): Promise<unknown>;
18
+ removeGroupAsync?(groupId: string): Promise<unknown>;
19
+ addExistingContactToGroupAsync?(contactId: string, groupId: string): Promise<unknown>;
20
+ removeContactFromGroupAsync?(contactId: string, groupId: string): Promise<unknown>;
21
+ getGroupsAsync?(groupQuery: GroupQuery): Promise<Group[]>;
22
+ presentContactPickerAsync?(): Promise<ExistingContact | null>;
23
+ getDefaultContainerIdentifierAsync?(): Promise<string>;
24
+ getContainersAsync?(containerQuery: ContainerQuery): Promise<Container[]>;
25
+ presentAccessPickerAsync?(): Promise<string[]>;
26
+ getPermissionsAsync?(): Promise<ContactsPermissionResponse>;
27
+ requestPermissionsAsync?(): Promise<ContactsPermissionResponse>;
28
+ addListener?(eventName: typeof ON_CONTACTS_CHANGE_EVENT_NAME, listener: () => void): EventSubscription;
29
+ };
30
+ export declare const expoContacts: INativeContactsModule;
@@ -0,0 +1,4 @@
1
+ import { requireNativeModule } from 'expo-modules-core';
2
+ const EXPO_CONTACTS_MODULE_NAME = 'ExpoContacts';
3
+ export const ON_CONTACTS_CHANGE_EVENT_NAME = 'onContactsChange';
4
+ export const expoContacts = requireNativeModule(EXPO_CONTACTS_MODULE_NAME);
@@ -0,0 +1,158 @@
1
+ import type { PermissionResponse } from 'expo-modules-core';
2
+ import type { CalendarFormats, ContactTypes, ContainerTypes, Fields, SortTypes } from './enums';
3
+ export type ContactsPermissionResponse = PermissionResponse & {
4
+ accessPrivileges?: 'all' | 'limited' | 'none';
5
+ };
6
+ export type CalendarFormatType = CalendarFormats | `${CalendarFormats}`;
7
+ export type ContainerType = ContainerTypes | `${ContainerTypes}`;
8
+ export type ContactType = ContactTypes | `${ContactTypes}`;
9
+ export type FieldType = Fields | `${Fields}`;
10
+ export type Date = {
11
+ day: number;
12
+ month: number;
13
+ year?: number;
14
+ id?: string;
15
+ label?: string;
16
+ format?: CalendarFormatType;
17
+ };
18
+ export type Relationship = {
19
+ label: string;
20
+ name?: string;
21
+ id?: string;
22
+ };
23
+ export type Email = {
24
+ email?: string;
25
+ isPrimary?: boolean;
26
+ label: string;
27
+ id?: string;
28
+ };
29
+ export type PhoneNumber = {
30
+ number?: string;
31
+ isPrimary?: boolean;
32
+ digits?: string;
33
+ countryCode?: string;
34
+ label: string;
35
+ id?: string;
36
+ };
37
+ export type Address = {
38
+ street?: string;
39
+ city?: string;
40
+ country?: string;
41
+ region?: string;
42
+ neighborhood?: string;
43
+ postalCode?: string;
44
+ poBox?: string;
45
+ isoCountryCode?: string;
46
+ label: string;
47
+ id?: string;
48
+ };
49
+ export type SocialProfile = {
50
+ service?: string;
51
+ localizedProfile?: string;
52
+ url?: string;
53
+ username?: string;
54
+ userId?: string;
55
+ label: string;
56
+ id?: string;
57
+ };
58
+ export type InstantMessageAddress = {
59
+ service?: string;
60
+ username?: string;
61
+ localizedService?: string;
62
+ label: string;
63
+ id?: string;
64
+ };
65
+ export type UrlAddress = {
66
+ label: string;
67
+ url?: string;
68
+ id?: string;
69
+ };
70
+ export type Image = {
71
+ uri?: string;
72
+ width?: number;
73
+ height?: number;
74
+ base64?: string;
75
+ };
76
+ export type Contact = {
77
+ contactType: ContactType;
78
+ name: string;
79
+ firstName?: string;
80
+ middleName?: string;
81
+ lastName?: string;
82
+ maidenName?: string;
83
+ namePrefix?: string;
84
+ nameSuffix?: string;
85
+ nickname?: string;
86
+ phoneticFirstName?: string;
87
+ phoneticMiddleName?: string;
88
+ phoneticLastName?: string;
89
+ company?: string;
90
+ jobTitle?: string;
91
+ department?: string;
92
+ note?: string;
93
+ imageAvailable?: boolean;
94
+ image?: Image;
95
+ rawImage?: Image;
96
+ birthday?: Date;
97
+ dates?: Date[];
98
+ relationships?: Relationship[];
99
+ emails?: Email[];
100
+ phoneNumbers?: PhoneNumber[];
101
+ addresses?: Address[];
102
+ instantMessageAddresses?: InstantMessageAddress[];
103
+ urlAddresses?: UrlAddress[];
104
+ nonGregorianBirthday?: Date;
105
+ socialProfiles?: SocialProfile[];
106
+ isFavorite?: boolean;
107
+ };
108
+ export type ExistingContact = Contact & {
109
+ id: string;
110
+ };
111
+ export type ContactResponse = {
112
+ data: ExistingContact[];
113
+ hasNextPage: boolean;
114
+ hasPreviousPage: boolean;
115
+ };
116
+ export type ContactSort = `${SortTypes}`;
117
+ export type ContactQuery = {
118
+ pageSize?: number;
119
+ pageOffset?: number;
120
+ fields?: FieldType[];
121
+ sort?: ContactSort;
122
+ name?: string;
123
+ id?: string | string[];
124
+ groupId?: string;
125
+ containerId?: string;
126
+ rawContacts?: boolean;
127
+ };
128
+ export type FormOptions = {
129
+ displayedPropertyKeys?: FieldType[];
130
+ message?: string;
131
+ alternateName?: string;
132
+ allowsEditing?: boolean;
133
+ allowsActions?: boolean;
134
+ shouldShowLinkedContacts?: boolean;
135
+ isNew?: boolean;
136
+ cancelButtonTitle?: string;
137
+ preventAnimation?: boolean;
138
+ groupId?: string;
139
+ };
140
+ export type GroupQuery = {
141
+ groupId?: string;
142
+ groupName?: string;
143
+ containerId?: string;
144
+ };
145
+ export type Group = {
146
+ name?: string;
147
+ id?: string;
148
+ };
149
+ export type ContainerQuery = {
150
+ contactId?: string;
151
+ groupId?: string;
152
+ containerId?: string | string[];
153
+ };
154
+ export type Container = {
155
+ name: string;
156
+ id: string;
157
+ type: ContainerType;
158
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,10 @@
1
+ import type { ReactElement } from 'react';
2
+ import { isContactAccessButtonAvailable } from '../core/contact-access-button';
3
+ import type { IContactAccessButtonProps } from '../core/contact-access-button';
4
+ declare function ContactAccessButtonView(props: IContactAccessButtonProps): ReactElement | null;
5
+ /** React twin of `expo-contacts`' `ContactAccessButton`, iOS 18+ only, nothing elsewhere */
6
+ export declare const ContactAccessButton: typeof ContactAccessButtonView & {
7
+ /** True only on iOS 18.0 and newer */
8
+ isAvailable: typeof isContactAccessButtonAvailable;
9
+ };
10
+ export {};
@@ -0,0 +1,11 @@
1
+ import { descriptorToReact } from '@symbiote-native/react';
2
+ import { isContactAccessButtonAvailable, renderContactAccessButton, } from '../core/contact-access-button.js';
3
+ function ContactAccessButtonView(props) {
4
+ const descriptor = renderContactAccessButton(props);
5
+ return descriptor ? descriptorToReact(descriptor) : null;
6
+ }
7
+ /** React twin of `expo-contacts`' `ContactAccessButton`, iOS 18+ only, nothing elsewhere */
8
+ export const ContactAccessButton = Object.assign(ContactAccessButtonView, {
9
+ /** True only on iOS 18.0 and newer */
10
+ isAvailable: isContactAccessButtonAvailable,
11
+ });
@@ -0,0 +1,2 @@
1
+ export * from '../core';
2
+ export { ContactAccessButton } from './contact-access-button';
@@ -0,0 +1,2 @@
1
+ export * from '../core/index.js';
2
+ export { ContactAccessButton } from './contact-access-button.js';
@@ -0,0 +1,10 @@
1
+ import { descriptorToSolid } from '@symbiote-native/solid';
2
+ import { isContactAccessButtonAvailable } from '../core/contact-access-button';
3
+ import type { IContactAccessButtonProps } from '../core/contact-access-button';
4
+ declare function ContactAccessButtonView(props: IContactAccessButtonProps): ReturnType<typeof descriptorToSolid> | null;
5
+ /** Solid twin of `expo-contacts`' `ContactAccessButton`, iOS 18+ only, nothing elsewhere */
6
+ export declare const ContactAccessButton: typeof ContactAccessButtonView & {
7
+ /** True only on iOS 18.0 and newer */
8
+ isAvailable: typeof isContactAccessButtonAvailable;
9
+ };
10
+ export {};
@@ -0,0 +1,15 @@
1
+ import { descriptorToSolid } from '@symbiote-native/solid';
2
+ import { isContactAccessButtonAvailable, renderContactAccessButton, } from '../core/contact-access-button.js';
3
+ // The platform decision is made once at mount: the descriptor bridge builds the node once and
4
+ // only diffs prop values afterwards, so the descriptor's shape must not change
5
+ function ContactAccessButtonView(props) {
6
+ const initial = renderContactAccessButton({ ...props });
7
+ if (!initial)
8
+ return null;
9
+ return descriptorToSolid(() => renderContactAccessButton({ ...props }) ?? initial);
10
+ }
11
+ /** Solid twin of `expo-contacts`' `ContactAccessButton`, iOS 18+ only, nothing elsewhere */
12
+ export const ContactAccessButton = Object.assign(ContactAccessButtonView, {
13
+ /** True only on iOS 18.0 and newer */
14
+ isAvailable: isContactAccessButtonAvailable,
15
+ });
@@ -0,0 +1,2 @@
1
+ export * from '../core';
2
+ export { ContactAccessButton } from './contact-access-button';
@@ -0,0 +1,2 @@
1
+ export * from '../core/index.js';
2
+ export { ContactAccessButton } from './contact-access-button.js';
@@ -0,0 +1,18 @@
1
+ <script lang="ts">
2
+ // The native view name is mixed-case, which a literal tag would parse as a component reference,
3
+ // so the tag is dynamic. The platform decision is made once at mount, like the other adapters
4
+ import { hostProps } from '@symbiote-native/svelte/native-view-bridge';
5
+ import {
6
+ contactAccessButtonViewName,
7
+ ensureContactAccessButtonRegistered,
8
+ } from '../core/contact-access-button';
9
+ import type { IContactAccessButtonProps } from '../core/contact-access-button';
10
+
11
+ const props: IContactAccessButtonProps = $props();
12
+ const isRegistered = ensureContactAccessButtonRegistered();
13
+ const viewName = contactAccessButtonViewName();
14
+ </script>
15
+
16
+ {#if isRegistered}
17
+ <svelte:element this={viewName} {@attach hostProps({ ...props })} />
18
+ {/if}
@@ -0,0 +1,4 @@
1
+ import type { IContactAccessButtonProps } from '../core/contact-access-button';
2
+ declare const ContactAccessButton: import("svelte").Component<IContactAccessButtonProps, {}, "">;
3
+ type ContactAccessButton = ReturnType<typeof ContactAccessButton>;
4
+ export default ContactAccessButton;
@@ -0,0 +1,7 @@
1
+ import { isContactAccessButtonAvailable } from '../core/contact-access-button';
2
+ export * from '../core';
3
+ /** Svelte twin of `expo-contacts`' `ContactAccessButton`, iOS 18+ only, nothing elsewhere */
4
+ export declare const ContactAccessButton: import("svelte").Component<import(".").IContactAccessButtonProps, {}, ""> & {
5
+ /** True only on iOS 18.0 and newer */
6
+ isAvailable: typeof isContactAccessButtonAvailable;
7
+ };
@@ -0,0 +1,8 @@
1
+ import { isContactAccessButtonAvailable } from '../core/contact-access-button.js';
2
+ import ContactAccessButtonView from './contact-access-button.svelte';
3
+ export * from '../core/index.js';
4
+ /** Svelte twin of `expo-contacts`' `ContactAccessButton`, iOS 18+ only, nothing elsewhere */
5
+ export const ContactAccessButton = Object.assign(ContactAccessButtonView, {
6
+ /** True only on iOS 18.0 and newer */
7
+ isAvailable: isContactAccessButtonAvailable,
8
+ });
@@ -0,0 +1,19 @@
1
+ import { type VNode } from '@vue/runtime-core';
2
+ import { isContactAccessButtonAvailable } from '../core/contact-access-button';
3
+ /** Vue twin of `expo-contacts`' `ContactAccessButton`, iOS 18+ only, nothing elsewhere */
4
+ export declare const ContactAccessButton: {
5
+ new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<{}> & Readonly<{}>, () => VNode | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {}, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
6
+ P: {};
7
+ B: {};
8
+ D: {};
9
+ C: {};
10
+ M: {};
11
+ Defaults: {};
12
+ }, Readonly<{}> & Readonly<{}>, () => VNode | null, {}, {}, {}, {}>;
13
+ __isFragment?: never;
14
+ __isTeleport?: never;
15
+ __isSuspense?: never;
16
+ } & import("vue").ComponentOptionsBase<Readonly<{}> & Readonly<{}>, () => VNode | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & {
17
+ /** True only on iOS 18.0 and newer */
18
+ isAvailable: typeof isContactAccessButtonAvailable;
19
+ };