@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,19 @@
1
+ import { defineComponent } from '@vue/runtime-core';
2
+ import { descriptorToVue, normalizeVueAttrs } from '@symbiote-native/vue';
3
+ import { isContactAccessButtonAvailable, renderContactAccessButton, } from '../core/contact-access-button.js';
4
+ const ContactAccessButtonView = defineComponent({
5
+ name: 'ContactAccessButton',
6
+ // Every attribute is a native view prop, so none falls through onto a wrapper element
7
+ inheritAttrs: false,
8
+ setup(_props, { attrs }) {
9
+ return () => {
10
+ const descriptor = renderContactAccessButton(normalizeVueAttrs(attrs));
11
+ return descriptor ? descriptorToVue(descriptor) : null;
12
+ };
13
+ },
14
+ });
15
+ /** Vue twin of `expo-contacts`' `ContactAccessButton`, iOS 18+ only, nothing elsewhere */
16
+ export const ContactAccessButton = Object.assign(ContactAccessButtonView, {
17
+ /** True only on iOS 18.0 and newer */
18
+ isAvailable: isContactAccessButtonAvailable,
19
+ });
@@ -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,21 @@
1
+ import { NativeViewBase } from '@symbiote-native/angular';
2
+ import type { IDescriptor } from '@symbiote-native/components';
3
+ import { isContactAccessButtonAvailable } from '../../core/contact-access-button';
4
+ import type { IContactAccessButtonProps } from '../../core/contact-access-button';
5
+ import * as i0 from "@angular/core";
6
+ /** Angular twin of `expo-contacts`' `ContactAccessButton`, iOS 18+ only, nothing elsewhere */
7
+ export declare class ContactAccessButton extends NativeViewBase {
8
+ /** True only on iOS 18.0 and newer */
9
+ static readonly isAvailable: typeof isContactAccessButtonAvailable;
10
+ query?: string;
11
+ caption?: IContactAccessButtonProps['caption'];
12
+ ignoredEmails?: string[];
13
+ ignoredPhoneNumbers?: string[];
14
+ tintColor?: IContactAccessButtonProps['tintColor'];
15
+ backgroundColor?: IContactAccessButtonProps['backgroundColor'];
16
+ textColor?: IContactAccessButtonProps['textColor'];
17
+ protected readonly propNames: readonly ["query", "caption", "ignoredEmails", "ignoredPhoneNumbers", "tintColor", "backgroundColor", "textColor"];
18
+ protected renderView(props: object): IDescriptor | null;
19
+ static ɵfac: i0.ɵɵFactoryDeclaration<ContactAccessButton, never>;
20
+ static ɵcmp: i0.ɵɵComponentDeclaration<ContactAccessButton, "ContactAccessButton", never, { "query": { "alias": "query"; "required": false; }; "caption": { "alias": "caption"; "required": false; }; "ignoredEmails": { "alias": "ignoredEmails"; "required": false; }; "ignoredPhoneNumbers": { "alias": "ignoredPhoneNumbers"; "required": false; }; "tintColor": { "alias": "tintColor"; "required": false; }; "backgroundColor": { "alias": "backgroundColor"; "required": false; }; "textColor": { "alias": "textColor"; "required": false; }; }, {}, never, never, true, never>;
21
+ }
@@ -0,0 +1,59 @@
1
+ import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
2
+ import { DescriptorOutlet, NativeViewBase } from '@symbiote-native/angular';
3
+ import { isContactAccessButtonAvailable, renderContactAccessButton, } from '../../core/contact-access-button';
4
+ import * as i0 from "@angular/core";
5
+ /** Angular twin of `expo-contacts`' `ContactAccessButton`, iOS 18+ only, nothing elsewhere */
6
+ export class ContactAccessButton extends NativeViewBase {
7
+ /** True only on iOS 18.0 and newer */
8
+ static isAvailable = isContactAccessButtonAvailable;
9
+ query;
10
+ caption;
11
+ ignoredEmails;
12
+ ignoredPhoneNumbers;
13
+ tintColor;
14
+ backgroundColor;
15
+ textColor;
16
+ propNames = [
17
+ 'query',
18
+ 'caption',
19
+ 'ignoredEmails',
20
+ 'ignoredPhoneNumbers',
21
+ 'tintColor',
22
+ 'backgroundColor',
23
+ 'textColor',
24
+ ];
25
+ renderView(props) {
26
+ return renderContactAccessButton(props);
27
+ }
28
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ContactAccessButton, deps: null, target: i0.ɵɵFactoryTarget.Component });
29
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: ContactAccessButton, isStandalone: true, selector: "ContactAccessButton", inputs: { query: "query", caption: "caption", ignoredEmails: "ignoredEmails", ignoredPhoneNumbers: "ignoredPhoneNumbers", tintColor: "tintColor", backgroundColor: "backgroundColor", textColor: "textColor" }, usesInheritance: true, ngImport: i0, template: `@if (descriptor; as node) {
30
+ <symbiote-descriptor-outlet [node]="node" />
31
+ }`, isInline: true, dependencies: [{ kind: "component", type: DescriptorOutlet, selector: "symbiote-descriptor-outlet", inputs: ["node"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
32
+ }
33
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ContactAccessButton, decorators: [{
34
+ type: Component,
35
+ args: [{
36
+ selector: 'ContactAccessButton',
37
+ standalone: true,
38
+ imports: [DescriptorOutlet],
39
+ changeDetection: ChangeDetectionStrategy.OnPush,
40
+ template: `@if (descriptor; as node) {
41
+ <symbiote-descriptor-outlet [node]="node" />
42
+ }`,
43
+ }]
44
+ }], propDecorators: { query: [{
45
+ type: Input
46
+ }], caption: [{
47
+ type: Input
48
+ }], ignoredEmails: [{
49
+ type: Input
50
+ }], ignoredPhoneNumbers: [{
51
+ type: Input
52
+ }], tintColor: [{
53
+ type: Input
54
+ }], backgroundColor: [{
55
+ type: Input
56
+ }], textColor: [{
57
+ type: Input
58
+ }] } });
59
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/angular/contact-access-button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE5E,OAAO,EACL,8BAA8B,EAC9B,yBAAyB,GAC1B,MAAM,kCAAkC,CAAC;;AAG1C,8FAA8F;AAU9F,MAAM,OAAO,mBAAoB,SAAQ,cAAc;IACrD,sCAAsC;IACtC,MAAM,CAAU,WAAW,GAAG,8BAA8B,CAAC;IAEpD,KAAK,CAAU;IACf,OAAO,CAAwC;IAC/C,aAAa,CAAY;IACzB,mBAAmB,CAAY;IAC/B,SAAS,CAA0C;IACnD,eAAe,CAAgD;IAC/D,SAAS,CAA0C;IAEhC,SAAS,GAAG;QACtC,OAAO;QACP,SAAS;QACT,eAAe;QACf,qBAAqB;QACrB,WAAW;QACX,iBAAiB;QACjB,WAAW;KAC8C,CAAC;IAEzC,UAAU,CAAC,KAAa;QACzC,OAAO,yBAAyB,CAAC,KAAK,CAAC,CAAC;IAC1C,CAAC;uGAxBU,mBAAmB;2FAAnB,mBAAmB,sTAJpB;;IAER,4DAJQ,gBAAgB;;2FAMf,mBAAmB;kBAT/B,SAAS;mBAAC;oBACT,QAAQ,EAAE,qBAAqB;oBAC/B,UAAU,EAAE,IAAI;oBAChB,OAAO,EAAE,CAAC,gBAAgB,CAAC;oBAC3B,eAAe,EAAE,uBAAuB,CAAC,MAAM;oBAC/C,QAAQ,EAAE;;IAER;iBACH;;sBAKE,KAAK;;sBACL,KAAK;;sBACL,KAAK;;sBACL,KAAK;;sBACL,KAAK;;sBACL,KAAK;;sBACL,KAAK"}
@@ -0,0 +1,2 @@
1
+ export * from '../core';
2
+ export { ContactAccessButton } from './contact-access-button';
@@ -0,0 +1,4 @@
1
+ // No per-instance state or event stream to wrap in an injectable service - plain re-export.
2
+ export * from '../core';
3
+ export { ContactAccessButton } from './contact-access-button';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/angular/index.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC"}
@@ -0,0 +1,29 @@
1
+ import type { IAccessibilityProps, IAriaProps, IDescriptor, IResponderProps } from '@symbiote-native/components';
2
+ import type { IColorValue, IStyleProp, ISymbioteEvent, IViewStyle } from '@symbiote-native/engine';
3
+ export declare const CONTACT_ACCESS_BUTTON_MODULE_NAME = "ExpoContactAccessButton";
4
+ export type IContactAccessButtonCaption = 'default' | 'email' | 'phone';
5
+ export type IContactAccessButtonProps = IAccessibilityProps & IAriaProps & IResponderProps & {
6
+ /** Matched against contacts not yet exposed to the app, typically from a search field */
7
+ query?: string;
8
+ /** Caption under the contact name when the query has one match, nothing by default */
9
+ caption?: IContactAccessButtonCaption;
10
+ /** Contacts matching `query` that also match one of these emails are left out */
11
+ ignoredEmails?: string[];
12
+ /** Contacts matching `query` that also match one of these phone numbers are left out */
13
+ ignoredPhoneNumbers?: string[];
14
+ /** Tint of the button and of the modal shown when there is more than one match */
15
+ tintColor?: IColorValue;
16
+ /** Button background, keep it opaque to satisfy the platform legibility rules */
17
+ backgroundColor?: IColorValue;
18
+ /** Button title color, a dimmed version of it is used for the caption */
19
+ textColor?: IColorValue;
20
+ style?: IStyleProp<IViewStyle>;
21
+ testID?: string;
22
+ nativeID?: string;
23
+ onLayout?: (event: ISymbioteEvent) => void;
24
+ };
25
+ export declare function contactAccessButtonViewName(): string;
26
+ /** True only on iOS 18.0 and newer, where the native module reports the button as available */
27
+ export declare function isContactAccessButtonAvailable(): boolean;
28
+ export declare function ensureContactAccessButtonRegistered(): boolean;
29
+ export declare function renderContactAccessButton(props: object): IDescriptor | null;
@@ -0,0 +1,28 @@
1
+ import { Platform, requireNativeViewManager, requireOptionalNativeModule, } from 'expo-modules-core';
2
+ import { el } from '@symbiote-native/components';
3
+ import { expoViewManagerName, tryRegisterNativeView, } from '@symbiote-native/engine';
4
+ export const CONTACT_ACCESS_BUTTON_MODULE_NAME = 'ExpoContactAccessButton';
5
+ export function contactAccessButtonViewName() {
6
+ return expoViewManagerName(CONTACT_ACCESS_BUTTON_MODULE_NAME);
7
+ }
8
+ /** True only on iOS 18.0 and newer, where the native module reports the button as available */
9
+ export function isContactAccessButtonAvailable() {
10
+ return (Platform.OS === 'ios' &&
11
+ (requireOptionalNativeModule(CONTACT_ACCESS_BUTTON_MODULE_NAME)?.isAvailable ??
12
+ false));
13
+ }
14
+ // Registers the view config in React Native's registry, which the engine derives the view's events
15
+ // and prop processors from. Called at render, not at import: a registration that only a barrel's
16
+ // load-time side effect performs is dropped by Metro's `inlineRequires` in release
17
+ export function ensureContactAccessButtonRegistered() {
18
+ if (Platform.OS !== 'ios')
19
+ return false;
20
+ return tryRegisterNativeView(() => requireNativeViewManager(CONTACT_ACCESS_BUTTON_MODULE_NAME));
21
+ }
22
+ // `object`, not the props type: Vue and Angular hand over an untyped attribute bag
23
+ export function renderContactAccessButton(props) {
24
+ if (!ensureContactAccessButtonRegistered())
25
+ return null;
26
+ return el(contactAccessButtonViewName(), { ...props });
27
+ }
28
+ //# sourceMappingURL=contact-access-button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contact-access-button.js","sourceRoot":"","sources":["../../src/core/contact-access-button.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,wBAAwB,EACxB,2BAA2B,GAC5B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,EAAE,EAAE,MAAM,6BAA6B,CAAC;AAOjD,OAAO,EACL,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,yBAAyB,CAAC;AAQjC,MAAM,CAAC,MAAM,iCAAiC,GAAG,yBAAyB,CAAC;AA8B3E,MAAM,UAAU,2BAA2B;IACzC,OAAO,mBAAmB,CAAC,iCAAiC,CAAC,CAAC;AAChE,CAAC;AAED,+FAA+F;AAC/F,MAAM,UAAU,8BAA8B;IAC5C,OAAO,CACL,QAAQ,CAAC,EAAE,KAAK,KAAK;QACrB,CAAC,2BAA2B,CAC1B,iCAAiC,CAClC,EAAE,WAAW;YACZ,KAAK,CAAC,CACT,CAAC;AACJ,CAAC;AAED,mGAAmG;AACnG,iGAAiG;AACjG,mFAAmF;AACnF,MAAM,UAAU,mCAAmC;IACjD,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK;QAAE,OAAO,KAAK,CAAC;IACxC,OAAO,qBAAqB,CAAC,GAAG,EAAE,CAChC,wBAAwB,CAAC,iCAAiC,CAAC,CAC5D,CAAC;AACJ,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,yBAAyB,CAAC,KAAa;IACrD,IAAI,CAAC,mCAAmC,EAAE;QAAE,OAAO,IAAI,CAAC;IACxD,OAAO,EAAE,CAAC,2BAA2B,EAAE,EAAE,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC;AACzD,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { expoContactsNext } from './native-module';
2
+ export declare class Contact extends expoContactsNext.Contact {
3
+ }
@@ -0,0 +1,4 @@
1
+ import { expoContactsNext } from './native-module';
2
+ export class Contact extends expoContactsNext.Contact {
3
+ }
4
+ //# sourceMappingURL=contact.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contact.js","sourceRoot":"","sources":["../../src/core/contact.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD,MAAM,OAAO,OAAQ,SAAQ,gBAAgB,CAAC,OAAO;CAAG"}
@@ -0,0 +1,5 @@
1
+ declare const Container_base: typeof import("./native-module").NativeContainer;
2
+ /** @platform ios - Android has no Container concept in expo-contacts. */
3
+ export declare class Container extends Container_base {
4
+ }
5
+ export {};
@@ -0,0 +1,6 @@
1
+ import { expoContactsNext, FallbackContainer } from './native-module';
2
+ /** @platform ios - Android has no Container concept in expo-contacts. */
3
+ export class Container extends (expoContactsNext.Container ??
4
+ FallbackContainer) {
5
+ }
6
+ //# sourceMappingURL=container.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"container.js","sourceRoot":"","sources":["../../src/core/container.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEtE,yEAAyE;AACzE,MAAM,OAAO,SAAU,SAAQ,CAAC,gBAAgB,CAAC,SAAS;IACxD,iBAAiB,CAAC;CAAG"}
@@ -0,0 +1,53 @@
1
+ export declare enum ContactField {
2
+ IS_FAVOURITE = "isFavourite",
3
+ FULL_NAME = "fullName",
4
+ GIVEN_NAME = "givenName",
5
+ MIDDLE_NAME = "middleName",
6
+ FAMILY_NAME = "familyName",
7
+ MAIDEN_NAME = "maidenName",
8
+ NICKNAME = "nickname",
9
+ PREFIX = "prefix",
10
+ SUFFIX = "suffix",
11
+ PHONETIC_GIVEN_NAME = "phoneticGivenName",
12
+ PHONETIC_MIDDLE_NAME = "phoneticMiddleName",
13
+ PHONETIC_FAMILY_NAME = "phoneticFamilyName",
14
+ COMPANY = "company",
15
+ PHONETIC_COMPANY_NAME = "phoneticCompanyName",
16
+ DEPARTMENT = "department",
17
+ JOB_TITLE = "jobTitle",
18
+ NOTE = "note",
19
+ IMAGE = "image",
20
+ THUMBNAIL = "thumbnail",
21
+ BIRTHDAY = "birthday",
22
+ NON_GREGORIAN_BIRTHDAY = "nonGregorianBirthday",
23
+ EMAILS = "emails",
24
+ PHONES = "phones",
25
+ ADDRESSES = "addresses",
26
+ EXTRA_NAMES = "extraNames",
27
+ DATES = "dates",
28
+ RELATIONS = "relations",
29
+ URL_ADDRESSES = "urlAddresses",
30
+ SOCIAL_PROFILES = "socialProfiles",
31
+ IM_ADDRESSES = "imAddresses"
32
+ }
33
+ export declare enum ContactsSortOrder {
34
+ UserDefault = "userDefault",
35
+ GivenName = "givenName",
36
+ FamilyName = "familyName",
37
+ None = "none"
38
+ }
39
+ /** @platform ios */
40
+ export declare enum NonGregorianCalendar {
41
+ buddhist = "buddhist",
42
+ chinese = "chinese",
43
+ coptic = "coptic",
44
+ ethiopicAmeteMihret = "ethiopicAmeteMihret",
45
+ ethiopicAmeteAlem = "ethiopicAmeteAlem",
46
+ hebrew = "hebrew",
47
+ indian = "indian",
48
+ islamic = "islamic",
49
+ islamicCivil = "islamicCivil",
50
+ japanese = "japanese",
51
+ persian = "persian",
52
+ republicOfChina = "republicOfChina"
53
+ }
@@ -0,0 +1,57 @@
1
+ export var ContactField;
2
+ (function (ContactField) {
3
+ ContactField["IS_FAVOURITE"] = "isFavourite";
4
+ ContactField["FULL_NAME"] = "fullName";
5
+ ContactField["GIVEN_NAME"] = "givenName";
6
+ ContactField["MIDDLE_NAME"] = "middleName";
7
+ ContactField["FAMILY_NAME"] = "familyName";
8
+ ContactField["MAIDEN_NAME"] = "maidenName";
9
+ ContactField["NICKNAME"] = "nickname";
10
+ ContactField["PREFIX"] = "prefix";
11
+ ContactField["SUFFIX"] = "suffix";
12
+ ContactField["PHONETIC_GIVEN_NAME"] = "phoneticGivenName";
13
+ ContactField["PHONETIC_MIDDLE_NAME"] = "phoneticMiddleName";
14
+ ContactField["PHONETIC_FAMILY_NAME"] = "phoneticFamilyName";
15
+ ContactField["COMPANY"] = "company";
16
+ ContactField["PHONETIC_COMPANY_NAME"] = "phoneticCompanyName";
17
+ ContactField["DEPARTMENT"] = "department";
18
+ ContactField["JOB_TITLE"] = "jobTitle";
19
+ ContactField["NOTE"] = "note";
20
+ ContactField["IMAGE"] = "image";
21
+ ContactField["THUMBNAIL"] = "thumbnail";
22
+ ContactField["BIRTHDAY"] = "birthday";
23
+ ContactField["NON_GREGORIAN_BIRTHDAY"] = "nonGregorianBirthday";
24
+ ContactField["EMAILS"] = "emails";
25
+ ContactField["PHONES"] = "phones";
26
+ ContactField["ADDRESSES"] = "addresses";
27
+ ContactField["EXTRA_NAMES"] = "extraNames";
28
+ ContactField["DATES"] = "dates";
29
+ ContactField["RELATIONS"] = "relations";
30
+ ContactField["URL_ADDRESSES"] = "urlAddresses";
31
+ ContactField["SOCIAL_PROFILES"] = "socialProfiles";
32
+ ContactField["IM_ADDRESSES"] = "imAddresses";
33
+ })(ContactField || (ContactField = {}));
34
+ export var ContactsSortOrder;
35
+ (function (ContactsSortOrder) {
36
+ ContactsSortOrder["UserDefault"] = "userDefault";
37
+ ContactsSortOrder["GivenName"] = "givenName";
38
+ ContactsSortOrder["FamilyName"] = "familyName";
39
+ ContactsSortOrder["None"] = "none";
40
+ })(ContactsSortOrder || (ContactsSortOrder = {}));
41
+ /** @platform ios */
42
+ export var NonGregorianCalendar;
43
+ (function (NonGregorianCalendar) {
44
+ NonGregorianCalendar["buddhist"] = "buddhist";
45
+ NonGregorianCalendar["chinese"] = "chinese";
46
+ NonGregorianCalendar["coptic"] = "coptic";
47
+ NonGregorianCalendar["ethiopicAmeteMihret"] = "ethiopicAmeteMihret";
48
+ NonGregorianCalendar["ethiopicAmeteAlem"] = "ethiopicAmeteAlem";
49
+ NonGregorianCalendar["hebrew"] = "hebrew";
50
+ NonGregorianCalendar["indian"] = "indian";
51
+ NonGregorianCalendar["islamic"] = "islamic";
52
+ NonGregorianCalendar["islamicCivil"] = "islamicCivil";
53
+ NonGregorianCalendar["japanese"] = "japanese";
54
+ NonGregorianCalendar["persian"] = "persian";
55
+ NonGregorianCalendar["republicOfChina"] = "republicOfChina";
56
+ })(NonGregorianCalendar || (NonGregorianCalendar = {}));
57
+ //# sourceMappingURL=enums.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enums.js","sourceRoot":"","sources":["../../src/core/enums.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,YA+BX;AA/BD,WAAY,YAAY;IACtB,4CAA4B,CAAA;IAC5B,sCAAsB,CAAA;IACtB,wCAAwB,CAAA;IACxB,0CAA0B,CAAA;IAC1B,0CAA0B,CAAA;IAC1B,0CAA0B,CAAA;IAC1B,qCAAqB,CAAA;IACrB,iCAAiB,CAAA;IACjB,iCAAiB,CAAA;IACjB,yDAAyC,CAAA;IACzC,2DAA2C,CAAA;IAC3C,2DAA2C,CAAA;IAC3C,mCAAmB,CAAA;IACnB,6DAA6C,CAAA;IAC7C,yCAAyB,CAAA;IACzB,sCAAsB,CAAA;IACtB,6BAAa,CAAA;IACb,+BAAe,CAAA;IACf,uCAAuB,CAAA;IACvB,qCAAqB,CAAA;IACrB,+DAA+C,CAAA;IAC/C,iCAAiB,CAAA;IACjB,iCAAiB,CAAA;IACjB,uCAAuB,CAAA;IACvB,0CAA0B,CAAA;IAC1B,+BAAe,CAAA;IACf,uCAAuB,CAAA;IACvB,8CAA8B,CAAA;IAC9B,kDAAkC,CAAA;IAClC,4CAA4B,CAAA;AAC9B,CAAC,EA/BW,YAAY,KAAZ,YAAY,QA+BvB;AAED,MAAM,CAAN,IAAY,iBAKX;AALD,WAAY,iBAAiB;IAC3B,gDAA2B,CAAA;IAC3B,4CAAuB,CAAA;IACvB,8CAAyB,CAAA;IACzB,kCAAa,CAAA;AACf,CAAC,EALW,iBAAiB,KAAjB,iBAAiB,QAK5B;AAED,oBAAoB;AACpB,MAAM,CAAN,IAAY,oBAaX;AAbD,WAAY,oBAAoB;IAC9B,6CAAqB,CAAA;IACrB,2CAAmB,CAAA;IACnB,yCAAiB,CAAA;IACjB,mEAA2C,CAAA;IAC3C,+DAAuC,CAAA;IACvC,yCAAiB,CAAA;IACjB,yCAAiB,CAAA;IACjB,2CAAmB,CAAA;IACnB,qDAA6B,CAAA;IAC7B,6CAAqB,CAAA;IACrB,2CAAmB,CAAA;IACnB,2DAAmC,CAAA;AACrC,CAAC,EAbW,oBAAoB,KAApB,oBAAoB,QAa/B"}
@@ -0,0 +1,5 @@
1
+ declare const Group_base: typeof import("./native-module").NativeGroup;
2
+ /** @platform ios - Android has no Group concept in expo-contacts. */
3
+ export declare class Group extends Group_base {
4
+ }
5
+ export {};
@@ -0,0 +1,5 @@
1
+ import { expoContactsNext, FallbackGroup } from './native-module';
2
+ /** @platform ios - Android has no Group concept in expo-contacts. */
3
+ export class Group extends (expoContactsNext.Group ?? FallbackGroup) {
4
+ }
5
+ //# sourceMappingURL=group.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"group.js","sourceRoot":"","sources":["../../src/core/group.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAElE,qEAAqE;AACrE,MAAM,OAAO,KAAM,SAAQ,CAAC,gBAAgB,CAAC,KAAK,IAAI,aAAa,CAAC;CAAG"}
@@ -0,0 +1,8 @@
1
+ export * from './enums';
2
+ export * from './types';
3
+ export type { IContactAccessButtonCaption, IContactAccessButtonProps, } from './contact-access-button';
4
+ export { Contact } from './contact';
5
+ export { Group } from './group';
6
+ export { Container } from './container';
7
+ export { getPermissionsAsync, requestPermissionsAsync } from './permissions';
8
+ export { addContactsChangeListener, removeAllContactsChangeListeners, } from './listeners';
@@ -0,0 +1,8 @@
1
+ export * from './enums';
2
+ export * from './types';
3
+ export { Contact } from './contact';
4
+ export { Group } from './group';
5
+ export { Container } from './container';
6
+ export { getPermissionsAsync, requestPermissionsAsync } from './permissions';
7
+ export { addContactsChangeListener, removeAllContactsChangeListeners, } from './listeners';
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AAKxB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAC7E,OAAO,EACL,yBAAyB,EACzB,gCAAgC,GACjC,MAAM,aAAa,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { EventSubscription } from 'expo-modules-core';
2
+ export declare function addContactsChangeListener(listener: () => void): EventSubscription;
3
+ export declare function removeAllContactsChangeListeners(): void;
@@ -0,0 +1,12 @@
1
+ import { UnavailabilityError } from 'expo-modules-core';
2
+ import { expoContactsNext, ON_CONTACTS_CHANGE_EVENT_NAME, } from './native-module';
3
+ export function addContactsChangeListener(listener) {
4
+ if (!expoContactsNext.addListener) {
5
+ throw new UnavailabilityError('Contacts', 'addContactsChangeListener');
6
+ }
7
+ return expoContactsNext.addListener(ON_CONTACTS_CHANGE_EVENT_NAME, listener);
8
+ }
9
+ export function removeAllContactsChangeListeners() {
10
+ expoContactsNext.removeAllListeners?.(ON_CONTACTS_CHANGE_EVENT_NAME);
11
+ }
12
+ //# sourceMappingURL=listeners.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"listeners.js","sourceRoot":"","sources":["../../src/core/listeners.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EACL,gBAAgB,EAChB,6BAA6B,GAC9B,MAAM,iBAAiB,CAAC;AAEzB,MAAM,UAAU,yBAAyB,CACvC,QAAoB;IAEpB,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,CAAC;QAClC,MAAM,IAAI,mBAAmB,CAAC,UAAU,EAAE,2BAA2B,CAAC,CAAC;IACzE,CAAC;IACD,OAAO,gBAAgB,CAAC,WAAW,CAAC,6BAA6B,EAAE,QAAQ,CAAC,CAAC;AAC/E,CAAC;AAED,MAAM,UAAU,gCAAgC;IAC9C,gBAAgB,CAAC,kBAAkB,EAAE,CAAC,6BAA6B,CAAC,CAAC;AACvE,CAAC"}
@@ -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;