craft-native 0.0.55 → 0.0.74

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 (146) hide show
  1. package/dist/android/src/index.d.ts +73 -0
  2. package/dist/android/src/index.js +177 -37
  3. package/dist/android/templates/AndroidManifest.xml.template +10 -36
  4. package/dist/android/templates/CraftBridge.kt.template +192 -60
  5. package/dist/android/templates/CraftHealthConnect.kt.template +200 -0
  6. package/dist/android/templates/CraftHealthConnectStub.kt.template +28 -0
  7. package/dist/android/templates/LocationRecordingService.kt.template +160 -0
  8. package/dist/android/templates/MainActivity.kt.template +140 -19
  9. package/dist/android/templates/build.gradle.kts.app.template +23 -1
  10. package/dist/android/templates/build.gradle.kts.project.template +3 -2
  11. package/dist/android/templates/proguard-rules.pro.template +9 -0
  12. package/dist/api/android-advanced.d.ts +5 -6
  13. package/dist/api/app.d.ts +0 -1
  14. package/dist/api/clipboard.d.ts +0 -1
  15. package/dist/api/crypto.d.ts +1 -2
  16. package/dist/api/db.d.ts +1 -2
  17. package/dist/api/dialog.d.ts +0 -1
  18. package/dist/api/fs.d.ts +1 -2
  19. package/dist/api/gestures.d.ts +66 -0
  20. package/dist/api/http.d.ts +1 -2
  21. package/dist/api/index.d.ts +37 -34
  22. package/dist/api/ios-advanced.d.ts +6 -7
  23. package/dist/api/macos-advanced.d.ts +2 -3
  24. package/dist/api/media.d.ts +0 -1
  25. package/dist/api/mobile.d.ts +109 -1
  26. package/dist/api/process.d.ts +0 -1
  27. package/dist/api/sidebar.d.ts +3 -20
  28. package/dist/api/spaces.d.ts +83 -0
  29. package/dist/api/tray.d.ts +2 -3
  30. package/dist/api/window.d.ts +1 -2
  31. package/dist/api/windows-advanced.d.ts +6 -7
  32. package/dist/assets/index.d.ts +0 -1
  33. package/dist/binary-resolver.d.ts +23 -1
  34. package/dist/bridge/android.d.ts +0 -1
  35. package/dist/bridge/core.d.ts +0 -38
  36. package/dist/bridge/ids.d.ts +0 -1
  37. package/dist/bridge/ios.d.ts +0 -1
  38. package/dist/bridge/webkit-pending.d.ts +0 -1
  39. package/dist/build/bundle-optimizer.d.ts +0 -1
  40. package/dist/cli.js +666 -90
  41. package/dist/components/index.d.ts +6 -7
  42. package/dist/components/native.d.ts +0 -1
  43. package/dist/components/sidebar.d.ts +2 -81
  44. package/dist/dev/devtools.d.ts +0 -1
  45. package/dist/dev/error-overlay.d.ts +0 -1
  46. package/dist/dev/hot-reload.d.ts +0 -1
  47. package/dist/index.cjs +113 -3
  48. package/dist/index.d.cts +16 -16
  49. package/dist/index.d.ts +16 -16
  50. package/dist/index.js +112 -4
  51. package/dist/ios/src/index.d.ts +172 -0
  52. package/dist/ios/src/index.js +440 -42
  53. package/dist/ios/templates/CraftActivityAttributes.swift +14 -0
  54. package/dist/ios/templates/CraftApp.swift +1001 -73
  55. package/dist/ios/templates/CraftLiveActivityWidget.swift.template +62 -0
  56. package/dist/ios/templates/CraftWatchApp.swift.template +155 -0
  57. package/dist/ios/templates/Info.plist.template +10 -9
  58. package/dist/ios/templates/WatchApp.Info.plist.template +26 -0
  59. package/dist/ios/templates/WidgetExtension.Info.plist +31 -0
  60. package/dist/ios/templates/project.yml.template +12 -1
  61. package/dist/logging/index.d.ts +0 -1
  62. package/dist/mobile.d.ts +8 -0
  63. package/dist/mobile.js +755 -0
  64. package/dist/optimizations/index.d.ts +3 -4
  65. package/dist/package.d.ts +11 -1
  66. package/dist/performance/runtime.d.ts +0 -1
  67. package/dist/performance/startup.d.ts +0 -1
  68. package/dist/plugins/index.d.ts +0 -1
  69. package/dist/security/index.d.ts +0 -1
  70. package/dist/sidebar-types.d.ts +102 -0
  71. package/dist/signing/index.d.ts +0 -1
  72. package/dist/styles/headwind.d.ts +0 -1
  73. package/dist/styles/index.d.ts +9 -10
  74. package/dist/styles/sidebar-templates.d.ts +0 -1
  75. package/dist/styles/sidebars.d.ts +0 -1
  76. package/dist/types.d.ts +131 -1
  77. package/dist/updater/index.d.ts +0 -1
  78. package/dist/utils/audio.d.ts +0 -1
  79. package/dist/utils/index.d.ts +4 -5
  80. package/dist/utils/native.d.ts +1 -2
  81. package/dist/utils/react.d.ts +0 -1
  82. package/dist/utils/storage.d.ts +0 -1
  83. package/dist/utils/svelte.d.ts +0 -1
  84. package/dist/utils/timer.d.ts +0 -1
  85. package/dist/utils/vue.d.ts +0 -1
  86. package/package.json +32 -4
  87. package/dist/android/src/index.js.map +0 -10
  88. package/dist/api/android-advanced.d.ts.map +0 -1
  89. package/dist/api/app.d.ts.map +0 -1
  90. package/dist/api/clipboard.d.ts.map +0 -1
  91. package/dist/api/crypto.d.ts.map +0 -1
  92. package/dist/api/db.d.ts.map +0 -1
  93. package/dist/api/dialog.d.ts.map +0 -1
  94. package/dist/api/fs.d.ts.map +0 -1
  95. package/dist/api/http.d.ts.map +0 -1
  96. package/dist/api/index.d.ts.map +0 -1
  97. package/dist/api/ios-advanced.d.ts.map +0 -1
  98. package/dist/api/macos-advanced.d.ts.map +0 -1
  99. package/dist/api/media.d.ts.map +0 -1
  100. package/dist/api/mobile.d.ts.map +0 -1
  101. package/dist/api/process.d.ts.map +0 -1
  102. package/dist/api/sidebar.d.ts.map +0 -1
  103. package/dist/api/tray.d.ts.map +0 -1
  104. package/dist/api/window.d.ts.map +0 -1
  105. package/dist/api/windows-advanced.d.ts.map +0 -1
  106. package/dist/assets/index.d.ts.map +0 -1
  107. package/dist/binary-resolver.d.ts.map +0 -1
  108. package/dist/bridge/android.d.ts.map +0 -1
  109. package/dist/bridge/core.d.ts.map +0 -1
  110. package/dist/bridge/ids.d.ts.map +0 -1
  111. package/dist/bridge/ios.d.ts.map +0 -1
  112. package/dist/bridge/webkit-pending.d.ts.map +0 -1
  113. package/dist/build/bundle-optimizer.d.ts.map +0 -1
  114. package/dist/components/index.d.ts.map +0 -1
  115. package/dist/components/native.d.ts.map +0 -1
  116. package/dist/components/sidebar.d.ts.map +0 -1
  117. package/dist/dev/devtools.d.ts.map +0 -1
  118. package/dist/dev/error-overlay.d.ts.map +0 -1
  119. package/dist/dev/hot-reload.d.ts.map +0 -1
  120. package/dist/index.d.ts.map +0 -1
  121. package/dist/index.js.map +0 -45
  122. package/dist/ios/src/index.js.map +0 -10
  123. package/dist/logging/index.d.ts.map +0 -1
  124. package/dist/optimizations/index.d.ts.map +0 -1
  125. package/dist/package.d.ts.map +0 -1
  126. package/dist/package.test.d.ts +0 -2
  127. package/dist/package.test.d.ts.map +0 -1
  128. package/dist/performance/runtime.d.ts.map +0 -1
  129. package/dist/performance/startup.d.ts.map +0 -1
  130. package/dist/plugins/index.d.ts.map +0 -1
  131. package/dist/security/index.d.ts.map +0 -1
  132. package/dist/signing/index.d.ts.map +0 -1
  133. package/dist/styles/headwind.d.ts.map +0 -1
  134. package/dist/styles/index.d.ts.map +0 -1
  135. package/dist/styles/sidebar-templates.d.ts.map +0 -1
  136. package/dist/styles/sidebars.d.ts.map +0 -1
  137. package/dist/types.d.ts.map +0 -1
  138. package/dist/updater/index.d.ts.map +0 -1
  139. package/dist/utils/audio.d.ts.map +0 -1
  140. package/dist/utils/index.d.ts.map +0 -1
  141. package/dist/utils/native.d.ts.map +0 -1
  142. package/dist/utils/react.d.ts.map +0 -1
  143. package/dist/utils/storage.d.ts.map +0 -1
  144. package/dist/utils/svelte.d.ts.map +0 -1
  145. package/dist/utils/timer.d.ts.map +0 -1
  146. package/dist/utils/vue.d.ts.map +0 -1
