also looking at this
feat(ios): haptic, whose reason expired when ios_config landed
#134
18 files
+562
-163
| @@ -1145,13 +1145,33 @@ export interface PickedFile { | ||
| 1145 | 1145 | mimeType?: string; |
| 1146 | 1146 | } |
| 1147 | 1147 | |
| 1148 | /** | |
| 1149 | * A location fix, exactly as the bridge sends it. | |
| 1150 | * | |
| 1151 | * All eight fields are always present. The native dictionary is built | |
| 1152 | * unconditionally from `CLLocation`'s non-optional properties, so there is no | |
| 1153 | * path that omits one — and this type previously declared six of them, three | |
| 1154 | * of those optional, which left `altitudeAccuracy` and `timestamp` unreachable | |
| 1155 | * from TypeScript even though every fix carries them. | |
| 1156 | * | |
| 1157 | * `heading` and `speed` are `-1` when the device has no fix for them, which is | |
| 1158 | * CoreLocation's own sentinel rather than an absent key. Android has no | |
| 1159 | * geolocation surface, so nothing else fills this in. | |
| 1160 | */ | |
| 1148 | 1161 | export interface Position { |
| 1149 | 1162 | latitude: number; |
| 1150 | 1163 | longitude: number; |
| 1164 | /** Horizontal accuracy in metres. */ | |
| 1151 | 1165 | accuracy: number; |
| 1152 | altitude?: number; | |
| 1153 | speed?: number; | |
| 1154 | heading?: number; | |
| 1166 | altitude: number; | |
| 1167 | /** Vertical accuracy in metres. */ | |
| 1168 | altitudeAccuracy: number; | |
| 1169 | /** Course over ground in degrees, or `-1` when unavailable. */ | |
| 1170 | heading: number; | |
| 1171 | /** Metres per second, or `-1` when unavailable. */ | |
| 1172 | speed: number; | |
| 1173 | /** Milliseconds since the Unix epoch. */ | |
| 1174 | timestamp: number; | |
| 1155 | 1175 | } |
| 1156 | 1176 | |
| 1157 | 1177 | export interface Contact { |
| @@ -1378,12 +1398,29 @@ export interface CraftARPlaneEvent extends CustomEvent { | ||
| 1378 | 1398 | detail: ARPlaneEvent; |
| 1379 | 1399 | } |
| 1380 | 1400 | |
| 1401 | /** | |
| 1402 | * A home-screen quick action being tapped. | |
| 1403 | * | |
| 1404 | * **Never dispatched today.** `craft.shortcuts.set()` really does install the | |
| 1405 | * items and they appear in the long-press menu, but no template implements | |
| 1406 | * `application(_:performActionFor:completionHandler:)` or a scene-delegate | |
| 1407 | * equivalent, so a tap launches the app and stops there. A listener registered | |
| 1408 | * for this is never called. | |
| 1409 | */ | |
| 1381 | 1410 | export interface CraftShortcutEvent extends CustomEvent { |
| 1382 | 1411 | detail: { |
| 1383 | 1412 | type: string; |
| 1384 | 1413 | }; |
| 1385 | 1414 | } |
| 1386 | 1415 | |
| 1416 | /** | |
| 1417 | * A donated Siri shortcut being invoked. | |
| 1418 | * | |
| 1419 | * **Never dispatched today.** `craft.siri.register()` donates an | |
| 1420 | * `NSUserActivity`, but the only `onContinueUserActivity` in the template is | |
| 1421 | * bound to `NSUserActivityTypeBrowsingWeb` and routes to the deep-link | |
| 1422 | * handler, so invoking a donated shortcut relaunches the app and is dropped. | |
| 1423 | */ | |
| 1387 | 1424 | export interface CraftSiriShortcutEvent extends CustomEvent { |
| 1388 | 1425 | detail: SiriInvocationEvent; |
| 1389 | 1426 | } |
| @@ -1402,13 +1439,38 @@ export interface CraftWatchContextEvent extends CustomEvent { | ||
| 1402 | 1439 | detail: Record<string, any>; |
| 1403 | 1440 | } |
| 1404 | 1441 | |
| 1405 | export interface CraftVoiceActionEvent extends CustomEvent { | |
| 1442 | export interface CraftLocationUpdateEvent extends CustomEvent { | |
| 1443 | detail: Position; | |
| 1444 | } | |
| 1445 | ||
| 1446 | export interface CraftLocationErrorEvent extends CustomEvent { | |
| 1406 | 1447 | detail: { |
| 1407 | action: string; | |
| 1408 | data?: string; | |
| 1448 | message: string; | |
| 1409 | 1449 | }; |
| 1410 | 1450 | } |
| 1411 | 1451 | |
| 1452 | export interface CraftNetworkChangeEvent extends CustomEvent { | |
| 1453 | detail: NetworkStatus; | |
| 1454 | } | |
| 1455 | ||
| 1456 | export interface CraftPushTokenEvent extends CustomEvent { | |
| 1457 | detail: { | |
| 1458 | token: string; | |
| 1459 | }; | |
| 1460 | } | |
| 1461 | ||
| 1462 | /** | |
| 1463 | * The `userInfo` of the notification the user acted on, forwarded verbatim. | |
| 1464 | * The bridge does not reshape it, so its keys are whatever was scheduled. | |
| 1465 | */ | |
| 1466 | export interface CraftNotificationResponseEvent extends CustomEvent { | |
| 1467 | detail: Record<string, any>; | |
| 1468 | } | |
| 1469 | ||
| 1470 | export interface CraftWatchUserInfoEvent extends CustomEvent { | |
| 1471 | detail: Record<string, any>; | |
| 1472 | } | |
| 1473 | ||
| 1412 | 1474 | export interface CraftErrorEvent extends CustomEvent { |
| 1413 | 1475 | detail: CraftError; |
| 1414 | 1476 | } |
| @@ -1428,14 +1490,24 @@ declare global { | ||
| 1428 | 1490 | craftMotionUpdate: CraftMotionUpdateEvent; |
| 1429 | 1491 | craftBluetoothDevice: CraftBluetoothDeviceEvent; |
| 1430 | 1492 | craftARPlane: CraftARPlaneEvent; |
| 1431 | craftShortcut: CraftShortcutEvent; | |
| 1432 | craftSiriShortcut: CraftSiriShortcutEvent; | |
| 1493 | craftLocationUpdate: CraftLocationUpdateEvent; | |
| 1494 | craftLocationError: CraftLocationErrorEvent; | |
| 1495 | craftNetworkChange: CraftNetworkChangeEvent; | |
| 1496 | craftPushToken: CraftPushTokenEvent; | |
| 1497 | craftNotificationResponse: CraftNotificationResponseEvent; | |
| 1433 | 1498 | craftWatchMessage: CraftWatchMessageEvent; |
| 1434 | 1499 | craftWatchReachability: CraftWatchReachabilityEvent; |
| 1435 | 1500 | craftWatchContext: CraftWatchContextEvent; |
| 1436 | craftVoiceAction: CraftVoiceActionEvent; | |
| 1501 | craftWatchUserInfo: CraftWatchUserInfoEvent; | |
| 1437 | 1502 | craftError: CraftErrorEvent; |
| 1438 | 1503 | craftDeepLink: CraftDeepLinkEvent; |
| 1504 | // Kept, and kept last, because nothing dispatches either one: the app | |
| 1505 | // installs the shortcuts and donates the activities, and no template | |
| 1506 | // implements the callback that would deliver a tap. Typed so the listener | |
| 1507 | // an app writes today compiles against the shape it will receive if that | |
| 1508 | // lands; see the note on each interface. | |
| 1509 | craftShortcut: CraftShortcutEvent; | |
| 1510 | craftSiriShortcut: CraftSiriShortcutEvent; | |
| 1439 | 1511 | } |
| 1440 | 1512 | } |
| 1441 | 1513 | |