@use-voltra/ios 1.3.1 → 1.4.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/build/cjs/index.js +9 -1
  2. package/build/cjs/index.js.map +1 -1
  3. package/build/cjs/payload/component-ids.js +1 -0
  4. package/build/cjs/payload/component-ids.js.map +1 -1
  5. package/build/cjs/widgets/renderer.js +1 -1
  6. package/build/cjs/widgets/renderer.js.map +1 -1
  7. package/build/esm/index.js +3 -0
  8. package/build/esm/index.js.map +1 -1
  9. package/build/esm/payload/component-ids.js +1 -0
  10. package/build/esm/payload/component-ids.js.map +1 -1
  11. package/build/esm/widgets/renderer.js +1 -1
  12. package/build/esm/widgets/renderer.js.map +1 -1
  13. package/build/types/index.d.ts +7 -2
  14. package/build/types/index.d.ts.map +1 -1
  15. package/build/types/payload/component-ids.d.ts.map +1 -1
  16. package/build/types/styles/index.d.ts +1 -1
  17. package/build/types/styles/index.d.ts.map +1 -1
  18. package/build/types/styles/types.d.ts +89 -1
  19. package/build/types/styles/types.d.ts.map +1 -1
  20. package/build/types/types.d.ts +25 -1
  21. package/build/types/types.d.ts.map +1 -1
  22. package/package.json +3 -11
  23. package/build/cjs/VoltraModule.js +0 -6
  24. package/build/cjs/VoltraModule.js.map +0 -1
  25. package/build/cjs/client.js +0 -49
  26. package/build/cjs/client.js.map +0 -1
  27. package/build/cjs/components/VoltraLiveActivityPreview.js +0 -42
  28. package/build/cjs/components/VoltraLiveActivityPreview.js.map +0 -1
  29. package/build/cjs/components/VoltraView.js +0 -54
  30. package/build/cjs/components/VoltraView.js.map +0 -1
  31. package/build/cjs/components/VoltraWidgetPreview.js +0 -47
  32. package/build/cjs/components/VoltraWidgetPreview.js.map +0 -1
  33. package/build/cjs/events.js +0 -35
  34. package/build/cjs/events.js.map +0 -1
  35. package/build/cjs/helpers.js +0 -39
  36. package/build/cjs/helpers.js.map +0 -1
  37. package/build/cjs/live-activity/api.js +0 -277
  38. package/build/cjs/live-activity/api.js.map +0 -1
  39. package/build/cjs/logger.js +0 -36
  40. package/build/cjs/logger.js.map +0 -1
  41. package/build/cjs/preload.js +0 -115
  42. package/build/cjs/preload.js.map +0 -1
  43. package/build/cjs/utils/assertRunningOnApple.js +0 -13
  44. package/build/cjs/utils/assertRunningOnApple.js.map +0 -1
  45. package/build/cjs/utils/helpers.js +0 -39
  46. package/build/cjs/utils/helpers.js.map +0 -1
  47. package/build/cjs/utils/index.js +0 -19
  48. package/build/cjs/utils/index.js.map +0 -1
  49. package/build/cjs/utils/useUpdateOnHMR.js +0 -27
  50. package/build/cjs/utils/useUpdateOnHMR.js.map +0 -1
  51. package/build/cjs/widgets/server-credentials.js +0 -62
  52. package/build/cjs/widgets/server-credentials.js.map +0 -1
  53. package/build/cjs/widgets/widget-api.js +0 -196
  54. package/build/cjs/widgets/widget-api.js.map +0 -1
  55. package/build/esm/VoltraModule.js +0 -4
  56. package/build/esm/VoltraModule.js.map +0 -1
  57. package/build/esm/client.js +0 -10
  58. package/build/esm/client.js.map +0 -1
  59. package/build/esm/components/VoltraLiveActivityPreview.js +0 -39
  60. package/build/esm/components/VoltraLiveActivityPreview.js.map +0 -1
  61. package/build/esm/components/VoltraView.js +0 -51
  62. package/build/esm/components/VoltraView.js.map +0 -1
  63. package/build/esm/components/VoltraWidgetPreview.js +0 -44
  64. package/build/esm/components/VoltraWidgetPreview.js.map +0 -1
  65. package/build/esm/events.js +0 -29
  66. package/build/esm/events.js.map +0 -1
  67. package/build/esm/helpers.js +0 -32
  68. package/build/esm/helpers.js.map +0 -1
  69. package/build/esm/live-activity/api.js +0 -265
  70. package/build/esm/live-activity/api.js.map +0 -1
  71. package/build/esm/logger.js +0 -33
  72. package/build/esm/logger.js.map +0 -1
  73. package/build/esm/preload.js +0 -107
  74. package/build/esm/preload.js.map +0 -1
  75. package/build/esm/utils/assertRunningOnApple.js +0 -9
  76. package/build/esm/utils/assertRunningOnApple.js.map +0 -1
  77. package/build/esm/utils/helpers.js +0 -32
  78. package/build/esm/utils/helpers.js.map +0 -1
  79. package/build/esm/utils/index.js +0 -3
  80. package/build/esm/utils/index.js.map +0 -1
  81. package/build/esm/utils/useUpdateOnHMR.js +0 -23
  82. package/build/esm/utils/useUpdateOnHMR.js.map +0 -1
  83. package/build/esm/widgets/server-credentials.js +0 -55
  84. package/build/esm/widgets/server-credentials.js.map +0 -1
  85. package/build/esm/widgets/widget-api.js +0 -184
  86. package/build/esm/widgets/widget-api.js.map +0 -1
  87. package/build/types/VoltraModule.d.ts +0 -143
  88. package/build/types/VoltraModule.d.ts.map +0 -1
  89. package/build/types/client.d.ts +0 -13
  90. package/build/types/client.d.ts.map +0 -1
  91. package/build/types/components/VoltraLiveActivityPreview.d.ts +0 -28
  92. package/build/types/components/VoltraLiveActivityPreview.d.ts.map +0 -1
  93. package/build/types/components/VoltraView.d.ts +0 -43
  94. package/build/types/components/VoltraView.d.ts.map +0 -1
  95. package/build/types/components/VoltraWidgetPreview.d.ts +0 -32
  96. package/build/types/components/VoltraWidgetPreview.d.ts.map +0 -1
  97. package/build/types/events.d.ts +0 -49
  98. package/build/types/events.d.ts.map +0 -1
  99. package/build/types/helpers.d.ts +0 -12
  100. package/build/types/helpers.d.ts.map +0 -1
  101. package/build/types/live-activity/api.d.ts +0 -189
  102. package/build/types/live-activity/api.d.ts.map +0 -1
  103. package/build/types/logger.d.ts +0 -16
  104. package/build/types/logger.d.ts.map +0 -1
  105. package/build/types/preload.d.ts +0 -67
  106. package/build/types/preload.d.ts.map +0 -1
  107. package/build/types/utils/assertRunningOnApple.d.ts +0 -2
  108. package/build/types/utils/assertRunningOnApple.d.ts.map +0 -1
  109. package/build/types/utils/helpers.d.ts +0 -12
  110. package/build/types/utils/helpers.d.ts.map +0 -1
  111. package/build/types/utils/index.d.ts +0 -3
  112. package/build/types/utils/index.d.ts.map +0 -1
  113. package/build/types/utils/useUpdateOnHMR.d.ts +0 -9
  114. package/build/types/utils/useUpdateOnHMR.d.ts.map +0 -1
  115. package/build/types/widgets/server-credentials.d.ts +0 -49
  116. package/build/types/widgets/server-credentials.d.ts.map +0 -1
  117. package/build/types/widgets/widget-api.d.ts +0 -146
  118. package/build/types/widgets/widget-api.d.ts.map +0 -1
