@octane-xplat/contacts 0.19.0 → 0.20.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.
package/src/types.ts CHANGED
@@ -4,144 +4,144 @@ export type PermissionResult = 'granted' | 'denied' | 'unsupported'
4
4
  /** Fields the app asks for — a superset is fetched natively, this selects
5
5
  * which members are populated on the returned Contact. */
6
6
  export type ContactField =
7
- | 'name'
8
- | 'emails'
9
- | 'phoneNumbers'
10
- | 'addresses'
11
- | 'urls'
12
- | 'company'
13
- | 'note'
14
- | 'image'
15
- | 'nickname'
7
+ | 'name'
8
+ | 'emails'
9
+ | 'phoneNumbers'
10
+ | 'addresses'
11
+ | 'urls'
12
+ | 'company'
13
+ | 'note'
14
+ | 'image'
15
+ | 'nickname'
16
16
 
17
17
  /** One labeled email field. */
18
18
  export interface ContactEmail {
19
- /** Free-form label (home/work/custom) as stored. */
20
- label?: string
21
- /** Email address value. */
22
- email: string
19
+ /** Free-form label (home/work/custom) as stored. */
20
+ label?: string
21
+ /** Email address value. */
22
+ email: string
23
23
  }
24
24
 
25
25
  /** One labeled phone field. */
26
26
  export interface ContactPhone {
27
- /** Free-form label (home/work/custom) as stored. */
28
- label?: string
29
- /** Phone number string as stored. */
30
- number: string
27
+ /** Free-form label (home/work/custom) as stored. */
28
+ label?: string
29
+ /** Phone number string as stored. */
30
+ number: string
31
31
  }
32
32
 
33
33
  /** One labeled postal address. */
34
34
  export interface ContactAddress {
35
- /** Free-form label (home/work/custom) as stored. */
36
- label?: string
37
- /** Street line(s). */
38
- street?: string
39
- /** City. */
40
- city?: string
41
- /** State/province region. */
42
- region?: string
43
- /** Postal/ZIP code. */
44
- postalCode?: string
45
- /** Country name or code. */
46
- country?: string
35
+ /** Free-form label (home/work/custom) as stored. */
36
+ label?: string
37
+ /** Street line(s). */
38
+ street?: string
39
+ /** City. */
40
+ city?: string
41
+ /** State/province region. */
42
+ region?: string
43
+ /** Postal/ZIP code. */
44
+ postalCode?: string
45
+ /** Country name or code. */
46
+ country?: string
47
47
  }
48
48
 
49
49
  /** One labeled URL field. */
50
50
  export interface ContactUrl {
51
- /** Free-form label (home/work/custom) as stored. */
52
- label?: string
53
- /** URL value. */
54
- url: string
51
+ /** Free-form label (home/work/custom) as stored. */
52
+ label?: string
53
+ /** URL value. */
54
+ url: string
55
55
  }
56
56
 
57
57
  /** A stored contact record. */
58
58
  export interface Contact {
59
- /** Store-assigned contact id. */
60
- id: string
61
- /** Display name — falls back to composed given/family when the store
62
- * lacks a display string. */
63
- name: string
64
- /** Given name. */
65
- firstName?: string
66
- /** Middle name(s). */
67
- middleName?: string
68
- /** Family name. */
69
- lastName?: string
70
- /** Nickname. */
71
- nickname?: string
72
- /** Email addresses with labels. */
73
- emails?: ContactEmail[]
74
- /** Phone numbers with labels. */
75
- phoneNumbers?: ContactPhone[]
76
- /** Postal addresses with labels. */
77
- addresses?: ContactAddress[]
78
- /** Associated URLs with labels. */
79
- urls?: ContactUrl[]
80
- /** Organization name. */
81
- company?: string
82
- /** Role within the organization. */
83
- jobTitle?: string
84
- /** Free-text note field. */
85
- note?: string
86
- /** Platform image reference when 'image' was requested — a file path or
87
- * data reference; shape is platform-dependent. */
88
- image?: unknown
59
+ /** Store-assigned contact id. */
60
+ id: string
61
+ /** Display name — falls back to composed given/family when the store
62
+ * lacks a display string. */
63
+ name: string
64
+ /** Given name. */
65
+ firstName?: string
66
+ /** Middle name(s). */
67
+ middleName?: string
68
+ /** Family name. */
69
+ lastName?: string
70
+ /** Nickname. */
71
+ nickname?: string
72
+ /** Email addresses with labels. */
73
+ emails?: ContactEmail[]
74
+ /** Phone numbers with labels. */
75
+ phoneNumbers?: ContactPhone[]
76
+ /** Postal addresses with labels. */
77
+ addresses?: ContactAddress[]
78
+ /** Associated URLs with labels. */
79
+ urls?: ContactUrl[]
80
+ /** Organization name. */
81
+ company?: string
82
+ /** Role within the organization. */
83
+ jobTitle?: string
84
+ /** Free-text note field. */
85
+ note?: string
86
+ /** Platform image reference when 'image' was requested — a file path or
87
+ * data reference; shape is platform-dependent. */
88
+ image?: unknown
89
89
  }
90
90
 
91
91
  /** Contact fields for add/update — no store id. */
