@capgo/capacitor-contacts 8.0.19 → 8.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.
@@ -283,6 +283,16 @@ export interface Contact {
283
283
  * @since 1.0.0
284
284
  */
285
285
  id?: string;
286
+ /**
287
+ * Formatted name shown by the device for this contact.
288
+ *
289
+ * Derived from `CNContactFormatter` on iOS and `DISPLAY_NAME` on Android.
290
+ * Read-only: setting this when creating or updating a contact has no effect.
291
+ * Use `givenName` and `familyName` to write a name.
292
+ *
293
+ * @since 8.1.0
294
+ */
295
+ displayName?: string;
286
296
  /**
287
297
  * Account information for the contact.
288
298
  *
@@ -676,6 +686,34 @@ export interface DeleteGroupByIdOptions {
676
686
  */
677
687
  id: string;
678
688
  }
689
+ /**
690
+ * Contact property that the native picker can select without `READ_CONTACTS`.
691
+ *
692
+ * Use with {@link PickContactsOptions.property} so the user picks one phone
693
+ * number, email address, or postal address instead of a full contact record.
694
+ *
695
+ * @since 8.1.0
696
+ */
697
+ export declare enum ContactProperty {
698
+ /**
699
+ * A single phone number.
700
+ *
701
+ * @since 8.1.0
702
+ */
703
+ PhoneNumber = "phoneNumber",
704
+ /**
705
+ * A single email address.
706
+ *
707
+ * @since 8.1.0
708
+ */
709
+ EmailAddress = "emailAddress",
710
+ /**
711
+ * A single postal address.
712
+ *
713
+ * @since 8.1.0
714
+ */
715
+ PostalAddress = "postalAddress"
716
+ }
679
717
  /**
680
718
  * Options for picking contacts using the native contact picker.
681
719
  *
@@ -685,15 +723,36 @@ export interface PickContactsOptions {
685
723
  /**
686
724
  * Optional list of specific fields to retrieve. If not specified, all fields are returned.
687
725
  *
726
+ * Ignored when {@link PickContactsOptions.property} is set. The result then
727
+ * contains only `id`, `displayName`, and the selected property.
728
+ *
688
729
  * @since 1.0.0
689
730
  */
690
731
  fields?: ContactField[];
691
732
  /**
692
733
  * Whether to allow selecting multiple contacts. Default is false.
693
734
  *
735
+ * Ignored when {@link PickContactsOptions.property} is set. Property picking
736
+ * always returns a single value.
737
+ *
694
738
  * @since 1.0.0
695
739
  */
696
740
  multiple?: boolean;
741
+ /**
742
+ * Restrict the picker to a single contact property.
743
+ *
744
+ * On Android this launches the picker against the phone, email, or postal
745
+ * address table and reads the granted data row. That requires no
746
+ * `READ_CONTACTS` permission on any Android version, which is required for
747
+ * apps that only pick a contact detail and target Android 17 (API 37) or
748
+ * later under the Google Play Contacts Permissions policy.
749
+ *
750
+ * On iOS the picker lets the user choose one phone number, email address,
751
+ * or postal address. It never requires a contacts permission.
752
+ *
753
+ * @since 8.1.0
754
+ */
755
+ property?: ContactProperty;
697
756
  }
