xxf_react 0.2.4 → 0.2.6

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.
@@ -0,0 +1,7 @@
1
+ /**
2
+ * 类似 Kotlin 的 measureTimeMillis
3
+ * @param block 要测量的代码块
4
+ * @returns 执行时间(毫秒)
5
+ */
6
+ export declare function measureTimeMillis(block: () => void): number;
7
+ //# sourceMappingURL=Debug.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Debug.d.ts","sourceRoot":"","sources":["../../src/foundation/Debug.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,IAAI,GAAG,MAAM,CAK3D"}
@@ -0,0 +1,12 @@
1
+ import { PerformanceMonitor } from "./PerformanceMonitor";
2
+ /**
3
+ * 类似 Kotlin 的 measureTimeMillis
4
+ * @param block 要测量的代码块
5
+ * @returns 执行时间(毫秒)
6
+ */
7
+ export function measureTimeMillis(block) {
8
+ const monitor = new PerformanceMonitor();
9
+ monitor.start();
10
+ block();
11
+ return monitor.end();
12
+ }
@@ -0,0 +1,13 @@
1
+ export declare class PerformanceMonitor {
2
+ private startTime;
3
+ private label;
4
+ /**
5
+ * 开始计时
6
+ */
7
+ start(label?: string): PerformanceMonitor;
8
+ /**
9
+ * 结束计时并返回时间(毫秒)
10
+ */
11
+ end(): number;
12
+ }
13
+ //# sourceMappingURL=PerformanceMonitor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PerformanceMonitor.d.ts","sourceRoot":"","sources":["../../src/foundation/PerformanceMonitor.ts"],"names":[],"mappings":"AAAA,qBAAa,kBAAkB;IAC3B,OAAO,CAAC,SAAS,CAAY;IAC7B,OAAO,CAAC,KAAK,CAAa;IAE1B;;OAEG;IACH,KAAK,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,kBAAkB;IAOzC;;OAEG;IACH,GAAG,IAAI,MAAM;CAKhB"}
@@ -0,0 +1,26 @@
1
+ export class PerformanceMonitor {
2
+ constructor() {
3
+ this.startTime = 0;
4
+ this.label = '';
5
+ }
6
+ /**
7
+ * 开始计时
8
+ */
9
+ start(label) {
10
+ this.startTime = performance.now();
11
+ if (label)
12
+ this.label = label;
13
+ if (this.label)
14
+ console.time(this.label);
15
+ return this;
16
+ }
17
+ /**
18
+ * 结束计时并返回时间(毫秒)
19
+ */
20
+ end() {
21
+ const elapsed = performance.now() - this.startTime;
22
+ if (this.label)
23
+ console.timeEnd(this.label);
24
+ return elapsed;
25
+ }
26
+ }
@@ -0,0 +1,3 @@
1
+ export * from './Debug';
2
+ export * from './PerformanceMonitor';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/foundation/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,sBAAsB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './Debug';
2
+ export * from './PerformanceMonitor';
package/dist/index.d.ts CHANGED
@@ -6,5 +6,6 @@ export * from './models';
6
6
  export * from './media';
7
7
  export * from './flow';
8
8
  export * from './responsive';
9
+ export * from './foundation';
9
10
  export declare function initXXF(): void;
10
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAG7B,wBAAgB,OAAO,SAEtB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAG7B,wBAAgB,OAAO,SAEtB"}
package/dist/index.js CHANGED
@@ -7,6 +7,7 @@ export * from './models';
7
7
  export * from './media';
8
8
  export * from './flow';
9
9
  export * from './responsive';
10
+ export * from './foundation';
10
11
  ///框架初始化函数,调用后会初始化一些全局功能
11
12
  export function initXXF() {
12
13
  initPromiseErrorExtension();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xxf_react",
3
- "version": "0.2.4",
3
+ "version": "0.2.6",
4
4
  "private": false,
5
5
 
6
6
  "type": "module",
@@ -44,6 +44,10 @@
44
44
  "./responsive": {
45
45
  "types": "./dist/responsive/index.d.ts",
46
46
  "import": "./dist/responsive/index.js"
47
+ },
48
+ "./foundation": {
49
+ "types": "./dist/foundation/index.d.ts",
50
+ "import": "./dist/foundation/index.js"
47
51
  }
48
52
  },
49
53