92
92
  export interface NewContact {
93
- /** Given name. */
94
- firstName?: string
95
- /** Middle name(s). */
96
- middleName?: string
97
- /** Family name. */
98
- lastName?: string
99
- /** Nickname. */
100
- nickname?: string
101
- /** Email addresses with labels. */
102
- emails?: ContactEmail[]
103
- /** Phone numbers with labels. */
104
- phoneNumbers?: ContactPhone[]
105
- /** Organization name. */
106
- company?: string
107
- /** Role within the organization. */
108
- jobTitle?: string
109
- /** Free-text note field. */
110
- note?: string
93
+ /** Given name. */
94
+ firstName?: string
95
+ /** Middle name(s). */
96
+ middleName?: string
97
+ /** Family name. */
98
+ lastName?: string
99
+ /** Nickname. */
100
+ nickname?: string
101
+ /** Email addresses with labels. */
102
+ emails?: ContactEmail[]
103
+ /** Phone numbers with labels. */
104
+ phoneNumbers?: ContactPhone[]
105
+ /** Organization name. */
106
+ company?: string
107
+ /** Role within the organization. */
108
+ jobTitle?: string
109
+ /** Free-text note field. */
110
+ note?: string
111
111
  }
112
112
 
113
113
  /** Paging options for getAll(). */
114
114
  export interface GetContactsOptions {
115
- /** Restrict which members are populated (all fetched by default). */
116
- fields?: ContactField[]
117
- /** Client-side sort — the native stores return an unspecified order. */
118
- sort?: 'firstName' | 'lastName' | 'none'
119
- /** Max contacts per page. */
120
- pageSize?: number
121
- /** Start offset into the result set. */
122
- pageOffset?: number
115
+ /** Restrict which members are populated (all fetched by default). */
116
+ fields?: ContactField[]
117
+ /** Client-side sort — the native stores return an unspecified order. */
118
+ sort?: 'firstName' | 'lastName' | 'none'
119
+ /** Max contacts per page. */
120
+ pageSize?: number
121
+ /** Start offset into the result set. */
122
+ pageOffset?: number
123
123
  }
124
124
 
125
125
  /** System address-book facade; false supported off mobile. */
126
126
  export interface Contacts {
127
- /** Whether the system address book is reachable on this target — false off mobile. */
128
- readonly supported: boolean
129
- /** Ensure the contacts permission without prompting twice — returns the
130
- * post-request grant state, 'unsupported' when the store can't be reached. */
131
- ensure(): Promise<PermissionResult>
132
- /** Fetch contacts in pages. */
133
- getAll(options?: GetContactsOptions): Promise<Contact[]>
134
- /** Substring search over display names. */
135
- getByName(predicate: string, fields?: ContactField[]): Promise<Contact[]>
136
- /** iOS: direct id fetch. Android: the plugin ships no id lookup, so this
137
- * fetches the full store and filters — read-all cost, call sparingly. */
138
- getById(id: string, fields?: ContactField[]): Promise<Contact | null>
139
- /** Insert a contact; resolves the store-assigned id. */
140
- add(contact: NewContact): Promise<string>
141
- /** Patch fields of an existing contact by id. */
142
- update(id: string, contact: NewContact): Promise<string>
143
- /** Delete a contact by id. */
144
- remove(id: string): Promise<void>
127
+ /** Whether the system address book is reachable on this target — false off mobile. */
128
+ readonly supported: boolean
129
+ /** Ensure the contacts permission without prompting twice — returns the
130
+ * post-request grant state, 'unsupported' when the store can't be reached. */
131
+ ensure(): Promise<PermissionResult>
132
+ /** Fetch contacts in pages. */
133
+ getAll(options?: GetContactsOptions): Promise<Contact[]>
134
+ /** Substring search over display names. */
135
+ getByName(predicate: string, fields?: ContactField[]): Promise<Contact[]>
136
+ /** iOS: direct id fetch. Android: the plugin ships no id lookup, so this
137
+ * fetches the full store and filters — read-all cost, call sparingly. */
138
+ getById(id: string, fields?: ContactField[]): Promise<Contact | null>
139
+ /** Insert a contact; resolves the store-assigned id. */
140
+ add(contact: NewContact): Promise<string>
141
+ /** Patch fields of an existing contact by id. */
142
+ update(id: string, contact: NewContact): Promise<string>
143
+ /** Delete a contact by id. */
144
+ remove(id: string): Promise<void>
145
145
  }
146
146
 
147
147
  export declare const contacts: Contacts
@@ -2,13 +2,7 @@
2
2
  "version": 1,
3
3
  "files": [
4
4
  "contacts.d.ts",
5
- "contacts.linux.d.ts",
6
- "contacts.macos.d.ts",
7
- "contacts.web.d.ts",
8
- "contacts.windows.d.ts",
9
5
  "index.d.ts",
10
- "index.macos.d.ts",
11
- "index.web.d.ts",
12
6
  "types.d.ts"
13
7
  ]
14
8
  }
@@ -1 +0,0 @@
1
- export { contacts } from './contacts.web.js';
@@ -1,3 +0,0 @@
1
- import type { Contacts } from './types.js';
2
- /** Contacts service — system address book. */
3
- export declare const contacts: Contacts;
@@ -1,3 +0,0 @@
1
- import type { Contacts } from './types.js';
2
- /** Contacts service — system address book. */
3
- export declare const contacts: Contacts;
@@ -1,3 +0,0 @@
1
- import type { Contacts } from './types.js';
2
- /** Contacts service — system address book. */
3
- export declare const contacts: Contacts;
@@ -1,2 +0,0 @@
1
- export * from './types.js';
2
- export { contacts } from './contacts.macos.js';
@@ -1,2 +0,0 @@
1
- export * from './types.js';
2
- export { contacts } from './contacts.web.js';