698
757
  /**
699
758
  * Result from picking contacts.
@@ -896,6 +955,9 @@ export interface CapacitorContactsPlugin {
896
955
  /**
897
956
  * Pick a single contact using the native contact picker.
898
957
  *
958
+ * Same options as {@link pickContacts}. Pass `property` to select one phone
959
+ * number, email address, or postal address without `READ_CONTACTS` on Android.
960
+ *
899
961
  * @param options - Optional fields to retrieve and picker configuration
900
962
  * @returns Promise that resolves with the selected contact(s)
901
963
  * @since 1.0.0
@@ -904,6 +966,18 @@ export interface CapacitorContactsPlugin {
904
966
  /**
905
967
  * Pick one or more contacts using the native contact picker.
906
968
  *
969
+ * On iOS this never requires a contacts permission.
970
+ *
971
+ * On Android, pass `property` to select a single phone number, email address,
972
+ * or postal address with no `READ_CONTACTS` permission. That works on every
973
+ * Android version and is the way to ship without declaring the permission
974
+ * when targeting Android 17 (API 37) or later.
975
+ *
976
+ * Picking a full contact without `property` still needs `READ_CONTACTS` below
977
+ * Android 17, because the picker URI exposes no phone, email, or structured
978
+ * name. On Android 17 and later the system contact picker returns a session
979
+ * URI the plugin reads without that permission.
980
+ *
907
981
  * @param options - Optional fields to retrieve and picker configuration
908
982
  * @returns Promise that resolves with the selected contacts
909
983
  * @since 1.0.0
@@ -1,2 +1,30 @@
1
- export {};
1
+ /**
2
+ * Contact property that the native picker can select without `READ_CONTACTS`.
3
+ *
4
+ * Use with {@link PickContactsOptions.property} so the user picks one phone
5
+ * number, email address, or postal address instead of a full contact record.
6
+ *
7
+ * @since 8.1.0
8
+ */
9
+ export var ContactProperty;
10
+ (function (ContactProperty) {
11
+ /**
12
+ * A single phone number.
13
+ *
14
+ * @since 8.1.0
15
+ */
16
+ ContactProperty["PhoneNumber"] = "phoneNumber";
17
+ /**
18
+ * A single email address.
19
+ *
20
+ * @since 8.1.0
21
+ */
22
+ ContactProperty["EmailAddress"] = "emailAddress";
23
+ /**
24
+ * A single postal address.
25
+ *
26
+ * @since 8.1.0
27
+ */
28
+ ContactProperty["PostalAddress"] = "postalAddress";
29
+ })(ContactProperty || (ContactProperty = {}));
2
30
  //# sourceMappingURL=definitions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["import type { PermissionState } from '@capacitor/core';\n\n/**\n * Permission state for contacts access, including the 'limited' state for iOS 18+.\n *\n * @since 1.0.0\n */\nexport type ContactsPermissionState = PermissionState | 'limited';\n\n/**\n * Type of contacts permission to request.\n *\n * @since 1.0.0\n */\nexport type ContactsPermissionType = 'readContacts' | 'writeContacts';\n\n/**\n * Status of contacts permissions.\n *\n * @since 1.0.0\n */\nexport interface PermissionStatus {\n /**\n * Permission state for reading contacts.\n *\n * @since 1.0.0\n */\n readContacts: ContactsPermissionState;\n\n /**\n * Permission state for writing contacts.\n *\n * @since 1.0.0\n */\n writeContacts: ContactsPermissionState;\n}\n\n/**\n * Options for requesting contacts permissions.\n *\n * @since 1.0.0\n */\nexport interface RequestPermissionsOptions {\n /**\n * Specific permissions to request. If not provided, all permissions will be requested.\n *\n * @since 1.0.0\n */\n permissions?: ContactsPermissionType[];\n}\n\n/**\n * Account information for a contact.\n *\n * @since 1.0.0\n */\nexport interface Account {\n /**\n * The name of the account.\n *\n * @since 1.0.0\n */\n name: string;\n\n /**\n * The type of the account.\n *\n * @since 1.0.0\n */\n type?: string;\n}\n\n/**\n * Birthday information for a contact.\n *\n * @since 1.0.0\n */\nexport interface Birthday {\n /**\n * The day of the month (1-31).\n *\n * @since 1.0.0\n */\n day?: number;\n\n /**\n * The month (1-12).\n *\n * @since 1.0.0\n */\n month?: number;\n\n /**\n * The year.\n *\n * @since 1.0.0\n */\n year?: number;\n}\n\n/**\n * Type of email address.\n *\n * @since 1.0.0\n */\nexport type EmailAddressType = 'CUSTOM' | 'HOME' | 'ICLOUD' | 'OTHER' | 'WORK';\n\n/**\n * Email address information for a contact.\n *\n * @since 1.0.0\n */\nexport interface EmailAddress {\n /**\n * The email address value.\n *\n * @since 1.0.0\n */\n value: string;\n\n /**\n * The type of email address.\n *\n * @since 1.0.0\n */\n type?: EmailAddressType;\n\n /**\n * Custom label for the email address.\n *\n * @since 1.0.0\n */\n label?: string;\n\n /**\n * Whether this is the primary email address.\n *\n * @since 1.0.0\n */\n isPrimary?: boolean;\n}\n\n/**\n * Type of phone number.\n *\n * @since 1.0.0\n */\nexport type PhoneNumberType =\n | 'ASSISTANT'\n | 'CALLBACK'\n | 'CAR'\n | 'COMPANY_MAIN'\n | 'CUSTOM'\n | 'FAX_HOME'\n | 'FAX_WORK'\n | 'HOME'\n | 'HOME_FAX'\n | 'ISDN'\n | 'MAIN'\n | 'MMS'\n | 'MOBILE'\n | 'OTHER'\n | 'OTHER_FAX'\n | 'PAGER'\n | 'RADIO'\n | 'TELEX'\n | 'TTY_TDD'\n | 'WORK'\n | 'WORK_MOBILE'\n | 'WORK_PAGER';\n\n/**\n * Phone number information for a contact.\n *\n * @since 1.0.0\n */\nexport interface PhoneNumber {\n /**\n * The phone number value.\n *\n * @since 1.0.0\n */\n value: string;\n\n /**\n * The type of phone number.\n *\n * @since 1.0.0\n */\n type?: PhoneNumberType;\n\n /**\n * Custom label for the phone number.\n *\n * @since 1.0.0\n */\n label?: string;\n\n /**\n * Whether this is the primary phone number.\n *\n * @since 1.0.0\n */\n isPrimary?: boolean;\n}\n\n/**\n * Type of postal address.\n *\n * @since 1.0.0\n */\nexport type PostalAddressType = 'CUSTOM' | 'HOME' | 'OTHER' | 'WORK';\n\n/**\n * Postal address information for a contact.\n *\n * @since 1.0.0\n */\nexport interface PostalAddress {\n /**\n * The city name.\n *\n * @since 1.0.0\n */\n city?: string;\n\n /**\n * The country name.\n *\n * @since 1.0.0\n */\n country?: string;\n\n /**\n * The formatted address string.\n *\n * @since 1.0.0\n */\n formatted?: string;\n\n /**\n * The ISO country code.\n *\n * @since 1.0.0\n */\n isoCountryCode?: string;\n\n /**\n * Whether this is the primary postal address.\n *\n * @since 1.0.0\n */\n isPrimary?: boolean;\n\n /**\n * Custom label for the postal address.\n *\n * @since 1.0.0\n */\n label?: string;\n\n /**\n * The neighborhood name.\n *\n * @since 1.0.0\n */\n neighborhood?: string;\n\n /**\n * The postal code.\n *\n * @since 1.0.0\n */\n postalCode?: string;\n\n /**\n * The state or province name.\n *\n * @since 1.0.0\n */\n state?: string;\n\n /**\n * The street address.\n *\n * @since 1.0.0\n */\n street?: string;\n\n /**\n * The type of postal address.\n *\n * @since 1.0.0\n */\n type?: PostalAddressType;\n}\n\n/**\n * Type of URL address.\n *\n * @since 1.0.0\n */\nexport type UrlAddressType = 'BLOG' | 'CUSTOM' | 'FTP' | 'HOME' | 'HOMEPAGE' | 'OTHER' | 'PROFILE' | 'SCHOOL' | 'WORK';\n\n/**\n * URL address information for a contact.\n *\n * @since 1.0.0\n */\nexport interface UrlAddress {\n /**\n * The URL value.\n *\n * @since 1.0.0\n */\n value: string;\n\n /**\n * The type of URL.\n *\n * @since 1.0.0\n */\n type?: UrlAddressType;\n\n /**\n * Custom label for the URL.\n *\n * @since 1.0.0\n */\n label?: string;\n}\n\n/**\n * Contact information.\n *\n * @since 1.0.0\n */\nexport interface Contact {\n /**\n * Unique identifier for the contact.\n *\n * @since 1.0.0\n */\n id?: string;\n\n /**\n * Account information for the contact.\n *\n * @since 1.0.0\n */\n account?: Account;\n\n /**\n * Birthday information for the contact.\n *\n * @since 1.0.0\n */\n birthday?: Birthday;\n\n /**\n * Email addresses for the contact.\n *\n * @since 1.0.0\n */\n emailAddresses?: EmailAddress[];\n\n /**\n * Family name (last name) of the contact.\n *\n * @since 1.0.0\n */\n familyName?: string;\n\n /**\n * Full name of the contact.\n *\n * @since 1.0.0\n */\n fullName?: string;\n\n /**\n * Given name (first name) of the contact.\n *\n * @since 1.0.0\n */\n givenName?: string;\n\n /**\n * Group IDs the contact belongs to.\n *\n * @since 1.0.0\n */\n groupIds?: string[];\n\n /**\n * Job title of the contact.\n *\n * @since 1.0.0\n */\n jobTitle?: string;\n\n /**\n * Middle name of the contact.\n *\n * @since 1.0.0\n */\n middleName?: string;\n\n /**\n * Name prefix (e.g., \"Dr.\", \"Mr.\", \"Ms.\") of the contact.\n *\n * @since 1.0.0\n */\n namePrefix?: string;\n\n /**\n * Name suffix (e.g., \"Jr.\", \"Sr.\", \"III\") of the contact.\n *\n * @since 1.0.0\n */\n nameSuffix?: string;\n\n /**\n * Notes about the contact.\n *\n * @since 1.0.0\n */\n note?: string;\n\n /**\n * Organization name of the contact.\n *\n * @since 1.0.0\n */\n organizationName?: string;\n\n /**\n * Phone numbers for the contact.\n *\n * @since 1.0.0\n */\n phoneNumbers?: PhoneNumber[];\n\n /**\n * Base64-encoded photo of the contact.\n *\n * @since 1.0.0\n */\n photo?: string;\n\n /**\n * Postal addresses for the contact.\n *\n * @since 1.0.0\n */\n postalAddresses?: PostalAddress[];\n\n /**\n * URL addresses for the contact.\n *\n * @since 1.0.0\n */\n urlAddresses?: UrlAddress[];\n}\n\n/**\n * Field names available in a Contact object.\n *\n * @since 1.0.0\n */\nexport type ContactField = keyof Contact;\n\n/**\n * Result from counting contacts.\n *\n * @since 1.0.0\n */\nexport interface CountContactsResult {\n /**\n * Total number of contacts.\n *\n * @since 1.0.0\n */\n count: number;\n}\n\n/**\n * Options for creating a contact.\n *\n * @since 1.0.0\n */\nexport interface CreateContactOptions {\n /**\n * Contact information to create. The 'id' field will be generated automatically.\n *\n * @since 1.0.0\n */\n contact: Omit<Contact, 'id'>;\n}\n\n/**\n * Result from creating a contact.\n *\n * @since 1.0.0\n */\nexport interface CreateContactResult {\n /**\n * The ID of the newly created contact.\n *\n * @since 1.0.0\n */\n id: string;\n}\n\n/**\n * Options for displaying the native create contact UI.\n *\n * @since 1.0.0\n */\nexport interface DisplayCreateContactOptions {\n /**\n * Optional pre-filled contact information for the create UI.\n *\n * @since 1.0.0\n */\n contact?: Omit<Contact, 'id'>;\n}\n\n/**\n * Result from displaying the native create contact UI.\n *\n * @since 1.0.0\n */\nexport interface DisplayCreateContactResult {\n /**\n * The ID of the created contact, if one was created. Undefined if the user cancelled.\n *\n * @since 1.0.0\n */\n id?: string;\n}\n\n/**\n * Options for displaying a contact by ID.\n *\n * @since 1.0.0\n */\nexport interface DisplayContactByIdOptions {\n /**\n * The ID of the contact to display.\n *\n * @since 1.0.0\n */\n id: string;\n}\n\n/**\n * Options for displaying the native update contact UI.\n *\n * @since 1.0.0\n */\nexport interface DisplayUpdateContactByIdOptions {\n /**\n * The ID of the contact to update.\n *\n * @since 1.0.0\n */\n id: string;\n}\n\n/**\n * Result from getting accounts.\n *\n * @since 1.0.0\n */\nexport interface GetAccountsResult {\n /**\n * List of accounts available on the device.\n *\n * @since 1.0.0\n */\n accounts: Account[];\n}\n\n/**\n * Options for getting a contact by ID.\n *\n * @since 1.0.0\n */\nexport interface GetContactByIdOptions {\n /**\n * The ID of the contact to retrieve.\n *\n * @since 1.0.0\n */\n id: string;\n\n /**\n * Optional list of specific fields to retrieve. If not specified, all fields are returned.\n *\n * @since 1.0.0\n */\n fields?: ContactField[];\n}\n\n/**\n * Result from getting a contact by ID.\n *\n * @since 1.0.0\n */\nexport interface GetContactByIdResult {\n /**\n * The contact, or null if not found.\n *\n * @since 1.0.0\n */\n contact: Contact | null;\n}\n\n/**\n * Options for getting contacts.\n *\n * @since 1.0.0\n */\nexport interface GetContactsOptions {\n /**\n * Optional list of specific fields to retrieve. If not specified, all fields are returned.\n *\n * @since 1.0.0\n */\n fields?: ContactField[];\n\n /**\n * Maximum number of contacts to return.\n *\n * @since 1.0.0\n */\n limit?: number;\n\n /**\n * Number of contacts to skip before starting to return results.\n *\n * @since 1.0.0\n */\n offset?: number;\n}\n\n/**\n * Result from getting contacts.\n *\n * @since 1.0.0\n */\nexport interface GetContactsResult {\n /**\n * List of contacts.\n *\n * @since 1.0.0\n */\n contacts: Contact[];\n}\n\n/**\n * Options for getting a group by ID.\n *\n * @since 1.0.0\n */\nexport interface GetGroupByIdOptions {\n /**\n * The ID of the group to retrieve.\n *\n * @since 1.0.0\n */\n id: string;\n}\n\n/**\n * Result from getting a group by ID.\n *\n * @since 1.0.0\n */\nexport interface GetGroupByIdResult {\n /**\n * The group, or null if not found.\n *\n * @since 1.0.0\n */\n group: Group | null;\n}\n\n/**\n * Result from getting groups.\n *\n * @since 1.0.0\n */\nexport interface GetGroupsResult {\n /**\n * List of groups.\n *\n * @since 1.0.0\n */\n groups: Group[];\n}\n\n/**\n * Contact group information.\n *\n * @since 1.0.0\n */\nexport interface Group {\n /**\n * Unique identifier for the group.\n *\n * @since 1.0.0\n */\n id: string;\n\n /**\n * Name of the group.\n *\n * @since 1.0.0\n */\n name: string;\n}\n\n/**\n * Options for creating a group.\n *\n * @since 1.0.0\n */\nexport interface CreateGroupOptions {\n /**\n * Group information to create. The 'id' field will be generated automatically.\n *\n * @since 1.0.0\n */\n group: Omit<Group, 'id'>;\n}\n\n/**\n * Result from creating a group.\n *\n * @since 1.0.0\n */\nexport interface CreateGroupResult {\n /**\n * The ID of the newly created group.\n *\n * @since 1.0.0\n */\n id: string;\n}\n\n/**\n * Options for deleting a contact by ID.\n *\n * @since 1.0.0\n */\nexport interface DeleteContactByIdOptions {\n /**\n * The ID of the contact to delete.\n *\n * @since 1.0.0\n */\n id: string;\n}\n\n/**\n * Options for deleting a group by ID.\n *\n * @since 1.0.0\n */\nexport interface DeleteGroupByIdOptions {\n /**\n * The ID of the group to delete.\n *\n * @since 1.0.0\n */\n id: string;\n}\n\n/**\n * Options for picking contacts using the native contact picker.\n *\n * @since 1.0.0\n */\nexport interface PickContactsOptions {\n /**\n * Optional list of specific fields to retrieve. If not specified, all fields are returned.\n *\n * @since 1.0.0\n */\n fields?: ContactField[];\n\n /**\n * Whether to allow selecting multiple contacts. Default is false.\n *\n * @since 1.0.0\n */\n multiple?: boolean;\n}\n\n/**\n * Result from picking contacts.\n *\n * @since 1.0.0\n */\nexport interface PickContactsResult {\n /**\n * List of selected contacts.\n *\n * @since 1.0.0\n */\n contacts: Contact[];\n}\n\n/**\n * Alias for PickContactsOptions.\n *\n * @since 1.0.0\n */\nexport type PickContactOptions = PickContactsOptions;\n\n/**\n * Alias for PickContactsResult.\n *\n * @since 1.0.0\n */\nexport type PickContactResult = PickContactsResult;\n\n/**\n * Options for updating a contact by ID.\n *\n * @since 1.0.0\n */\nexport interface UpdateContactByIdOptions {\n /**\n * The ID of the contact to update.\n *\n * @since 1.0.0\n */\n id: string;\n\n /**\n * Updated contact information.\n *\n * @since 1.0.0\n */\n contact: Omit<Contact, 'id'>;\n}\n\n/**\n * Result from checking if the plugin is supported on the platform.\n *\n * @since 1.0.0\n */\nexport interface IsSupportedResult {\n /**\n * Whether the plugin is supported on this platform.\n *\n * @since 1.0.0\n */\n isSupported: boolean;\n}\n\n/**\n * Result from checking if contacts are available on the device.\n *\n * @since 1.0.0\n */\nexport interface IsAvailableResult {\n /**\n * Whether contacts are available on this device.\n *\n * @since 1.0.0\n */\n isAvailable: boolean;\n}\n\n/**\n * Capacitor Contacts Plugin interface for managing device contacts.\n *\n * @since 1.0.0\n */\nexport interface CapacitorContactsPlugin {\n /**\n * Count the total number of contacts on the device.\n *\n * @returns Promise that resolves with the total count of contacts\n * @since 1.0.0\n */\n countContacts(): Promise<CountContactsResult>;\n\n /**\n * Create a new contact programmatically.\n *\n * @param options - The contact information to create\n * @returns Promise that resolves with the ID of the newly created contact\n * @since 1.0.0\n */\n createContact(options: CreateContactOptions): Promise<CreateContactResult>;\n\n /**\n * Create a new contact group.\n *\n * @param options - The group information to create\n * @returns Promise that resolves with the ID of the newly created group\n * @since 1.0.0\n */\n createGroup(options: CreateGroupOptions): Promise<CreateGroupResult>;\n\n /**\n * Delete a contact by ID.\n *\n * @param options - The ID of the contact to delete\n * @returns Promise that resolves when the contact is deleted\n * @since 1.0.0\n */\n deleteContactById(options: DeleteContactByIdOptions): Promise<void>;\n\n /**\n * Delete a group by ID.\n *\n * @param options - The ID of the group to delete\n * @returns Promise that resolves when the group is deleted\n * @since 1.0.0\n */\n deleteGroupById(options: DeleteGroupByIdOptions): Promise<void>;\n\n /**\n * Display a contact using the native contact viewer.\n *\n * @param options - The ID of the contact to display\n * @returns Promise that resolves when the viewer is closed\n * @since 1.0.0\n */\n displayContactById(options: DisplayContactByIdOptions): Promise<void>;\n\n /**\n * Display the native create contact UI.\n *\n * @param options - Optional pre-filled contact information\n * @returns Promise that resolves with the ID of the created contact, or undefined if cancelled\n * @since 1.0.0\n */\n displayCreateContact(options?: DisplayCreateContactOptions): Promise<DisplayCreateContactResult>;\n\n /**\n * Display the native update contact UI for a specific contact.\n *\n * @param options - The ID of the contact to update\n * @returns Promise that resolves when the update UI is closed\n * @since 1.0.0\n */\n displayUpdateContactById(options: DisplayUpdateContactByIdOptions): Promise<void>;\n\n /**\n * Get all accounts available on the device.\n *\n * @returns Promise that resolves with the list of accounts\n * @since 1.0.0\n */\n getAccounts(): Promise<GetAccountsResult>;\n\n /**\n * Get a specific contact by ID.\n *\n * @param options - The ID and optional fields to retrieve\n * @returns Promise that resolves with the contact, or null if not found\n * @since 1.0.0\n */\n getContactById(options: GetContactByIdOptions): Promise<GetContactByIdResult>;\n\n /**\n * Get all contacts from the device.\n *\n * @param options - Optional filters and pagination options\n * @returns Promise that resolves with the list of contacts\n * @since 1.0.0\n */\n getContacts(options?: GetContactsOptions): Promise<GetContactsResult>;\n\n /**\n * Get a specific group by ID.\n *\n * @param options - The ID of the group to retrieve\n * @returns Promise that resolves with the group, or null if not found\n * @since 1.0.0\n */\n getGroupById(options: GetGroupByIdOptions): Promise<GetGroupByIdResult>;\n\n /**\n * Get all contact groups.\n *\n * @returns Promise that resolves with the list of groups\n * @since 1.0.0\n */\n getGroups(): Promise<GetGroupsResult>;\n\n /**\n * Check if contacts are available on the device.\n *\n * @returns Promise that resolves with availability status\n * @since 1.0.0\n */\n isAvailable(): Promise<IsAvailableResult>;\n\n /**\n * Check if the plugin is supported on the current platform.\n *\n * @returns Promise that resolves with support status\n * @since 1.0.0\n */\n isSupported(): Promise<IsSupportedResult>;\n\n /**\n * Open the device's contacts settings.\n *\n * @returns Promise that resolves when the settings are opened\n * @since 1.0.0\n */\n openSettings(): Promise<void>;\n\n /**\n * Pick a single contact using the native contact picker.\n *\n * @param options - Optional fields to retrieve and picker configuration\n * @returns Promise that resolves with the selected contact(s)\n * @since 1.0.0\n */\n pickContact(options?: PickContactOptions): Promise<PickContactResult>;\n\n /**\n * Pick one or more contacts using the native contact picker.\n *\n * @param options - Optional fields to retrieve and picker configuration\n * @returns Promise that resolves with the selected contacts\n * @since 1.0.0\n */\n pickContacts(options?: PickContactsOptions): Promise<PickContactsResult>;\n\n /**\n * Update an existing contact by ID.\n *\n * @param options - The ID and updated contact information\n * @returns Promise that resolves when the contact is updated\n * @since 1.0.0\n */\n updateContactById(options: UpdateContactByIdOptions): Promise<void>;\n\n /**\n * Check the current permission status for contacts.\n *\n * @returns Promise that resolves with the current permission status\n * @since 1.0.0\n */\n checkPermissions(): Promise<PermissionStatus>;\n\n /**\n * Request permissions to access contacts.\n *\n * @param options - Optional specific permissions to request\n * @returns Promise that resolves with the updated permission status\n * @since 1.0.0\n */\n requestPermissions(options?: RequestPermissionsOptions): Promise<PermissionStatus>;\n\n /**\n * Get the native Capacitor plugin version.\n *\n * @returns Promise that resolves with the plugin version\n * @since 1.0.0\n */\n getPluginVersion(): Promise<{ version: string }>;\n}\n"]}