@@ -1,189 +0,0 @@
1
- import type { DismissalPolicy, LiveActivityVariants } from './types.js';
2
- export type SharedLiveActivityOptions = {
3
- /**
4
- * Unix timestamp in milliseconds
5
- */
6
- staleDate?: number;
7
- /**
8
- * Double value between 0.0 and 1.0
9
- * @default 0.0
10
- */
11
- relevanceScore?: number;
12
- /**
13
- * How the Live Activity should be dismissed after ending
14
- * @default 'immediate'
15
- */
16
- dismissalPolicy?: DismissalPolicy;
17
- };
18
- export type StartLiveActivityOptions = {
19
- /**
20
- * The name of the Live Activity.
21
- * Allows you to rebind to the same activity on app restart.
22
- */
23
- activityName?: string;
24
- /**
25
- * URL to open when the Live Activity is tapped.
26
- */
27
- deepLinkUrl?: string;
28
- /**
29
- * Channel ID for broadcast push notifications (iOS 18+).
30
- * When provided, the Live Activity subscribes to broadcast updates on this channel
31
- * instead of receiving individual push tokens.
32
- */
33
- channelId?: string;
34
- } & SharedLiveActivityOptions;
35
- export type UpdateLiveActivityOptions = SharedLiveActivityOptions;
36
- export type EndLiveActivityOptions = {
37
- dismissalPolicy?: DismissalPolicy;
38
- };
39
- export type UseLiveActivityOptions = {
40
- /**
41
- * The name of the Live Activity.
42
- * Allows you to rebind to the same activity on app restart.
43
- */
44
- activityName?: string;
45
- /**
46
- * Automatically start the Live Activity when the component mounts.
47
- */
48
- autoStart?: boolean;
49
- /**
50
- * Automatically update the Live Activity when the component updates.
51
- */
52
- autoUpdate?: boolean;
53
- /**
54
- * URL to open when the Live Activity is tapped.
55
- */
56
- deepLinkUrl?: string;
57
- /**
58
- * Channel ID for broadcast push notifications (iOS 18+).
59
- */
60
- channelId?: string;
61
- };
62
- export type UseLiveActivityResult = {
63
- start: (options?: StartLiveActivityOptions) => Promise<void>;
64
- update: (options?: UpdateLiveActivityOptions) => Promise<void>;
65
- end: (options?: EndLiveActivityOptions) => Promise<void>;
66
- isActive: boolean;
67
- };
68
- /**
69
- * React hook for managing Live Activities with automatic lifecycle handling.
70
- *
71
- * @param variants - The Live Activity content variants to display
72
- * @param options - Configuration options for the hook
73
- * @returns Object with start, update, end methods and isActive state
74
- *
75
- * @example
76
- * ```tsx
77
- * import { useLiveActivity, Voltra } from 'voltra'
78
- *
79
- * const MyLiveActivity = () => {
80
- * const { start, update, end, isActive } = useLiveActivity({
81
- * minimal: <Voltra.Text>Live Activity</Voltra.Text>,
82
- * compact: <Voltra.HStack>...</Voltra.HStack>,
83
- * expanded: <Voltra.VStack>...</Voltra.VStack>
84
- * }, {
85
- * activityName: 'my-activity',
86
- * autoStart: true,
87
- * autoUpdate: true
88
- * })
89
- *
90
- * return (
91
- * <View>
92
- * <Button title={isActive ? "Stop" : "Start"} onPress={isActive ? end : start} />
93
- * </View>
94
- * )
95
- * }
96
- * ```
97
- */
98
- export declare const useLiveActivity: (variants: LiveActivityVariants, options?: UseLiveActivityOptions) => UseLiveActivityResult;
99
- /**
100
- * Start a new Live Activity with the provided content variants.
101
- *
102
- * @param variants - The Live Activity content variants to display
103
- * @param options - Configuration options for the Live Activity
104
- * @returns Promise resolving to the activity ID
105
- *
106
- * @example
107
- * ```tsx
108
- * import { startLiveActivity, Voltra } from 'voltra'
109
- *
110
- * const activityId = await startLiveActivity({
111
- * minimal: <Voltra.Text>Live Activity</Voltra.Text>,
112
- * compact: <Voltra.HStack>...</Voltra.HStack>,
113
- * expanded: <Voltra.VStack>...</Voltra.VStack>
114
- * }, {
115
- * activityName: 'my-activity',
116
- * deepLinkUrl: '/details',
117
- * relevanceScore: 0.8
118
- * })
119
- * ```
120
- */
121
- export declare const startLiveActivity: (variants: LiveActivityVariants, options?: StartLiveActivityOptions) => Promise<string>;
122
- /**
123
- * Update an existing Live Activity with new content.
124
- *
125
- * @param targetId - The ID of the Live Activity to update
126
- * @param variants - The new Live Activity content variants
127
- * @param options - Update options like relevance score
128
- *
129
- * @example
130
- * ```tsx
131
- * import { updateLiveActivity, Voltra } from 'voltra'
132
- *
133
- * await updateLiveActivity('activity-123', {
134
- * minimal: <Voltra.Text>Updated: Live Activity</Voltra.Text>,
135
- * compact: <Voltra.HStack>...</Voltra.HStack>,
136
- * expanded: <Voltra.VStack>...</Voltra.VStack>
137
- * }, {
138
- * relevanceScore: 0.9
139
- * })
140
- * ```
141
- */
142
- export declare const updateLiveActivity: (targetId: string, variants: LiveActivityVariants, options?: UpdateLiveActivityOptions) => Promise<void>;
143
- /**
144
- * Stop a Live Activity.
145
- *
146
- * @param targetId - The ID of the Live Activity to stop
147
- * @param options - Options for how to end the activity
148
- *
149
- * @example
150
- * ```tsx
151
- * import { stopLiveActivity } from 'voltra'
152
- *
153
- * await stopLiveActivity('activity-123', { dismissalPolicy: 'immediate' })
154
- * ```
155
- */
156
- export declare const stopLiveActivity: (targetId: string, options?: EndLiveActivityOptions) => Promise<void>;
157
- /**
158
- * Check if a Live Activity with the given name is currently active.
159
- *
160
- * @param activityName - The name of the Live Activity to check
161
- * @returns true if the activity is active, false otherwise
162
- *
163
- * @example
164
- * ```tsx
165
- * import { isLiveActivityActive } from 'voltra'
166
- *
167
- * if (isLiveActivityActive('my-activity')) {
168
- * console.log('Activity is running')
169
- * }
170
- * ```
171
- */
172
- export declare const isLiveActivityActive: (activityName: string) => boolean;
173
- /**
174
- * End all active Live Activities.
175
- *
176
- * This function stops and dismisses all currently running Live Activities in the app.
177
- * It's useful for cleanup operations, such as when the app is being closed or
178
- * when you want to reset all Live Activity states.
179
- *
180
- * @example
181
- * ```typescript
182
- * import { endAllLiveActivities } from 'voltra'
183
- *
184
- * // End all active Live Activities
185
- * await endAllLiveActivities()
186
- * ```
187
- */
188
- export declare function endAllLiveActivities(): Promise<void>;
189
- //# sourceMappingURL=api.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../src/live-activity/api.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAEvE,MAAM,MAAM,yBAAyB,GAAG;IACtC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB;;;OAGG;IACH,eAAe,CAAC,EAAE,eAAe,CAAA;CAClC,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG;IACrC;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,GAAG,yBAAyB,CAAA;AAE7B,MAAM,MAAM,yBAAyB,GAAG,yBAAyB,CAAA;AAEjE,MAAM,MAAM,sBAAsB,GAAG;IACnC,eAAe,CAAC,EAAE,eAAe,CAAA;CAClC,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG;IAClC,KAAK,EAAE,CAAC,OAAO,CAAC,EAAE,wBAAwB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IAC5D,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,yBAAyB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IAC9D,GAAG,EAAE,CAAC,OAAO,CAAC,EAAE,sBAAsB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACxD,QAAQ,EAAE,OAAO,CAAA;CAClB,CAAA;AA8CD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,eAAO,MAAM,eAAe,GAC1B,UAAU,oBAAoB,EAC9B,UAAU,sBAAsB,KAC/B,qBAwFF,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,iBAAiB,GAC5B,UAAU,oBAAoB,EAC9B,UAAU,wBAAwB,KACjC,OAAO,CAAC,MAAM,CAchB,CAAA;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,kBAAkB,GAC7B,UAAU,MAAM,EAChB,UAAU,oBAAoB,EAC9B,UAAU,yBAAyB,KAClC,OAAO,CAAC,IAAI,CAOd,CAAA;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,gBAAgB,GAAU,UAAU,MAAM,EAAE,UAAU,sBAAsB,KAAG,OAAO,CAAC,IAAI,CAKvG,CAAA;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,oBAAoB,GAAI,cAAc,MAAM,KAAG,OAI3D,CAAA;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC,CAG1D"}
@@ -1,16 +0,0 @@
1
- declare const LEVELS: {
2
- readonly debug: 0;
3
- readonly info: 1;
4
- readonly warn: 2;
5
- readonly error: 3;
6
- };
7
- export type VoltraLogLevel = keyof typeof LEVELS;
8
- export declare const logger: {
9
- debug: (message: string) => void;
10
- info: (message: string) => void;
11
- warn: (message: string) => void;
12
- error: (message: string) => void;
13
- setLevel: (level: VoltraLogLevel) => void;
14
- };
15
- export {};
16
- //# sourceMappingURL=logger.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,MAAM;;;;;CAKF,CAAA;AACV,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,MAAM,CAAA;AAIhD,eAAO,MAAM,MAAM;qBACA,MAAM;oBAKP,MAAM;oBAKN,MAAM;qBAKL,MAAM;sBAKL,cAAc;CAGjC,CAAA"}
@@ -1,67 +0,0 @@
1
- import type { PreloadImageOptions, PreloadImagesResult } from './types.js';
2
- export type { PreloadImageOptions, PreloadImagesResult } from './types.js';
3
- /**
4
- * Preload images to App Group storage for use in Live Activities.
5
- *
6
- * Downloaded images are stored in shared storage accessible by both the app
7
- * and the Live Activity widget extension. Images can then be referenced using
8
- * the `assetName` property in the Image component.
9
- *
10
- * Images must be less than 4KB to comply with ActivityKit limits.
11
- *
12
- * @param images - Array of images to preload
13
- * @returns Result indicating which images succeeded or failed
14
- *
15
- * @example
16
- * ```typescript
17
- * const result = await preloadImages([
18
- * {
19
- * url: 'https://example.com/album-art.jpg',
20
- * key: 'current-album',
21
- * headers: { 'Authorization': 'Bearer token' }
22
- * }
23
- * ])
24
- *
25
- * // Use in Live Activity
26
- * <Voltra.Image source={{ assetName: 'current-album' }} />
27
- * ```
28
- */
29
- export declare function preloadImages(images: PreloadImageOptions[]): Promise<PreloadImagesResult>;
30
- /**
31
- * Reload Live Activities to pick up newly preloaded images.
32
- *
33
- * This triggers an update on the specified Live Activities (or all if none specified)
34
- * with their current content state, forcing SwiftUI to re-render and load the
35
- * newly preloaded images from App Group storage.
36
- *
37
- * @param activityNames - Optional array of activity names to reload. If omitted, reloads all.
38
- *
39
- * @example
40
- * ```typescript
41
- * // Preload new image
42
- * await preloadImages([{ url: 'https://example.com/new-art.jpg', key: 'album-art' }])
43
- *
44
- * // Reload specific activity to pick up the new image
45
- * await reloadLiveActivities(['music-player'])
46
- *
47
- * // Or reload all activities
48
- * await reloadLiveActivities()
49
- * ```
50
- */
51
- export declare function reloadLiveActivities(activityNames?: string[]): Promise<void>;
52
- /**
53
- * Clear preloaded images from App Group storage.
54
- *
55
- * @param keys - Optional array of image keys to clear. If omitted, clears all preloaded images.
56
- *
57
- * @example
58
- * ```typescript
59
- * // Clear specific images
60
- * await clearPreloadedImages(['album-art', 'profile-pic'])
61
- *
62
- * // Clear all preloaded images
63
- * await clearPreloadedImages()
64
- * ```
65
- */
66
- export declare function clearPreloadedImages(keys?: string[]): Promise<void>;
67
- //# sourceMappingURL=preload.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"preload.d.ts","sourceRoot":"","sources":["../../src/preload.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAI1E,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAQ1E;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAsB,aAAa,CAAC,MAAM,EAAE,mBAAmB,EAAE,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAgB/F;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,oBAAoB,CAAC,aAAa,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAQlF;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,oBAAoB,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAQzE"}
@@ -1,2 +0,0 @@
1
- export declare const assertRunningOnApple: () => boolean;
2
- //# sourceMappingURL=assertRunningOnApple.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"assertRunningOnApple.d.ts","sourceRoot":"","sources":["../../../src/utils/assertRunningOnApple.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,oBAAoB,QAAO,OAOvC,CAAA"}
@@ -1,12 +0,0 @@
1
- /**
2
- * Return whether Liquid Glass APIs are supported on this device (iOS 26+).
3
- * This is a convenience gate for authoring fallbacks in JS.
4
- */
5
- export declare function isGlassSupported(): boolean;
6
- /**
7
- * Return whether the app was launched in the background (headless).
8
- * Returns true if the app was launched in background, false if launched in foreground.
9
- * Always returns false on non-iOS platforms.
10
- */
11
- export declare function isHeadless(): boolean;
12
- //# sourceMappingURL=helpers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/utils/helpers.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,OAAO,CAW1C;AAED;;;;GAIG;AACH,wBAAgB,UAAU,IAAI,OAAO,CAGpC"}
@@ -1,3 +0,0 @@
1
- export * from './assertRunningOnApple.js';
2
- export * from './useUpdateOnHMR.js';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAA;AACzC,cAAc,qBAAqB,CAAA"}
@@ -1,9 +0,0 @@
1
- declare global {
2
- var __accept: (...args: unknown[]) => void;
3
- }
4
- /**
5
- * Taps into the HMR accept function to forcefully re-render the component when any module is updated.
6
- * Is only available in development mode.
7
- */
8
- export declare const useUpdateOnHMR: () => void;
9
- //# sourceMappingURL=useUpdateOnHMR.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useUpdateOnHMR.d.ts","sourceRoot":"","sources":["../../../src/utils/useUpdateOnHMR.ts"],"names":[],"mappings":"AAEA,OAAO,CAAC,MAAM,CAAC;IAEb,IAAI,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAA;CAC3C;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,YAmB1B,CAAA"}
@@ -1,49 +0,0 @@
1
- import type { WidgetServerCredentials } from '../types.js';
2
- export type { WidgetServerCredentials } from '../types.js';
3
- /**
4
- * Store server credentials for widget server-driven updates.
5
- *
6
- * On iOS, credentials are stored in the Shared Keychain (accessible by both the
7
- * main app and widget extension) with `kSecAttrAccessibleAfterFirstUnlock` to allow
8
- * background access.
9
- *
10
- * On Android, credentials are encrypted via Google Tink (AES-256-GCM) and
11
- * persisted in Jetpack DataStore. The encryption key is managed by the Android
12
- * Keystore. The WorkManager background worker can access this storage directly
13
- * since widgets are part of the main app binary.
14
- *
15
- * Call this after the user logs in to enable authenticated widget updates.
16
- *
17
- * @param credentials - The server credentials to store
18
- *
19
- * @example
20
- * ```typescript
21
- * import { setWidgetServerCredentials } from 'voltra'
22
- *
23
- * // After user login
24
- * await setWidgetServerCredentials({
25
- * token: userAccessToken,
26
- * headers: {
27
- * 'X-App-Version': '1.0.0',
28
- * }
29
- * })
30
- * ```
31
- */
32
- export declare function setWidgetServerCredentials(credentials: WidgetServerCredentials): Promise<void>;
33
- /**
34
- * Clear stored server credentials for widget updates.
35
- *
36
- * Call this when the user logs out to stop authenticated widget updates.
37
- * All widgets are automatically reloaded after clearing credentials so they
38
- * revert to their default/unauthenticated state.
39
- *
40
- * @example
41
- * ```typescript
42
- * import { clearWidgetServerCredentials } from 'voltra'
43
- *
44
- * // On user logout
45
- * await clearWidgetServerCredentials()
46
- * ```
47
- */
48
- export declare function clearWidgetServerCredentials(): Promise<void>;
49
- //# sourceMappingURL=server-credentials.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"server-credentials.d.ts","sourceRoot":"","sources":["../../../src/widgets/server-credentials.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA;AAI1D,YAAY,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAsB,0BAA0B,CAAC,WAAW,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC,CAMpG;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,4BAA4B,IAAI,OAAO,CAAC,IAAI,CAAC,CAElE"}
@@ -1,146 +0,0 @@
1
- import type { UpdateWidgetOptions } from '../types.js';
2
- import { ScheduledWidgetEntry, WidgetInfo, WidgetVariants } from './types.js';
3
- export type { UpdateWidgetOptions } from '../types.js';
4
- export type { ScheduledWidgetEntry, WidgetInfo } from './types.js';
5
- /**
6
- * Update a home screen widget with new content.
7
- *
8
- * The content will be stored in App Group storage and the widget timeline
9
- * will be reloaded to display the new content.
10
- *
11
- * @param widgetId - The widget identifier (as defined in your config plugin)
12
- * @param variants - An object mapping widget families to specific content.
13
- * Each key corresponds to a widget size family.
14
- * @param options - Optional settings like deep link URL
15
- *
16
- * @example Different content per size
17
- * ```tsx
18
- * import { updateWidget, Voltra } from 'voltra'
19
- *
20
- * await updateWidget('weather', {
21
- * systemSmall: <Voltra.Text fontSize={32}>72°F</Voltra.Text>,
22
- * systemMedium: (
23
- * <Voltra.HStack>
24
- * <Voltra.Text fontSize={32}>72°F</Voltra.Text>
25
- * <Voltra.VStack>
26
- * <Voltra.Text>Sunny</Voltra.Text>
27
- * <Voltra.Text>High: 78° Low: 65°</Voltra.Text>
28
- * </Voltra.VStack>
29
- * </Voltra.HStack>
30
- * ),
31
- * }, { deepLinkUrl: '/weather' })
32
- * ```
33
- */
34
- export declare const updateWidget: (widgetId: string, variants: WidgetVariants, options?: UpdateWidgetOptions) => Promise<void>;
35
- /**
36
- * Reload widget timelines to refresh their content.
37
- *
38
- * Use this after updating data that widgets depend on (e.g., after preloading
39
- * new images) to force them to re-render.
40
- *
41
- * @param widgetIds - Optional array of widget IDs to reload. If omitted, reloads all widgets.
42
- *
43
- * @example
44
- * ```typescript
45
- * // Reload specific widgets
46
- * await reloadWidgets(['weather', 'calendar'])
47
- *
48
- * // Reload all widgets
49
- * await reloadWidgets()
50
- * ```
51
- */
52
- export declare const reloadWidgets: (widgetIds?: string[]) => Promise<void>;
53
- /**
54
- * Clear a widget's stored data.
55
- *
56
- * This removes the JSON content and deep link URL for the specified widget,
57
- * causing it to show its placeholder state.
58
- *
59
- * @param widgetId - The widget identifier to clear
60
- *
61
- * @example
62
- * ```typescript
63
- * await clearWidget('weather')
64
- * ```
65
- */
66
- export declare const clearWidget: (widgetId: string) => Promise<void>;
67
- /**
68
- * Clear all widgets' stored data.
69
- *
70
- * This removes the JSON content and deep link URLs for all configured widgets,
71
- * causing them to show their placeholder states.
72
- *
73
- * @example
74
- * ```typescript
75
- * await clearAllWidgets()
76
- * ```
77
- */
78
- export declare const clearAllWidgets: () => Promise<void>;
79
- /**
80
- * Schedule a widget timeline with multiple entries to be displayed at future times.
81
- *
82
- * iOS will automatically display each entry at its scheduled time, even when your
83
- * app is not running. This allows you to batch widget updates in advance.
84
- *
85
- * @param widgetId - The widget identifier (as defined in your config plugin)
86
- * @param entries - Array of scheduled entries, each with a date and content variants
87
- * @param options - Optional settings like reload policy
88
- *
89
- * @example Schedule weather updates throughout the day
90
- * ```tsx
91
- * import { scheduleWidget, Voltra } from 'voltra'
92
- *
93
- * await scheduleWidget('weather', [
94
- * {
95
- * date: new Date('2026-01-16T09:00:00'),
96
- * variants: {
97
- * systemSmall: <Voltra.Text>Morning: 65°F</Voltra.Text>
98
- * }
99
- * },
100
- * {
101
- * date: new Date('2026-01-16T15:00:00'),
102
- * variants: {
103
- * systemSmall: <Voltra.Text>Afternoon: 72°F</Voltra.Text>
104
- * }
105
- * },
106
- * {
107
- * date: new Date('2026-01-16T21:00:00'),
108
- * variants: {
109
- * systemSmall: <Voltra.Text>Evening: 68°F</Voltra.Text>
110
- * }
111
- * }
112
- * ], {
113
- * policy: { type: 'atEnd' } // Request new timeline when last entry expires
114
- * })
115
- * ```
116
- *
117
- * @example With deep links per entry
118
- * ```tsx
119
- * await scheduleWidget('news', [
120
- * {
121
- * date: new Date('2026-01-16T08:00:00'),
122
- * variants: { systemSmall: <Voltra.Text>Morning News</Voltra.Text> },
123
- * deepLinkUrl: '/news/morning'
124
- * },
125
- * {
126
- * date: new Date('2026-01-16T20:00:00'),
127
- * variants: { systemSmall: <Voltra.Text>Evening News</Voltra.Text> },
128
- * deepLinkUrl: '/news/evening'
129
- * }
130
- * ])
131
- * ```
132
- */
133
- export declare const scheduleWidget: (widgetId: string, entries: ScheduledWidgetEntry[]) => Promise<void>;
134
- /**
135
- * Fetches all active widget configurations for the containing app on iOS.
136
- *
137
- * @returns A promise that resolves to an array of active widget configurations.
138
- *
139
- * @example
140
- * ```typescript
141
- * const widgets = await getActiveWidgets()
142
- * console.log('Active widgets:', widgets)
143
- * ```
144
- */
145
- export declare const getActiveWidgets: () => Promise<WidgetInfo[]>;
146
- //# sourceMappingURL=widget-api.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"widget-api.d.ts","sourceRoot":"","sources":["../../../src/widgets/widget-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAItD,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAG7E,YAAY,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AACtD,YAAY,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAElE;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,YAAY,GACvB,UAAU,MAAM,EAChB,UAAU,cAAc,EACxB,UAAU,mBAAmB,KAC5B,OAAO,CAAC,IAAI,CAQd,CAAA;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,aAAa,GAAU,YAAY,MAAM,EAAE,KAAG,OAAO,CAAC,IAAI,CAItE,CAAA;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,WAAW,GAAU,UAAU,MAAM,KAAG,OAAO,CAAC,IAAI,CAIhE,CAAA;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,eAAe,QAAa,OAAO,CAAC,IAAI,CAIpD,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,eAAO,MAAM,cAAc,GAAU,UAAU,MAAM,EAAE,SAAS,oBAAoB,EAAE,KAAG,OAAO,CAAC,IAAI,CAmBpG,CAAA;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,gBAAgB,QAAa,OAAO,CAAC,UAAU,EAAE,CAI7D,CAAA"}