@dompling/trollscript-types 1.0.51 → 1.0.54

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 (2) hide show
  1. package/index.d.ts +37 -517
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -131,12 +131,6 @@ interface Storage {
131
131
  declare const storage: Storage;
132
132
 
133
133
  interface Icloud {
134
- /**
135
- * 检查 iCloud 是否可用
136
- * @returns 是否可用
137
- */
138
- isAvailable(): boolean;
139
-
140
134
  /**
141
135
  * 获取 iCloud 容器路径
142
136
  * @returns iCloud 容器的本地路径,不可用时返回 null
@@ -170,7 +164,7 @@ interface Icloud {
170
164
  * @param path 目录路径,默认为根目录
171
165
  * @returns 文件名列表数组
172
166
  */
173
- list(path: string): any;
167
+ list(path?: string): any;
174
168
 
175
169
  }
176
170
 
@@ -336,42 +330,42 @@ interface Http {
336
330
  * @param options 请求选项 { headers, timeout }
337
331
  * @returns 包含状态码、响应数据、响应头的对象
338
332
  */
339
- get(url: string, options: Record<string, any>): any;
333
+ get(url: string, options?: Record<string, any>): any;
340
334
 
341
335
  /**
342
336
  * 发送 POST 请求
343
337
  * @param url 请求地址
344
338
  * @param options 请求选项 { body, headers, timeout }
345
339
  */
346
- post(url: string, options: Record<string, any>): any;
340
+ post(url: string, options?: Record<string, any>): any;
347
341
 
348
342
  /**
349
343
  * 发送 PUT 请求
350
344
  * @param url 请求地址
351
345
  * @param options 请求选项 { body, headers, timeout }
352
346
  */
353
- put(url: string, options: Record<string, any>): any;
347
+ put(url: string, options?: Record<string, any>): any;
354
348
 
355
349
  /**
356
350
  * 发送 DELETE 请求
357
351
  * @param url 请求地址
358
352
  * @param options 请求选项 { headers, timeout }
359
353
  */
360
- delete(url: string, options: Record<string, any>): any;
354
+ delete(url: string, options?: Record<string, any>): any;
361
355
 
362
356
  /**
363
357
  * 发送 PATCH 请求
364
358
  * @param url 请求地址
365
359
  * @param options 请求选项 { body, headers, timeout }
366
360
  */
367
- patch(url: string, options: Record<string, any>): any;
361
+ patch(url: string, options?: Record<string, any>): any;
368
362
 
369
363
  /**
370
364
  * 发送 HEAD 请求
371
365
  * @param url 请求地址
372
366
  * @param options 请求选项 { headers, timeout }
373
367
  */
374
- head(url: string, options: Record<string, any>): any;
368
+ head(url: string, options?: Record<string, any>): any;
375
369
 
376
370
  /**
377
371
  * 发送自定义请求
@@ -411,12 +405,6 @@ interface Network {
411
405
  */
412
406
  getIPAddress(): any;
413
407
 
414
- /**
415
- * 获取 WiFi 信息
416
- * @returns 包含 SSID 和 BSSID 的对象
417
- */
418
- getWiFiInfo(): any;
419
-
420
408
  /**
421
409
  * URL 编码
422
410
  * @param string 要编码的字符串
@@ -444,7 +432,7 @@ interface Network {
444
432
  * @param params 查询参数
445
433
  * @returns 构建的 URL 字符串
446
434
  */
447
- buildURL(baseURL: string, params: Record<string, any>): string;
435
+ buildURL(baseURL: string, params?: Record<string, any>): string;
448
436
 
449
437
  /**
450
438
  * Ping 主机
@@ -459,20 +447,7 @@ interface Network {
459
447
  * @param filename 保存文件名
460
448
  * @returns 包含本地文件路径的对象
461
449
  */
462
- download(url: string, filename: string): any;
463
-
464
- /**
465
- * 获取飞行模式状态
466
- * @returns 是否开启
467
- */
468
- getAirplaneMode(): boolean;
469
-
470
- /**
471
- * 设置飞行模式
472
- * @param enabled 是否开启
473
- * @returns 是否设置成功
474
- */
475
- setAirplaneMode(enabled: boolean): boolean;
450
+ download(url: string, filename?: string): any;
476
451
 
477
452
  /**
478
453
  * 列出 VPN 配置
@@ -485,7 +460,7 @@ interface Network {
485
460
  * @param name VPN 名称,默认第一个
486
461
  * @returns 是否发起连接成功
487
462
  */
488
- connectVPN(name: string): boolean;
463
+ connectVPN(name?: string): boolean;
489
464
 
490
465
  /**
491
466
  * 断开 VPN
@@ -499,25 +474,12 @@ interface Network {
499
474
  */
500
475
  getVPNStatus(): any;
501
476
 
502
- /**
503
- * 获取 WiFi 开关状态
504
- * @returns 是否开启
505
- */
506
- getWiFiEnabled(): boolean;
507
-
508
- /**
509
- * 设置 WiFi 开关
510
- * @param enabled 是否开启
511
- * @returns 是否设置成功
512
- */
513
- setWiFi(enabled: boolean): boolean;
514
-
515
477
  /**
516
478
  * 打开系统设置
517
479
  * @param section 设置页面(如 'WIFI')
518
480
  * @returns 是否成功打开
519
481
  */
520
- openSettings(section: string): boolean;
482
+ openSettings(section?: string): boolean;
521
483
 
522
484
  }
523
485
 
@@ -572,7 +534,7 @@ interface App {
572
534
  * @param limit 返回的日志条数
573
535
  * @returns 日志对象数组
574
536
  */
575
- getLogs(limit: number): any;
537
+ getLogs(limit?: number): any;
576
538
 
577
539
  /**
578
540
  * 导出日志为字符串
@@ -601,7 +563,7 @@ interface App {
601
563
  * 退出应用(仅用于调试)
602
564
  * @param code 退出码,默认为 0
603
565
  */
604
- exit(code: number): void;
566
+ exit(code?: number): void;
605
567
 
606
568
  /**
607
569
  * 打开应用设置页面
@@ -659,7 +621,7 @@ interface Haptic {
659
621
  * 触觉冲击反馈
660
622
  * @param style 'light' | 'medium' | 'heavy' | 'soft' | 'rigid'
661
623
  */
662
- impact(style: string): void;
624
+ impact(style?: string): void;
663
625
 
664
626
  /**
665
627
  * 通知触觉反馈
@@ -728,13 +690,13 @@ interface Display {
728
690
  * 增加亮度
729
691
  * @param amount 增加量 (默认 0.1)
730
692
  */
731
- increaseBrightness(amount: number): void;
693
+ increaseBrightness(amount?: number): void;
732
694
 
733
695
  /**
734
696
  * 降低亮度
735
697
  * @param amount 减少量 (默认 0.1)
736
698
  */
737
- decreaseBrightness(amount: number): void;
699
+ decreaseBrightness(amount?: number): void;
738
700
 
739
701
  /**
740
702
  * 获取屏幕信息
@@ -884,7 +846,7 @@ interface Location {
884
846
  * @param locale 语言区域标识(可选,如 'zh_CN'、'en_US',默认使用系统语言)
885
847
  * @returns 地址信息对象数组
886
848
  */
887
- reverseGeocode(lat: number, lng: number, locale: string): any;
849
+ reverseGeocode(lat: number, lng: number, locale?: string): any;
888
850
 
889
851
  /**
890
852
  * 定位服务是否开启
@@ -946,7 +908,7 @@ interface Calendar {
946
908
  * @param calendarId 日历 ID
947
909
  * @returns 事件数组
948
910
  */
949
- getEvents(start: number, end: number, calendarId: string): any;
911
+ getEvents(start: number, end: number, calendarId?: string): any;
950
912
 
951
913
  /**
952
914
  * 创建日历事件
@@ -956,7 +918,7 @@ interface Calendar {
956
918
  * @param options 选项 { calendarId, notes, location, url, allDay }
957
919
  * @returns 创建的事件 ID
958
920
  */
959
- create(title: string, start: number, end: number, options: Record<string, any>): any;
921
+ create(title: string, start: number, end: number, options?: Record<string, any>): any;
960
922
 
961
923
  /**
962
924
  * 删除日历事件
@@ -993,7 +955,7 @@ interface Reminder {
993
955
  * @param listId 列表 ID
994
956
  * @returns 提醒事项数组
995
957
  */
996
- getAll(listId: string): any;
958
+ getAll(listId?: string): any;
997
959
 
998
960
  /**
999
961
  * 创建提醒事项
@@ -1001,7 +963,7 @@ interface Reminder {
1001
963
  * @param options 选项 { listId, notes, dueDate, priority, sortOrder, isPinned }
1002
964
  * @returns 创建的提醒 ID
1003
965
  */
1004
- create(title: string, options: Record<string, any>): any;
966
+ create(title: string, options?: Record<string, any>): any;
1005
967
 
1006
968
  /**
1007
969
  * 标记为已完成
@@ -1022,14 +984,14 @@ interface Reminder {
1022
984
  * @param options { sortBy: 'createdAt'|'dueDate'|'priority'|'title', ascending: boolean, completed: boolean }
1023
985
  * @returns 排序后的提醒列表
1024
986
  */
1025
- getSorted(options: Record<string, any>): any;
987
+ getSorted(options?: Record<string, any>): any;
1026
988
 
1027
989
  /**
1028
990
  * 获取即将到期的提醒
1029
991
  * @param days 未来几天,默认 7 天
1030
992
  * @returns 即将到期的提醒列表
1031
993
  */
1032
- getUpcoming(days: number): any;
994
+ getUpcoming(days?: number): any;
1033
995
 
1034
996
  /**
1035
997
  * 获取已过期的提醒
@@ -1050,7 +1012,7 @@ interface Reminder {
1050
1012
  * @param options { listId, notes, dueDate, priority, location: { latitude, longitude, radius, onArrive, name } }
1051
1013
  * @returns { success: boolean, id: string, title: string, isSystemReminder: true }
1052
1014
  */
1053
- createSystemReminder(title: string, options: Record<string, any>): any;
1015
+ createSystemReminder(title: string, options?: Record<string, any>): any;
1054
1016
 
1055
1017
  /**
1056
1018
  * 获取系统提醒列表
@@ -1087,7 +1049,7 @@ interface Contacts {
1087
1049
  * @param limit 返回的最大数量,默认全部
1088
1050
  * @returns 联系人对象数组
1089
1051
  */
1090
- getAll(offset: number, limit: number): any;
1052
+ getAll(offset?: number, limit?: number): any;
1091
1053
 
1092
1054
  /**
1093
1055
  * 获取联系人总数
@@ -1170,7 +1132,7 @@ interface Notification {
1170
1132
  * @param options 选项 { url, userInfo, sound, badge }
1171
1133
  * @returns 发送的通知 ID
1172
1134
  */
1173
- send(title: string, body: string, options: Record<string, any>): any;
1135
+ send(title: string, body: string, options?: Record<string, any>): any;
1174
1136
 
1175
1137
  /**
1176
1138
  * 取消通知
@@ -1234,319 +1196,12 @@ interface Notification {
1234
1196
  * @param options 选项 { url, userInfo, sound, badge, repeat: 'daily'|'weekly'|'monthly' }
1235
1197
  * @returns 发送的通知 ID
1236
1198
  */
1237
- schedule(title: string, body: string, date: number, options: Record<string, any>): any;
1199
+ schedule(title: string, body: string, date: number, options?: Record<string, any>): any;
1238
1200
 
1239
1201
  }
1240
1202
 
1241
1203
  declare const notification: Notification;
1242
1204
 
1243
- interface Alarm {
1244
- /**
1245
- * 请求通知权限
1246
- * @returns 是否授权成功
1247
- */
1248
- requestAccess(): any;
1249
-
1250
- /**
1251
- * 获取权限状态
1252
- * @returns 权限状态
1253
- */
1254
- getAccessStatus(): any;
1255
-
1256
- /**
1257
- * 创建一次性闹钟
1258
- * @param timestamp 触发时间戳
1259
- * @param title 标题
1260
- * @param options 选项 { sound }
1261
- * @returns 创建的闹钟 ID
1262
- */
1263
- createOnce(timestamp: number, title: string, options: Record<string, any>): any;
1264
-
1265
- /**
1266
- * 创建每日重复闹钟
1267
- * @param hour 小时 (0-23)
1268
- * @param minute 分钟 (0-59)
1269
- * @param title 标题
1270
- * @param options 选项 { sound }
1271
- * @returns 创建的闹钟 ID
1272
- */
1273
- createDaily(hour: number, minute: number, title: string, options: Record<string, any>): any;
1274
-
1275
- /**
1276
- * 创建每周重复闹钟
1277
- * @param weekday 周几 (1-7, 周日为1)
1278
- * @param hour 小时 (0-23)
1279
- * @param minute 分钟 (0-59)
1280
- * @param title 标题
1281
- * @param options 选项 { sound }
1282
- * @returns 创建的闹钟 ID
1283
- */
1284
- createWeekly(weekday: number, hour: number, minute: number, title: string, options: Record<string, any>): any;
1285
-
1286
- /**
1287
- * 创建倒计时提醒
1288
- * @param seconds 秒数
1289
- * @param title 标题
1290
- * @param options 选项 { sound }
1291
- * @returns 创建的闹钟 ID
1292
- */
1293
- createCountdown(seconds: number, title: string, options: Record<string, any>): any;
1294
-
1295
- /**
1296
- * 获取待触发的闹钟
1297
- * @returns 待触发闹钟列表
1298
- */
1299
- getPending(): any;
1300
-
1301
- /**
1302
- * 获取闹钟数量
1303
- * @returns 闹钟数量
1304
- */
1305
- getCount(): any;
1306
-
1307
- /**
1308
- * 取消指定闹钟
1309
- * @param id 闹钟 ID
1310
- */
1311
- cancel(id: string): void;
1312
-
1313
- /**
1314
- * 取消所有闹钟
1315
- */
1316
- cancelAll(): void;
1317
-
1318
- /**
1319
- * 打开系统时钟
1320
- */
1321
- openClockApp(): void;
1322
-
1323
- /**
1324
- * 打开计时器
1325
- */
1326
- openTimer(): void;
1327
-
1328
- }
1329
-
1330
- declare const alarm: Alarm;
1331
-
1332
- interface Media {
1333
- /**
1334
- * 播放
1335
- */
1336
- play(): void;
1337
-
1338
- /**
1339
- * 暂停
1340
- */
1341
- pause(): void;
1342
-
1343
- /**
1344
- * 停止
1345
- */
1346
- stop(): void;
1347
-
1348
- /**
1349
- * 切换播放/暂停
1350
- */
1351
- togglePlayPause(): void;
1352
-
1353
- /**
1354
- * 下一首
1355
- */
1356
- next(): void;
1357
-
1358
- /**
1359
- * 上一首
1360
- */
1361
- previous(): void;
1362
-
1363
- /**
1364
- * 跳到开头
1365
- */
1366
- skipToBeginning(): void;
1367
-
1368
- /**
1369
- * 获取播放状态
1370
- * @returns 播放状态
1371
- */
1372
- getPlaybackState(): any;
1373
-
1374
- /**
1375
- * 是否正在播放
1376
- * @returns 是否正在播放
1377
- */
1378
- isPlaying(): boolean;
1379
-
1380
- /**
1381
- * 获取当前播放信息
1382
- * @returns 当前播放信息对象
1383
- */
1384
- getNowPlaying(): any;
1385
-
1386
- /**
1387
- * 获取音量
1388
- * @returns 当前音量(0.0-1.0)
1389
- */
1390
- getVolume(): number;
1391
-
1392
- /**
1393
- * 设置音量
1394
- * @param volume 音量 (0.0 - 1.0)
1395
- */
1396
- setVolume(volume: number): void;
1397
-
1398
- /**
1399
- * 获取重复模式
1400
- * @returns 重复模式
1401
- */
1402
- getRepeatMode(): any;
1403
-
1404
- /**
1405
- * 设置重复模式
1406
- * @param mode 'none' | 'one' | 'all'
1407
- */
1408
- setRepeatMode(mode: string): void;
1409
-
1410
- /**
1411
- * 获取随机播放模式
1412
- * @returns 随机播放模式
1413
- */
1414
- getShuffleMode(): any;
1415
-
1416
- /**
1417
- * 设置随机播放模式
1418
- * @param mode 'off' | 'songs' | 'albums'
1419
- */
1420
- setShuffleMode(mode: string): void;
1421
-
1422
- /**
1423
- * 获取当前播放时间
1424
- * @returns 当前播放时间(秒)
1425
- */
1426
- getCurrentTime(): number;
1427
-
1428
- /**
1429
- * 设置播放时间
1430
- * @param time 时间 (秒)
1431
- */
1432
- setCurrentTime(time: number): void;
1433
-
1434
- /**
1435
- * 快进
1436
- * @param seconds 秒数 (默认 15)
1437
- */
1438
- seekForward(seconds: number): void;
1439
-
1440
- /**
1441
- * 快退
1442
- * @param seconds 秒数 (默认 15)
1443
- */
1444
- seekBackward(seconds: number): void;
1445
-
1446
- /**
1447
- * 请求音乐库权限
1448
- * @returns 是否授权成功
1449
- */
1450
- requestAccess(): any;
1451
-
1452
- /**
1453
- * 获取权限状态
1454
- * @returns 权限状态
1455
- */
1456
- getAccessStatus(): any;
1457
-
1458
- /**
1459
- * 搜索音乐库
1460
- * @param query 搜索关键词
1461
- * @returns 歌曲列表数组
1462
- */
1463
- searchSongs(query: string): any;
1464
-
1465
- /**
1466
- * 播放指定歌曲
1467
- * @param persistentID 歌曲 ID
1468
- */
1469
- playSong(persistentID: string): void;
1470
-
1471
- /**
1472
- * 获取所有歌曲
1473
- * @returns 歌曲列表数组
1474
- */
1475
- getAllSongs(): any;
1476
-
1477
- /**
1478
- * 获取所有专辑
1479
- * @returns 专辑列表数组
1480
- */
1481
- getAlbums(): any;
1482
-
1483
- /**
1484
- * 获取所有艺术家
1485
- * @returns 艺术家列表数组
1486
- */
1487
- getArtists(): any;
1488
-
1489
- /**
1490
- * 获取播放列表
1491
- * @returns 播放列表数组
1492
- */
1493
- getPlaylists(): any;
1494
-
1495
- /**
1496
- * 播放专辑
1497
- * @param id 专辑 ID
1498
- */
1499
- playAlbum(id: string): void;
1500
-
1501
- /**
1502
- * 播放艺术家
1503
- * @param id 艺术家 ID
1504
- */
1505
- playArtist(id: string): void;
1506
-
1507
- /**
1508
- * 播放播放列表
1509
- * @param id 播放列表 ID
1510
- * @returns 无返回值
1511
- */
1512
- playPlaylist(id: string): void;
1513
-
1514
- }
1515
-
1516
- declare const media: Media;
1517
-
1518
- interface Mail {
1519
- /**
1520
- * 检查邮件功能是否可用
1521
- * @returns 是否能发送邮件
1522
- */
1523
- isAvailable(): boolean;
1524
-
1525
- /**
1526
- * 打开邮件编辑器
1527
- * @param options 邮件选项 { to: string|string[], cc?: string|string[], bcc?: string|string[], subject?: string, body?: string, isHTML?: boolean, attachments?: [{path, mimeType?, filename?}] }
1528
- * @returns 包含发送结果的对象
1529
- */
1530
- compose(options: Record<string, any>): any;
1531
-
1532
- /**
1533
- * 通过 URL Scheme 发送邮件 (sendDirect 的别名)
1534
- * @param options 邮件选项 { to: string|string[], cc?: string, bcc?: string, subject?: string, body?: string }
1535
- * @returns 是否成功打开邮件客户端
1536
- */
1537
- send(options: Record<string, any>): boolean;
1538
-
1539
- /**
1540
- * 通过 URL Scheme 发送邮件(打开默认邮件客户端)
1541
- * @param options 邮件选项 { to: string|string[], cc?: string, bcc?: string, subject?: string, body?: string }
1542
- * @returns 是否成功打开邮件客户端
1543
- */
1544
- sendDirect(options: Record<string, any>): boolean;
1545
-
1546
- }
1547
-
1548
- declare const mail: Mail;
1549
-
1550
1205
  interface Sms {
1551
1206
  /**
1552
1207
  * 检查短信权限
@@ -1565,14 +1220,14 @@ interface Sms {
1565
1220
  * @param limit 限制条数 (默认 10)
1566
1221
  * @returns 短信对象数组
1567
1222
  */
1568
- read(limit: number): any;
1223
+ read(limit?: number): any;
1569
1224
 
1570
1225
  /**
1571
1226
  * 获取验证码
1572
1227
  * @param minutes 查找最近几分钟内的验证码 (默认 5)
1573
1228
  * @returns 验证码或 null
1574
1229
  */
1575
- getVerificationCode(minutes: number): any;
1230
+ getVerificationCode(minutes?: number): any;
1576
1231
 
1577
1232
  /**
1578
1233
  * 搜索短信
@@ -1624,7 +1279,7 @@ interface Sql {
1624
1279
  * @param params 参数列表
1625
1280
  * @returns 查询结果数组
1626
1281
  */
1627
- query(dbPath: string, sql: string, params: any[]): any[];
1282
+ query(dbPath: string, sql: string, params?: any[]): any[];
1628
1283
 
1629
1284
  /**
1630
1285
  * 执行 INSERT/UPDATE/DELETE
@@ -1633,7 +1288,7 @@ interface Sql {
1633
1288
  * @param params 参数列表
1634
1289
  * @returns 执行结果对象
1635
1290
  */
1636
- execute(dbPath: string, sql: string, params: any[]): any;
1291
+ execute(dbPath: string, sql: string, params?: any[]): any;
1637
1292
 
1638
1293
  /**
1639
1294
  * 列出数据库中的所有表
@@ -1661,7 +1316,7 @@ interface Shortcuts {
1661
1316
  * @param input 输入文本(可选)
1662
1317
  * @returns 是否成功打开快捷指令
1663
1318
  */
1664
- run(name: string, input: string): boolean;
1319
+ run(name: string, input?: string): boolean;
1665
1320
 
1666
1321
  /**
1667
1322
  * 运行快捷指令(带 x-callback-url 回调)
@@ -1669,7 +1324,7 @@ interface Shortcuts {
1669
1324
  * @param input 输入文本(可选)
1670
1325
  * @returns 是否成功打开快捷指令
1671
1326
  */
1672
- runWithCallback(name: string, input: string): boolean;
1327
+ runWithCallback(name: string, input?: string): boolean;
1673
1328
 
1674
1329
  /**
1675
1330
  * 打开快捷指令 App
@@ -1728,141 +1383,6 @@ interface Shortcuts {
1728
1383
 
1729
1384
  declare const shortcuts: Shortcuts;
1730
1385
 
1731
- interface Bluetooth {
1732
- /**
1733
- * 蓝牙是否开启
1734
- */
1735
- isEnabled(): boolean;
1736
-
1737
- /**
1738
- * 获取蓝牙状态
1739
- */
1740
- getStatus(): any;
1741
-
1742
- /**
1743
- * 设置蓝牙开关
1744
- * @param enabled 是否开启
1745
- * @returns 无返回值
1746
- */
1747
- setEnabled(enabled: boolean): void;
1748
-
1749
- /**
1750
- * 打开蓝牙
1751
- * @returns 无返回值
1752
- */
1753
- turnOn(): void;
1754
-
1755
- /**
1756
- * 关闭蓝牙
1757
- * @returns 无返回值
1758
- */
1759
- turnOff(): void;
1760
-
1761
- /**
1762
- * 获取配对设备
1763
- */
1764
- getPairedDevices(): any;
1765
-
1766
- /**
1767
- * 获取已连接设备
1768
- */
1769
- getConnectedDevices(): any;
1770
-
1771
- /**
1772
- * 连接设备
1773
- * @param id 设备 UUID
1774
- */
1775
- connectDevice(id: string): any;
1776
-
1777
- /**
1778
- * 断开设备
1779
- * @param id 设备 UUID
1780
- */
1781
- disconnectDevice(id: string): any;
1782
-
1783
- /**
1784
- * 开始扫描
1785
- * @returns 无返回值
1786
- */
1787
- startScan(): void;
1788
-
1789
- /**
1790
- * 停止扫描
1791
- * @returns 无返回值
1792
- */
1793
- stopScan(): void;
1794
-
1795
- /**
1796
- * 打开蓝牙设置
1797
- * @returns 无返回值
1798
- */
1799
- openSettings(): void;
1800
-
1801
- }
1802
-
1803
- declare const bluetooth: Bluetooth;
1804
-
1805
- interface Memo {
1806
- /**
1807
- * 创建备忘录
1808
- * @param title 备忘录标题
1809
- * @param content 备忘录内容
1810
- * @param tags 标签列表
1811
- * @returns { success: 是否成功, id: 备忘录ID, memo: 备忘录对象 }
1812
- */
1813
- create(title: string, content: string, tags: any): Record<string, any>;
1814
-
1815
- /**
1816
- * 获取所有备忘录
1817
- * @returns 备忘录数组 [{ id: ID, title: 标题, content: 内容, createdAt: 创建时间, updatedAt: 更新时间, tags: 标签 }]
1818
- */
1819
- getAll(): any;
1820
-
1821
- /**
1822
- * 根据 ID 获取备忘录
1823
- * @param id 备忘录 ID
1824
- * @returns 备忘录对象或 null(不存在时)
1825
- */
1826
- getById(id: string): any;
1827
-
1828
- /**
1829
- * 搜索备忘录(标题和内容)
1830
- * @param keyword 搜索关键词
1831
- * @returns 匹配的备忘录数组
1832
- */
1833
- search(keyword: string): any;
1834
-
1835
- /**
1836
- * 更新备忘录
1837
- * @param id 备忘录 ID
1838
- * @param data 更新数据 { title?: 新标题, content?: 新内容, tags?: 新标签 }
1839
- * @returns { success: 是否成功, id: 备忘录ID }
1840
- */
1841
- update(id: string, data: Record<string, any>): Record<string, any>;
1842
-
1843
- /**
1844
- * 删除备忘录
1845
- * @param id 备忘录 ID
1846
- * @returns { success: 是否成功, id: 已删除的ID }
1847
- */
1848
- delete(id: string): Record<string, any>;
1849
-
1850
- /**
1851
- * 清空所有备忘录
1852
- * @returns { success: 是否成功 }
1853
- */
1854
- clear(): Record<string, any>;
1855
-
1856
- /**
1857
- * 获取备忘录数量
1858
- * @returns 备忘录总数
1859
- */
1860
- count(): number;
1861
-
1862
- }
1863
-
1864
- declare const memo: Memo;
1865
-
1866
1386
  interface System {
1867
1387
  /**
1868
1388
  * 检查 WiFi 是否开启
@@ -1921,7 +1441,7 @@ interface System {
1921
1441
  * @param category 音量类别: 'System', 'Ringer', 'Media',默认 'Media'
1922
1442
  * @returns 当前音量 (0.0 - 1.0)
1923
1443
  */
1924
- getVolume(category: string): number;
1444
+ getVolume(category?: string): number;
1925
1445
 
1926
1446
  /**
1927
1447
  * 设置系统音量
@@ -1929,7 +1449,7 @@ interface System {
1929
1449
  * @param category 音量类别: 'System', 'Ringer', 'Media',默认 'Media'
1930
1450
  * @returns 是否设置成功
1931
1451
  */
1932
- setVolume(level: number, category: string): boolean;
1452
+ setVolume(level: number, category?: string): boolean;
1933
1453
 
1934
1454
  /**
1935
1455
  * 检查设备是否有闪光灯
@@ -1949,7 +1469,7 @@ interface System {
1949
1469
  * @param level 亮度级别 (0.0 - 1.0),默认 1.0
1950
1470
  * @returns 是否设置成功
1951
1471
  */
1952
- setFlashlight(enabled: boolean, level: number): boolean;
1472
+ setFlashlight(enabled: boolean, level?: number): boolean;
1953
1473
 
1954
1474
  /**
1955
1475
  * 检查方向锁定是否开启
@@ -2008,7 +1528,7 @@ interface System {
2008
1528
  * @param section 设置页面: 'WIFI', 'BLUETOOTH', 'CELLULAR', 'VPN', 'GENERAL', 'DISPLAY', 'SOUND', 'NOTIFICATION', 'PRIVACY', 'BATTERY', 'STORAGE', 'WALLPAPER', 'SIRI', 'ACCESSIBILITY', 'DND', 'SCREEN_TIME', 'PASSWORDS'
2009
1529
  * @returns 是否成功打开
2010
1530
  */
2011
- openSettings(section: string): boolean;
1531
+ openSettings(section?: string): boolean;
2012
1532
 
2013
1533
  }
2014
1534
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dompling/trollscript-types",
3
- "version": "1.0.51",
3
+ "version": "1.0.54",
4
4
  "description": "TypeScript definitions for TrollScript",
5
5
  "main": "",
6
6
  "types": "index.d.ts",