expo-invoke 2.6.14 → 2.7.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 (149) hide show
  1. package/android/src/main/java/expo/modules/invoke/ExpoInvokeModule.kt +35 -0
  2. package/android/src/main/java/expo/modules/invoke/InvokeSliceProvider.kt +9 -0
  3. package/build/plugin/codegen/generateSwiftIntents.js +22 -0
  4. package/build/plugin/codegen/generateSwiftIntents.js.map +1 -1
  5. package/build/plugin/codegen/generateSwiftLiveActivities.d.ts +17 -0
  6. package/build/plugin/codegen/generateSwiftLiveActivities.js +165 -0
  7. package/build/plugin/codegen/generateSwiftLiveActivities.js.map +1 -0
  8. package/build/plugin/codegen/generateSwiftWidget.d.ts +5 -0
  9. package/build/plugin/codegen/generateSwiftWidget.js.map +1 -1
  10. package/build/plugin/ios/widgets/withAppGroupEntitlements.d.ts +6 -0
  11. package/build/plugin/ios/widgets/withAppGroupEntitlements.js +27 -0
  12. package/build/plugin/ios/widgets/withAppGroupEntitlements.js.map +1 -0
  13. package/build/plugin/ios/widgets/withAppInfoPlist.d.ts +7 -0
  14. package/build/plugin/ios/widgets/withAppInfoPlist.js +12 -0
  15. package/build/plugin/ios/widgets/withAppInfoPlist.js.map +1 -0
  16. package/build/plugin/ios/widgets/withEasConfig.d.ts +8 -0
  17. package/build/plugin/ios/widgets/withEasConfig.js +52 -0
  18. package/build/plugin/ios/widgets/withEasConfig.js.map +1 -0
  19. package/build/plugin/ios/widgets/withIosWarning.d.ts +7 -0
  20. package/build/plugin/ios/widgets/withIosWarning.js +10 -0
  21. package/build/plugin/ios/widgets/withIosWarning.js.map +1 -0
  22. package/build/plugin/ios/widgets/withIosWidgets.d.ts +11 -0
  23. package/build/plugin/ios/widgets/withIosWidgets.js +83 -0
  24. package/build/plugin/ios/widgets/withIosWidgets.js.map +1 -0
  25. package/build/plugin/ios/widgets/withPodsLinking.d.ts +6 -0
  26. package/build/plugin/ios/widgets/withPodsLinking.js +102 -0
  27. package/build/plugin/ios/widgets/withPodsLinking.js.map +1 -0
  28. package/build/plugin/ios/widgets/withPushNotifications.d.ts +6 -0
  29. package/build/plugin/ios/widgets/withPushNotifications.js +12 -0
  30. package/build/plugin/ios/widgets/withPushNotifications.js.map +1 -0
  31. package/build/plugin/ios/widgets/withWidgetSourceFiles.d.ts +10 -0
  32. package/build/plugin/ios/widgets/withWidgetSourceFiles.js +379 -0
  33. package/build/plugin/ios/widgets/withWidgetSourceFiles.js.map +1 -0
  34. package/build/plugin/ios/widgets/xcode/addBuildPhases.d.ts +12 -0
  35. package/build/plugin/ios/widgets/xcode/addBuildPhases.js +41 -0
  36. package/build/plugin/ios/widgets/xcode/addBuildPhases.js.map +1 -0
  37. package/build/plugin/ios/widgets/xcode/addPbxGroup.d.ts +5 -0
  38. package/build/plugin/ios/widgets/xcode/addPbxGroup.js +20 -0
  39. package/build/plugin/ios/widgets/xcode/addPbxGroup.js.map +1 -0
  40. package/build/plugin/ios/widgets/xcode/addProductFile.d.ts +7 -0
  41. package/build/plugin/ios/widgets/xcode/addProductFile.js +41 -0
  42. package/build/plugin/ios/widgets/xcode/addProductFile.js.map +1 -0
  43. package/build/plugin/ios/widgets/xcode/addTargetDependency.d.ts +4 -0
  44. package/build/plugin/ios/widgets/xcode/addTargetDependency.js +17 -0
  45. package/build/plugin/ios/widgets/xcode/addTargetDependency.js.map +1 -0
  46. package/build/plugin/ios/widgets/xcode/addToPbxNativeTargetSection.d.ts +14 -0
  47. package/build/plugin/ios/widgets/xcode/addToPbxNativeTargetSection.js +29 -0
  48. package/build/plugin/ios/widgets/xcode/addToPbxNativeTargetSection.js.map +1 -0
  49. package/build/plugin/ios/widgets/xcode/addToPbxProjectSection.d.ts +4 -0
  50. package/build/plugin/ios/widgets/xcode/addToPbxProjectSection.js +20 -0
  51. package/build/plugin/ios/widgets/xcode/addToPbxProjectSection.js.map +1 -0
  52. package/build/plugin/ios/widgets/xcode/addXCConfigurationList.d.ts +11 -0
  53. package/build/plugin/ios/widgets/xcode/addXCConfigurationList.js +37 -0
  54. package/build/plugin/ios/widgets/xcode/addXCConfigurationList.js.map +1 -0
  55. package/build/plugin/ios/widgets/xcode/withTargetXcodeProject.d.ts +10 -0
  56. package/build/plugin/ios/widgets/xcode/withTargetXcodeProject.js +86 -0
  57. package/build/plugin/ios/widgets/xcode/withTargetXcodeProject.js.map +1 -0
  58. package/build/plugin/ios/withIOSInvoke.d.ts +6 -15
  59. package/build/plugin/ios/withIOSInvoke.js +54 -25
  60. package/build/plugin/ios/withIOSInvoke.js.map +1 -1
  61. package/build/plugin/ios/withWidgetExtension.d.ts +5 -0
  62. package/build/plugin/ios/withWidgetExtension.js +36 -6
  63. package/build/plugin/ios/withWidgetExtension.js.map +1 -1
  64. package/build/plugin/src/withInvoke.d.ts +34 -23
  65. package/build/plugin/src/withInvoke.js +16 -27
  66. package/build/plugin/src/withInvoke.js.map +1 -1
  67. package/build/plugin/types/WidgetConfig.type.d.ts +54 -0
  68. package/build/plugin/types/WidgetConfig.type.js +3 -0
  69. package/build/plugin/types/WidgetConfig.type.js.map +1 -0
  70. package/build/plugin/types/WidgetFamily.type.d.ts +10 -0
  71. package/build/plugin/types/WidgetFamily.type.js +13 -0
  72. package/build/plugin/types/WidgetFamily.type.js.map +1 -0
  73. package/build/src/hooks/useLiveActivity.d.ts +20 -10
  74. package/build/src/hooks/useLiveActivity.d.ts.map +1 -1
  75. package/build/src/hooks/useLiveActivity.js +20 -10
  76. package/build/src/hooks/useLiveActivity.js.map +1 -1
  77. package/build/src/index.d.ts +2 -0
  78. package/build/src/index.d.ts.map +1 -1
  79. package/build/src/index.js +5 -0
  80. package/build/src/index.js.map +1 -1
  81. package/build/src/module.d.ts +4 -0
  82. package/build/src/module.d.ts.map +1 -1
  83. package/build/src/module.js +8 -0
  84. package/build/src/module.js.map +1 -1
  85. package/build/src/web/index.d.ts +10 -1
  86. package/build/src/web/index.d.ts.map +1 -1
  87. package/build/src/web/index.js +4 -0
  88. package/build/src/web/index.js.map +1 -1
  89. package/build/src/widgets/ExpoWidgets.d.ts +12 -0
  90. package/build/src/widgets/ExpoWidgets.d.ts.map +1 -0
  91. package/build/src/widgets/ExpoWidgets.ios.d.ts +12 -0
  92. package/build/src/widgets/ExpoWidgets.ios.d.ts.map +1 -0
  93. package/build/src/widgets/ExpoWidgets.ios.js +3 -0
  94. package/build/src/widgets/ExpoWidgets.ios.js.map +1 -0
  95. package/build/src/widgets/ExpoWidgets.js +42 -0
  96. package/build/src/widgets/ExpoWidgets.js.map +1 -0
  97. package/build/src/widgets/Widgets.d.ts +119 -0
  98. package/build/src/widgets/Widgets.d.ts.map +1 -0
  99. package/build/src/widgets/Widgets.js +158 -0
  100. package/build/src/widgets/Widgets.js.map +1 -0
  101. package/build/src/widgets/Widgets.types.d.ts +263 -0
  102. package/build/src/widgets/Widgets.types.d.ts.map +1 -0
  103. package/build/src/widgets/Widgets.types.js +2 -0
  104. package/build/src/widgets/Widgets.types.js.map +1 -0
  105. package/build/src/widgets/index.d.ts +3 -0
  106. package/build/src/widgets/index.d.ts.map +1 -0
  107. package/build/src/widgets/index.js +2 -0
  108. package/build/src/widgets/index.js.map +1 -0
  109. package/bundle/__tests__/decorator.test.ts +89 -0
  110. package/bundle/decorator.ts +61 -0
  111. package/bundle/expo-modules-core-stub.ts +1 -0
  112. package/bundle/expo-stub.ts +15 -0
  113. package/bundle/index.ts +69 -0
  114. package/bundle/jsx-runtime-stub.ts +71 -0
  115. package/bundle/react-native-stub.ts +3 -0
  116. package/bundle/react-stub.ts +13 -0
  117. package/expo-module.config.json +1 -1
  118. package/ios/LiveActivity/LiveActivityManager.swift +15 -14
  119. package/ios/Module/ExpoInvokeModule.swift +124 -0
  120. package/ios/Widget/WidgetManager.swift +25 -8
  121. package/ios/Widgets/LiveActivity.swift +81 -0
  122. package/ios/Widgets/LiveActivityFactory.swift +49 -0
  123. package/ios/Widgets/Widget/AppIntent.swift +130 -0
  124. package/ios/Widgets/Widget/Buttons.swift +62 -0
  125. package/ios/Widgets/Widget/DynamicView.swift +161 -0
  126. package/ios/Widgets/Widget/EntryView.swift +36 -0
  127. package/ios/Widgets/Widget/Fragment.swift +13 -0
  128. package/ios/Widgets/Widget/LiveActivityBanner.swift +19 -0
  129. package/ios/Widgets/Widget/RedBoxView.swift +83 -0
  130. package/ios/Widgets/Widget/TimelineEntry.swift +8 -0
  131. package/ios/Widgets/Widget/TimelineProvider.swift +45 -0
  132. package/ios/Widgets/Widget/Type.swift +6 -0
  133. package/ios/Widgets/Widget/Utils.swift +116 -0
  134. package/ios/Widgets/Widget/WidgetLiveActivity.swift +104 -0
  135. package/ios/Widgets/Widget/WidgetsJSRuntime.swift +148 -0
  136. package/ios/Widgets/WidgetObject.swift +31 -0
  137. package/ios/Widgets/WidgetsContext.swift +7 -0
  138. package/ios/Widgets/WidgetsEvents.swift +16 -0
  139. package/ios/Widgets/WidgetsExceptions.swift +25 -0
  140. package/ios/Widgets/WidgetsModule.swift +149 -0
  141. package/ios/Widgets/WidgetsRecords.swift +22 -0
  142. package/ios/Widgets/WidgetsStorage.swift +58 -0
  143. package/metro.widget.config.js +76 -0
  144. package/package.json +11 -1
  145. package/scripts/autolinking.rb +34 -0
  146. package/scripts/build-bundle.mjs +69 -0
  147. package/scripts/with-node.sh +44 -0
  148. package/scripts/xcode-build-bundle.sh +23 -0
  149. package/spm.config.json +40 -0
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/web/index.ts"],"names":[],"mappings":"AAGA,cAAc,UAAU,CAAC;AAGzB,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAA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,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAClE,YAAY,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,YAAY,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAC9F,YAAY,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACxF,YAAY,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AACrE,YAAY,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAGrF,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,MAAM,EACN,YAAY,EACZ,mBAAmB,EACnB,0BAA0B,EAC1B,2BAA2B,EAC3B,KAAK,EACL,gBAAgB,GACjB,MAAM,YAAY,CAAC;AAEpB,YAAY,EACV,iBAAiB,EACjB,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,2BAA2B,EAC3B,uBAAuB,EACvB,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,qBAAqB,EACrB,oBAAoB,EACpB,aAAa,GACd,MAAM,YAAY,CAAC"}
@@ -34,4 +34,8 @@ export { mockInvoke, simulateColdStart, simulateWarmStart, createMockIntent } fr
34
34
  // OTA / analytics utilities