@@ -2,37 +2,40 @@
2
2
  * Craft API Modules
3
3
  * Native APIs available in Craft applications
4
4
  */
5
- export { windowManager, win, window, createWindow, Window } from './window';
6
- export type { WindowPosition, WindowSize, WindowBounds, WindowState, WindowCreateOptions, WindowEventType, WindowEventMap, WindowEventHandler } from './window';
7
- export { trayManager, tray, SystemTray, MenubarApp, createMenubarApp, buildMenu, separator, menuItem, checkbox, submenu } from './tray';
8
- export type { MenuItem, TrayClickEvent, TrayOptions, MenubarAppConfig, TrayEventType, TrayEventMap, TrayEventHandler } from './tray';
9
- export { appManager, app, quit, hide, show, focus, hideDockIcon, showDockIcon, setBadge, getInfo, getVersion, getName, getPath, isDarkMode, getLocale, notify, registerShortcut, unregisterShortcut } from './app';
10
- export type { AppInfo, SystemPreferences, DisplayInfo, BadgeOptions, NotificationOptions, AppEventType, AppEventMap, AppEventHandler, ShortcutHandler } from './app';
11
- export { fs, readBinaryFile, writeBinaryFile, stat, copy, move, watch } from './fs';
12
- export type { FileStats } from './fs';
13
- export { db, openDatabase, Database, KeyValueStore } from './db';
14
- export type { ExecuteResult, TableColumn } from './db';
15
- export { http, HttpClient, WebSocketClient, createClient, HttpError } from './http';
16
- export type { HttpClientOptions, RequestOptions, HttpResponse, WebSocketOptions } from './http';
17
- export { crypto, uuid, randomString, hmac, timingSafeEqual, hashPassword, verifyPassword } from './crypto';
18
- export { env, getPlatform, isDesktop, isMobile, isCraft, getSystemInfo, exec, spawn, ChildProcess, cwd, homeDir, tempDir, exit, argv, open } from './process';
19
- export type { Platform, SystemInfo, ExecOptions, ExecResult, SpawnOptions } from './process';
20
- export { device, haptics, permissions, camera, biometrics, secureStorage, location, share, lifecycle, notifications, notifications as notification } from './mobile';
21
- export type { DeviceInfo, DeviceCapabilities, HapticStyle, HapticNotificationType, PermissionType, PermissionStatus, CameraOptions as MobileCameraOptions, PhotoResult, BiometricType, Location, LocationOptions, ShareOptions, AppState, NotificationOptions as MobileNotificationOptions } from './mobile';
22
- export { carplay, appClips, liveActivities, sharePlay, storeKit, appIntents, tipKit, focusFilters } from './ios-advanced';
23
- export type { CarPlayTemplateType, CarPlayListItem, CarPlayGridItem, CarPlayTemplate, AppClipInvocation, LiveActivityContentState, LiveActivityAttributes, LiveActivityConfig, SharePlaySessionState, SharePlayParticipant, SharePlayActivity, ProductType, Product, Transaction, IntentParameterType, IntentParameter, AppIntent, TipDisplayFrequency, Tip, FocusStatus, FocusFilter } from './ios-advanced';
24
- export { materialYou, photoPicker, workManager, foregroundService, predictiveBack, appLanguage, widgets as androidWidgets, playBilling } from './android-advanced';
25
- export type { MaterialYouColors, PhotoPickerMediaType, PhotoPickerResult, WorkConstraints, WorkRequest, WorkInfo, ForegroundServiceType, ForegroundNotification, BackEvent, WidgetSizeClass, WidgetConfig, WidgetData, PlayProduct, PlayPurchase } from './android-advanced';
26
- export { touchBar, desktopWidgets, stageManager, handoff, sidecar, spotlight, quickActions, shareExtension, windowManagement } from './macos-advanced';
27
- export type { TouchBarItemType, TouchBarButton, TouchBarLabel, TouchBarSlider, TouchBarColorPicker, TouchBarScrubber, TouchBarSegmentedControl, TouchBarPopover, TouchBarSpacer, TouchBarGroup, TouchBarItem, WidgetFamily, WidgetTimelineEntry, WidgetConfiguration, UserActivity, SidecarDevice, SpotlightItem, QuickAction, WindowTabGroup } from './macos-advanced';
28
- export { jumpList, taskbarProgress, toastNotifications, windowsHello, windowsWidgets, msixUpdate, shareTarget, startupTask, secondaryTiles } from './windows-advanced';
29
- export type { JumpListTask, JumpListCategory, TaskbarProgressState, ToastAction, ToastInput, ToastContent, WindowsHelloAvailability, WidgetTemplateType, WindowsWidgetContent, PackageVersion, UpdateInfo, SharedDataItem, SecondaryTile } from './windows-advanced';
30
- export { dialog, openFile, openFolder, saveFile, showAlert, showConfirm, showPrompt } from './dialog';
31
- export type { FileFilter, OpenDialogOptions, SaveDialogOptions, AlertStyle, AlertOptions, ConfirmOptions, OpenDialogResult, SaveDialogResult } from './dialog';
32
- export { clipboard, writeText, readText, writeHTML, readHTML } from './clipboard';
33
- export type { ClipboardFormat, ClipboardData } from './clipboard';
34
- export { media } from './media';
35
- export type { MediaDeviceInfo, CameraOptions as MediaCameraOptions, MicrophoneOptions, MediaStreamOptions } from './media';
36
- export { Sidebar, createSidebar, createFileSidebar, createSettingsSidebar, sidebar } from './sidebar';
37
- export type { SidebarItem, SidebarSection, SidebarConfig, MacOSSidebarConfig, WindowsSidebarConfig, LinuxSidebarConfig, SidebarSelectEvent, SidebarSearchEvent } from './sidebar';
38
- //# sourceMappingURL=index.d.ts.map
5
+ export { windowManager, win, window, createWindow, Window } from './window.js';
6
+ export type { WindowPosition, WindowSize, WindowBounds, WindowState, WindowCreateOptions, WindowEventType, WindowEventMap, WindowEventHandler } from './window.js';
7
+ export { trayManager, tray, SystemTray, MenubarApp, createMenubarApp, buildMenu, separator, menuItem, checkbox, submenu } from './tray.js';
8
+ export type { MenuItem, TrayClickEvent, TrayOptions, MenubarAppConfig, TrayEventType, TrayEventMap, TrayEventHandler } from './tray.js';
9
+ export { appManager, app, quit, hide, show, focus, hideDockIcon, showDockIcon, setBadge, getInfo, getVersion, getName, getPath, isDarkMode, getLocale, notify, registerShortcut, unregisterShortcut } from './app.js';
10
+ export type { AppInfo, SystemPreferences, DisplayInfo, BadgeOptions, NotificationOptions, AppEventType, AppEventMap, AppEventHandler, ShortcutHandler } from './app.js';
11
+ export { fs, readBinaryFile, writeBinaryFile, stat, copy, move, watch } from './fs.js';
12
+ export type { FileStats } from './fs.js';
13
+ export { db, openDatabase, Database, KeyValueStore } from './db.js';
14
+ export type { ExecuteResult, TableColumn } from './db.js';
15
+ export { http, HttpClient, WebSocketClient, createClient, HttpError } from './http.js';
16
+ export type { HttpClientOptions, RequestOptions, HttpResponse, WebSocketOptions } from './http.js';
17
+ export { crypto, uuid, randomString, hmac, timingSafeEqual, hashPassword, verifyPassword } from './crypto.js';
18
+ export { env, getPlatform, isDesktop, isMobile, isCraft, getSystemInfo, exec, spawn, ChildProcess, cwd, homeDir, tempDir, exit, argv, open } from './process.js';
19
+ export type { Platform, SystemInfo, ExecOptions, ExecResult, SpawnOptions } from './process.js';
20
+ export { device, haptics, permissions, camera, biometrics, secureStorage, location, share, lifecycle, notifications, notifications as notification } from './mobile.js';
21
+ export type { DeviceInfo, DeviceCapabilities, HapticStyle, HapticNotificationType, PermissionType, PermissionStatus, CameraOptions as MobileCameraOptions, PhotoResult, BiometricType, Location, LocationOptions, ShareOptions, AppState, NotificationOptions as MobileNotificationOptions } from './mobile.js';
22
+ export { carplay, appClips, liveActivities, sharePlay, storeKit, appIntents, tipKit, focusFilters } from './ios-advanced.js';
23
+ export type { CarPlayTemplateType, CarPlayListItem, CarPlayGridItem, CarPlayTemplate, AppClipInvocation, LiveActivityContentState, LiveActivityAttributes, LiveActivityConfig, SharePlaySessionState, SharePlayParticipant, SharePlayActivity, ProductType, Product, Transaction, IntentParameterType, IntentParameter, AppIntent, TipDisplayFrequency, Tip, FocusStatus, FocusFilter } from './ios-advanced.js';
24
+ export { materialYou, photoPicker, workManager, foregroundService, predictiveBack, appLanguage, widgets as androidWidgets, playBilling } from './android-advanced.js';
25
+ export type { MaterialYouColors, PhotoPickerMediaType, PhotoPickerResult, WorkConstraints, WorkRequest, WorkInfo, ForegroundServiceType, ForegroundNotification, BackEvent, WidgetSizeClass, WidgetConfig, WidgetData, PlayProduct, PlayPurchase } from './android-advanced.js';
26
+ export { touchBar, desktopWidgets, stageManager, handoff, sidecar, spotlight, quickActions, shareExtension, windowManagement } from './macos-advanced.js';
27
+ export type { TouchBarItemType, TouchBarButton, TouchBarLabel, TouchBarSlider, TouchBarColorPicker, TouchBarScrubber, TouchBarSegmentedControl, TouchBarPopover, TouchBarSpacer, TouchBarGroup, TouchBarItem, WidgetFamily, WidgetTimelineEntry, WidgetConfiguration, UserActivity, SidecarDevice, SpotlightItem, QuickAction, WindowTabGroup } from './macos-advanced.js';
28
+ export { jumpList, taskbarProgress, toastNotifications, windowsHello, windowsWidgets, msixUpdate, shareTarget, startupTask, secondaryTiles } from './windows-advanced.js';
29
+ export type { JumpListTask, JumpListCategory, TaskbarProgressState, ToastAction, ToastInput, ToastContent, WindowsHelloAvailability, WidgetTemplateType, WindowsWidgetContent, PackageVersion, UpdateInfo, SharedDataItem, SecondaryTile } from './windows-advanced.js';
30
+ export { dialog, openFile, openFolder, saveFile, showAlert, showConfirm, showPrompt } from './dialog.js';
31
+ export type { FileFilter, OpenDialogOptions, SaveDialogOptions, AlertStyle, AlertOptions, ConfirmOptions, OpenDialogResult, SaveDialogResult } from './dialog.js';
32
+ export { clipboard, writeText, readText, writeHTML, readHTML } from './clipboard.js';
33
+ export type { ClipboardFormat, ClipboardData } from './clipboard.js';
34
+ export { media } from './media.js';
35
+ export type { MediaDeviceInfo, CameraOptions as MediaCameraOptions, MicrophoneOptions, MediaStreamOptions } from './media.js';
36
+ export { Sidebar, createSidebar, createFileSidebar, createSettingsSidebar, sidebar } from './sidebar.js';
37
+ export type { SidebarItem, SidebarSection, SidebarConfig, MacOSSidebarConfig, WindowsSidebarConfig, LinuxSidebarConfig, SidebarSelectEvent, SidebarSearchEvent } from './sidebar.js';
38
+ export { spaces, createSpacesSidebar, hasNativeSpaces } from './spaces.js';
39
+ export type { SpaceDescriptor, SpacesSidebarOptions, SpacesSidebarHandle, NativeUIAPI } from './spaces.js';
40
+ export { gestures, onSwipe, hasNativeGestures } from './gestures.js';
41
+ export type { SwipeAxis, SwipePhase, SwipeEvent, SwipeListener, Unsubscribe } from './gestures.js';
@@ -271,7 +271,7 @@ export declare const liveActivities: {
271
271
  /**
272
272
  * End a Live Activity.
273
273
  */
274
- end(activityId: string, finalContentState?: LiveActivityContentState, dismissalPolicy?: "immediate" | "default" | "after"): Promise<void>;
274
+ end(activityId: string, finalContentState?: LiveActivityContentState, dismissalPolicy?: 'immediate' | 'default' | 'after'): Promise<void>;
275
275
  /**
276
276
  * Get all active Live Activities.
277
277
  */
@@ -503,11 +503,11 @@ export declare const storeKit: {
503
503
  * Get subscription status.
504
504
  */
505
505
  getSubscriptionStatus(groupId: string): Promise<{
506
- state: "subscribed" | "expired" | "inBillingRetry" | "inGracePeriod" | "revoked";
506
+ state: 'subscribed' | 'expired' | 'inBillingRetry' | 'inGracePeriod' | 'revoked';
507
507
  renewalInfo?: {
508
508
  willAutoRenew: boolean;
509
509
  autoRenewProductId: string;
510
- expirationIntent?: "cancelled" | "billingError" | "priceIncrease" | "productNotAvailable";
510
+ expirationIntent?: 'cancelled' | 'billingError' | 'priceIncrease' | 'productNotAvailable';
511
511
  };
512
512
  } | null>;
513
513
  /**
@@ -521,7 +521,7 @@ export declare const storeKit: {
521
521
  /**
522
522
  * Present refund request sheet.
523
523
  */
524
- beginRefundRequest(transactionId: string): Promise<"success" | "userCancelled" | "failed">;
524
+ beginRefundRequest(transactionId: string): Promise<'success' | 'userCancelled' | 'failed'>;
525
525
  /**
526
526
  * Listen for transaction updates.
527
527
  */
@@ -706,7 +706,7 @@ export declare const tipKit: {
706
706
  */
707
707
  configure(options: {
708
708
  displayFrequency?: TipDisplayFrequency;
709
- datastoreLocation?: "applicationDefault" | "groupContainer";
709
+ datastoreLocation?: 'applicationDefault' | 'groupContainer';
710
710
  }): Promise<void>;
711
711
  /**
712
712
  * Register a tip.
@@ -793,7 +793,7 @@ export declare const focusFilters: {
793
793
  /**
794
794
  * Check Focus authorization status.
795
795
  */
796
- getAuthorizationStatus(): Promise<"notDetermined" | "denied" | "authorized">;
796
+ getAuthorizationStatus(): Promise<'notDetermined' | 'denied' | 'authorized'>;
797
797
  /**
798
798
  * Request Focus authorization.
799
799
  */
@@ -830,4 +830,3 @@ declare const iosAdvanced: {
830
830
  focusFilters: typeof focusFilters;
831
831
  };
832
832
  export default iosAdvanced;
833
- //# sourceMappingURL=ios-advanced.d.ts.map
@@ -240,7 +240,7 @@ export declare const desktopWidgets: {
240
240
  }) => Promise<{
241
241
  entries: WidgetTimelineEntry[];
242
242
  policy: {
243
- type: "atEnd" | "never" | "after";
243
+ type: 'atEnd' | 'never' | 'after';
244
244
  date?: Date;
245
245
  };
246
246
  }>): void;
@@ -590,7 +590,7 @@ export declare const shareExtension: {
590
590
  * Handle receiving shared items.
591
591
  */
592
592
  onReceive(handler: (items: Array<{
593
- type: "text" | "url" | "image" | "file";
593
+ type: 'text' | 'url' | 'image' | 'file';
594
594
  text?: string;
595
595
  url?: string;
596
596
  filePath?: string;
@@ -718,4 +718,3 @@ declare const macosAdvanced: {
718
718
  windowManagement: typeof windowManagement;
719
719
  };
720
720
  export default macosAdvanced;
721
- //# sourceMappingURL=macos-advanced.d.ts.map
@@ -230,4 +230,3 @@ export declare const media: {
230
230
  _buildAudioConstraints(options: MicrophoneOptions): MediaTrackConstraints;
231
231
  };
232
232
  export default media;
233
- //# sourceMappingURL=media.d.ts.map
@@ -86,6 +86,8 @@ export interface DeviceCapabilities {
86
86
  bluetooth: boolean;
87
87
  /** Has GPS */
88
88
  gps: boolean;
89
+ /** Can continue location recording in the background */
90
+ backgroundLocation?: boolean;
89
91
  /** Has accelerometer */
90
92
  accelerometer: boolean;
91
93
  /** Has gyroscope */
@@ -459,6 +461,16 @@ export interface LocationOptions {
459
461
  /** Maximum age of cached position in milliseconds */
460
462
  maximumAge?: number;
461
463
  }
464
+ export interface LocationRecordingState {
465
+ id: string | null;
466
+ active: boolean;
467
+ paused: boolean;
468
+ startedAt: number | null;
469
+ sampleCount?: number;
470
+ }
471
+ export interface LocationRecordingResult extends LocationRecordingState {
472
+ locations: Location[];
473
+ }
462
474
  /**
463
475
  * Location API.
464
476
  *
@@ -499,6 +511,12 @@ export declare const location: {
499
511
  * @param watchId - Watch ID returned from watchPosition
500
512
  */
501
513
  clearWatch(watchId: number): void;
514
+ startRecording(options?: LocationOptions): Promise<LocationRecordingState>;
515
+ pauseRecording(): Promise<LocationRecordingState>;
516
+ resumeRecording(): Promise<LocationRecordingState>;
517
+ stopRecording(): Promise<LocationRecordingResult>;
518
+ getRecordingState(): Promise<LocationRecordingState>;
519
+ readRecording(): Promise<Location[]>;
502
520
  };
503
521
  /**
504
522
  * Share options.
@@ -642,6 +660,89 @@ export declare const notifications: {
642
660
  */
643
661
  setBadge(count: number): Promise<void>;
644
662
  };
663
+ export interface NetworkStatus {
664
+ type: 'wifi' | 'cellular' | 'ethernet' | 'none' | 'unknown';
665
+ isConnected: boolean;
666
+ }
667
+ export declare const keepAwake: {
668
+ enable(): Promise<void>;
669
+ disable(): Promise<void>;
670
+ };
671
+ export declare const deepLinks: {
672
+ getInitialURL(): Promise<string | null>;
673
+ onLink(callback: (url: string) => void): () => void;
674
+ };
675
+ export declare function normalizeDeepLinkURL(value: unknown): string | null;
676
+ export declare const network: {
677
+ getStatus(): Promise<NetworkStatus>;
678
+ onChange(callback: (status: NetworkStatus) => void): () => void;
679
+ };
680
+ export declare const appReview: {
681
+ request(): Promise<boolean>;
682
+ };
683
+ export declare const pushNotifications: {
684
+ register(): Promise<string>;
685
+ onToken(callback: (token: string) => void): () => void;
686
+ onNotification(callback: (data: Record<string, unknown>) => void): () => void;
687
+ };
688
+ export type HealthDataType = 'steps' | 'heartRate' | 'activeEnergy' | 'distance' | 'workouts';
689
+ export interface HealthDataOptions {
690
+ startDate?: number;
691
+ endDate?: number;
692
+ }
693
+ export interface HealthDataResult {
694
+ value: number;
695
+ unit: string;
696
+ }
697
+ export type HealthWorkoutType = 'running' | 'walking' | 'hiking' | 'cycling';
698
+ export interface HealthWorkoutLocation {
699
+ latitude: number;
700
+ longitude: number;
701
+ altitude?: number;
702
+ accuracy?: number;
703
+ timestamp: number;
704
+ }
705
+ export interface HealthWorkout {
706
+ activityId: string;
707
+ type: HealthWorkoutType;
708
+ startDate: number;
709
+ endDate: number;
710
+ distanceMeters?: number;
711
+ activeEnergyCalories?: number;
712
+ locations?: HealthWorkoutLocation[];
713
+ }
714
+ export interface HealthWorkoutResult {
715
+ id: string;
716
+ }
717
+ export declare const health: {
718
+ requestAuthorization(types: HealthDataType[]): Promise<boolean>;
719
+ getData(type: HealthDataType, options?: HealthDataOptions): Promise<HealthDataResult>;
720
+ saveWorkout(workout: HealthWorkout): Promise<HealthWorkoutResult>;
721
+ };
722
+ export interface LiveActivityState {
723
+ status?: string;
724
+ distanceMeters?: number;
725
+ durationSeconds?: number;
726
+ progress?: number;
727
+ }
728
+ export interface LiveActivityOptions extends LiveActivityState {
729
+ activityId: string;
730
+ title: string;
731
+ }
732
+ export declare const liveActivities: {
733
+ start(options: LiveActivityOptions): Promise<{
734
+ id: string;
735
+ }>;
736
+ update(state: LiveActivityState): Promise<void>;
737
+ end(): Promise<void>;
738
+ };
739
+ export declare const watchConnectivity: {
740
+ send(message: Record<string, unknown>): Promise<Record<string, unknown>>;
741
+ updateContext(context: Record<string, unknown>): Promise<void>;
742
+ isReachable(): Promise<boolean>;
743
+ onMessage(callback: (message: Record<string, unknown>) => void): () => void;
744
+ onReachabilityChange(callback: (reachable: boolean) => void): () => void;
745
+ };
645
746
  declare const mobile: {
646
747
  device: typeof device;
647
748
  haptics: typeof haptics;
@@ -653,6 +754,13 @@ declare const mobile: {
653
754
  share: typeof share;
654
755
  lifecycle: typeof lifecycle;
655
756
  notifications: typeof notifications;
757
+ keepAwake: typeof keepAwake;
758
+ deepLinks: typeof deepLinks;
759
+ network: typeof network;
760
+ appReview: typeof appReview;
761
+ pushNotifications: typeof pushNotifications;
762
+ health: typeof health;
763
+ liveActivities: typeof liveActivities;
764
+ watchConnectivity: typeof watchConnectivity;
656
765
  };
657
766
  export default mobile;
658
- //# sourceMappingURL=mobile.d.ts.map
@@ -165,4 +165,3 @@ declare const processApi: {
165
165
  open: typeof open;
166
166
  };
167
167
  export default processApi;
168
- //# sourceMappingURL=process.d.ts.map
@@ -4,25 +4,9 @@
4
4
  * on macOS, Windows, and Linux.
5
5
  * @module @craft-native/api/sidebar
6
6
  */
7
- export interface SidebarItem {
8
- id: string;
9
- label: string;
10
- icon?: string;
11
- badge?: string | number;
12
- selected?: boolean;
13
- children?: SidebarItem[];
14
- expanded?: boolean;
15
- enabled?: boolean;
16
- tintColor?: string;
17
- tooltip?: string;
18
- }
19
- export interface SidebarSection {
20
- id: string;
21
- title?: string;
22
- items: SidebarItem[];
23
- collapsible?: boolean;
24
- collapsed?: boolean;
25
- }
7
+ export type { SidebarItem, SidebarSection } from '../sidebar-types.js';
8
+ export { isSidebarItemDisabled } from '../sidebar-types.js';
9
+ import type { SidebarItem, SidebarSection } from '../sidebar-types.js';
26
10
  export interface SidebarConfig {
27
11
  /** Sidebar width in pixels */
28
12
  width?: number;
@@ -122,4 +106,3 @@ export declare const sidebar: {
122
106
  Sidebar: typeof Sidebar;
123
107
  };
124
108
  export default sidebar;
125
- //# sourceMappingURL=sidebar.d.ts.map
@@ -0,0 +1,83 @@
1
+ /**
2
+ * @fileoverview Native switcher for Arc-style sidebar spaces
3
+ * @description Publishes a space list to a real control in the window chrome —
4
+ * an NSSegmentedControl in the titlebar on macOS — and reports back what the
5
+ * user picks.
6
+ *
7
+ * This is a *switcher*, not a second sidebar. The spaces, their rows and the
8
+ * swipe stay in the webview (see `@stacksjs/components`' `<Sidebar :spaces>`);
9
+ * only the chrome control is native. That is also why it does not collide with
10
+ * `api/sidebar`'s one-native-sidebar-per-window rule: a window can have both.
11
+ * @module @craft-native/api/spaces
12
+ */
13
+ export interface SpaceDescriptor {
14
+ /** Stable id. Also what comes back from `onSpaceChange`. */
15
+ id: string;
16
+ /** Shown on the native control. Falls back to `id`. */
17
+ label?: string;
18
+ /** SF Symbol name, where the host can render one. */
19
+ icon?: string;
20
+ /**
21
+ * Accent colour as `#rrggbb`. The host tints the selected segment with it so
22
+ * the window chrome agrees with the pane instead of staying neutral grey
23
+ * while the sidebar is deep blue.
24
+ */
25
+ tint?: string;
26
+ }
27
+ export interface SpacesSidebarOptions {
28
+ /** Supply one to keep a stable id across reloads; generated otherwise. */
29
+ id?: string;
30
+ /**
31
+ * Fewer than two and the native control stays hidden — one space renders as a
32
+ * single selected segment naming the space the user is already in. It is
33
+ * hidden rather than destroyed, so a later `setSpaces` with two or more
34
+ * brings it straight back.
35
+ */
36
+ spaces?: SpaceDescriptor[];
37
+ /** Which space opens selected. Defaults to the first. */
38
+ activeSpace?: string;
39
+ }
40
+ export interface SpacesSidebarHandle {
41
+ readonly id: string;
42
+ /** Fires when the user picks a space in the native control. */
43
+ onSpaceChange: (listener: (spaceId: string) => void) => SpacesSidebarHandle;
44
+ /**
45
+ * Replace the list. The active space is preserved **by id** when it survives
46
+ * the replacement, so reordering or inserting does not silently move the user
47
+ * to a different space.
48
+ */
49
+ setSpaces: (spaces: SpaceDescriptor[]) => SpacesSidebarHandle;
50
+ /** Follow a switch that happened in the webview, e.g. a swipe. */
51
+ setActiveSpace: (spaceId: string) => SpacesSidebarHandle;
52
+ destroy: () => void;
53
+ }
54
+ export interface NativeUIAPI {
55
+ createSpacesSidebar?: (options?: SpacesSidebarOptions) => SpacesSidebarHandle;
56
+ }
57
+ /**
58
+ * Whether this host can put a native space switcher in the window chrome.
59
+ *
60
+ * Unlike `hasNativeGestures`, this one is meaningful: `createSpacesSidebar` is
61
+ * only defined where the native UI bridge exists, so a `false` here really does
62
+ * mean the web rail should render itself.
63
+ */
64
+ export declare function hasNativeSpaces(): boolean;
65
+ /**
66
+ * Create the native switcher, or return `null` in a plain browser so callers
67
+ * can fall back to their own rail without a try/catch.
68
+ *
69
+ * @example
70
+ * ```ts
71
+ * const switcher = createSpacesSidebar({
72
+ * spaces: profiles.map(p => ({ id: p.id, label: p.name, tint: p.tint })),
73
+ * activeSpace: active.id,
74
+ * })
75
+ * switcher?.onSpaceChange(id => goToProfile(id))
76
+ * ```
77
+ */
78
+ export declare function createSpacesSidebar(options?: SpacesSidebarOptions): SpacesSidebarHandle | null;
79
+ /** Namespace form, for `import { spaces } from 'craft-native'`. */
80
+ export declare const spaces: {
81
+ hasNativeSpaces: () => boolean;
82
+ createSpacesSidebar: (options?: SpacesSidebarOptions) => SpacesSidebarHandle | null;
83
+ };
@@ -368,9 +368,9 @@ declare class TrayManager {
368
368
  /** Register menu action on main tray */
369
369
  onMenuAction: (actionId: string, handler: () => void) => (() => void);
370
370
  /** Register click handler on main tray */
371
- onClick: (handler: TrayEventHandler<"click">) => (() => void);
371
+ onClick: (handler: TrayEventHandler<'click'>) => (() => void);
372
372
  /** Register right-click handler on main tray */
373
- onRightClick: (handler: TrayEventHandler<"right-click">) => (() => void);
373
+ onRightClick: (handler: TrayEventHandler<'right-click'>) => (() => void);
374
374
  /** Toggle window on click */
375
375
  onClickToggleWindow: () => (() => void);
376
376
  }
@@ -407,4 +407,3 @@ export declare function checkbox(label: string, checked: boolean, options?: Omit
407
407
  */
408
408
  export declare function submenu(label: string, items: MenuItem[], options?: Omit<MenuItem, 'label' | 'type' | 'submenu'>): MenuItem;
409
409
  export default trayManager;
410
- //# sourceMappingURL=tray.d.ts.map
@@ -447,7 +447,7 @@ declare class WindowManager {
447
447
  /** Set current window background color */
448
448
  setBackgroundColor: (color: string) => Promise<void>;
449
449
  /** Set current window vibrancy (macOS) */
450
- setVibrancy: (vibrancy: WindowCreateOptions["vibrancy"] | null) => Promise<void>;
450
+ setVibrancy: (vibrancy: WindowCreateOptions['vibrancy'] | null) => Promise<void>;
451
451
  /** Set current window resizable */
452
452
  setResizable: (resizable: boolean) => Promise<void>;
453
453
  /** Start moving current window from a native pointer event */
@@ -477,4 +477,3 @@ export declare const window: WindowManager;
477
477
  export declare function createWindow(_options?: WindowCreateOptions): Promise<Window>;
478
478
  export declare function createWindow(_html: string, _options?: WindowCreateOptions): Promise<Window>;
479
479
  export default windowManager;
480
- //# sourceMappingURL=window.d.ts.map
@@ -133,7 +133,7 @@ export declare const taskbarProgress: {
133
133
  flash(options?: {
134
134
  count?: number;
135
135
  interval?: number;
136
- flags?: "all" | "caption" | "tray";
136
+ flags?: 'all' | 'caption' | 'tray';
137
137
  }): Promise<void>;
138
138
  /**
139
139
  * Stop flashing.
@@ -310,7 +310,7 @@ export declare const toastNotifications: {
310
310
  */
311
311
  onDismissed(handler: (args: {
312
312
  tag?: string;
313
- reason: "user" | "application" | "timeout";
313
+ reason: 'user' | 'application' | 'timeout';
314
314
  }) => void): void;
315
315
  };
316
316
  /**
@@ -354,7 +354,7 @@ export declare const windowsHello: {
354
354
  */
355
355
  authenticate(message: string): Promise<{
356
356
  success: boolean;
357
- error?: "canceled" | "notConfigured" | "notAllowed" | "unknown";
357
+ error?: 'canceled' | 'notConfigured' | 'notAllowed' | 'unknown';
358
358
  }>;
359
359
  /**
360
360
  * Create a Windows Hello credential.
@@ -610,11 +610,11 @@ export declare const startupTask: {
610
610
  /**
611
611
  * Get current startup state.
612
612
  */
613
- getState(): Promise<"disabled" | "disabledByUser" | "enabled" | "disabledByPolicy" | "enabledByPolicy">;
613
+ getState(): Promise<'disabled' | 'disabledByUser' | 'enabled' | 'disabledByPolicy' | 'enabledByPolicy'>;
614
614
  /**
615
615
  * Request enabling startup.
616
616
  */
617
- request(): Promise<"disabled" | "disabledByUser" | "enabled" | "disabledByPolicy" | "enabledByPolicy">;
617
+ request(): Promise<'disabled' | 'disabledByUser' | 'enabled' | 'disabledByPolicy' | 'enabledByPolicy'>;
618
618
  /**
619
619
  * Disable startup.
620
620
  */
@@ -694,7 +694,7 @@ export declare const secondaryTiles: {
694
694
  /**
695
695
  * Update tile badge.
696
696
  */
697
- updateBadge(tileId: string, value: number | "none" | "activity" | "alert" | "attention" | "available" | "away" | "busy" | "newMessage" | "paused" | "playing" | "unavailable" | "error"): Promise<void>;
697
+ updateBadge(tileId: string, value: number | 'none' | 'activity' | 'alert' | 'attention' | 'available' | 'away' | 'busy' | 'newMessage' | 'paused' | 'playing' | 'unavailable' | 'error'): Promise<void>;
698
698
  /**
699
699
  * Clear tile notification.
700
700
  */
@@ -716,4 +716,3 @@ declare const windowsAdvanced: {
716
716
  secondaryTiles: typeof secondaryTiles;
717
717
  };
718
718
  export default windowsAdvanced;
719
- //# sourceMappingURL=windows-advanced.d.ts.map
@@ -66,4 +66,3 @@ export declare class AssetOptimizer {
66
66
  }
67
67
  export declare function assetsCommand(args: string[]): Promise<void>;
68
68
  export default AssetOptimizer;
69
- //# sourceMappingURL=index.d.ts.map
@@ -30,10 +30,32 @@
30
30
  * `process.env.CRAFT_BIN`, or the bare `'craft'` for PATH lookup.
31
31
  */
32
32
  export declare function resolveCraftBinary(explicit?: string): string;
33
+ /**
34
+ * Set on the child environment whenever the CLI spawns what it believes is
35
+ * the native binary.
36
+ *
37
+ * `resolveCraftBinary()` returns the bare string `'craft'` and lets the OS
38
+ * resolve it, which is the pantry contract and stays that way. But `craft` on
39
+ * PATH is not always the native binary: install the SDK with a package manager
40
+ * that publishes a `bin` entry and PATH may resolve `craft` to this very CLI
41
+ * (`~/.bun/bin/craft`, a `#!/usr/bin/env bun` script). Spawning that re-enters
42
+ * the TypeScript entry point with native-binary flags, and the user sees
43
+ * `Unknown option --url` for an option they never typed.
44
+ *
45
+ * Probing for the binary elsewhere would answer it, but that is exactly the
46
+ * path-matrix behaviour the pantry contract exists to remove. So instead the
47
+ * spawn is marked, and a CLI that starts up already marked knows it *is* the
48
+ * thing that was spawned, and says so.
49
+ */
50
+ export declare const CRAFT_CLI_SPAWN_MARKER = "CRAFT_CLI_SPAWNED_FROM";
51
+ /**
52
+ * The message for that case. Names the offending PATH entry, because the whole
53
+ * difficulty of the original report was that nothing pointed at PATH at all.
54
+ */
55
+ export declare function craftBinaryIsCliShimMessage(spawnedFrom: string): string;
33
56
  /**
34
57
  * Build a deterministic, pantry-aware error for the case where the
35
58
  * spawn errored with ENOENT (binary not found on PATH). Used as the
36
59
  * `process.on('error', …)` handler in both the SDK and the CLI.
37
60
  */
38
61
  export declare function craftBinaryNotFoundMessage(triedPath: string): string;
39
- //# sourceMappingURL=binary-resolver.d.ts.map
@@ -571,4 +571,3 @@ export declare const android: {
571
571
  NativeComponents: AndroidNativeComponents;
572
572
  };
573
573
  export default android;
574
- //# sourceMappingURL=android.d.ts.map
@@ -230,40 +230,6 @@ export interface BridgeMethod<P = void, R = void> {
230
230
  export type InferParams<T> = T extends BridgeMethod<infer P, unknown> ? P : never;
231
231
  export type InferResult<T> = T extends BridgeMethod<unknown, infer R> ? R : never;
232
232
  export declare function createTypedBridge<T extends Record<string, BridgeMethod<any, any>>>(bridge: NativeBridge): { [K in keyof T]: (params: InferParams<T[K]>) => Promise<InferResult<T[K]>>; };
233
- export interface MenuItem {
234
- id: string;
235
- label: string;
236
- accelerator?: string;
237
- type?: 'normal' | 'separator' | 'checkbox' | 'radio';
238
- checked?: boolean;
239
- enabled?: boolean;
240
- visible?: boolean;
241
- icon?: string;
242
- submenu?: MenuItem[];
243
- }
244
- export declare class NativeMenus {
245
- private bridge;
246
- constructor(bridge: NativeBridge);
247
- /**
248
- * Set application menu
249
- */
250
- setApplicationMenu(menu: MenuItem[]): Promise<void>;
251
- /**
252
- * Show context menu
253
- */
254
- showContextMenu(menu: MenuItem[], position?: {
255
- x: number;
256
- y: number;
257
- }): Promise<string | null>;
258
- /**
259
- * Update menu item
260
- */
261
- updateMenuItem(id: string, updates: Partial<MenuItem>): Promise<void>;
262
- /**
263
- * Listen for menu item clicks
264
- */
265
- onMenuClick(callback: (id: string) => void): () => void;
266
- }
267
233
  export interface OpenDialogOptions {
268
234
  title?: string;
269
235
  defaultPath?: string;
@@ -455,7 +421,6 @@ export declare function createBridge(config?: BridgeConfig): NativeBridge;
455
421
  * created any pending work.
456
422
  */
457
423
  export declare function resetGlobalBridge(): void;
458
- export declare function getMenus(): NativeMenus;
459
424
  export declare function getDialogs(): NativeDialogs;
460
425
  export declare function getComponents(): NativeComponentBridge;
461
426
  declare const bridgeCore: {
@@ -463,14 +428,11 @@ declare const bridgeCore: {
463
428
  BridgeError: typeof BridgeError;
464
429
  BridgeErrorCodes: typeof BridgeErrorCodes;
465
430
  createTypedBridge: typeof createTypedBridge;
466
- NativeMenus: typeof NativeMenus;
467
431
  NativeDialogs: typeof NativeDialogs;
468
432
  NativeComponentBridge: typeof NativeComponentBridge;
469
433
  getBridge: typeof getBridge;
470
434
  createBridge: typeof createBridge;
471
- getMenus: typeof getMenus;
472
435
  getDialogs: typeof getDialogs;
473
436
  getComponents: typeof getComponents;
474
437
  };
475
438
  export default bridgeCore;
476
- //# sourceMappingURL=core.d.ts.map
@@ -15,4 +15,3 @@ export declare function secureUUID(): string;
15
15
  * Returns a prefixed, secure ID, e.g. `webview_3f7a…`.
16
16
  */
17
17
  export declare function secureId(prefix: string): string;
18
- //# sourceMappingURL=ids.d.ts.map
@@ -525,4 +525,3 @@ export declare const ios: {
525
525
  AppLifecycle: IOSAppLifecycle;
526
526
  };
527
527
  export default ios;
528
- //# sourceMappingURL=ios.d.ts.map
@@ -47,4 +47,3 @@ export declare function webkitRequest<T>(bucket: string, message: unknown, optio
47
47
  * error. Used by the test suite to assert that we don't leak closures.
48
48
  */
49
49
  export declare function _drainPendingForTests(error?: Error): number;
50
- //# sourceMappingURL=webkit-pending.d.ts.map