You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"en": "This class represents binary data and provides methods to convert between various formats.",
@@ -3235,7 +3307,9 @@
3235
3307
"en": "This interface allows you to send messages using the device's messaging capabilities, such as SMS or iMessage.",
3236
3308
"zh": "该接口允许您使用设备的消息功能发送信息,例如短信或 iMessage。"
3237
3309
},
3238
-
"keywords": ["MessageUI"],
3310
+
"keywords": [
3311
+
"MessageUI"
3312
+
],
3239
3313
"readme": "message_ui/"
3240
3314
},
3241
3315
{
@@ -3276,6 +3350,73 @@
3276
3350
"zh": "该接口提供语言翻译功能,允许您在不同语言之间翻译文本。"
3277
3351
},
3278
3352
"readme": "translation/"
3353
+
},
3354
+
{
3355
+
"title": {
3356
+
"en": "Bluetooth",
3357
+
"zh": "蓝牙"
3358
+
},
3359
+
"subtitle": {
3360
+
"en": "This interface provides classes to scan, connect, and exchange data with Bluetooth devices.",
3361
+
"zh": "提供蓝牙相关的API,允许你扫描、连接和与蓝牙设备交换数据。"
3362
+
},
3363
+
"children": [
3364
+
{
3365
+
"title": {
3366
+
"en": "BluetoothCentralManager",
3367
+
"zh": "蓝牙中央设备管理器"
3368
+
},
3369
+
"subtitle": {
3370
+
"en": "This interface allows you to scan for, connect to, and interact with nearby Bluetooth peripherals.",
3371
+
"zh": "该接口允许你扫描、连接和与附近的蓝牙外设进行交互。"
3372
+
},
3373
+
"readme": "bluetooth/central_manager/"
3374
+
},
3375
+
{
3376
+
"title": {
3377
+
"en": "BluetoothPeripheral",
3378
+
"zh": "蓝牙外设"
3379
+
},
3380
+
"subtitle": {
3381
+
"en": "This interface provides properties and methods for interacting with the device, including connecting, discovering services and characteristics, reading/writing values, and subscribing to notifications.",
3382
+
"zh": "表示一个 BLE 外围设备对象,支持读取设备信息、连接状态、发现服务与特征值、读取写入数据、订阅通知等。"
3383
+
},
3384
+
"readme": "bluetooth/peripheral/"
3385
+
},
3386
+
{
3387
+
"title": {
3388
+
"en": "BluetoothService",
3389
+
"zh": "蓝牙服务"
3390
+
},
3391
+
"subtitle": {
3392
+
"en": "This interface represents a Bluetooth Low Energy (BLE) service. A service is a logical grouping of related characteristics and possibly other included services.",
"en": "This interface represents a Bluetooth Low Energy (BLE) service. A service is a logical grouping of related characteristics and possibly other included services.",
3404
+
"zh": "表示蓝牙服务(`BluetoothService`)中的一个特征值,是 BLE 设备数据交互的核心单元。"
3405
+
},
3406
+
"readme": "bluetooth/characteristic/"
3407
+
},
3408
+
{
3409
+
"title": {
3410
+
"en": "BluetoothPeripheralManager",
3411
+
"zh": "蓝牙外设管理器"
3412
+
},
3413
+
"subtitle": {
3414
+
"en": "This interface allows you to create a Bluetooth peripheral that can advertise services and characteristics, and accept connections from central devices.",
Copy file name to clipboardExpand all lines: Scripting Documentation/location/en.md
+61-40Lines changed: 61 additions & 40 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
The global `Location` API provides access to the device’s geographic location, including one-time location retrieval, reverse geocoding, user-driven location selection via map, and accuracy control. It also supports permission checking for widgets that need location updates.
1
+
The global `Location` API provides access to the device’s geographic location, including one-time location retrieval, reverse geocoding, user-driven location selection via map, accuracy control, and permission checking for widgets.
Requests the user's current location once. May trigger a permission prompt if not previously granted.
57
57
58
+
By default, if a cached location is available, it will be returned immediately. If no cached location exists, a new request will be made. To force a new location retrieval even if a cached value exists, pass `{ forceRequest: true }`.
Opens the built-in map interface to allow the user to pick a location manually.
79
+
Opens the built-in map interface to allow the user to manually select a location.
71
80
72
81
```ts
73
82
const selected =awaitLocation.pickFromMap()
@@ -110,7 +119,7 @@ if (placemarks?.length) {
110
119
111
120
### `LocationAccuracy`
112
121
113
-
Specifies the accuracy of the location data:
122
+
Specifies the desired accuracy of location data:
114
123
115
124
```ts
116
125
typeLocationAccuracy=
@@ -125,20 +134,30 @@ type LocationAccuracy =
125
134
126
135
### `LocationInfo`
127
136
128
-
Represents a geographic coordinate:
137
+
Represents a geographic coordinate with timestamp:
129
138
130
139
```ts
131
140
typeLocationInfo= {
141
+
/**
142
+
* The latitude in degrees.
143
+
*/
132
144
latitude:number
145
+
/**
146
+
* The longitude in degrees.
147
+
*/
133
148
longitude:number
149
+
/**
150
+
* Timestamp of when the location was recorded, in milliseconds since epoch.
151
+
*/
152
+
timestamp:number
134
153
}
135
154
```
136
155
137
156
---
138
157
139
158
### `LocationPlacemark`
140
159
141
-
Represents a human-readable description of a geographic coordinate, typically returned by reverse geocoding. It contains structured location details, such as street, city, region, country, and points of interest.
160
+
Represents a human-readable description of a geographic coordinate, typically returned by reverse geocoding. Includes structured location details such as city, country, and street.
0 commit comments