35
35
  export { fetchOTAConfig, applyOTAConfig, getOTAConfig } from '../utils/otaConfig';
36
36
  export { loadPersistedAnalytics, persistAnalytics, clearPersistedAnalytics } from '../utils/persistentAnalytics';
37
+ // Error handling utilities
38
+ export { setInvokeErrorHandler, resetInvokeErrorHandler, reportInvokeError, createInvokeError, } from '../utils/invokeError';
39
+ // Widget & Live Activity — stubs on web (no-op implementations)
40
+ export { createWidget, createLiveActivity, Widget, LiveActivity, LiveActivityFactory, addUserInteractionListener, addPushToStartTokenListener, after, widgetsDirectory, } from '../widgets';
37
41
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"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,EAC1B,2BAA2B,EAC3B,KAAK,EACL,gBAAgB,GACjB,MAAM,YAAY,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { EventSubscription } from 'expo-modules-core';
2
+ import type { ExpoWidgetsEvents, NativeLiveActivity, NativeLiveActivityFactory, NativeWidgetObject } from './Widgets.types';
3
+ declare const ExpoWidgetsModule: {
4
+ widgetsDirectory: string;
5
+ reloadAllWidgets(): void;
6
+ Widget: typeof NativeWidgetObject;
7
+ LiveActivityFactory: typeof NativeLiveActivityFactory;
8
+ LiveActivity: typeof NativeLiveActivity;
9
+ addListener<EventName extends keyof ExpoWidgetsEvents>(_eventName: EventName, _listener: ExpoWidgetsEvents[EventName]): EventSubscription;
10
+ };
11
+ export default ExpoWidgetsModule;
12
+ //# sourceMappingURL=ExpoWidgets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpoWidgets.d.ts","sourceRoot":"","sources":["../../../src/widgets/ExpoWidgets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,OAAO,KAAK,EAEV,iBAAiB,EACjB,kBAAkB,EAClB,yBAAyB,EACzB,kBAAkB,EACnB,MAAM,iBAAiB,CAAC;AAyCzB,QAAA,MAAM,iBAAiB;;wBAED,IAAI;YACF,OAAO,kBAAkB;yBACC,OAAO,yBAAyB;kBAC9C,OAAO,kBAAkB;gBAC/C,SAAS,SAAS,MAAM,iBAAiB,cACvC,SAAS,aACV,iBAAiB,CAAC,SAAS,CAAC,GACtC,iBAAiB;CAGrB,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { NativeModule } from 'expo-modules-core';
2
+ import type { ExpoWidgetsEvents, NativeLiveActivity, NativeLiveActivityFactory, NativeWidgetObject } from './Widgets.types';
3
+ declare class ExpoWidgetsModule extends NativeModule<ExpoWidgetsEvents> {
4
+ widgetsDirectory: string;
5
+ reloadAllWidgets(): void;
6
+ readonly Widget: typeof NativeWidgetObject;
7
+ readonly LiveActivityFactory: typeof NativeLiveActivityFactory;
8
+ readonly LiveActivity: typeof NativeLiveActivity;
9
+ }
10
+ declare const _default: ExpoWidgetsModule;
11
+ export default _default;
12
+ //# sourceMappingURL=ExpoWidgets.ios.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpoWidgets.ios.d.ts","sourceRoot":"","sources":["../../../src/widgets/ExpoWidgets.ios.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAuB,MAAM,mBAAmB,CAAC;AAEtE,OAAO,KAAK,EACV,iBAAiB,EACjB,kBAAkB,EAClB,yBAAyB,EACzB,kBAAkB,EACnB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,OAAO,iBAAkB,SAAQ,YAAY,CAAC,iBAAiB,CAAC;IACrE,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,IAAI,IAAI;IACxB,QAAQ,CAAC,MAAM,EAAE,OAAO,kBAAkB,CAAC;IAC3C,QAAQ,CAAC,mBAAmB,EAAE,OAAO,yBAAyB,CAAC;IAC/D,QAAQ,CAAC,YAAY,EAAE,OAAO,kBAAkB,CAAC;CAClD;;AAED,wBAAqE"}
@@ -0,0 +1,3 @@
1
+ import { requireNativeModule } from 'expo-modules-core';
2
+ export default requireNativeModule('ExpoWidgets');
3
+ //# sourceMappingURL=ExpoWidgets.ios.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpoWidgets.ios.js","sourceRoot":"","sources":["../../../src/widgets/ExpoWidgets.ios.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAiBtE,eAAe,mBAAmB,CAAoB,aAAa,CAAC,CAAC"}
@@ -0,0 +1,42 @@
1
+ const noopSubscription = { remove() { } };
2
+ class WidgetStub {
3
+ // eslint-disable-next-line @typescript-eslint/no-useless-constructor
4
+ constructor(_name, _layout) { }
5
+ reload() { }
6
+ updateTimeline(_entries) { }
7
+ async getTimeline() {
8
+ return [];
9
+ }
10
+ }
11
+ class LiveActivityStub {
12
+ async update(_props) { }
13
+ async end(_dismissalPolicy, _afterDate, _state, _contentDate) { }
14
+ async getPushToken() {
15
+ return null;
16
+ }
17
+ addListener(_eventName, _listener) {
18
+ return noopSubscription;
19
+ }
20
+ }
21
+ class LiveActivityFactoryStub {
22
+ // eslint-disable-next-line @typescript-eslint/no-useless-constructor
23
+ constructor(_name, _layout) { }
24
+ start(_props, _url) {
25
+ return new LiveActivityStub();
26
+ }
27
+ getInstances() {
28
+ return [];
29
+ }
30
+ }
31
+ const ExpoWidgetsModule = {
32
+ widgetsDirectory: '',
33
+ reloadAllWidgets() { },
34
+ Widget: WidgetStub,
35
+ LiveActivityFactory: LiveActivityFactoryStub,
36
+ LiveActivity: LiveActivityStub,
37
+ addListener(_eventName, _listener) {
38
+ return noopSubscription;
39
+ },
40
+ };
41
+ export default ExpoWidgetsModule;
42
+ //# sourceMappingURL=ExpoWidgets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpoWidgets.js","sourceRoot":"","sources":["../../../src/widgets/ExpoWidgets.ts"],"names":[],"mappings":"AAUA,MAAM,gBAAgB,GAAsB,EAAE,MAAM,KAAI,CAAC,EAAE,CAAC;AAE5D,MAAM,UAAU;IACd,qEAAqE;IACrE,YAAY,KAAa,EAAE,OAAe,IAAG,CAAC;IAC9C,MAAM,KAAU,CAAC;IACjB,cAAc,CAAC,QAA6B,IAAS,CAAC;IACtD,KAAK,CAAC,WAAW;QACf,OAAO,EAAE,CAAC;IACZ,CAAC;CACF;AAED,MAAM,gBAAgB;IACpB,KAAK,CAAC,MAAM,CAAC,MAAe,IAAkB,CAAC;IAC/C,KAAK,CAAC,GAAG,CACP,gBAAyB,EACzB,UAAmB,EACnB,MAAe,EACf,YAAqB,IACL,CAAC;IACnB,KAAK,CAAC,YAAY;QAChB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,WAAW,CAAC,UAAkB,EAAE,SAAuC;QACrE,OAAO,gBAAgB,CAAC;IAC1B,CAAC;CACF;AAED,MAAM,uBAAuB;IAC3B,qEAAqE;IACrE,YAAY,KAAa,EAAE,OAAe,IAAG,CAAC;IAC9C,KAAK,CAAC,MAAe,EAAE,IAAa;QAClC,OAAO,IAAI,gBAAgB,EAAwB,CAAC;IACtD,CAAC;IACD,YAAY;QACV,OAAO,EAAE,CAAC;IACZ,CAAC;CACF;AAED,MAAM,iBAAiB,GAAG;IACxB,gBAAgB,EAAE,EAAE;IACpB,gBAAgB,KAAU,CAAC;IAC3B,MAAM,EAAE,UAAuC;IAC/C,mBAAmB,EAAE,uBAA2D;IAChF,YAAY,EAAE,gBAA6C;IAC3D,WAAW,CACT,UAAqB,EACrB,SAAuC;QAEvC,OAAO,gBAAgB,CAAC;IAC1B,CAAC;CACF,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,119 @@
1
+ import type { EventSubscription } from 'expo-modules-core';
2
+ import type { ExpoWidgetsEvents, LiveActivityComponent, LiveActivityDismissalPolicy, NativeLiveActivity, PushTokenEvent, WidgetEnvironment, WidgetTimelineEntry } from './Widgets.types';
3
+ /**
4
+ * Represents a widget instance. Provides methods to manage the widget's timeline.
5
+ */
6
+ export declare class Widget<PropsType extends object = object, ConfigurationType extends object | undefined = undefined> {
7
+ /** @hidden */
8
+ private nativeWidgetObject;
9
+ constructor(name: string, layout: (props: PropsType, environment: WidgetEnvironment<ConfigurationType>) => React.JSX.Element);
10
+ /**
11
+ * Force reloads the widget, causing it to refresh its content and timeline.
12
+ */
13
+ reload(): void;
14
+ /**
15
+ * Schedules a series of updates for the widget's content and reloads the widget.
16
+ * @param entries Timeline entries, each specifying a date and the props to display at that time.
17
+ */
18
+ updateTimeline(entries: WidgetTimelineEntry<PropsType>[]): void;
19
+ /**
20
+ * Sets the widget's content to the given props immediately, without scheduling a timeline.
21
+ * @param props The properties to display in the widget.
22
+ */
23
+ updateSnapshot(props: PropsType): void;
24
+ /**
25
+ * Returns the current timeline entries for the widget, including past and future entries.
26
+ */
27
+ getTimeline(): Promise<WidgetTimelineEntry<PropsType>[]>;
28
+ }
29
+ /**
30
+ * Represents a Live Activity instance. Provides methods to update its content and end it.
31
+ */
32
+ export declare class LiveActivity<T extends object = object> {
33
+ /** @hidden */
34
+ private nativeLiveActivity;
35
+ constructor(nativeLiveActivity: NativeLiveActivity);
36
+ /**
37
+ * Updates the Live Activity's content. The UI reflects the new properties immediately.
38
+ * @param props The updated content properties.
39
+ */
40
+ update(props: T): Promise<void>;
41
+ /**
42
+ * Ends the Live Activity.
43
+ * @param dismissalPolicy Controls when the Live Activity is removed from the Lock Screen after ending.
44
+ * Can be `'default'`, `'immediate'`, or `after(date)`.
45
+ * @param props Final content properties to update after the activity ends.
46
+ * @param contentDate The time the data in the payload was generated. If this is older than a previous update or push payload, the system ignores this update.
47
+ */
48
+ end(dismissalPolicy?: LiveActivityDismissalPolicy, props?: T, contentDate?: Date): Promise<void>;
49
+ /**
50
+ * Returns the push token for this Live Activity, used to send push notification updates via APNs.
51
+ * Returns `null` if push notifications are not enabled or the token is not yet available.
52
+ */
53
+ getPushToken(): Promise<string | null>;
54
+ /**
55
+ * Adds a listener for push token update events on this Live Activity instance.
56
+ * The token can be used to send content updates to this specific activity via APNs.
57
+ * @param listener Callback invoked when a new push token is available.
58
+ * @returns An event subscription that can be used to remove the listener.
59
+ */
60
+ addPushTokenListener(listener: (event: PushTokenEvent) => void): EventSubscription;
61
+ }
62
+ /**
63
+ * Manages Live Activity instances of a specific type. Use it to start new activities and retrieve currently active ones.
64
+ */
65
+ export declare class LiveActivityFactory<T extends object = object> {
66
+ /** @hidden */
67
+ private nativeLiveActivityFactory;
68
+ constructor(name: string, layout: LiveActivityComponent<T>);
69
+ /**
70
+ * Starts a new Live Activity with the given properties.
71
+ * @param props The initial content properties for the Live Activity.
72
+ * @param url An optional URL to associate with the Live Activity, used for deep linking.
73
+ * @returns The new Live Activity instance.
74
+ */
75
+ start(props: T, url?: string): LiveActivity<T>;
76
+ /**
77
+ * Returns all currently active instances of this Live Activity type.
78
+ */
79
+ getInstances(): LiveActivity<T>[];
80
+ }
81
+ /**
82
+ * Creates a dismissal policy that removes the Live Activity at the specified time within a four-hour window.
83
+ * @param date The date after which the Live Activity should be removed from the Lock Screen.
84
+ * @hidden
85
+ */
86
+ export declare function after(date: Date): {
87
+ after: Date;
88
+ };
89
+ /**
90
+ * Creates a Widget instance.
91
+ * @param name The widget name. Must match the `'name'` field in your widget configuration in the app config.
92
+ * @param widget The widget component, marked with the `'widget'` directive.
93
+ */
94
+ export declare function createWidget<PropsType extends object = object, ConfigurationType extends object | undefined = undefined>(name: string, widget: (props: PropsType, context: WidgetEnvironment<ConfigurationType>) => React.JSX.Element): Widget<PropsType, ConfigurationType>;
95
+ /**
96
+ * Creates a Live Activity Factory for managing Live Activities of a specific type.
97
+ * @param name The Live Activity name. Must match the `'name'` field in your widget configuration in the app config.
98
+ * @param liveActivity The Live Activity component, marked with the `'widget'` directive.
99
+ */
100
+ export declare function createLiveActivity<T extends object = object>(name: string, liveActivity: LiveActivityComponent<T>): LiveActivityFactory<T>;
101
+ /**
102
+ * Adds a listener for widget interaction events (for example, button taps).
103
+ * @param listener Callback function to handle user interaction events.
104
+ * @return An event subscription that can be used to remove the listener.
105
+ */
106
+ export declare function addUserInteractionListener(listener: ExpoWidgetsEvents['onExpoWidgetsUserInteraction']): EventSubscription;
107
+ /**
108
+ * Adds a listener for push-to-start token events.
109
+ * This token can be used to start live activities remotely via APNs.
110
+ * @param listener Callback function to handle push-to-start token events.
111
+ * @return An event subscription that can be used to remove the listener.
112
+ */
113
+ export declare function addPushToStartTokenListener(listener: ExpoWidgetsEvents['onExpoWidgetsPushToStartTokenReceived']): EventSubscription;
114
+ /**
115
+ * A directory that can be used to store shared images for widgets.
116
+ * The contents of this directory are accessible by both the main app and widgets.
117
+ */
118
+ export declare const widgetsDirectory: string;
119
+ //# sourceMappingURL=Widgets.d.ts.map
@@ -0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,EAAE,iBAAiB,CAAC,uCAAuC,CAAC,GACnE,iBAAiB,CAEnB;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,QAAqC,CAAC"}
@@ -0,0 +1,158 @@
1
+ import ExpoWidgetsModule from './ExpoWidgets';
2
+ /**
3
+ * Represents a widget instance. Provides methods to manage the widget's timeline.
4
+ */
5
+ export class Widget {
6
+ constructor(name, layout) {
7
+ this.nativeWidgetObject = new ExpoWidgetsModule.Widget(name, layout);
8
+ }
9
+ /**
10
+ * Force reloads the widget, causing it to refresh its content and timeline.
11
+ */
12
+ reload() {
13
+ this.nativeWidgetObject.reload();
14
+ }
15
+ /**
16
+ * Schedules a series of updates for the widget's content and reloads the widget.
17
+ * @param entries Timeline entries, each specifying a date and the props to display at that time.
18
+ */
19
+ updateTimeline(entries) {
20
+ this.nativeWidgetObject.updateTimeline(entries.map((entry) => ({ timestamp: entry.date.getTime(), props: entry.props })));
21
+ }
22
+ /**
23
+ * Sets the widget's content to the given props immediately, without scheduling a timeline.
24
+ * @param props The properties to display in the widget.
25
+ */
26
+ updateSnapshot(props) {
27
+ this.nativeWidgetObject.updateTimeline([{ timestamp: Date.now(), props }]);
28
+ }
29
+ /**
30
+ * Returns the current timeline entries for the widget, including past and future entries.
31
+ */
32
+ async getTimeline() {
33
+ return (await this.nativeWidgetObject.getTimeline()).map((entry) => ({
34
+ date: new Date(entry.timestamp),
35
+ props: entry.props,
36
+ }));
37
+ }
38
+ }
39
+ /**
40
+ * Represents a Live Activity instance. Provides methods to update its content and end it.
41
+ */
42
+ export class LiveActivity {
43
+ constructor(nativeLiveActivity) {
44
+ this.nativeLiveActivity = nativeLiveActivity;
45
+ }
46
+ /**
47
+ * Updates the Live Activity's content. The UI reflects the new properties immediately.
48
+ * @param props The updated content properties.
49
+ */
50
+ update(props) {
51
+ return this.nativeLiveActivity.update(JSON.stringify(props));
52
+ }
53
+ /**
54
+ * Ends the Live Activity.
55
+ * @param dismissalPolicy Controls when the Live Activity is removed from the Lock Screen after ending.
56
+ * Can be `'default'`, `'immediate'`, or `after(date)`.
57
+ * @param props Final content properties to update after the activity ends.
58
+ * @param contentDate The time the data in the payload was generated. If this is older than a previous update or push payload, the system ignores this update.
59
+ */
60
+ end(dismissalPolicy, props, contentDate) {
61
+ var _a;
62
+ const serializedProps = props ? JSON.stringify(props) : undefined;
63
+ if (typeof dismissalPolicy === 'object' &&
64
+ dismissalPolicy !== null &&
65
+ 'after' in dismissalPolicy) {
66
+ return this.nativeLiveActivity.end('after', (_a = dismissalPolicy.after) === null || _a === void 0 ? void 0 : _a.getTime(), serializedProps, contentDate === null || contentDate === void 0 ? void 0 : contentDate.getTime());
67
+ }
68
+ return this.nativeLiveActivity.end(dismissalPolicy, undefined, serializedProps, contentDate === null || contentDate === void 0 ? void 0 : contentDate.getTime());
69
+ }
70
+ /**
71
+ * Returns the push token for this Live Activity, used to send push notification updates via APNs.
72
+ * Returns `null` if push notifications are not enabled or the token is not yet available.
73
+ */
74
+ getPushToken() {
75
+ return this.nativeLiveActivity.getPushToken();
76
+ }
77
+ /**
78
+ * Adds a listener for push token update events on this Live Activity instance.
79
+ * The token can be used to send content updates to this specific activity via APNs.
80
+ * @param listener Callback invoked when a new push token is available.
81
+ * @returns An event subscription that can be used to remove the listener.
82
+ */
83
+ addPushTokenListener(listener) {
84
+ return this.nativeLiveActivity.addListener('onExpoWidgetsTokenReceived', listener);
85
+ }
86
+ }
87
+ /**
88
+ * Manages Live Activity instances of a specific type. Use it to start new activities and retrieve currently active ones.
89
+ */
90
+ export class LiveActivityFactory {
91
+ constructor(name, layout) {
92
+ this.nativeLiveActivityFactory = new ExpoWidgetsModule.LiveActivityFactory(name, layout);
93
+ }
94
+ /**
95
+ * Starts a new Live Activity with the given properties.
96
+ * @param props The initial content properties for the Live Activity.
97
+ * @param url An optional URL to associate with the Live Activity, used for deep linking.
98
+ * @returns The new Live Activity instance.
99
+ */
100
+ start(props, url) {
101
+ return new LiveActivity(this.nativeLiveActivityFactory.start(JSON.stringify(props), url));
102
+ }
103
+ /**
104
+ * Returns all currently active instances of this Live Activity type.
105
+ */
106
+ getInstances() {
107
+ return this.nativeLiveActivityFactory
108
+ .getInstances()
109
+ .map((instance) => new LiveActivity(instance));
110
+ }
111
+ }
112
+ /**
113
+ * Creates a dismissal policy that removes the Live Activity at the specified time within a four-hour window.
114
+ * @param date The date after which the Live Activity should be removed from the Lock Screen.
115
+ * @hidden
116
+ */
117
+ export function after(date) {
118
+ return { after: date };
119
+ }
120
+ /**
121
+ * Creates a Widget instance.
122
+ * @param name The widget name. Must match the `'name'` field in your widget configuration in the app config.
123
+ * @param widget The widget component, marked with the `'widget'` directive.
124
+ */
125
+ export function createWidget(name, widget) {
126
+ return new Widget(name, widget);
127
+ }
128
+ /**
129
+ * Creates a Live Activity Factory for managing Live Activities of a specific type.
130
+ * @param name The Live Activity name. Must match the `'name'` field in your widget configuration in the app config.
131
+ * @param liveActivity The Live Activity component, marked with the `'widget'` directive.
132
+ */
133
+ export function createLiveActivity(name, liveActivity) {
134
+ return new LiveActivityFactory(name, liveActivity);
135
+ }
136
+ /**
137
+ * Adds a listener for widget interaction events (for example, button taps).
138
+ * @param listener Callback function to handle user interaction events.
139
+ * @return An event subscription that can be used to remove the listener.
140
+ */
141
+ export function addUserInteractionListener(listener) {
142
+ return ExpoWidgetsModule.addListener('onExpoWidgetsUserInteraction', listener);
143
+ }
144
+ /**
145
+ * Adds a listener for push-to-start token events.
146
+ * This token can be used to start live activities remotely via APNs.
147
+ * @param listener Callback function to handle push-to-start token events.
148
+ * @return An event subscription that can be used to remove the listener.
149
+ */
150
+ export function addPushToStartTokenListener(listener) {
151
+ return ExpoWidgetsModule.addListener('onExpoWidgetsPushToStartTokenReceived', listener);
152
+ }
153
+ /**
154
+ * A directory that can be used to store shared images for widgets.
155
+ * The contents of this directory are accessible by both the main app and widgets.
156
+ */
157
+ export const widgetsDirectory = ExpoWidgetsModule.widgetsDirectory;
158
+ //# sourceMappingURL=Widgets.js.map
@@ -0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