Skip to content

Commit 062ffc3

Browse files
committed
v2.4.2
1 parent dea9ce1 commit 062ffc3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+6783
-1871
lines changed

Scripting Documentation/audio_player/en.md

Lines changed: 222 additions & 139 deletions
Large diffs are not rendered by default.

Scripting Documentation/audio_player/zh.md

Lines changed: 215 additions & 139 deletions
Large diffs are not rendered by default.

Scripting Documentation/clipboard/index.tsx

Lines changed: 0 additions & 42 deletions
This file was deleted.

Scripting Documentation/doc.json

Lines changed: 90 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -892,8 +892,8 @@
892892
"zh": "手势"
893893
},
894894
"subtitle": {
895-
"en": "Define interactions from taps, clicks, and swipes to fine-grained gestures.",
896-
"zh": "定义从轻点、点击、滑动到更精细手势的交互方式"
895+
"en": "This interface provides a gesture system similar to SwiftUI, allowing any view to respond to touch interactions such as tapping, long pressing, dragging, rotating, and magnifying.",
896+
"zh": "该接口提供了类似于 SwiftUI 的手势系统,允许任何视图响应触摸交互,如轻点、长按、拖拽、旋转和放大"
897897
},
898898
"keywords": [
899899
"tap",
@@ -907,7 +907,6 @@
907907
"双击",
908908
"长按"
909909
],
910-
"example": "views/gestures/index",
911910
"readme": "views/gestures/"
912911
},
913912
{
@@ -2240,6 +2239,10 @@
22402239
"en": "This view modifier allows you to chain multiple modifiers together, supporting the same modifier being used multiple times in the same view.",
22412240
"zh": "该修饰符可用于连续调用多个修饰符,支持同一个修饰符在同一个视图中多次使用。"
22422241
},
2242+
"keywords": [
2243+
"modifiers",
2244+
"ViewModifiers"
2245+
],
22432246
"readme": "view_modifiers/modifiers/"
22442247
}
22452248
]
@@ -2342,6 +2345,17 @@
23422345
},
23432346
"readme": "data/"
23442347
},
2348+
{
2349+
"title": {
2350+
"en": "Encoding",
2351+
"zh": "编码"
2352+
},
2353+
"subtitle": {
2354+
"en": "This type defines a set of supported character encodings.",
2355+
"zh": "该类型定义了支持的字符编码集。"
2356+
},
2357+
"readme": "encoding/"
2358+
},
23452359
{
23462360
"title": {
23472361
"en": "UIImage",
@@ -2620,6 +2634,51 @@
26202634
},
26212635
"readme": "oauth2/"
26222636
},
2637+
{
2638+
"title": {
2639+
"en": "URLSession",
2640+
"zh": "URLSession(网络会话)"
2641+
},
2642+
"subtitle": {
2643+
"en": "This native iOS interface allows you to perform network requests, manage HTTP headers, and handle HTTP responses.",
2644+
"zh": "iOS原生的URLSession,允许你进行网络请求,管理HTTP头部和处理HTTP响应。"
2645+
},
2646+
"children": [
2647+
{
2648+
"title": {
2649+
"en": "BackgroundURLSession",
2650+
"zh": "后台网络会话"
2651+
},
2652+
"subtitle": {
2653+
"en": "This interface provides the ability to initiate, resume, and query background download and upload tasks.",
2654+
"zh": "该接口提供发起、恢复与查询「后台可持续」的下载与上传任务的能力"
2655+
},
2656+
"readme": "url_session/background_url_session/"
2657+
},
2658+
{
2659+
"title": {
2660+
"en": "URLSessionDownloadTask",
2661+
"zh": "下载任务"
2662+
},
2663+
"subtitle": {
2664+
"en": "Represents a download task instance that can be performed in the foreground or background, and can be resumed after the script is terminated.",
2665+
"zh": "表示一个后台下载任务实例,用于在前台或后台下载文件,并可在脚本被终止后继续运行。"
2666+
},
2667+
"readme": "url_session/url_session_download_task/"
2668+
},
2669+
{
2670+
"title": {
2671+
"en": "URLSessionUploadTask",
2672+
"zh": "上传任务"
2673+
},
2674+
"subtitle": {
2675+
"en": "Represents an upload task instance that can be performed in the foreground or background, and can be resumed after the script is terminated.",
2676+
"zh": "表示一个后台上传任务实例,用于在前台或后台上传文件,并可在脚本被终止后继续运行。"
2677+
},
2678+
"readme": "url_session/url_session_upload_task/"
2679+
}
2680+
]
2681+
},
26232682
{
26242683
"title": {
26252684
"en": "App Events",
@@ -2702,20 +2761,20 @@
27022761
},
27032762
{
27042763
"title": {
2705-
"en": "Clipboard",
2764+
"en": "Pasteboard",
27062765
"zh": "剪贴板"
27072766
},
27082767
"subtitle": {
2709-
"en": "Read and set the clipboard.",
2710-
"zh": "读取并设置剪贴板内容"
2768+
"en": "This namspace provides a complete interface for reading, writing, and observing system pasteboard changes.",
2769+
"zh": "该命名空间提供了读取、写入和观察剪贴板变化的完整接口"
27112770
},
27122771
"keywords": [
27132772
"copy",
2714-
"pasteboard",
2773+
"clipboard",
27152774
"复制",
27162775
"粘贴板"
27172776
],
2718-
"example": "clipboard/index"
2777+
"readme": "pasteboard/"
27192778
},
27202779
{
27212780
"title": {
@@ -2990,6 +3049,17 @@
29903049
},
29913050
"readme": "audio_recorder/"
29923051
},
3052+
{
3053+
"title": {
3054+
"en": "AVMetadataItem",
3055+
"zh": "AVMetadataItem"
3056+
},
3057+
"subtitle": {
3058+
"en": "AVMetadataItem is a class that represents a metadata item in an audio or video asset.",
3059+
"zh": "AVMetadataItem 是一个类,表示音频或视频资源中的元数据项。"
3060+
},
3061+
"readme": "av_metadata_item/"
3062+
},
29933063
{
29943064
"title": {
29953065
"en": "Audio Player",
@@ -3528,6 +3598,18 @@
35283598
"readme": "bluetooth/peripheral_manager/"
35293599
}
35303600
]
3601+
},
3602+
{
3603+
"pro": true,
3604+
"title": {
3605+
"en": "BackgroundKeeper",
3606+
"zh": "后台保活"
3607+
},
3608+
"subtitle": {
3609+
"en": "This interface provides methods for keeping the Scripting app running in the background.",
3610+
"zh": "该接口提供了用于保持 Scripting 应用在后台运行的方法。"
3611+
},
3612+
"readme": "background_keeper/"
35313613
}
35323614
]
35333615
}

