craft-native 0.0.37
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/LICENSE.md +21 -0
- package/README.md +424 -0
- package/bin/cli.ts +937 -0
- package/dist/api/android-advanced.d.ts +737 -0
- package/dist/api/android-advanced.d.ts.map +1 -0
- package/dist/api/app.d.ts +432 -0
- package/dist/api/app.d.ts.map +1 -0
- package/dist/api/clipboard.d.ts +85 -0
- package/dist/api/clipboard.d.ts.map +1 -0
- package/dist/api/crypto.d.ts +79 -0
- package/dist/api/crypto.d.ts.map +1 -0
- package/dist/api/db.d.ts +427 -0
- package/dist/api/db.d.ts.map +1 -0
- package/dist/api/dialog.d.ts +141 -0
- package/dist/api/dialog.d.ts.map +1 -0
- package/dist/api/fs.d.ts +131 -0
- package/dist/api/fs.d.ts.map +1 -0
- package/dist/api/http.d.ts +196 -0
- package/dist/api/http.d.ts.map +1 -0
- package/dist/api/index.d.ts +38 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/ios-advanced.d.ts +833 -0
- package/dist/api/ios-advanced.d.ts.map +1 -0
- package/dist/api/macos-advanced.d.ts +721 -0
- package/dist/api/macos-advanced.d.ts.map +1 -0
- package/dist/api/media.d.ts +233 -0
- package/dist/api/media.d.ts.map +1 -0
- package/dist/api/mobile.d.ts +658 -0
- package/dist/api/mobile.d.ts.map +1 -0
- package/dist/api/process.d.ts +168 -0
- package/dist/api/process.d.ts.map +1 -0
- package/dist/api/sidebar.d.ts +125 -0
- package/dist/api/sidebar.d.ts.map +1 -0
- package/dist/api/tray.d.ts +410 -0
- package/dist/api/tray.d.ts.map +1 -0
- package/dist/api/window.d.ts +462 -0
- package/dist/api/window.d.ts.map +1 -0
- package/dist/api/windows-advanced.d.ts +719 -0
- package/dist/api/windows-advanced.d.ts.map +1 -0
- package/dist/assets/index.d.ts +69 -0
- package/dist/assets/index.d.ts.map +1 -0
- package/dist/binary-resolver.d.ts +39 -0
- package/dist/binary-resolver.d.ts.map +1 -0
- package/dist/bridge/android.d.ts +574 -0
- package/dist/bridge/android.d.ts.map +1 -0
- package/dist/bridge/core.d.ts +474 -0
- package/dist/bridge/core.d.ts.map +1 -0
- package/dist/bridge/ids.d.ts +18 -0
- package/dist/bridge/ids.d.ts.map +1 -0
- package/dist/bridge/ios.d.ts +528 -0
- package/dist/bridge/ios.d.ts.map +1 -0
- package/dist/bridge/webkit-pending.d.ts +50 -0
- package/dist/bridge/webkit-pending.d.ts.map +1 -0
- package/dist/build/bundle-optimizer.d.ts +69 -0
- package/dist/build/bundle-optimizer.d.ts.map +1 -0
- package/dist/components/index.d.ts +719 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/native.d.ts +728 -0
- package/dist/components/native.d.ts.map +1 -0
- package/dist/components/sidebar.d.ts +458 -0
- package/dist/components/sidebar.d.ts.map +1 -0
- package/dist/dev/devtools.d.ts +118 -0
- package/dist/dev/devtools.d.ts.map +1 -0
- package/dist/dev/error-overlay.d.ts +73 -0
- package/dist/dev/error-overlay.d.ts.map +1 -0
- package/dist/dev/hot-reload.d.ts +127 -0
- package/dist/dev/hot-reload.d.ts.map +1 -0
- package/dist/index.cjs +10253 -0
- package/dist/index.d.cts +59 -0
- package/dist/index.d.ts +59 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10240 -0
- package/dist/logging/index.d.ts +152 -0
- package/dist/logging/index.d.ts.map +1 -0
- package/dist/optimizations/index.d.ts +232 -0
- package/dist/optimizations/index.d.ts.map +1 -0
- package/dist/package.d.ts +90 -0
- package/dist/package.d.ts.map +1 -0
- package/dist/performance/runtime.d.ts +230 -0
- package/dist/performance/runtime.d.ts.map +1 -0
- package/dist/performance/startup.d.ts +223 -0
- package/dist/performance/startup.d.ts.map +1 -0
- package/dist/plugins/index.d.ts +114 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/security/index.d.ts +268 -0
- package/dist/security/index.d.ts.map +1 -0
- package/dist/signing/index.d.ts +104 -0
- package/dist/signing/index.d.ts.map +1 -0
- package/dist/styles/headwind.d.ts +222 -0
- package/dist/styles/headwind.d.ts.map +1 -0
- package/dist/styles/index.d.ts +31 -0
- package/dist/styles/index.d.ts.map +1 -0
- package/dist/styles/sidebar-templates.d.ts +77 -0
- package/dist/styles/sidebar-templates.d.ts.map +1 -0
- package/dist/styles/sidebars.d.ts +194 -0
- package/dist/styles/sidebars.d.ts.map +1 -0
- package/dist/types.d.ts +1555 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/updater/index.d.ts +164 -0
- package/dist/updater/index.d.ts.map +1 -0
- package/dist/utils/audio.d.ts +40 -0
- package/dist/utils/audio.d.ts.map +1 -0
- package/dist/utils/index.d.ts +9 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/native.d.ts +27 -0
- package/dist/utils/native.d.ts.map +1 -0
- package/dist/utils/react.d.ts +157 -0
- package/dist/utils/react.d.ts.map +1 -0
- package/dist/utils/storage.d.ts +35 -0
- package/dist/utils/storage.d.ts.map +1 -0
- package/dist/utils/svelte.d.ts +187 -0
- package/dist/utils/svelte.d.ts.map +1 -0
- package/dist/utils/timer.d.ts +57 -0
- package/dist/utils/timer.d.ts.map +1 -0
- package/dist/utils/vue.d.ts +157 -0
- package/dist/utils/vue.d.ts.map +1 -0
- package/package.json +78 -0
|
@@ -0,0 +1,833 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview iOS Advanced Features API
|
|
3
|
+
* @description Advanced iOS-specific features including CarPlay, App Clips, Live Activities,
|
|
4
|
+
* SharePlay, StoreKit 2, App Intents, TipKit, and Focus Filters.
|
|
5
|
+
* @module @craft-native/api/ios-advanced
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* CarPlay template types.
|
|
9
|
+
*/
|
|
10
|
+
export type CarPlayTemplateType = 'list' | 'grid' | 'information' | 'point-of-interest' | 'tab-bar' | 'alert' | 'action-sheet' | 'now-playing' | 'voice-control' | 'search' | 'map';
|
|
11
|
+
/**
|
|
12
|
+
* CarPlay list item.
|
|
13
|
+
*/
|
|
14
|
+
export interface CarPlayListItem {
|
|
15
|
+
/** Unique identifier */
|
|
16
|
+
id: string;
|
|
17
|
+
/** Display text */
|
|
18
|
+
text: string;
|
|
19
|
+
/** Detail text */
|
|
20
|
+
detailText?: string;
|
|
21
|
+
/** Image name or URL */
|
|
22
|
+
image?: string;
|
|
23
|
+
/** Whether item shows disclosure indicator */
|
|
24
|
+
showsDisclosureIndicator?: boolean;
|
|
25
|
+
/** Whether item is playing */
|
|
26
|
+
isPlaying?: boolean;
|
|
27
|
+
/** Playback progress (0-1) */
|
|
28
|
+
playbackProgress?: number;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* CarPlay grid item.
|
|
32
|
+
*/
|
|
33
|
+
export interface CarPlayGridItem {
|
|
34
|
+
/** Unique identifier */
|
|
35
|
+
id: string;
|
|
36
|
+
/** Display title */
|
|
37
|
+
title: string;
|
|
38
|
+
/** Image name or URL */
|
|
39
|
+
image: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* CarPlay template configuration.
|
|
43
|
+
*/
|
|
44
|
+
export interface CarPlayTemplate {
|
|
45
|
+
/** Template type */
|
|
46
|
+
type: CarPlayTemplateType;
|
|
47
|
+
/** Template title */
|
|
48
|
+
title?: string;
|
|
49
|
+
/** List items (for list template) */
|
|
50
|
+
listItems?: CarPlayListItem[];
|
|
51
|
+
/** Grid items (for grid template) */
|
|
52
|
+
gridItems?: CarPlayGridItem[];
|
|
53
|
+
/** Sections for grouped lists */
|
|
54
|
+
sections?: Array<{
|
|
55
|
+
header?: string;
|
|
56
|
+
items: CarPlayListItem[];
|
|
57
|
+
}>;
|
|
58
|
+
/** Tab bar items */
|
|
59
|
+
tabs?: Array<{
|
|
60
|
+
title: string;
|
|
61
|
+
image: string;
|
|
62
|
+
template: CarPlayTemplate;
|
|
63
|
+
}>;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* CarPlay API for automotive integration.
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* // Set up CarPlay scene
|
|
70
|
+
* carplay.onConnect((_window) => {
|
|
71
|
+
* carplay.pushTemplate({
|
|
72
|
+
* type: 'list',
|
|
73
|
+
* title: 'My Music',
|
|
74
|
+
* listItems: [
|
|
75
|
+
* { id: '1', text: 'Favorites', showsDisclosureIndicator: true },
|
|
76
|
+
* { id: '2', text: 'Recently Played', showsDisclosureIndicator: true }
|
|
77
|
+
* ]
|
|
78
|
+
* })
|
|
79
|
+
* })
|
|
80
|
+
*
|
|
81
|
+
* carplay.onSelectListItem((item, _template) => {
|
|
82
|
+
* console.log('Selected:', item.text)
|
|
83
|
+
* })
|
|
84
|
+
*/
|
|
85
|
+
export declare const carplay: {
|
|
86
|
+
/**
|
|
87
|
+
* Check if CarPlay is available.
|
|
88
|
+
*/
|
|
89
|
+
isAvailable(): Promise<boolean>;
|
|
90
|
+
/**
|
|
91
|
+
* Check if CarPlay is currently connected.
|
|
92
|
+
*/
|
|
93
|
+
isConnected(): Promise<boolean>;
|
|
94
|
+
/**
|
|
95
|
+
* Register CarPlay connection handler.
|
|
96
|
+
*/
|
|
97
|
+
onConnect(handler: (window: any) => void): void;
|
|
98
|
+
/**
|
|
99
|
+
* Register CarPlay disconnection handler.
|
|
100
|
+
*/
|
|
101
|
+
onDisconnect(handler: () => void): void;
|
|
102
|
+
/**
|
|
103
|
+
* Push a template to the CarPlay screen.
|
|
104
|
+
*/
|
|
105
|
+
pushTemplate(template: CarPlayTemplate, animated?: boolean): Promise<void>;
|
|
106
|
+
/**
|
|
107
|
+
* Pop the current template.
|
|
108
|
+
*/
|
|
109
|
+
popTemplate(animated?: boolean): Promise<void>;
|
|
110
|
+
/**
|
|
111
|
+
* Pop to root template.
|
|
112
|
+
*/
|
|
113
|
+
popToRootTemplate(animated?: boolean): Promise<void>;
|
|
114
|
+
/**
|
|
115
|
+
* Present a template modally.
|
|
116
|
+
*/
|
|
117
|
+
presentTemplate(template: CarPlayTemplate, animated?: boolean): Promise<void>;
|
|
118
|
+
/**
|
|
119
|
+
* Dismiss presented template.
|
|
120
|
+
*/
|
|
121
|
+
dismissTemplate(animated?: boolean): Promise<void>;
|
|
122
|
+
/**
|
|
123
|
+
* Register list item selection handler.
|
|
124
|
+
*/
|
|
125
|
+
onSelectListItem(handler: (item: CarPlayListItem, template: CarPlayTemplate) => void): void;
|
|
126
|
+
/**
|
|
127
|
+
* Register grid item selection handler.
|
|
128
|
+
*/
|
|
129
|
+
onSelectGridItem(handler: (item: CarPlayGridItem, template: CarPlayTemplate) => void): void;
|
|
130
|
+
/**
|
|
131
|
+
* Update now playing information.
|
|
132
|
+
*/
|
|
133
|
+
updateNowPlaying(info: {
|
|
134
|
+
title: string;
|
|
135
|
+
artist?: string;
|
|
136
|
+
album?: string;
|
|
137
|
+
artwork?: string;
|
|
138
|
+
duration?: number;
|
|
139
|
+
elapsedTime?: number;
|
|
140
|
+
playbackRate?: number;
|
|
141
|
+
isPlaying?: boolean;
|
|
142
|
+
}): Promise<void>;
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* App Clip invocation context.
|
|
146
|
+
*/
|
|
147
|
+
export interface AppClipInvocation {
|
|
148
|
+
/** Invocation URL */
|
|
149
|
+
url: string;
|
|
150
|
+
/** URL parameters */
|
|
151
|
+
parameters: Record<string, string>;
|
|
152
|
+
/** Physical location (if available) */
|
|
153
|
+
location?: {
|
|
154
|
+
latitude: number;
|
|
155
|
+
longitude: number;
|
|
156
|
+
};
|
|
157
|
+
/** Invocation source */
|
|
158
|
+
source: 'qr-code' | 'nfc' | 'safari' | 'messages' | 'maps' | 'smart-banner';
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* App Clips API for lightweight app experiences.
|
|
162
|
+
*
|
|
163
|
+
* @example
|
|
164
|
+
* // Handle App Clip launch
|
|
165
|
+
* appClips.onInvoke((invocation) => {
|
|
166
|
+
* console.log('Launched from:', invocation.source)
|
|
167
|
+
* console.log('URL:', invocation.url)
|
|
168
|
+
* })
|
|
169
|
+
*
|
|
170
|
+
* // Prompt to install full app
|
|
171
|
+
* await appClips.promptToInstallFullApp()
|
|
172
|
+
*/
|
|
173
|
+
export declare const appClips: {
|
|
174
|
+
/**
|
|
175
|
+
* Check if running as App Clip.
|
|
176
|
+
*/
|
|
177
|
+
isAppClip(): boolean;
|
|
178
|
+
/**
|
|
179
|
+
* Register App Clip invocation handler.
|
|
180
|
+
*/
|
|
181
|
+
onInvoke(handler: (invocation: AppClipInvocation) => void): void;
|
|
182
|
+
/**
|
|
183
|
+
* Get the invocation context.
|
|
184
|
+
*/
|
|
185
|
+
getInvocation(): Promise<AppClipInvocation | null>;
|
|
186
|
+
/**
|
|
187
|
+
* Prompt user to install the full app.
|
|
188
|
+
*/
|
|
189
|
+
promptToInstallFullApp(): Promise<void>;
|
|
190
|
+
/**
|
|
191
|
+
* Request ephemeral notification permission.
|
|
192
|
+
*/
|
|
193
|
+
requestEphemeralNotificationPermission(): Promise<boolean>;
|
|
194
|
+
/**
|
|
195
|
+
* Request location confirmation.
|
|
196
|
+
* Used to verify user is at a specific location for App Clip experiences.
|
|
197
|
+
*/
|
|
198
|
+
confirmLocation(regionIdentifier: string): Promise<boolean>;
|
|
199
|
+
};
|
|
200
|
+
/**
|
|
201
|
+
* Live Activity content state.
|
|
202
|
+
*/
|
|
203
|
+
export interface LiveActivityContentState {
|
|
204
|
+
[key: string]: string | number | boolean;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Live Activity attributes (static content).
|
|
208
|
+
*/
|
|
209
|
+
export interface LiveActivityAttributes {
|
|
210
|
+
[key: string]: string | number | boolean;
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Live Activity configuration.
|
|
214
|
+
*/
|
|
215
|
+
export interface LiveActivityConfig {
|
|
216
|
+
/** Activity type identifier */
|
|
217
|
+
activityType: string;
|
|
218
|
+
/** Static attributes */
|
|
219
|
+
attributes: LiveActivityAttributes;
|
|
220
|
+
/** Initial content state */
|
|
221
|
+
contentState: LiveActivityContentState;
|
|
222
|
+
/** Stale date (when content becomes outdated) */
|
|
223
|
+
staleDate?: Date;
|
|
224
|
+
/** Relevance score (0-100) */
|
|
225
|
+
relevanceScore?: number;
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Live Activities API for Dynamic Island and Lock Screen.
|
|
229
|
+
*
|
|
230
|
+
* @example
|
|
231
|
+
* // Start a delivery tracking activity
|
|
232
|
+
* const activity = await liveActivities.start({
|
|
233
|
+
* activityType: 'DeliveryActivity',
|
|
234
|
+
* attributes: { orderNumber: '12345', restaurant: 'Pizza Place' },
|
|
235
|
+
* contentState: { status: 'preparing', eta: '15 min' }
|
|
236
|
+
* })
|
|
237
|
+
*
|
|
238
|
+
* // Update the activity
|
|
239
|
+
* await liveActivities.update(activity.id, {
|
|
240
|
+
* status: 'on-the-way',
|
|
241
|
+
* eta: '5 min',
|
|
242
|
+
* driverName: 'John'
|
|
243
|
+
* })
|
|
244
|
+
*
|
|
245
|
+
* // End the activity
|
|
246
|
+
* await liveActivities.end(activity.id, { status: 'delivered' })
|
|
247
|
+
*/
|
|
248
|
+
export declare const liveActivities: {
|
|
249
|
+
/**
|
|
250
|
+
* Check if Live Activities are supported.
|
|
251
|
+
*/
|
|
252
|
+
areSupported(): Promise<boolean>;
|
|
253
|
+
/**
|
|
254
|
+
* Check if Live Activities are enabled by user.
|
|
255
|
+
*/
|
|
256
|
+
areEnabled(): Promise<boolean>;
|
|
257
|
+
/**
|
|
258
|
+
* Start a new Live Activity.
|
|
259
|
+
*/
|
|
260
|
+
start(config: LiveActivityConfig): Promise<{
|
|
261
|
+
id: string;
|
|
262
|
+
}>;
|
|
263
|
+
/**
|
|
264
|
+
* Update an existing Live Activity.
|
|
265
|
+
*/
|
|
266
|
+
update(activityId: string, contentState: LiveActivityContentState, alertConfig?: {
|
|
267
|
+
title: string;
|
|
268
|
+
body: string;
|
|
269
|
+
sound?: string;
|
|
270
|
+
}): Promise<void>;
|
|
271
|
+
/**
|
|
272
|
+
* End a Live Activity.
|
|
273
|
+
*/
|
|
274
|
+
end(activityId: string, finalContentState?: LiveActivityContentState, dismissalPolicy?: "immediate" | "default" | "after"): Promise<void>;
|
|
275
|
+
/**
|
|
276
|
+
* Get all active Live Activities.
|
|
277
|
+
*/
|
|
278
|
+
getAll(): Promise<Array<{
|
|
279
|
+
id: string;
|
|
280
|
+
activityType: string;
|
|
281
|
+
contentState: LiveActivityContentState;
|
|
282
|
+
}>>;
|
|
283
|
+
/**
|
|
284
|
+
* Request push token for remote Live Activity updates.
|
|
285
|
+
*/
|
|
286
|
+
requestPushToken(activityId: string): Promise<string | null>;
|
|
287
|
+
};
|
|
288
|
+
/**
|
|
289
|
+
* SharePlay session state.
|
|
290
|
+
*/
|
|
291
|
+
export type SharePlaySessionState = 'waiting' | 'joined' | 'invalidated';
|
|
292
|
+
/**
|
|
293
|
+
* SharePlay participant info.
|
|
294
|
+
*/
|
|
295
|
+
export interface SharePlayParticipant {
|
|
296
|
+
/** Participant identifier */
|
|
297
|
+
id: string;
|
|
298
|
+
/** Whether this is the local participant */
|
|
299
|
+
isLocal: boolean;
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* SharePlay activity configuration.
|
|
303
|
+
*/
|
|
304
|
+
export interface SharePlayActivity {
|
|
305
|
+
/** Activity identifier */
|
|
306
|
+
id: string;
|
|
307
|
+
/** Activity title */
|
|
308
|
+
title: string;
|
|
309
|
+
/** Activity subtitle */
|
|
310
|
+
subtitle?: string;
|
|
311
|
+
/** Activity image */
|
|
312
|
+
image?: string;
|
|
313
|
+
/** Whether activity supports picture-in-picture */
|
|
314
|
+
supportsPictureInPicture?: boolean;
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* SharePlay API for shared experiences during FaceTime calls.
|
|
318
|
+
*
|
|
319
|
+
* @example
|
|
320
|
+
* // Start a SharePlay activity
|
|
321
|
+
* await sharePlay.startActivity({
|
|
322
|
+
* id: 'watch-together',
|
|
323
|
+
* title: 'Watch Movie Together',
|
|
324
|
+
* subtitle: 'Synchronized playback'
|
|
325
|
+
* })
|
|
326
|
+
*
|
|
327
|
+
* // Send synchronized message to all participants
|
|
328
|
+
* sharePlay.broadcast({ action: 'play', timestamp: 1234 })
|
|
329
|
+
*
|
|
330
|
+
* // Receive messages from other participants
|
|
331
|
+
* sharePlay.onMessage((message, participant) => {
|
|
332
|
+
* console.log(`${participant.id}: ${message.action}`)
|
|
333
|
+
* })
|
|
334
|
+
*/
|
|
335
|
+
export declare const sharePlay: {
|
|
336
|
+
/**
|
|
337
|
+
* Check if SharePlay is available.
|
|
338
|
+
*/
|
|
339
|
+
isAvailable(): Promise<boolean>;
|
|
340
|
+
/**
|
|
341
|
+
* Get the current session state.
|
|
342
|
+
*/
|
|
343
|
+
getSessionState(): Promise<SharePlaySessionState | null>;
|
|
344
|
+
/**
|
|
345
|
+
* Get all participants in the current session.
|
|
346
|
+
*/
|
|
347
|
+
getParticipants(): Promise<SharePlayParticipant[]>;
|
|
348
|
+
/**
|
|
349
|
+
* Start a SharePlay activity.
|
|
350
|
+
*/
|
|
351
|
+
startActivity(activity: SharePlayActivity): Promise<boolean>;
|
|
352
|
+
/**
|
|
353
|
+
* End the current SharePlay activity.
|
|
354
|
+
*/
|
|
355
|
+
endActivity(): Promise<void>;
|
|
356
|
+
/**
|
|
357
|
+
* Broadcast a message to all participants.
|
|
358
|
+
*/
|
|
359
|
+
broadcast(message: Record<string, any>): Promise<void>;
|
|
360
|
+
/**
|
|
361
|
+
* Send a message to a specific participant.
|
|
362
|
+
*/
|
|
363
|
+
send(participantId: string, message: Record<string, any>): Promise<void>;
|
|
364
|
+
/**
|
|
365
|
+
* Register message handler.
|
|
366
|
+
*/
|
|
367
|
+
onMessage(handler: (message: Record<string, any>, participant: SharePlayParticipant) => void): void;
|
|
368
|
+
/**
|
|
369
|
+
* Register session state change handler.
|
|
370
|
+
*/
|
|
371
|
+
onSessionStateChange(handler: (state: SharePlaySessionState) => void): void;
|
|
372
|
+
/**
|
|
373
|
+
* Register participant change handler.
|
|
374
|
+
*/
|
|
375
|
+
onParticipantsChange(handler: (participants: SharePlayParticipant[]) => void): void;
|
|
376
|
+
/**
|
|
377
|
+
* Coordinate playback state across participants.
|
|
378
|
+
*/
|
|
379
|
+
coordinatePlayback(state: {
|
|
380
|
+
isPlaying: boolean;
|
|
381
|
+
playbackRate: number;
|
|
382
|
+
currentTime: number;
|
|
383
|
+
}): Promise<void>;
|
|
384
|
+
};
|
|
385
|
+
/**
|
|
386
|
+
* Product type.
|
|
387
|
+
*/
|
|
388
|
+
export type ProductType = 'consumable' | 'non-consumable' | 'auto-renewable' | 'non-renewable';
|
|
389
|
+
/**
|
|
390
|
+
* Product information.
|
|
391
|
+
*/
|
|
392
|
+
export interface Product {
|
|
393
|
+
/** Product identifier */
|
|
394
|
+
id: string;
|
|
395
|
+
/** Product type */
|
|
396
|
+
type: ProductType;
|
|
397
|
+
/** Display name */
|
|
398
|
+
displayName: string;
|
|
399
|
+
/** Description */
|
|
400
|
+
description: string;
|
|
401
|
+
/** Formatted price */
|
|
402
|
+
displayPrice: string;
|
|
403
|
+
/** Price in decimal */
|
|
404
|
+
price: number;
|
|
405
|
+
/** Currency code */
|
|
406
|
+
currencyCode: string;
|
|
407
|
+
/** Subscription info (for subscription products) */
|
|
408
|
+
subscription?: {
|
|
409
|
+
/** Subscription period */
|
|
410
|
+
subscriptionPeriod: {
|
|
411
|
+
unit: 'day' | 'week' | 'month' | 'year';
|
|
412
|
+
value: number;
|
|
413
|
+
};
|
|
414
|
+
/** Introductory offer */
|
|
415
|
+
introductoryOffer?: {
|
|
416
|
+
displayPrice: string;
|
|
417
|
+
period: {
|
|
418
|
+
unit: string;
|
|
419
|
+
value: number;
|
|
420
|
+
};
|
|
421
|
+
periodCount: number;
|
|
422
|
+
paymentMode: 'freeTrial' | 'payAsYouGo' | 'payUpFront';
|
|
423
|
+
};
|
|
424
|
+
};
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* Transaction information.
|
|
428
|
+
*/
|
|
429
|
+
export interface Transaction {
|
|
430
|
+
/** Transaction identifier */
|
|
431
|
+
id: string;
|
|
432
|
+
/** Original transaction ID (for renewals) */
|
|
433
|
+
originalId: string;
|
|
434
|
+
/** Product identifier */
|
|
435
|
+
productId: string;
|
|
436
|
+
/** Purchase date */
|
|
437
|
+
purchaseDate: Date;
|
|
438
|
+
/** Expiration date (for subscriptions) */
|
|
439
|
+
expirationDate?: Date;
|
|
440
|
+
/** Whether transaction is upgraded */
|
|
441
|
+
isUpgraded: boolean;
|
|
442
|
+
/** Revocation date (if revoked) */
|
|
443
|
+
revocationDate?: Date;
|
|
444
|
+
/** Revocation reason */
|
|
445
|
+
revocationReason?: 'developerIssue' | 'other';
|
|
446
|
+
/** Environment */
|
|
447
|
+
environment: 'production' | 'sandbox' | 'xcode';
|
|
448
|
+
}
|
|
449
|
+
/**
|
|
450
|
+
* StoreKit 2 API for in-app purchases and subscriptions.
|
|
451
|
+
*
|
|
452
|
+
* @example
|
|
453
|
+
* // Load products
|
|
454
|
+
* const products = await storeKit.getProducts(['premium_monthly', 'premium_yearly'])
|
|
455
|
+
*
|
|
456
|
+
* // Purchase a product
|
|
457
|
+
* const result = await storeKit.purchase(products[0].id)
|
|
458
|
+
* if (result.success) {
|
|
459
|
+
* console.log('Purchase successful!')
|
|
460
|
+
* }
|
|
461
|
+
*
|
|
462
|
+
* // Check entitlements
|
|
463
|
+
* const hasAccess = await storeKit.isEntitled('premium')
|
|
464
|
+
*/
|
|
465
|
+
export declare const storeKit: {
|
|
466
|
+
/**
|
|
467
|
+
* Get products by identifiers.
|
|
468
|
+
*/
|
|
469
|
+
getProducts(productIds: string[]): Promise<Product[]>;
|
|
470
|
+
/**
|
|
471
|
+
* Purchase a product.
|
|
472
|
+
*/
|
|
473
|
+
purchase(productId: string, options?: {
|
|
474
|
+
quantity?: number;
|
|
475
|
+
appAccountToken?: string;
|
|
476
|
+
simulatesAskToBuyInSandbox?: boolean;
|
|
477
|
+
}): Promise<{
|
|
478
|
+
success: boolean;
|
|
479
|
+
transaction?: Transaction;
|
|
480
|
+
error?: string;
|
|
481
|
+
}>;
|
|
482
|
+
/**
|
|
483
|
+
* Check if user is entitled to a product/feature.
|
|
484
|
+
*/
|
|
485
|
+
isEntitled(productId: string): Promise<boolean>;
|
|
486
|
+
/**
|
|
487
|
+
* Get current entitlements.
|
|
488
|
+
*/
|
|
489
|
+
getCurrentEntitlements(): Promise<Transaction[]>;
|
|
490
|
+
/**
|
|
491
|
+
* Get transaction history.
|
|
492
|
+
*/
|
|
493
|
+
getTransactionHistory(productId?: string): Promise<Transaction[]>;
|
|
494
|
+
/**
|
|
495
|
+
* Restore purchases.
|
|
496
|
+
*/
|
|
497
|
+
restorePurchases(): Promise<void>;
|
|
498
|
+
/**
|
|
499
|
+
* Finish a transaction (required after delivering content).
|
|
500
|
+
*/
|
|
501
|
+
finishTransaction(transactionId: string): Promise<void>;
|
|
502
|
+
/**
|
|
503
|
+
* Get subscription status.
|
|
504
|
+
*/
|
|
505
|
+
getSubscriptionStatus(groupId: string): Promise<{
|
|
506
|
+
state: "subscribed" | "expired" | "inBillingRetry" | "inGracePeriod" | "revoked";
|
|
507
|
+
renewalInfo?: {
|
|
508
|
+
willAutoRenew: boolean;
|
|
509
|
+
autoRenewProductId: string;
|
|
510
|
+
expirationIntent?: "cancelled" | "billingError" | "priceIncrease" | "productNotAvailable";
|
|
511
|
+
};
|
|
512
|
+
} | null>;
|
|
513
|
+
/**
|
|
514
|
+
* Present offer code redemption sheet.
|
|
515
|
+
*/
|
|
516
|
+
presentOfferCodeRedemption(): Promise<void>;
|
|
517
|
+
/**
|
|
518
|
+
* Present manage subscriptions sheet.
|
|
519
|
+
*/
|
|
520
|
+
presentManageSubscriptions(): Promise<void>;
|
|
521
|
+
/**
|
|
522
|
+
* Present refund request sheet.
|
|
523
|
+
*/
|
|
524
|
+
beginRefundRequest(transactionId: string): Promise<"success" | "userCancelled" | "failed">;
|
|
525
|
+
/**
|
|
526
|
+
* Listen for transaction updates.
|
|
527
|
+
*/
|
|
528
|
+
onTransactionUpdate(handler: (transaction: Transaction) => void): void;
|
|
529
|
+
/**
|
|
530
|
+
* Show price consent sheet if needed.
|
|
531
|
+
*/
|
|
532
|
+
showPriceConsentIfNeeded(): Promise<void>;
|
|
533
|
+
};
|
|
534
|
+
/**
|
|
535
|
+
* App Intent parameter type.
|
|
536
|
+
*/
|
|
537
|
+
export type IntentParameterType = 'string' | 'integer' | 'double' | 'boolean' | 'date' | 'url' | 'enum';
|
|
538
|
+
/**
|
|
539
|
+
* App Intent parameter definition.
|
|
540
|
+
*/
|
|
541
|
+
export interface IntentParameter {
|
|
542
|
+
/** Parameter name */
|
|
543
|
+
name: string;
|
|
544
|
+
/** Parameter type */
|
|
545
|
+
type: IntentParameterType;
|
|
546
|
+
/** Display title */
|
|
547
|
+
title: string;
|
|
548
|
+
/** Description */
|
|
549
|
+
description?: string;
|
|
550
|
+
/** Whether required */
|
|
551
|
+
required?: boolean;
|
|
552
|
+
/** Default value */
|
|
553
|
+
defaultValue?: any;
|
|
554
|
+
/** Enum values (for enum type) */
|
|
555
|
+
enumValues?: Array<{
|
|
556
|
+
value: string;
|
|
557
|
+
displayName: string;
|
|
558
|
+
}>;
|
|
559
|
+
}
|
|
560
|
+
/**
|
|
561
|
+
* App Intent definition.
|
|
562
|
+
*/
|
|
563
|
+
export interface AppIntent {
|
|
564
|
+
/** Intent identifier */
|
|
565
|
+
id: string;
|
|
566
|
+
/** Display title */
|
|
567
|
+
title: string;
|
|
568
|
+
/** Description */
|
|
569
|
+
description: string;
|
|
570
|
+
/** Parameters */
|
|
571
|
+
parameters?: IntentParameter[];
|
|
572
|
+
/** Suggested invocation phrase */
|
|
573
|
+
suggestedInvocationPhrase?: string;
|
|
574
|
+
}
|
|
575
|
+
/**
|
|
576
|
+
* App Intents API for Siri Shortcuts and Spotlight.
|
|
577
|
+
*
|
|
578
|
+
* @example
|
|
579
|
+
* // Register an intent
|
|
580
|
+
* appIntents.register({
|
|
581
|
+
* id: 'com.myapp.order-coffee',
|
|
582
|
+
* title: 'Order Coffee',
|
|
583
|
+
* description: 'Order your favorite coffee',
|
|
584
|
+
* parameters: [
|
|
585
|
+
* { name: 'size', type: 'enum', title: 'Size', enumValues: [
|
|
586
|
+
* { value: 'small', displayName: 'Small' },
|
|
587
|
+
* { value: 'medium', displayName: 'Medium' },
|
|
588
|
+
* { value: 'large', displayName: 'Large' }
|
|
589
|
+
* ]}
|
|
590
|
+
* ],
|
|
591
|
+
* suggestedInvocationPhrase: 'Order my coffee'
|
|
592
|
+
* })
|
|
593
|
+
*
|
|
594
|
+
* // Handle intent execution
|
|
595
|
+
* appIntents.onPerform('com.myapp.order-coffee', async (params) => {
|
|
596
|
+
* await orderCoffee(params.size)
|
|
597
|
+
* return { success: true, message: 'Coffee ordered!' }
|
|
598
|
+
* })
|
|
599
|
+
*/
|
|
600
|
+
export declare const appIntents: {
|
|
601
|
+
/**
|
|
602
|
+
* Register an App Intent.
|
|
603
|
+
*/
|
|
604
|
+
register(intent: AppIntent): void;
|
|
605
|
+
/**
|
|
606
|
+
* Unregister an App Intent.
|
|
607
|
+
*/
|
|
608
|
+
unregister(intentId: string): void;
|
|
609
|
+
/**
|
|
610
|
+
* Register intent execution handler.
|
|
611
|
+
*/
|
|
612
|
+
onPerform(intentId: string, handler: (parameters: Record<string, any>) => Promise<{
|
|
613
|
+
success: boolean;
|
|
614
|
+
message?: string;
|
|
615
|
+
value?: any;
|
|
616
|
+
}>): void;
|
|
617
|
+
/**
|
|
618
|
+
* Donate an intent for Siri suggestions.
|
|
619
|
+
*/
|
|
620
|
+
donate(intentId: string, parameters?: Record<string, any>): Promise<void>;
|
|
621
|
+
/**
|
|
622
|
+
* Delete donated intents.
|
|
623
|
+
*/
|
|
624
|
+
deleteDonations(intentId?: string): Promise<void>;
|
|
625
|
+
/**
|
|
626
|
+
* Update Spotlight index for intent.
|
|
627
|
+
*/
|
|
628
|
+
updateSpotlightIndex(intentId: string, searchableItems: Array<{
|
|
629
|
+
uniqueIdentifier: string;
|
|
630
|
+
title: string;
|
|
631
|
+
contentDescription?: string;
|
|
632
|
+
keywords?: string[];
|
|
633
|
+
thumbnailUrl?: string;
|
|
634
|
+
}>): Promise<void>;
|
|
635
|
+
};
|
|
636
|
+
/**
|
|
637
|
+
* Tip display frequency.
|
|
638
|
+
*/
|
|
639
|
+
export type TipDisplayFrequency = 'immediate' | 'hourly' | 'daily' | 'weekly' | 'monthly';
|
|
640
|
+
/**
|
|
641
|
+
* Tip configuration.
|
|
642
|
+
*/
|
|
643
|
+
export interface Tip {
|
|
644
|
+
/** Tip identifier */
|
|
645
|
+
id: string;
|
|
646
|
+
/** Title */
|
|
647
|
+
title: string;
|
|
648
|
+
/** Message */
|
|
649
|
+
message: string;
|
|
650
|
+
/** Image name (SF Symbol or asset) */
|
|
651
|
+
image?: string;
|
|
652
|
+
/** Action buttons */
|
|
653
|
+
actions?: Array<{
|
|
654
|
+
id: string;
|
|
655
|
+
title: string;
|
|
656
|
+
}>;
|
|
657
|
+
/** Display rules */
|
|
658
|
+
rules?: {
|
|
659
|
+
/** Show after event count */
|
|
660
|
+
eventCount?: {
|
|
661
|
+
event: string;
|
|
662
|
+
count: number;
|
|
663
|
+
};
|
|
664
|
+
/** Show after duration */
|
|
665
|
+
duration?: {
|
|
666
|
+
seconds: number;
|
|
667
|
+
};
|
|
668
|
+
/** Parameter-based conditions */
|
|
669
|
+
parameters?: Record<string, any>;
|
|
670
|
+
};
|
|
671
|
+
/** Display options */
|
|
672
|
+
options?: {
|
|
673
|
+
/** Maximum display count */
|
|
674
|
+
maxDisplayCount?: number;
|
|
675
|
+
/** Ignore display frequency */
|
|
676
|
+
ignoreDisplayFrequency?: boolean;
|
|
677
|
+
};
|
|
678
|
+
}
|
|
679
|
+
/**
|
|
680
|
+
* TipKit API for contextual hints and feature discovery.
|
|
681
|
+
*
|
|
682
|
+
* @example
|
|
683
|
+
* // Configure TipKit
|
|
684
|
+
* await tipKit.configure({ displayFrequency: 'daily' })
|
|
685
|
+
*
|
|
686
|
+
* // Register a tip
|
|
687
|
+
* tipKit.register({
|
|
688
|
+
* id: 'new-feature-tip',
|
|
689
|
+
* title: 'New Feature!',
|
|
690
|
+
* message: 'Try our new sharing feature',
|
|
691
|
+
* image: 'square.and.arrow.up',
|
|
692
|
+
* rules: {
|
|
693
|
+
* eventCount: { event: 'app-opened', count: 3 }
|
|
694
|
+
* }
|
|
695
|
+
* })
|
|
696
|
+
*
|
|
697
|
+
* // Track events for tip rules
|
|
698
|
+
* tipKit.trackEvent('app-opened')
|
|
699
|
+
*
|
|
700
|
+
* // Show tip inline
|
|
701
|
+
* const shouldShow = await tipKit.shouldShow('new-feature-tip')
|
|
702
|
+
*/
|
|
703
|
+
export declare const tipKit: {
|
|
704
|
+
/**
|
|
705
|
+
* Configure TipKit.
|
|
706
|
+
*/
|
|
707
|
+
configure(options: {
|
|
708
|
+
displayFrequency?: TipDisplayFrequency;
|
|
709
|
+
datastoreLocation?: "applicationDefault" | "groupContainer";
|
|
710
|
+
}): Promise<void>;
|
|
711
|
+
/**
|
|
712
|
+
* Register a tip.
|
|
713
|
+
*/
|
|
714
|
+
register(tip: Tip): void;
|
|
715
|
+
/**
|
|
716
|
+
* Check if a tip should be displayed.
|
|
717
|
+
*/
|
|
718
|
+
shouldShow(tipId: string): Promise<boolean>;
|
|
719
|
+
/**
|
|
720
|
+
* Invalidate a tip (permanently hide).
|
|
721
|
+
*/
|
|
722
|
+
invalidate(tipId: string, reason?: string): Promise<void>;
|
|
723
|
+
/**
|
|
724
|
+
* Track an event for tip rules.
|
|
725
|
+
*/
|
|
726
|
+
trackEvent(eventId: string): Promise<void>;
|
|
727
|
+
/**
|
|
728
|
+
* Set a parameter value for tip rules.
|
|
729
|
+
*/
|
|
730
|
+
setParameter(name: string, value: any): Promise<void>;
|
|
731
|
+
/**
|
|
732
|
+
* Show a tip as a popover.
|
|
733
|
+
*/
|
|
734
|
+
showPopover(tipId: string, sourceElement: string): Promise<void>;
|
|
735
|
+
/**
|
|
736
|
+
* Register tip action handler.
|
|
737
|
+
*/
|
|
738
|
+
onAction(tipId: string, handler: (actionId: string) => void): void;
|
|
739
|
+
/**
|
|
740
|
+
* Reset all tips (for testing).
|
|
741
|
+
*/
|
|
742
|
+
resetDatastore(): Promise<void>;
|
|
743
|
+
};
|
|
744
|
+
/**
|
|
745
|
+
* Focus status.
|
|
746
|
+
*/
|
|
747
|
+
export interface FocusStatus {
|
|
748
|
+
/** Whether Focus is active */
|
|
749
|
+
isFocusActive: boolean;
|
|
750
|
+
/** Current Focus name (if authorized) */
|
|
751
|
+
focusName?: string;
|
|
752
|
+
}
|
|
753
|
+
/**
|
|
754
|
+
* Focus filter configuration.
|
|
755
|
+
*/
|
|
756
|
+
export interface FocusFilter {
|
|
757
|
+
/** Filter identifier */
|
|
758
|
+
id: string;
|
|
759
|
+
/** Display name */
|
|
760
|
+
name: string;
|
|
761
|
+
/** Description */
|
|
762
|
+
description: string;
|
|
763
|
+
/** Filter parameters */
|
|
764
|
+
parameters?: Array<{
|
|
765
|
+
name: string;
|
|
766
|
+
type: 'boolean' | 'string' | 'selection';
|
|
767
|
+
displayName: string;
|
|
768
|
+
options?: string[];
|
|
769
|
+
}>;
|
|
770
|
+
}
|
|
771
|
+
/**
|
|
772
|
+
* Focus Filters API for Focus mode integration.
|
|
773
|
+
*
|
|
774
|
+
* @example
|
|
775
|
+
* // Register a focus filter
|
|
776
|
+
* focusFilters.register({
|
|
777
|
+
* id: 'work-mode',
|
|
778
|
+
* name: 'Work Mode',
|
|
779
|
+
* description: 'Show only work-related content',
|
|
780
|
+
* parameters: [
|
|
781
|
+
* { name: 'showNotifications', type: 'boolean', displayName: 'Show Notifications' }
|
|
782
|
+
* ]
|
|
783
|
+
* })
|
|
784
|
+
*
|
|
785
|
+
* // Handle filter changes
|
|
786
|
+
* focusFilters.onFilterChange((filterSettings) => {
|
|
787
|
+
* if (filterSettings.showNotifications === false) {
|
|
788
|
+
* disableNotifications()
|
|
789
|
+
* }
|
|
790
|
+
* })
|
|
791
|
+
*/
|
|
792
|
+
export declare const focusFilters: {
|
|
793
|
+
/**
|
|
794
|
+
* Check Focus authorization status.
|
|
795
|
+
*/
|
|
796
|
+
getAuthorizationStatus(): Promise<"notDetermined" | "denied" | "authorized">;
|
|
797
|
+
/**
|
|
798
|
+
* Request Focus authorization.
|
|
799
|
+
*/
|
|
800
|
+
requestAuthorization(): Promise<boolean>;
|
|
801
|
+
/**
|
|
802
|
+
* Get current Focus status.
|
|
803
|
+
*/
|
|
804
|
+
getFocusStatus(): Promise<FocusStatus>;
|
|
805
|
+
/**
|
|
806
|
+
* Register a Focus filter.
|
|
807
|
+
*/
|
|
808
|
+
register(filter: FocusFilter): void;
|
|
809
|
+
/**
|
|
810
|
+
* Get current filter settings.
|
|
811
|
+
*/
|
|
812
|
+
getCurrentFilterSettings(): Promise<Record<string, any> | null>;
|
|
813
|
+
/**
|
|
814
|
+
* Register Focus status change handler.
|
|
815
|
+
*/
|
|
816
|
+
onFocusChange(handler: (status: FocusStatus) => void): void;
|
|
817
|
+
/**
|
|
818
|
+
* Register filter settings change handler.
|
|
819
|
+
*/
|
|
820
|
+
onFilterChange(handler: (settings: Record<string, any>) => void): void;
|
|
821
|
+
};
|
|
822
|
+
declare const iosAdvanced: {
|
|
823
|
+
carplay: typeof carplay;
|
|
824
|
+
appClips: typeof appClips;
|
|
825
|
+
liveActivities: typeof liveActivities;
|
|
826
|
+
sharePlay: typeof sharePlay;
|
|
827
|
+
storeKit: typeof storeKit;
|
|
828
|
+
appIntents: typeof appIntents;
|
|
829
|
+
tipKit: typeof tipKit;
|
|
830
|
+
focusFilters: typeof focusFilters;
|
|
831
|
+
};
|
|
832
|
+
export default iosAdvanced;
|
|
833
|
+
//# sourceMappingURL=ios-advanced.d.ts.map
|