@dompling/trollscript-types 1.0.48 → 1.0.49

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 +48 -0
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -625,6 +625,54 @@ interface App {
625
625
  */
626
626
  getDataContainer(bundleId: string): any;
627
627
 
628
+ /**
629
+ * 获取 CPU 使用率(进程级 + 系统级)
630
+ * @returns 包含 process (进程 CPU %) 和 system (系统 CPU 对象,含 total/user/system/idle/nice/cores) 的对象
631
+ */
632
+ cpuUsage(): any;
633
+
634
+ /**
635
+ * 获取内存使用情况
636
+ * @returns 包含 usage (当前使用 MB), peak (峰值 MB), unit (单位) 的对象
637
+ */
638
+ memoryUsage(): any;
639
+
640
+ /**
641
+ * 获取当前帧率
642
+ * @returns 包含 fps (帧率), isWarning (警告状态), isCritical (危险状态) 的对象
643
+ */
644
+ fps(): any;
645
+
646
+ /**
647
+ * 获取完整性能指标快照
648
+ * @returns 包含 cpu, memory, fps, isMonitoring, timestamp 的完整性能快照
649
+ */
650
+ performanceSnapshot(): any;
651
+
652
+ /**
653
+ * 开启性能监控(FPS 采样、指标记录)
654
+ * @returns 是否成功开启
655
+ */
656
+ startMonitoring(): boolean;
657
+
658
+ /**
659
+ * 停止性能监控
660
+ * @returns 是否成功停止
661
+ */
662
+ stopMonitoring(): boolean;
663
+
664
+ /**
665
+ * 获取历史性能记录
666
+ * @param limit 返回的记录数量,默认 50
667
+ * @returns 性能记录数组,包含 id, scriptName, executionTime, peakMemory, averageCPU, timestamp, success
668
+ */
669
+ performanceRecords(limit?: number): any;
670
+
671
+ /**
672
+ * 清除所有性能记录
673
+ */
674
+ clearPerformanceRecords(): void;
675
+
628
676
  }
629
677
 
630
678
  declare const app: App;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dompling/trollscript-types",
3
- "version": "1.0.48",
3
+ "version": "1.0.49",
4
4
  "description": "TypeScript definitions for TrollScript",
5
5
  "main": "",
6
6
  "types": "index.d.ts",