Scripting Documentation/shared_audio_session/en.md

Lines changed: 35 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,17 @@ console.log(prefersNoInterruptions) // Example: false
159159

160160
### 7. **Session Activation**
161161

162-
#### `setActive(active: boolean)`
163-
Activate or deactivate the shared audio session.
162+
#### `setActive(active: boolean, options?: AudioSessionSetActiveOptions[])`
163+
Activate or deactivate the shared audio session with optional options.
164+
165+
- `active`: Set to `true` to activate the session, `false` to deactivate it.
166+
- `options`: An array of optional activation options, such as 'interruptSpokenAudioAndMixWithOthers'.
164167

165168
```typescript
166-
await SharedAudioSession.setActive(true)
169+
await SharedAudioSession.setActive(
170+
true,
171+
['notifyOthersOnDeactivation']
172+
)
167173
```
168174

169175
---
@@ -188,37 +194,40 @@ await SharedAudioSession.setPrefersNoInterruptionsFromSystemAlerts(true)
188194

189195
## Enumerations
190196

197+
### **AudioSessionSetActiveOptions**
198+
Optional activation options:
199+
- `'notifyOthersOnDeactivation'`: Notify other audio sessions when deactivating the shared audio session.
200+
191201
### **AudioSessionCategory**
192202
Defines the session's audio category:
193-
- `'ambient'`
194-
- `'multiRoute'`
195-
- `'playAndRecord'`
196-
- `'playback'`
197-
- `'record'`
198-
- `'soloAmbient'`
203+
- `'ambient'`: Ambient audio, such as background music or ambient sounds.
204+
- `'multiRoute'`: Multi-route audio, such as routing distinct streams of audio data to different output devices at the same time.
205+
- `'playAndRecord'`: Play and record audio, such as voice chat or video conferencing.
206+
- `'playback'`: Playback audio, such as music or sound effects.
207+
- `'record'`: Recording audio, such as voice chat or video conferencing.
208+
- `'soloAmbient'`: Solo ambient audio, such as background music or ambient sounds.
199209

200210
### **AudioSessionCategoryOptions**
201211
Optional behaviors for audio categories:
202-
- `'mixWithOthers'`
203-
- `'duckOthers'`
204-
- `'interruptSpokenAudioAndMixWithOthers'`
205-
- `'allowBluetooth'`
206-
- `'allowBluetoothA2DP'`
207-
- `'allowAirPlay'`
208-
- `'defaultToSpeaker'`
209-
- `'overrideMutedMicrophoneInterruption'`
212+
- `'mixWithOthers'`: Mix with other audio sessions.
213+
- `'duckOthers'`: Duck other audio sessions.
214+
- `'interruptSpokenAudioAndMixWithOthers'`: Interrupt spoken audio and mix with others.
215+
- `'allowBluetooth'`: Allow Bluetooth audio.
216+
- `'allowBluetoothA2DP'`: Allow Bluetooth A2DP audio.
217+
- `'allowAirPlay'`: Allow AirPlay audio.
218+
- `'defaultToSpeaker'`: Default to speaker, even if headphones are connected.
219+
- `'overrideMutedMicrophoneInterruption'`: Override muted microphone interruption.
210220