1
+ {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAuxBA;;;;;;;GAOG;AACH,MAAM,CAAN,IAAY,eAqBX;AArBD,WAAY,eAAe;IACzB;;;;OAIG;IACH,8CAA2B,CAAA;IAE3B;;;;OAIG;IACH,gDAA6B,CAAA;IAE7B;;;;OAIG;IACH,kDAA+B,CAAA;AACjC,CAAC,EArBW,eAAe,KAAf,eAAe,QAqB1B","sourcesContent":["import type { PermissionState } from '@capacitor/core';\n\n/**\n * Permission state for contacts access, including the 'limited' state for iOS 18+.\n *\n * @since 1.0.0\n */\nexport type ContactsPermissionState = PermissionState | 'limited';\n\n/**\n * Type of contacts permission to request.\n *\n * @since 1.0.0\n */\nexport type ContactsPermissionType = 'readContacts' | 'writeContacts';\n\n/**\n * Status of contacts permissions.\n *\n * @since 1.0.0\n */\nexport interface PermissionStatus {\n /**\n * Permission state for reading contacts.\n *\n * @since 1.0.0\n */\n readContacts: ContactsPermissionState;\n\n /**\n * Permission state for writing contacts.\n *\n * @since 1.0.0\n */\n writeContacts: ContactsPermissionState;\n}\n\n/**\n * Options for requesting contacts permissions.\n *\n * @since 1.0.0\n */\nexport interface RequestPermissionsOptions {\n /**\n * Specific permissions to request. If not provided, all permissions will be requested.\n *\n * @since 1.0.0\n */\n permissions?: ContactsPermissionType[];\n}\n\n/**\n * Account information for a contact.\n *\n * @since 1.0.0\n */\nexport interface Account {\n /**\n * The name of the account.\n *\n * @since 1.0.0\n */\n name: string;\n\n /**\n * The type of the account.\n *\n * @since 1.0.0\n */\n type?: string;\n}\n\n/**\n * Birthday information for a contact.\n *\n * @since 1.0.0\n */\nexport interface Birthday {\n /**\n * The day of the month (1-31).\n *\n * @since 1.0.0\n */\n day?: number;\n\n /**\n * The month (1-12).\n *\n * @since 1.0.0\n */\n month?: number;\n\n /**\n * The year.\n *\n * @since 1.0.0\n */\n year?: number;\n}\n\n/**\n * Type of email address.\n *\n * @since 1.0.0\n */\nexport type EmailAddressType = 'CUSTOM' | 'HOME' | 'ICLOUD' | 'OTHER' | 'WORK';\n\n/**\n * Email address information for a contact.\n *\n * @since 1.0.0\n */\nexport interface EmailAddress {\n /**\n * The email address value.\n *\n * @since 1.0.0\n */\n value: string;\n\n /**\n * The type of email address.\n *\n * @since 1.0.0\n */\n type?: EmailAddressType;\n\n /**\n * Custom label for the email address.\n *\n * @since 1.0.0\n */\n label?: string;\n\n /**\n * Whether this is the primary email address.\n *\n * @since 1.0.0\n */\n isPrimary?: boolean;\n}\n\n/**\n * Type of phone number.\n *\n * @since 1.0.0\n */\nexport type PhoneNumberType =\n | 'ASSISTANT'\n | 'CALLBACK'\n | 'CAR'\n | 'COMPANY_MAIN'\n | 'CUSTOM'\n | 'FAX_HOME'\n | 'FAX_WORK'\n | 'HOME'\n | 'HOME_FAX'\n | 'ISDN'\n | 'MAIN'\n | 'MMS'\n | 'MOBILE'\n | 'OTHER'\n | 'OTHER_FAX'\n | 'PAGER'\n | 'RADIO'\n | 'TELEX'\n | 'TTY_TDD'\n | 'WORK'\n | 'WORK_MOBILE'\n | 'WORK_PAGER';\n\n/**\n * Phone number information for a contact.\n *\n * @since 1.0.0\n */\nexport interface PhoneNumber {\n /**\n * The phone number value.\n *\n * @since 1.0.0\n */\n value: string;\n\n /**\n * The type of phone number.\n *\n * @since 1.0.0\n */\n type?: PhoneNumberType;\n\n /**\n * Custom label for the phone number.\n *\n * @since 1.0.0\n */\n label?: string;\n\n /**\n * Whether this is the primary phone number.\n *\n * @since 1.0.0\n */\n isPrimary?: boolean;\n}\n\n/**\n * Type of postal address.\n *\n * @since 1.0.0\n */\nexport type PostalAddressType = 'CUSTOM' | 'HOME' | 'OTHER' | 'WORK';\n\n/**\n * Postal address information for a contact.\n *\n * @since 1.0.0\n */\nexport interface PostalAddress {\n /**\n * The city name.\n *\n * @since 1.0.0\n */\n city?: string;\n\n /**\n * The country name.\n *\n * @since 1.0.0\n */\n country?: string;\n\n /**\n * The formatted address string.\n *\n * @since 1.0.0\n */\n formatted?: string;\n\n /**\n * The ISO country code.\n *\n * @since 1.0.0\n */\n isoCountryCode?: string;\n\n /**\n * Whether this is the primary postal address.\n *\n * @since 1.0.0\n */\n isPrimary?: boolean;\n\n /**\n * Custom label for the postal address.\n *\n * @since 1.0.0\n */\n label?: string;\n\n /**\n * The neighborhood name.\n *\n * @since 1.0.0\n */\n neighborhood?: string;\n\n /**\n * The postal code.\n *\n * @since 1.0.0\n */\n postalCode?: string;\n\n /**\n * The state or province name.\n *\n * @since 1.0.0\n */\n state?: string;\n\n /**\n * The street address.\n *\n * @since 1.0.0\n */\n street?: string;\n\n /**\n * The type of postal address.\n *\n * @since 1.0.0\n */\n type?: PostalAddressType;\n}\n\n/**\n * Type of URL address.\n *\n * @since 1.0.0\n */\nexport type UrlAddressType = 'BLOG' | 'CUSTOM' | 'FTP' | 'HOME' | 'HOMEPAGE' | 'OTHER' | 'PROFILE' | 'SCHOOL' | 'WORK';\n\n/**\n * URL address information for a contact.\n *\n * @since 1.0.0\n */\nexport interface UrlAddress {\n /**\n * The URL value.\n *\n * @since 1.0.0\n */\n value: string;\n\n /**\n * The type of URL.\n *\n * @since 1.0.0\n */\n type?: UrlAddressType;\n\n /**\n * Custom label for the URL.\n *\n * @since 1.0.0\n */\n label?: string;\n}\n\n/**\n * Contact information.\n *\n * @since 1.0.0\n */\nexport interface Contact {\n /**\n * Unique identifier for the contact.\n *\n * @since 1.0.0\n */\n id?: string;\n\n /**\n * Formatted name shown by the device for this contact.\n *\n * Derived from `CNContactFormatter` on iOS and `DISPLAY_NAME` on Android.\n * Read-only: setting this when creating or updating a contact has no effect.\n * Use `givenName` and `familyName` to write a name.\n *\n * @since 8.1.0\n */\n displayName?: string;\n\n /**\n * Account information for the contact.\n *\n * @since 1.0.0\n */\n account?: Account;\n\n /**\n * Birthday information for the contact.\n *\n * @since 1.0.0\n */\n birthday?: Birthday;\n\n /**\n * Email addresses for the contact.\n *\n * @since 1.0.0\n */\n emailAddresses?: EmailAddress[];\n\n /**\n * Family name (last name) of the contact.\n *\n * @since 1.0.0\n */\n familyName?: string;\n\n /**\n * Full name of the contact.\n *\n * @since 1.0.0\n */\n fullName?: string;\n\n /**\n * Given name (first name) of the contact.\n *\n * @since 1.0.0\n */\n givenName?: string;\n\n /**\n * Group IDs the contact belongs to.\n *\n * @since 1.0.0\n */\n groupIds?: string[];\n\n /**\n * Job title of the contact.\n *\n * @since 1.0.0\n */\n jobTitle?: string;\n\n /**\n * Middle name of the contact.\n *\n * @since 1.0.0\n */\n middleName?: string;\n\n /**\n * Name prefix (e.g., \"Dr.\", \"Mr.\", \"Ms.\") of the contact.\n *\n * @since 1.0.0\n */\n namePrefix?: string;\n\n /**\n * Name suffix (e.g., \"Jr.\", \"Sr.\", \"III\") of the contact.\n *\n * @since 1.0.0\n */\n nameSuffix?: string;\n\n /**\n * Notes about the contact.\n *\n * @since 1.0.0\n */\n note?: string;\n\n /**\n * Organization name of the contact.\n *\n * @since 1.0.0\n */\n organizationName?: string;\n\n /**\n * Phone numbers for the contact.\n *\n * @since 1.0.0\n */\n phoneNumbers?: PhoneNumber[];\n\n /**\n * Base64-encoded photo of the contact.\n *\n * @since 1.0.0\n */\n photo?: string;\n\n /**\n * Postal addresses for the contact.\n *\n * @since 1.0.0\n */\n postalAddresses?: PostalAddress[];\n\n /**\n * URL addresses for the contact.\n *\n * @since 1.0.0\n */\n urlAddresses?: UrlAddress[];\n}\n\n/**\n * Field names available in a Contact object.\n *\n * @since 1.0.0\n */\nexport type ContactField = keyof Contact;\n\n/**\n * Result from counting contacts.\n *\n * @since 1.0.0\n */\nexport interface CountContactsResult {\n /**\n * Total number of contacts.\n *\n * @since 1.0.0\n */\n count: number;\n}\n\n/**\n * Options for creating a contact.\n *\n * @since 1.0.0\n */\nexport interface CreateContactOptions {\n /**\n * Contact information to create. The 'id' field will be generated automatically.\n *\n * @since 1.0.0\n */\n contact: Omit<Contact, 'id'>;\n}\n\n/**\n * Result from creating a contact.\n *\n * @since 1.0.0\n */\nexport interface CreateContactResult {\n /**\n * The ID of the newly created contact.\n *\n * @since 1.0.0\n */\n id: string;\n}\n\n/**\n * Options for displaying the native create contact UI.\n *\n * @since 1.0.0\n */\nexport interface DisplayCreateContactOptions {\n /**\n * Optional pre-filled contact information for the create UI.\n *\n * @since 1.0.0\n */\n contact?: Omit<Contact, 'id'>;\n}\n\n/**\n * Result from displaying the native create contact UI.\n *\n * @since 1.0.0\n */\nexport interface DisplayCreateContactResult {\n /**\n * The ID of the created contact, if one was created. Undefined if the user cancelled.\n *\n * @since 1.0.0\n */\n id?: string;\n}\n\n/**\n * Options for displaying a contact by ID.\n *\n * @since 1.0.0\n */\nexport interface DisplayContactByIdOptions {\n /**\n * The ID of the contact to display.\n *\n * @since 1.0.0\n */\n id: string;\n}\n\n/**\n * Options for displaying the native update contact UI.\n *\n * @since 1.0.0\n */\nexport interface DisplayUpdateContactByIdOptions {\n /**\n * The ID of the contact to update.\n *\n * @since 1.0.0\n */\n id: string;\n}\n\n/**\n * Result from getting accounts.\n *\n * @since 1.0.0\n */\nexport interface GetAccountsResult {\n /**\n * List of accounts available on the device.\n *\n * @since 1.0.0\n */\n accounts: Account[];\n}\n\n/**\n * Options for getting a contact by ID.\n *\n * @since 1.0.0\n */\nexport interface GetContactByIdOptions {\n /**\n * The ID of the contact to retrieve.\n *\n * @since 1.0.0\n */\n id: string;\n\n /**\n * Optional list of specific fields to retrieve. If not specified, all fields are returned.\n *\n * @since 1.0.0\n */\n fields?: ContactField[];\n}\n\n/**\n * Result from getting a contact by ID.\n *\n * @since 1.0.0\n */\nexport interface GetContactByIdResult {\n /**\n * The contact, or null if not found.\n *\n * @since 1.0.0\n */\n contact: Contact | null;\n}\n\n/**\n * Options for getting contacts.\n *\n * @since 1.0.0\n */\nexport interface GetContactsOptions {\n /**\n * Optional list of specific fields to retrieve. If not specified, all fields are returned.\n *\n * @since 1.0.0\n */\n fields?: ContactField[];\n\n /**\n * Maximum number of contacts to return.\n *\n * @since 1.0.0\n */\n limit?: number;\n\n /**\n * Number of contacts to skip before starting to return results.\n *\n * @since 1.0.0\n */\n offset?: number;\n}\n\n/**\n * Result from getting contacts.\n *\n * @since 1.0.0\n */\nexport interface GetContactsResult {\n /**\n * List of contacts.\n *\n * @since 1.0.0\n */\n contacts: Contact[];\n}\n\n/**\n * Options for getting a group by ID.\n *\n * @since 1.0.0\n */\nexport interface GetGroupByIdOptions {\n /**\n * The ID of the group to retrieve.\n *\n * @since 1.0.0\n */\n id: string;\n}\n\n/**\n * Result from getting a group by ID.\n *\n * @since 1.0.0\n */\nexport interface GetGroupByIdResult {\n /**\n * The group, or null if not found.\n *\n * @since 1.0.0\n */\n group: Group | null;\n}\n\n/**\n * Result from getting groups.\n *\n * @since 1.0.0\n */\nexport interface GetGroupsResult {\n /**\n * List of groups.\n *\n * @since 1.0.0\n */\n groups: Group[];\n}\n\n/**\n * Contact group information.\n *\n * @since 1.0.0\n */\nexport interface Group {\n /**\n * Unique identifier for the group.\n *\n * @since 1.0.0\n */\n id: string;\n\n /**\n * Name of the group.\n *\n * @since 1.0.0\n */\n name: string;\n}\n\n/**\n * Options for creating a group.\n *\n * @since 1.0.0\n */\nexport interface CreateGroupOptions {\n /**\n * Group information to create. The 'id' field will be generated automatically.\n *\n * @since 1.0.0\n */\n group: Omit<Group, 'id'>;\n}\n\n/**\n * Result from creating a group.\n *\n * @since 1.0.0\n */\nexport interface CreateGroupResult {\n /**\n * The ID of the newly created group.\n *\n * @since 1.0.0\n */\n id: string;\n}\n\n/**\n * Options for deleting a contact by ID.\n *\n * @since 1.0.0\n */\nexport interface DeleteContactByIdOptions {\n /**\n * The ID of the contact to delete.\n *\n * @since 1.0.0\n */\n id: string;\n}\n\n/**\n * Options for deleting a group by ID.\n *\n * @since 1.0.0\n */\nexport interface DeleteGroupByIdOptions {\n /**\n * The ID of the group to delete.\n *\n * @since 1.0.0\n */\n id: string;\n}\n\n/**\n * Contact property that the native picker can select without `READ_CONTACTS`.\n *\n * Use with {@link PickContactsOptions.property} so the user picks one phone\n * number, email address, or postal address instead of a full contact record.\n *\n * @since 8.1.0\n */\nexport enum ContactProperty {\n /**\n * A single phone number.\n *\n * @since 8.1.0\n */\n PhoneNumber = 'phoneNumber',\n\n /**\n * A single email address.\n *\n * @since 8.1.0\n */\n EmailAddress = 'emailAddress',\n\n /**\n * A single postal address.\n *\n * @since 8.1.0\n */\n PostalAddress = 'postalAddress',\n}\n\n/**\n * Options for picking contacts using the native contact picker.\n *\n * @since 1.0.0\n */\nexport interface PickContactsOptions {\n /**\n * Optional list of specific fields to retrieve. If not specified, all fields are returned.\n *\n * Ignored when {@link PickContactsOptions.property} is set. The result then\n * contains only `id`, `displayName`, and the selected property.\n *\n * @since 1.0.0\n */\n fields?: ContactField[];\n\n /**\n * Whether to allow selecting multiple contacts. Default is false.\n *\n * Ignored when {@link PickContactsOptions.property} is set. Property picking\n * always returns a single value.\n *\n * @since 1.0.0\n */\n multiple?: boolean;\n\n /**\n * Restrict the picker to a single contact property.\n *\n * On Android this launches the picker against the phone, email, or postal\n * address table and reads the granted data row. That requires no\n * `READ_CONTACTS` permission on any Android version, which is required for\n * apps that only pick a contact detail and target Android 17 (API 37) or\n * later under the Google Play Contacts Permissions policy.\n *\n * On iOS the picker lets the user choose one phone number, email address,\n * or postal address. It never requires a contacts permission.\n *\n * @since 8.1.0\n */\n property?: ContactProperty;\n}\n\n/**\n * Result from picking contacts.\n *\n * @since 1.0.0\n */\nexport interface PickContactsResult {\n /**\n * List of selected contacts.\n *\n * @since 1.0.0\n */\n contacts: Contact[];\n}\n\n/**\n * Alias for PickContactsOptions.\n *\n * @since 1.0.0\n */\nexport type PickContactOptions = PickContactsOptions;\n\n/**\n * Alias for PickContactsResult.\n *\n * @since 1.0.0\n */\nexport type PickContactResult = PickContactsResult;\n\n/**\n * Options for updating a contact by ID.\n *\n * @since 1.0.0\n */\nexport interface UpdateContactByIdOptions {\n /**\n * The ID of the contact to update.\n *\n * @since 1.0.0\n */\n id: string;\n\n /**\n * Updated contact information.\n *\n * @since 1.0.0\n */\n contact: Omit<Contact, 'id'>;\n}\n\n/**\n * Result from checking if the plugin is supported on the platform.\n *\n * @since 1.0.0\n */\nexport interface IsSupportedResult {\n /**\n * Whether the plugin is supported on this platform.\n *\n * @since 1.0.0\n */\n isSupported: boolean;\n}\n\n/**\n * Result from checking if contacts are available on the device.\n *\n * @since 1.0.0\n */\nexport interface IsAvailableResult {\n /**\n * Whether contacts are available on this device.\n *\n * @since 1.0.0\n */\n isAvailable: boolean;\n}\n\n/**\n * Capacitor Contacts Plugin interface for managing device contacts.\n *\n * @since 1.0.0\n */\nexport interface CapacitorContactsPlugin {\n /**\n * Count the total number of contacts on the device.\n *\n * @returns Promise that resolves with the total count of contacts\n * @since 1.0.0\n */\n countContacts(): Promise<CountContactsResult>;\n\n /**\n * Create a new contact programmatically.\n *\n * @param options - The contact information to create\n * @returns Promise that resolves with the ID of the newly created contact\n * @since 1.0.0\n */\n createContact(options: CreateContactOptions): Promise<CreateContactResult>;\n\n /**\n * Create a new contact group.\n *\n * @param options - The group information to create\n * @returns Promise that resolves with the ID of the newly created group\n * @since 1.0.0\n */\n createGroup(options: CreateGroupOptions): Promise<CreateGroupResult>;\n\n /**\n * Delete a contact by ID.\n *\n * @param options - The ID of the contact to delete\n * @returns Promise that resolves when the contact is deleted\n * @since 1.0.0\n */\n deleteContactById(options: DeleteContactByIdOptions): Promise<void>;\n\n /**\n * Delete a group by ID.\n *\n * @param options - The ID of the group to delete\n * @returns Promise that resolves when the group is deleted\n * @since 1.0.0\n */\n deleteGroupById(options: DeleteGroupByIdOptions): Promise<void>;\n\n /**\n * Display a contact using the native contact viewer.\n *\n * @param options - The ID of the contact to display\n * @returns Promise that resolves when the viewer is closed\n * @since 1.0.0\n */\n displayContactById(options: DisplayContactByIdOptions): Promise<void>;\n\n /**\n * Display the native create contact UI.\n *\n * @param options - Optional pre-filled contact information\n * @returns Promise that resolves with the ID of the created contact, or undefined if cancelled\n * @since 1.0.0\n */\n displayCreateContact(options?: DisplayCreateContactOptions): Promise<DisplayCreateContactResult>;\n\n /**\n * Display the native update contact UI for a specific contact.\n *\n * @param options - The ID of the contact to update\n * @returns Promise that resolves when the update UI is closed\n * @since 1.0.0\n */\n displayUpdateContactById(options: DisplayUpdateContactByIdOptions): Promise<void>;\n\n /**\n * Get all accounts available on the device.\n *\n * @returns Promise that resolves with the list of accounts\n * @since 1.0.0\n */\n getAccounts(): Promise<GetAccountsResult>;\n\n /**\n * Get a specific contact by ID.\n *\n * @param options - The ID and optional fields to retrieve\n * @returns Promise that resolves with the contact, or null if not found\n * @since 1.0.0\n */\n getContactById(options: GetContactByIdOptions): Promise<GetContactByIdResult>;\n\n /**\n * Get all contacts from the device.\n *\n * @param options - Optional filters and pagination options\n * @returns Promise that resolves with the list of contacts\n * @since 1.0.0\n */\n getContacts(options?: GetContactsOptions): Promise<GetContactsResult>;\n\n /**\n * Get a specific group by ID.\n *\n * @param options - The ID of the group to retrieve\n * @returns Promise that resolves with the group, or null if not found\n * @since 1.0.0\n */\n getGroupById(options: GetGroupByIdOptions): Promise<GetGroupByIdResult>;\n\n /**\n * Get all contact groups.\n *\n * @returns Promise that resolves with the list of groups\n * @since 1.0.0\n */\n getGroups(): Promise<GetGroupsResult>;\n\n /**\n * Check if contacts are available on the device.\n *\n * @returns Promise that resolves with availability status\n * @since 1.0.0\n */\n isAvailable(): Promise<IsAvailableResult>;\n\n /**\n * Check if the plugin is supported on the current platform.\n *\n * @returns Promise that resolves with support status\n * @since 1.0.0\n */\n isSupported(): Promise<IsSupportedResult>;\n\n /**\n * Open the device's contacts settings.\n *\n * @returns Promise that resolves when the settings are opened\n * @since 1.0.0\n */\n openSettings(): Promise<void>;\n\n /**\n * Pick a single contact using the native contact picker.\n *\n * Same options as {@link pickContacts}. Pass `property` to select one phone\n * number, email address, or postal address without `READ_CONTACTS` on Android.\n *\n * @param options - Optional fields to retrieve and picker configuration\n * @returns Promise that resolves with the selected contact(s)\n * @since 1.0.0\n */\n pickContact(options?: PickContactOptions): Promise<PickContactResult>;\n\n /**\n * Pick one or more contacts using the native contact picker.\n *\n * On iOS this never requires a contacts permission.\n *\n * On Android, pass `property` to select a single phone number, email address,\n * or postal address with no `READ_CONTACTS` permission. That works on every\n * Android version and is the way to ship without declaring the permission\n * when targeting Android 17 (API 37) or later.\n *\n * Picking a full contact without `property` still needs `READ_CONTACTS` below\n * Android 17, because the picker URI exposes no phone, email, or structured\n * name. On Android 17 and later the system contact picker returns a session\n * URI the plugin reads without that permission.\n *\n * @param options - Optional fields to retrieve and picker configuration\n * @returns Promise that resolves with the selected contacts\n * @since 1.0.0\n */\n pickContacts(options?: PickContactsOptions): Promise<PickContactsResult>;\n\n /**\n * Update an existing contact by ID.\n *\n * @param options - The ID and updated contact information\n * @returns Promise that resolves when the contact is updated\n * @since 1.0.0\n */\n updateContactById(options: UpdateContactByIdOptions): Promise<void>;\n\n /**\n * Check the current permission status for contacts.\n *\n * @returns Promise that resolves with the current permission status\n * @since 1.0.0\n */\n checkPermissions(): Promise<PermissionStatus>;\n\n /**\n * Request permissions to access contacts.\n *\n * @param options - Optional specific permissions to request\n * @returns Promise that resolves with the updated permission status\n * @since 1.0.0\n */\n requestPermissions(options?: RequestPermissionsOptions): Promise<PermissionStatus>;\n\n /**\n * Get the native Capacitor plugin version.\n *\n * @returns Promise that resolves with the plugin version\n * @since 1.0.0\n */\n getPluginVersion(): Promise<{ version: string }>;\n}\n"]}
@@ -2,6 +2,36 @@
2
2
 
3
3
  var core = require('@capacitor/core');
4
4
 
5
+ /**
6
+ * Contact property that the native picker can select without `READ_CONTACTS`.
7
+ *
8
+ * Use with {@link PickContactsOptions.property} so the user picks one phone
9
+ * number, email address, or postal address instead of a full contact record.
10
+ *
11
+ * @since 8.1.0
12
+ */
13
+ exports.ContactProperty = void 0;
14
+ (function (ContactProperty) {
15
+ /**
16
+ * A single phone number.
17
+ *
18
+ * @since 8.1.0
19
+ */
20
+ ContactProperty["PhoneNumber"] = "phoneNumber";
21
+ /**
22
+ * A single email address.
23
+ *
24
+ * @since 8.1.0
25
+ */
26
+ ContactProperty["EmailAddress"] = "emailAddress";
27
+ /**
28
+ * A single postal address.
29
+ *
30
+ * @since 8.1.0
31
+ */
32
+ ContactProperty["PostalAddress"] = "postalAddress";
33
+ })(exports.ContactProperty || (exports.ContactProperty = {}));
34
+
5
35
  const CapacitorContacts = core.registerPlugin('CapacitorContacts', {
6
36
  web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.CapacitorContactsWeb()),
7
37
  });
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst CapacitorContacts = registerPlugin('CapacitorContacts', {\n web: () => import('./web').then((m) => new m.CapacitorContactsWeb()),\n});\nexport * from './definitions';\nexport { CapacitorContacts };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CapacitorContactsWeb extends WebPlugin {\n async countContacts() {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async createContact(_options) {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async createGroup(_options) {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async deleteContactById(_options) {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async deleteGroupById(_options) {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async displayContactById(_options) {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async displayCreateContact(_options) {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async displayUpdateContactById(_options) {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async getAccounts() {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async getContactById(_options) {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async getContacts(_options) {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async getGroupById(_options) {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async getGroups() {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async isAvailable() {\n return { isAvailable: false };\n }\n async isSupported() {\n return { isSupported: false };\n }\n async openSettings() {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async pickContact(_options) {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async pickContacts(_options) {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async updateContactById(_options) {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async checkPermissions() {\n return { readContacts: 'denied', writeContacts: 'denied' };\n }\n async requestPermissions(_options) {\n return { readContacts: 'denied', writeContacts: 'denied' };\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;AACK,MAAC,iBAAiB,GAAGA,mBAAc,CAAC,mBAAmB,EAAE;AAC9D,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,oBAAoB,EAAE,CAAC;AACxE,CAAC;;ACFM,MAAM,oBAAoB,SAASC,cAAS,CAAC;AACpD,IAAI,MAAM,aAAa,GAAG;AAC1B,QAAQ,MAAM,IAAI,CAAC,WAAW,CAAC,uDAAuD,CAAC;AACvF,IAAI;AACJ,IAAI,MAAM,aAAa,CAAC,QAAQ,EAAE;AAClC,QAAQ,MAAM,IAAI,CAAC,WAAW,CAAC,uDAAuD,CAAC;AACvF,IAAI;AACJ,IAAI,MAAM,WAAW,CAAC,QAAQ,EAAE;AAChC,QAAQ,MAAM,IAAI,CAAC,WAAW,CAAC,uDAAuD,CAAC;AACvF,IAAI;AACJ,IAAI,MAAM,iBAAiB,CAAC,QAAQ,EAAE;AACtC,QAAQ,MAAM,IAAI,CAAC,WAAW,CAAC,uDAAuD,CAAC;AACvF,IAAI;AACJ,IAAI,MAAM,eAAe,CAAC,QAAQ,EAAE;AACpC,QAAQ,MAAM,IAAI,CAAC,WAAW,CAAC,uDAAuD,CAAC;AACvF,IAAI;AACJ,IAAI,MAAM,kBA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C,uDAAuD,CAAC;AACvF,IAAI;AACJ,IAAI,MAAM,YAAY,CAAC,QAAQ,EAAE;AACjC,QAAQ,MAAM,IAAI,CAAC,WAAW,CAAC,uDAAuD,CAAC;AACvF,IAAI;AACJ,IAAI,MAAM,iBAAiB,CAAC,QAAQ,EAAE;AACtC,QAAQ,MAAM,IAAI,CAAC,WAAW,CAAC,uDAAuD,CAAC;AACvF,IAAI;AACJ,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,QAAQ,EAAE;AAClE,IAAI;AACJ,IAAI,MAAM,kBAAkB,CAAC,QAAQ,EAAE;AACvC,QAAQ,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,QAAQ,EAAE;AAClE,IAAI;AACJ,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;AACjC,IAAI;AACJ;;;;;;;;;"}
1
+ {"version":3,"file":"plugin.cjs.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["/**\n * Contact property that the native picker can select without `READ_CONTACTS`.\n *\n * Use with {@link PickContactsOptions.property} so the user picks one phone\n * number, email address, or postal address instead of a full contact record.\n *\n * @since 8.1.0\n */\nexport var ContactProperty;\n(function (ContactProperty) {\n /**\n * A single phone number.\n *\n * @since 8.1.0\n */\n ContactProperty[\"PhoneNumber\"] = \"phoneNumber\";\n /**\n * A single email address.\n *\n * @since 8.1.0\n */\n ContactProperty[\"EmailAddress\"] = \"emailAddress\";\n /**\n * A single postal address.\n *\n * @since 8.1.0\n */\n ContactProperty[\"PostalAddress\"] = \"postalAddress\";\n})(ContactProperty || (ContactProperty = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst CapacitorContacts = registerPlugin('CapacitorContacts', {\n web: () => import('./web').then((m) => new m.CapacitorContactsWeb()),\n});\nexport * from './definitions';\nexport { CapacitorContacts };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CapacitorContactsWeb extends WebPlugin {\n async countContacts() {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async createContact(_options) {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async createGroup(_options) {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async deleteContactById(_options) {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async deleteGroupById(_options) {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async displayContactById(_options) {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async displayCreateContact(_options) {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async displayUpdateContactById(_options) {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async getAccounts() {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async getContactById(_options) {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async getContacts(_options) {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async getGroupById(_options) {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async getGroups() {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async isAvailable() {\n return { isAvailable: false };\n }\n async isSupported() {\n return { isSupported: false };\n }\n async openSettings() {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async pickContact(_options) {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async pickContacts(_options) {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async updateContactById(_options) {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async checkPermissions() {\n return { readContacts: 'denied', writeContacts: 'denied' };\n }\n async requestPermissions(_options) {\n return { readContacts: 'denied', writeContacts: 'denied' };\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["ContactProperty","registerPlugin","WebPlugin"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;A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CAAC,uDAAuD,CAAC;AACvF,IAAI;AACJ,IAAI,MAAM,iBAAiB,CAAC,QAAQ,EAAE;AACtC,QAAQ,MAAM,IAAI,CAAC,WAAW,CAAC,uDAAuD,CAAC;AACvF,IAAI;AACJ,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,QAAQ,EAAE;AAClE,IAAI;AACJ,IAAI,MAAM,kBAAkB,CAAC,QAAQ,EAAE;AACvC,QAAQ,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,QAAQ,EAAE;AAClE,IAAI;AACJ,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;AACjC,IAAI;AACJ;;;;;;;;;"}
package/dist/plugin.js CHANGED
@@ -1,6 +1,36 @@
1
1
  var capacitorCapacitorContacts = (function (exports, core) {
2
2
  'use strict';
3
3
 
4
+ /**
5
+ * Contact property that the native picker can select without `READ_CONTACTS`.
6
+ *
7
+ * Use with {@link PickContactsOptions.property} so the user picks one phone
8
+ * number, email address, or postal address instead of a full contact record.
9
+ *
10
+ * @since 8.1.0
11
+ */
12
+ exports.ContactProperty = void 0;
13
+ (function (ContactProperty) {
14
+ /**
15
+ * A single phone number.
16
+ *
17
+ * @since 8.1.0
18
+ */
19
+ ContactProperty["PhoneNumber"] = "phoneNumber";
20
+ /**
21
+ * A single email address.
22
+ *
23
+ * @since 8.1.0
24
+ */
25
+ ContactProperty["EmailAddress"] = "emailAddress";
26
+ /**
27
+ * A single postal address.
28
+ *
29
+ * @since 8.1.0
30
+ */
31
+ ContactProperty["PostalAddress"] = "postalAddress";
32
+ })(exports.ContactProperty || (exports.ContactProperty = {}));
33
+
4
34
  const CapacitorContacts = core.registerPlugin('CapacitorContacts', {
5
35
  web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.CapacitorContactsWeb()),
6
36
  });
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst CapacitorContacts = registerPlugin('CapacitorContacts', {\n web: () => import('./web').then((m) => new m.CapacitorContactsWeb()),\n});\nexport * from './definitions';\nexport { CapacitorContacts };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CapacitorContactsWeb extends WebPlugin {\n async countContacts() {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async createContact(_options) {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async createGroup(_options) {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async deleteContactById(_options) {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async deleteGroupById(_options) {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async displayContactById(_options) {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async displayCreateContact(_options) {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async displayUpdateContactById(_options) {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async getAccounts() {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async getContactById(_options) {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async getContacts(_options) {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async getGroupById(_options) {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async getGroups() {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async isAvailable() {\n return { isAvailable: false };\n }\n async isSupported() {\n return { isSupported: false };\n }\n async openSettings() {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async pickContact(_options) {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async pickContacts(_options) {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async updateContactById(_options) {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async checkPermissions() {\n return { readContacts: 'denied', writeContacts: 'denied' };\n }\n async requestPermissions(_options) {\n return { readContacts: 'denied', writeContacts: 'denied' };\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,iBAAiB,GAAGA,mBAAc,CAAC,mBAAmB,EAAE;IAC9D,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,oBAAoB,EAAE,CAAC;IACxE,CAAC;;ICFM,MAAM,oBAAoB,SAASC,cAAS,CAAC;IACpD,IAAI,MAAM,aAAa,GAAG;IAC1B,QAAQ,MAAM,IAAI,CAAC,WAAW,CAAC,uDAAuD,CAAC;IACvF,IAAI;IACJ,IAAI,MAAM,aAAa,CAAC,QAAQ,EAAE;IAClC,QAAQ,MAAM,IAAI,CAAC,WAAW,CAAC,uDAAuD,CAAC;IACvF,IAAI;IACJ,IAAI,MAAM,WAAW,CAAC,QAAQ,EAAE;IAChC,QAAQ,MAAM,IAAI,CAAC,WAAW,CAAC,uDAAuD,CAAC;IACvF,IAAI;IACJ,IAAI,MAAM,iBAAiB,CAAC,QAAQ,EAAE;IACtC,QAAQ,MAAM,IAAI,CAAC,WAAW,CAAC,uDAAuD,CAAC;IACvF,IAAI;IACJ,IAAI,MAAM,eAAe,CAAC,QAAQ,EAAE;IACpC,QAAQ,MAAM,IAAI,CAAC,WAAW,CAAC,uDAAuD,CAAC;IACvF,IAAI;IACJ,IAAI,MAAM,kBAAkB,CAAC,QAAQ,EAAE;IACvC,QAAQ,MAAM,IAAI,CAAC,WAAW,CAAC,uDAAuD,CAAC;IACvF,IAAI;IACJ,IAAI,MAAM,oBAAoB,CAAC,QAAQ,EAAE;IACzC,QAAQ,MAAM,IAAI,CAAC,WAAW,CAAC,uDAAuD,CAAC;IACvF,IAAI;IACJ,IAAI,MAAM,wBAAwB,CAAC,QAAQ,EAAE;IAC7C,QAAQ,MAAM,IAAI,CAAC,WAAW,CAAC,uDAAuD,C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,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,QAAQ,EAAE;IAClE,IAAI;IACJ,IAAI,MAAM,kBAAkB,CAAC,QAAQ,EAAE;IACvC,QAAQ,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,QAAQ,EAAE;IAClE,IAAI;IACJ,IAAI,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;IACjC,IAAI;IACJ;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"plugin.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["/**\n * Contact property that the native picker can select without `READ_CONTACTS`.\n *\n * Use with {@link PickContactsOptions.property} so the user picks one phone\n * number, email address, or postal address instead of a full contact record.\n *\n * @since 8.1.0\n */\nexport var ContactProperty;\n(function (ContactProperty) {\n /**\n * A single phone number.\n *\n * @since 8.1.0\n */\n ContactProperty[\"PhoneNumber\"] = \"phoneNumber\";\n /**\n * A single email address.\n *\n * @since 8.1.0\n */\n ContactProperty[\"EmailAddress\"] = \"emailAddress\";\n /**\n * A single postal address.\n *\n * @since 8.1.0\n */\n ContactProperty[\"PostalAddress\"] = \"postalAddress\";\n})(ContactProperty || (ContactProperty = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst CapacitorContacts = registerPlugin('CapacitorContacts', {\n web: () => import('./web').then((m) => new m.CapacitorContactsWeb()),\n});\nexport * from './definitions';\nexport { CapacitorContacts };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CapacitorContactsWeb extends WebPlugin {\n async countContacts() {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async createContact(_options) {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async createGroup(_options) {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async deleteContactById(_options) {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async deleteGroupById(_options) {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async displayContactById(_options) {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async displayCreateContact(_options) {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async displayUpdateContactById(_options) {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async getAccounts() {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async getContactById(_options) {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async getContacts(_options) {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async getGroupById(_options) {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async getGroups() {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async isAvailable() {\n return { isAvailable: false };\n }\n async isSupported() {\n return { isSupported: false };\n }\n async openSettings() {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async pickContact(_options) {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async pickContacts(_options) {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async updateContactById(_options) {\n throw this.unavailable('Contacts API not available on the web implementation.');\n }\n async checkPermissions() {\n return { readContacts: 'denied', writeContacts: 'denied' };\n }\n async requestPermissions(_options) {\n return { readContacts: 'denied', writeContacts: 'denied' };\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["ContactProperty","registerPlugin","WebPlugin"],"mappings":";;;IAAA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;AACWA;IACX,CAAC,UAAU,eAAe,EAAE;IAC5B;IACA;IACA;IACA;IACA;IACA,IAAI,eAAe,CAAC,aAAa,CAAC,GAAG,aAAa;IAClD;IACA;IACA;IACA;IACA;IACA,IAAI,eAAe,CAAC,cAAc,CAAC,GAAG,cAAc;IACpD;IACA;IACA;IACA;IACA;IACA,IAAI,eAAe,CAAC,eAAe,CAAC,GAAG,eAAe;IACtD,CAAC,EAAEA,uBAAe,KAAKA,uBAAe,GAAG,EAAE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