211221
### **AudioSessionMode**
212222
Specifies the session's mode:
213-
- `'default'`
214-
- `'gameChat'`
215-
- `'measurement'`
216-
- `'moviePlayback'`
217-
- `'spokenAudio'`
218-
- `'videoChat'`
219-
- `'videoRecording'`
220-
- `'voiceChat'`
221-
- `'voicePrompt'`
223+
- `'default'`: Default mode.
224+
- `'gameChat'`: Game chat mode.
225+
- `'measurement'`: Measurement mode, such as audio input or output.
226+
- `'moviePlayback'`: Movie playback mode, such as movie content.
227+
- `'spokenAudio'`: Spoken audio mode, such as voice chat.
228+
- `'videoChat'`: Video chat mode, such as video conferencing.
229+
- `'videoRecording'`: Video recording mode, such as video conferencing.
230+
- `'voicePrompt'`: Voice prompt mode, such as text-to-speech.
222231

223232
### **AudioSessionInterruptionType**
224233
Specifies the type of interruption:

Scripting Documentation/shared_audio_session/zh.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,14 @@ console.log(prefersNoInterruptions) // 示例输出:false
161161

162162
### 7. **会话激活**
163163

164-
#### `setActive(active: boolean)`
165-
激活或停用共享音频会话。
164+
#### `setActive(active: boolean, options?: AudioSessionSetActiveOptions[])`
165+
激活或停用共享音频会话,可指定激活选项
166166

167167
```typescript
168-
await SharedAudioSession.setActive(true)
168+
await SharedAudioSession.setActive(
169+
true,
170+
['notifyOthersOnDeactivation']
171+
)
169172
```
170173

171174
---
@@ -190,6 +193,10 @@ await SharedAudioSession.setPrefersNoInterruptionsFromSystemAlerts(true)
190193

191194
## 枚举(Enumerations)
192195

196+
### **AudioSessionSetActiveOptions**
197+
定义激活选项:
198+
- `'notifyOthersOnDeactivation'`
199+
193200
### **AudioSessionCategory**
194201
定义音频会话的类别:
195202
- `'ambient'`

Scripting Documentation/view_modifiers/navigation_view_modifiers/en.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ The Scripting app supports a set of navigation-related view modifiers that enabl
55
## `navigationTitle`
66

77
```ts
8-
navigationTitle?: string | VirtualNode
8+
navigationTitle?: string
99
```
1010

1111
Specifies the navigation title of the view.
@@ -15,10 +15,6 @@ Specifies the navigation title of the view.
1515
* On **iOS**, the navigation title appears in the navigation bar when the view is part of a navigation stack.
1616
* On **iPadOS**, the title of the primary navigation destination is also used as the app window's title in the App Switcher.
1717

18-
### Usage
19-
20-
You can provide either a plain string or a `VirtualNode` (such as a `Text` component) for advanced formatting.
21-
2218
---
2319

2420
## `navigationBarTitleDisplayMode`

Scripting Documentation/view_modifiers/navigation_view_modifiers/zh.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ Scripting App 提供了一组用于配置导航行为的视图修饰符,允许
55
## `navigationTitle`
66

77
```ts
8-
navigationTitle?: string | VirtualNode
9-
```
8+
navigationTitle?: string
109

1110
设置当前视图在导航栏中显示的标题。
1211

@@ -15,10 +14,6 @@ navigationTitle?: string | VirtualNode
1514
***iOS** 中,当视图被嵌套在导航栈中时,所设置的标题将显示在导航栏中。
1615
***iPadOS** 中,主导航目的地的标题也会在多任务切换界面中显示为窗口的标题。
1716

18-
### 使用方式
19-
20-
可传入字符串(`string`)用于简单标题,或传入 `VirtualNode`(如 `Text`)以实现更复杂的格式控制。
21-
2217
---
2318

2419
## `navigationBarTitleDisplayMode`

Scripting Documentation/view_modifiers/text_view_modifiers/en.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,16 @@ Specifies how many lines of text can display. You can provide:
189189

190190
---
191191

192+
### `lineSpacing`
193+
194+
Sets the spacing between lines, in pixels.
195+
196+
```tsx
197+
<Text lineSpacing={5}>Line spacing set to 5 pixels</Text>
198+
```
199+
200+
---
201+
192202
### `multilineTextAlignment`
193203

194204
Sets the text alignment for multi-line text: `"leading"`, `"center"`, or `"trailing"`.

0 commit comments

Comments
 (0)