@polyvharmony/live-scenes-foundation 1.3.0 → 1.3.2-rc.1
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.
- package/CHANGELOG.md +29 -0
- package/ResourceTable.txt +17 -17
- package/oh-package.json5 +1 -1
- package/package.json +1 -1
- package/src/main/ets/common/PLVBasicDataSource.d.ets +19 -19
- package/src/main/ets/common/PLVBasicDataSource.js +75 -75
- package/src/main/ets/common/PLVCallback.d.ets +20 -19
- package/src/main/ets/common/PLVCallback.js +78 -78
- package/src/main/ets/common/PLVCommonEnums.js +16 -16
- package/src/main/ets/common/PLVDeviceUtils.d.ets +4 -4
- package/src/main/ets/common/PLVDeviceUtils.js +9 -9
- package/src/main/ets/common/PLVHashMap.d.ets +2 -2
- package/src/main/ets/common/PLVHashMap.js +2 -2
- package/src/main/ets/common/PLVJSONUtils.d.ets +13 -13
- package/src/main/ets/common/PLVJSONUtils.js +46 -46
- package/src/main/ets/common/PLVNetUtils.d.ets +4 -4
- package/src/main/ets/common/PLVNetUtils.js +24 -24
- package/src/main/ets/common/PLVPreferencesUtils.d.ets +9 -9
- package/src/main/ets/common/PLVPreferencesUtils.js +16 -16
- package/src/main/ets/common/PLVScheduledTask.d.ets +1 -1
- package/src/main/ets/common/PLVScheduledTask.js +9 -9
- package/src/main/ets/common/PLVSimpleBuffer.d.ets +3 -3
- package/src/main/ets/common/PLVSimpleBuffer.js +8 -8
- package/src/main/ets/common/PLVSparseArray.d.ets +6 -6
- package/src/main/ets/common/PLVSparseArray.js +21 -21
- package/src/main/ets/common/PLVTextUtils.d.ets +8 -8
- package/src/main/ets/common/PLVTextUtils.js +44 -44
- package/src/main/ets/common/PLVTimeUtils.d.ets +1 -1
- package/src/main/ets/common/PLVTimeUtils.js +8 -8
- package/src/main/ets/common/PLVToastUtils.d.ets +4 -4
- package/src/main/ets/common/PLVToastUtils.js +7 -7
- package/src/main/ets/common/PLVUACreator.d.ets +1 -1
- package/src/main/ets/common/PLVUACreator.js +6 -6
- package/src/main/ets/common/PLVUtils.d.ets +25 -24
- package/src/main/ets/common/PLVUtils.js +141 -141
- package/src/main/ets/common/PLVWebUtils.d.ets +4 -4
- package/src/main/ets/common/PLVWebUtils.js +46 -47
- package/src/main/ets/common/ui/PLVNodeController.d.ets +11 -9
- package/src/main/ets/common/ui/PLVNodeController.js +48 -47
- package/src/main/ets/modules/log/PLVLogger.d.ets +11 -11
- package/src/main/ets/modules/log/PLVLogger.js +36 -36
- package/src/main/ets/modules/log/PLVXLogFilePrinter.d.ets +2 -2
- package/src/main/ets/modules/log/PLVXLogFilePrinter.js +14 -12
- package/src/main/ets/modules/net/PLVHttpData.d.ets +1 -1
- package/src/main/ets/modules/net/PLVHttpData.js +3 -3
- package/src/main/ets/modules/net/PLVHttpError.d.ets +2 -2
- package/src/main/ets/modules/net/PLVHttpError.js +5 -5
- package/src/main/ets/modules/net/PLVHttpRequest.d.ets +10 -9
- package/src/main/ets/modules/net/PLVHttpRequest.js +89 -88
- package/src/main/ets/modules/net/PLVRequestSetting.d.ets +3 -3
- package/src/main/ets/modules/net/PLVRequestSetting.js +14 -14
- package/src/main/ets/modules/socket/PLVSocketIO.d.ets +20 -20
- package/src/main/ets/modules/socket/PLVSocketIO.js +61 -61
- package/src/main/ets/modules/web/PLVFailureLayout.js +17 -18
- package/src/main/ets/modules/web/PLVLoadingLayout.js +12 -13
- package/src/main/ets/modules/web/PLVNewWindowLayout.js +17 -18
- package/src/main/ets/modules/web/PLVSimpleWeb.js +75 -79
- package/src/main/ets/modules/web/PLVWebController.d.ets +39 -39
- package/src/main/ets/modules/web/PLVWebController.js +106 -106
- package/src/main/module.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import preferences from "@ohos.data.preferences";
|
|
2
2
|
export declare class PLVPreferencesUtils {
|
|
3
3
|
private constructor();
|
|
4
4
|
/**
|
|
@@ -7,7 +7,7 @@ export declare class PLVPreferencesUtils {
|
|
|
7
7
|
* @param value
|
|
8
8
|
* @param preferenceName
|
|
9
9
|
*/
|
|
10
|
-
static put(
|
|
10
|
+
static put(z5: string, a6: preferences.ValueType, b6?: string): Promise<void>;
|
|
11
11
|
/**
|
|
12
12
|
* 获取缓存值
|
|
13
13
|
* @param key
|
|
@@ -15,44 +15,44 @@ export declare class PLVPreferencesUtils {
|
|
|
15
15
|
* @param preferenceName
|
|
16
16
|
* @returns
|
|
17
17
|
*/
|
|
18
|
-
static get(
|
|
18
|
+
static get(w5: string, x5: preferences.ValueType, y5?: string): Promise<preferences.ValueType>;
|
|
19
19
|
/**
|
|
20
20
|
* 获取string类型的缓存值
|
|
21
21
|
* @param key
|
|
22
22
|
* @returns
|
|
23
23
|
*/
|
|
24
|
-
static getString(
|
|
24
|
+
static getString(u5: string, v5?: string): Promise<string>;
|
|
25
25
|
/**
|
|
26
26
|
* 获取number类型的缓存值
|
|
27
27
|
* @param key
|
|
28
28
|
* @returns
|
|
29
29
|
*/
|
|
30
|
-
static getNumber(
|
|
30
|
+
static getNumber(r5: string, s5?: string, t5?: number): Promise<number>;
|
|
31
31
|
/**
|
|
32
32
|
* 获取boolean类型的缓存值
|
|
33
33
|
* @param key
|
|
34
34
|
* @param preferenceName
|
|
35
35
|
* @returns
|
|
36
36
|
*/
|
|
37
|
-
static getBoolean(
|
|
37
|
+
static getBoolean(p5: string, q5?: string): Promise<boolean>;
|
|
38
38
|
/**
|
|
39
39
|
* 检查缓存的Preferences实例中是否包含名为给定Key的存储键值对
|
|
40
40
|
* @param key
|
|
41
41
|
* @param preferenceName
|
|
42
42
|
* @returns
|
|
43
43
|
*/
|
|
44
|
-
static has(
|
|
44
|
+
static has(n5: string, o5?: string): Promise<boolean>;
|
|
45
45
|
/**
|
|
46
46
|
* 删除缓存值
|
|
47
47
|
* @param key
|
|
48
48
|
* @param preferenceName
|
|
49
49
|
* @returns
|
|
50
50
|
*/
|
|
51
|
-
static delete(
|
|
51
|
+
static delete(l5: string, m5?: string): Promise<void>;
|
|
52
52
|
/**
|
|
53
53
|
* 清空缓存
|
|
54
54
|
* @param preferenceName
|
|
55
55
|
* @returns
|
|
56
56
|
*/
|
|
57
|
-
static clear(
|
|
57
|
+
static clear(k5?: string): Promise<void>;
|
|
58
58
|
}
|
|
@@ -3,28 +3,28 @@ const defaultPreferenceName = "PLV_SP_HARMONY_UTILS_PREFERENCES";
|
|
|
3
3
|
export class PLVPreferencesUtils {
|
|
4
4
|
constructor() {
|
|
5
5
|
}
|
|
6
|
-
static async put(
|
|
7
|
-
await PreferencesUtil.put(
|
|
6
|
+
static async put(z5, a6, b6 = defaultPreferenceName) {
|
|
7
|
+
await PreferencesUtil.put(z5, a6, b6);
|
|
8
8
|
}
|
|
9
|
-
static async get(
|
|
10
|
-
return PreferencesUtil.get(
|
|
9
|
+
static async get(w5, x5, y5 = defaultPreferenceName) {
|
|
10
|
+
return PreferencesUtil.get(w5, x5, y5);
|
|
11
11
|
}
|
|
12
|
-
static async getString(
|
|
13
|
-
return (await PreferencesUtil.get(
|
|
12
|
+
static async getString(u5, v5 = defaultPreferenceName) {
|
|
13
|
+
return (await PreferencesUtil.get(u5, "", v5));
|
|
14
14
|
}
|
|
15
|
-
static async getNumber(
|
|
16
|
-
return (await PreferencesUtil.get(
|
|
15
|
+
static async getNumber(r5, s5 = defaultPreferenceName, t5 = 0) {
|
|
16
|
+
return (await PreferencesUtil.get(r5, t5, s5));
|
|
17
17
|
}
|
|
18
|
-
static async getBoolean(
|
|
19
|
-
return (await PreferencesUtil.get(
|
|
18
|
+
static async getBoolean(p5, q5 = defaultPreferenceName) {
|
|
19
|
+
return (await PreferencesUtil.get(p5, false, q5));
|
|
20
20
|
}
|
|
21
|
-
static async has(
|
|
22
|
-
return PreferencesUtil.has(
|
|
21
|
+
static async has(n5, o5 = defaultPreferenceName) {
|
|
22
|
+
return PreferencesUtil.has(n5, o5);
|
|
23
23
|
}
|
|
24
|
-
static async delete(
|
|
25
|
-
return PreferencesUtil.delete(
|
|
24
|
+
static async delete(l5, m5 = defaultPreferenceName) {
|
|
25
|
+
return PreferencesUtil.delete(l5, m5);
|
|
26
26
|
}
|
|
27
|
-
static async clear(
|
|
28
|
-
return PreferencesUtil.clear(
|
|
27
|
+
static async clear(k5 = defaultPreferenceName) {
|
|
28
|
+
return PreferencesUtil.clear(k5);
|
|
29
29
|
}
|
|
30
30
|
}
|
|
@@ -5,7 +5,7 @@ export declare class PLVScheduledTask {
|
|
|
5
5
|
timerId?: number;
|
|
6
6
|
nextExecutionTime: number;
|
|
7
7
|
isRunning: boolean;
|
|
8
|
-
constructor(
|
|
8
|
+
constructor(f6: Function, g6: number, h6?: number);
|
|
9
9
|
start(): void;
|
|
10
10
|
scheduleNextExecution(): Promise<void>;
|
|
11
11
|
cancel(): void;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import PLVLogger from '../modules/log/PLVLogger';
|
|
2
2
|
const TAG = '[PLVScheduledTask]';
|
|
3
3
|
export class PLVScheduledTask {
|
|
4
|
-
constructor(
|
|
5
|
-
this.callback =
|
|
6
|
-
this.delay =
|
|
7
|
-
this.period =
|
|
4
|
+
constructor(f6, g6, h6 = g6) {
|
|
5
|
+
this.callback = f6;
|
|
6
|
+
this.delay = g6;
|
|
7
|
+
this.period = h6;
|
|
8
8
|
this.timerId = undefined;
|
|
9
9
|
this.nextExecutionTime = 0;
|
|
10
10
|
this.isRunning = false;
|
|
@@ -21,18 +21,18 @@ export class PLVScheduledTask {
|
|
|
21
21
|
if (!this.isRunning) {
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
24
|
-
const
|
|
25
|
-
const
|
|
24
|
+
const c6 = Date.now();
|
|
25
|
+
const d6 = Math.max(0, this.nextExecutionTime - c6);
|
|
26
26
|
this.timerId = setTimeout(async () => {
|
|
27
27
|
try {
|
|
28
28
|
await this.callback();
|
|
29
29
|
}
|
|
30
|
-
catch (
|
|
31
|
-
PLVLogger.printError(TAG, 'scheduleNextExecution error',
|
|
30
|
+
catch (e6) {
|
|
31
|
+
PLVLogger.printError(TAG, 'scheduleNextExecution error', e6);
|
|
32
32
|
}
|
|
33
33
|
this.nextExecutionTime = Date.now() + this.period;
|
|
34
34
|
this.scheduleNextExecution();
|
|
35
|
-
},
|
|
35
|
+
}, d6);
|
|
36
36
|
}
|
|
37
37
|
cancel() {
|
|
38
38
|
if (!this.isRunning) {
|
|
@@ -4,8 +4,8 @@ export declare class PLVSimpleBuffer<T> {
|
|
|
4
4
|
private intervalId?;
|
|
5
5
|
private timespan;
|
|
6
6
|
private isRelease;
|
|
7
|
-
constructor(
|
|
8
|
-
observe(
|
|
7
|
+
constructor(k6?: number);
|
|
8
|
+
observe(j6?: PLVCallback<T[]>): void;
|
|
9
9
|
release(): void;
|
|
10
|
-
push(
|
|
10
|
+
push(i6: T): void;
|
|
11
11
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
const
|
|
1
|
+
const SOCKET_EVENT_BUFFER_TIMESPAN = 500;
|
|
2
2
|
export class PLVSimpleBuffer {
|
|
3
|
-
constructor(
|
|
3
|
+
constructor(k6 = SOCKET_EVENT_BUFFER_TIMESPAN) {
|
|
4
4
|
this.buffer = [];
|
|
5
|
-
this.timespan =
|
|
5
|
+
this.timespan = SOCKET_EVENT_BUFFER_TIMESPAN;
|
|
6
6
|
this.isRelease = false;
|
|
7
|
-
this.timespan =
|
|
7
|
+
this.timespan = k6;
|
|
8
8
|
}
|
|
9
|
-
observe(
|
|
9
|
+
observe(j6) {
|
|
10
10
|
if (this.intervalId == undefined) {
|
|
11
11
|
this.intervalId = setInterval(() => {
|
|
12
12
|
if (this.buffer.length > 0) {
|
|
13
|
-
|
|
13
|
+
j6?.(this.buffer);
|
|
14
14
|
this.buffer.length = 0;
|
|
15
15
|
}
|
|
16
16
|
}, this.timespan);
|
|
@@ -21,10 +21,10 @@ export class PLVSimpleBuffer {
|
|
|
21
21
|
clearInterval(this.intervalId);
|
|
22
22
|
this.buffer.length = 0;
|
|
23
23
|
}
|
|
24
|
-
push(
|
|
24
|
+
push(i6) {
|
|
25
25
|
if (this.isRelease) {
|
|
26
26
|
return;
|
|
27
27
|
}
|
|
28
|
-
this.buffer.push(
|
|
28
|
+
this.buffer.push(i6);
|
|
29
29
|
}
|
|
30
30
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export declare class PLVSparseArray<V> {
|
|
2
2
|
private entries;
|
|
3
|
-
set(
|
|
4
|
-
get(
|
|
5
|
-
delete(
|
|
3
|
+
set(y6: number, z6: V): void;
|
|
4
|
+
get(v6: number): V | undefined;
|
|
5
|
+
delete(t6: number): void;
|
|
6
6
|
size(): number;
|
|
7
|
-
forEach(
|
|
8
|
-
forEachReverse(
|
|
9
|
-
someReverse(
|
|
7
|
+
forEach(r6: (key: number, value: V) => void): void;
|
|
8
|
+
forEachReverse(o6: (key: number, value: V) => void): void;
|
|
9
|
+
someReverse(l6: (key: number, value: V) => boolean): boolean;
|
|
10
10
|
}
|
|
@@ -2,40 +2,40 @@ export class PLVSparseArray {
|
|
|
2
2
|
constructor() {
|
|
3
3
|
this.entries = [];
|
|
4
4
|
}
|
|
5
|
-
set(
|
|
6
|
-
const
|
|
7
|
-
if (
|
|
8
|
-
this.entries[
|
|
5
|
+
set(y6, z6) {
|
|
6
|
+
const a7 = this.entries.findIndex((b7) => b7[0] >= y6);
|
|
7
|
+
if (a7 >= 0 && this.entries[a7][0] === y6) {
|
|
8
|
+
this.entries[a7][1] = z6;
|
|
9
9
|
}
|
|
10
10
|
else {
|
|
11
|
-
this.entries.splice(
|
|
11
|
+
this.entries.splice(a7 >= 0 ? a7 : this.entries.length, 0, [y6, z6]);
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
-
get(
|
|
15
|
-
const
|
|
16
|
-
return
|
|
14
|
+
get(v6) {
|
|
15
|
+
const w6 = this.entries.find((x6) => x6[0] === v6);
|
|
16
|
+
return w6 ? w6[1] : undefined;
|
|
17
17
|
}
|
|
18
|
-
delete(
|
|
19
|
-
this.entries = this.entries.filter((
|
|
18
|
+
delete(t6) {
|
|
19
|
+
this.entries = this.entries.filter((u6) => u6[0] !== t6);
|
|
20
20
|
}
|
|
21
21
|
size() {
|
|
22
22
|
return this.entries.length;
|
|
23
23
|
}
|
|
24
|
-
forEach(
|
|
25
|
-
for (const
|
|
26
|
-
|
|
24
|
+
forEach(r6) {
|
|
25
|
+
for (const s6 of this.entries) {
|
|
26
|
+
r6(s6[0], s6[1]);
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
forEachReverse(
|
|
30
|
-
for (let
|
|
31
|
-
const
|
|
32
|
-
|
|
29
|
+
forEachReverse(o6) {
|
|
30
|
+
for (let p6 = this.entries.length - 1; p6 >= 0; p6--) {
|
|
31
|
+
const q6 = this.entries[p6];
|
|
32
|
+
o6(q6[0], q6[1]);
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
someReverse(
|
|
36
|
-
for (let
|
|
37
|
-
const
|
|
38
|
-
if (
|
|
35
|
+
someReverse(l6) {
|
|
36
|
+
for (let m6 = this.entries.length - 1; m6 >= 0; m6--) {
|
|
37
|
+
const n6 = this.entries[m6];
|
|
38
|
+
if (l6(n6[0], n6[1])) {
|
|
39
39
|
return true;
|
|
40
40
|
}
|
|
41
41
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export declare class PLVTextUtils {
|
|
2
|
-
static checkValidDataLength(...
|
|
3
|
-
static parseString(
|
|
4
|
-
static convertSpecialString(
|
|
5
|
-
static toString(
|
|
6
|
-
static toWString(
|
|
7
|
-
static toKString(
|
|
8
|
-
static fixPic(
|
|
9
|
-
static isNumberZero(
|
|
2
|
+
static checkValidDataLength(...r7: string[]): boolean;
|
|
3
|
+
static parseString(j7?: string): string[];
|
|
4
|
+
static convertSpecialString(i7?: string): string;
|
|
5
|
+
static toString(h7?: number): string | undefined;
|
|
6
|
+
static toWString(g7?: number): string | undefined;
|
|
7
|
+
static toKString(f7?: number): string | undefined;
|
|
8
|
+
static fixPic(e7?: string): string;
|
|
9
|
+
static isNumberZero(c7?: string): boolean;
|
|
10
10
|
}
|
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
export class PLVTextUtils {
|
|
2
|
-
static checkValidDataLength(...
|
|
3
|
-
for (const
|
|
4
|
-
if (
|
|
2
|
+
static checkValidDataLength(...r7) {
|
|
3
|
+
for (const s7 of r7) {
|
|
4
|
+
if (s7.length == 0) {
|
|
5
5
|
return false;
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
8
|
return true;
|
|
9
9
|
}
|
|
10
|
-
static parseString(
|
|
11
|
-
if (!(
|
|
10
|
+
static parseString(j7) {
|
|
11
|
+
if (!(j7 = PLVTextUtils.convertSpecialString(j7))) {
|
|
12
12
|
return undefined;
|
|
13
13
|
}
|
|
14
|
-
const
|
|
15
|
-
let
|
|
16
|
-
let
|
|
17
|
-
const
|
|
18
|
-
while ((
|
|
19
|
-
const
|
|
20
|
-
if (
|
|
21
|
-
const
|
|
22
|
-
|
|
14
|
+
const k7 = /\[([^\[\]]{1,5})\]/g;
|
|
15
|
+
let l7;
|
|
16
|
+
let m7 = 0;
|
|
17
|
+
const n7 = [];
|
|
18
|
+
while ((l7 = k7.exec(j7)) !== null) {
|
|
19
|
+
const p7 = l7[0];
|
|
20
|
+
if (l7.index > m7) {
|
|
21
|
+
const q7 = j7.slice(m7, l7.index);
|
|
22
|
+
n7.push(q7);
|
|
23
23
|
}
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
n7.push(p7);
|
|
25
|
+
m7 = k7.lastIndex;
|
|
26
26
|
}
|
|
27
|
-
if (
|
|
28
|
-
const
|
|
29
|
-
|
|
27
|
+
if (m7 < j7.length) {
|
|
28
|
+
const o7 = j7.slice(m7);
|
|
29
|
+
n7.push(o7);
|
|
30
30
|
}
|
|
31
|
-
return
|
|
31
|
+
return n7;
|
|
32
32
|
}
|
|
33
|
-
static convertSpecialString(
|
|
34
|
-
return
|
|
33
|
+
static convertSpecialString(i7) {
|
|
34
|
+
return i7?.replace(/</g, "<")
|
|
35
35
|
.replace(/</g, "<")
|
|
36
36
|
.replace(/>/g, ">")
|
|
37
37
|
.replace(/>/g, ">")
|
|
@@ -42,38 +42,38 @@ export class PLVTextUtils {
|
|
|
42
42
|
.replace(/'/g, "'")
|
|
43
43
|
.replace(/&/g, "&");
|
|
44
44
|
}
|
|
45
|
-
static toString(
|
|
46
|
-
return (
|
|
45
|
+
static toString(h7) {
|
|
46
|
+
return (h7 || h7 == 0) ? h7 + '' : undefined;
|
|
47
47
|
}
|
|
48
|
-
static toWString(
|
|
49
|
-
if (
|
|
50
|
-
return (
|
|
48
|
+
static toWString(g7) {
|
|
49
|
+
if (g7 && g7 > 10000) {
|
|
50
|
+
return (g7 / 10000).toFixed(1) + 'w';
|
|
51
51
|
}
|
|
52
|
-
return PLVTextUtils.toString(
|
|
52
|
+
return PLVTextUtils.toString(g7);
|
|
53
53
|
}
|
|
54
|
-
static toKString(
|
|
55
|
-
if (
|
|
56
|
-
return (
|
|
54
|
+
static toKString(f7) {
|
|
55
|
+
if (f7 && f7 > 1000) {
|
|
56
|
+
return (f7 / 1000).toFixed(1) + 'k';
|
|
57
57
|
}
|
|
58
|
-
return PLVTextUtils.toString(
|
|
58
|
+
return PLVTextUtils.toString(f7);
|
|
59
59
|
}
|
|
60
|
-
static fixPic(
|
|
61
|
-
if (!
|
|
62
|
-
return
|
|
60
|
+
static fixPic(e7) {
|
|
61
|
+
if (!e7) {
|
|
62
|
+
return e7 || '';
|
|
63
63
|
}
|
|
64
|
-
if (
|
|
65
|
-
return `http:${
|
|
64
|
+
if (e7.startsWith('//')) {
|
|
65
|
+
return `http:${e7}`;
|
|
66
66
|
}
|
|
67
|
-
else if (
|
|
68
|
-
return `http://livestatic.videocc.net${
|
|
67
|
+
else if (e7.startsWith('/')) {
|
|
68
|
+
return `http://livestatic.videocc.net${e7}`;
|
|
69
69
|
}
|
|
70
|
-
return
|
|
70
|
+
return e7;
|
|
71
71
|
}
|
|
72
|
-
static isNumberZero(
|
|
73
|
-
if (!
|
|
72
|
+
static isNumberZero(c7) {
|
|
73
|
+
if (!c7) {
|
|
74
74
|
return true;
|
|
75
75
|
}
|
|
76
|
-
const
|
|
77
|
-
return
|
|
76
|
+
const d7 = parseFloat(c7);
|
|
77
|
+
return d7 === 0;
|
|
78
78
|
}
|
|
79
79
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export class PLVTimeUtils {
|
|
2
|
-
static generateTime(
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
if (
|
|
8
|
-
return `${
|
|
2
|
+
static generateTime(t7, u7) {
|
|
3
|
+
const v7 = Math.floor(t7 / 1000);
|
|
4
|
+
const w7 = v7 % 60;
|
|
5
|
+
const x7 = Math.floor((v7 / 60) % 60);
|
|
6
|
+
const y7 = Math.floor(v7 / 3600);
|
|
7
|
+
if (u7 || y7 > 0) {
|
|
8
|
+
return `${y7.toString().padStart(2, '0')}:${x7.toString().padStart(2, '0')}:${w7.toString().padStart(2, '0')}`;
|
|
9
9
|
}
|
|
10
10
|
else {
|
|
11
|
-
return `${
|
|
11
|
+
return `${x7.toString().padStart(2, '0')}:${w7.toString().padStart(2, '0')}`;
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare class PLVToastUtils {
|
|
2
|
-
shortShow(
|
|
3
|
-
longShow(
|
|
2
|
+
shortShow(c8: string | Resource): void;
|
|
3
|
+
longShow(b8: string | Resource): void;
|
|
4
4
|
private show;
|
|
5
5
|
}
|
|
6
|
-
declare const
|
|
7
|
-
export default
|
|
6
|
+
declare const _default: PLVToastUtils;
|
|
7
|
+
export default _default;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import promptAction from "@ohos.promptAction";
|
|
2
2
|
import PLVCommonConstants from './PLVCommonConstants';
|
|
3
3
|
export class PLVToastUtils {
|
|
4
|
-
shortShow(
|
|
5
|
-
this.show(
|
|
4
|
+
shortShow(c8) {
|
|
5
|
+
this.show(c8, PLVCommonConstants.LENGTH_SHORT);
|
|
6
6
|
}
|
|
7
|
-
longShow(
|
|
8
|
-
this.show(
|
|
7
|
+
longShow(b8) {
|
|
8
|
+
this.show(b8, PLVCommonConstants.LENGTH_LONG);
|
|
9
9
|
}
|
|
10
|
-
show(
|
|
10
|
+
show(z7, a8) {
|
|
11
11
|
promptAction.showToast({
|
|
12
|
-
message:
|
|
13
|
-
duration:
|
|
12
|
+
message: z7,
|
|
13
|
+
duration: a8
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import deviceInfo from '@ohos.deviceInfo';
|
|
2
2
|
export class PLVUACreator {
|
|
3
|
-
static createUA(
|
|
4
|
-
let
|
|
5
|
-
if (
|
|
6
|
-
|
|
3
|
+
static createUA(d8, e8) {
|
|
4
|
+
let f8 = d8;
|
|
5
|
+
if (e8) {
|
|
6
|
+
f8 += `(${e8})`;
|
|
7
7
|
}
|
|
8
|
-
|
|
9
|
-
return
|
|
8
|
+
f8 += ` ohos/${deviceInfo.osFullName} (HarmonyOS ${deviceInfo.osFullName}; ${deviceInfo.brand} ${deviceInfo.productModel};)`;
|
|
9
|
+
return f8;
|
|
10
10
|
}
|
|
11
11
|
}
|
|
@@ -1,32 +1,33 @@
|
|
|
1
1
|
import { PLVAvoidAreaChangeListener, PLVCallback, PLVCallback2, PLVDisposable, PLVMediaQueryListener } from './PLVCallback';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import common from "@ohos.app.ability.common";
|
|
3
|
+
import mediaquery from "@ohos.mediaquery";
|
|
4
|
+
import window from "@ohos.window";
|
|
4
5
|
import { PLVReject, PLVResolve } from './PLVType';
|
|
5
6
|
export default class PLVUtils {
|
|
6
7
|
private static readonly TIMES;
|
|
7
8
|
private constructor();
|
|
8
|
-
static init(
|
|
9
|
-
static getClassTag(
|
|
10
|
-
static retryWhen<
|
|
11
|
-
static disposablePromise<
|
|
12
|
-
static safePromise<
|
|
13
|
-
static retryPromise<
|
|
14
|
-
static delay(
|
|
15
|
-
static validCallback(
|
|
9
|
+
static init(f11: common.UIAbilityContext, g11: window.WindowStage): void;
|
|
10
|
+
static getClassTag(c11?: string | Object, d11?: boolean): string | undefined;
|
|
11
|
+
static retryWhen<u23 = void>(y10: PLVCallback<void, u23>, z10: PLVCallback<void, u23>): Promise<Awaited<u23>>;
|
|
12
|
+
static disposablePromise<t23>(v10: Promise<t23>, w10?: PLVDisposable): Promise<t23>;
|
|
13
|
+
static safePromise<s23 = void>(p10: PLVCallback2<PLVResolve<s23>, PLVReject, void>, q10?: PLVDisposable): Promise<s23>;
|
|
14
|
+
static retryPromise<r23>(h10: number, i10: number, j10: Promise<r23>, k10?: PLVDisposable): Promise<r23>;
|
|
15
|
+
static delay(f10?: number): Promise<void>;
|
|
16
|
+
static validCallback(e10: string): boolean;
|
|
16
17
|
static getPid(): string;
|
|
17
18
|
static getDeviceId(): string;
|
|
18
|
-
static undefinedToValue<
|
|
19
|
-
static copyText(
|
|
20
|
-
static listenerOrientation(
|
|
21
|
-
static listenerAvoidAreaChange(
|
|
22
|
-
static changeOrientation(
|
|
23
|
-
static isLandscape(
|
|
24
|
-
static setWindowFullScreen(
|
|
25
|
-
static setWindowSystemBarProperties(
|
|
26
|
-
static startScan(
|
|
27
|
-
static getVideoRectJS(
|
|
28
|
-
static getExitFullScreenJS(
|
|
29
|
-
static colorResourceToHex(
|
|
30
|
-
static colorIntToHex(
|
|
31
|
-
static debounce(
|
|
19
|
+
static undefinedToValue<q23>(z9: q23, a10: PLVCallback<q23, void>, b10?: number): undefined;
|
|
20
|
+
static copyText(y9: string): Promise<void>;
|
|
21
|
+
static listenerOrientation(w9: PLVCallback<mediaquery.MediaQueryResult>): PLVMediaQueryListener;
|
|
22
|
+
static listenerAvoidAreaChange(t9: PLVCallback<window.AvoidAreaOptions>): PLVAvoidAreaChangeListener;
|
|
23
|
+
static changeOrientation(m9: boolean, n9?: Object, o9?: window.Window): void;
|
|
24
|
+
static isLandscape(k9?: Object): boolean;
|
|
25
|
+
static setWindowFullScreen(z8?: boolean, a9?: boolean, b9?: Object, c9?: window.Window): Promise<Object[]>;
|
|
26
|
+
static setWindowSystemBarProperties(y8?: window.SystemBarProperties): void;
|
|
27
|
+
static startScan(s8?: Object): Promise<string>;
|
|
28
|
+
static getVideoRectJS(q8: boolean): string;
|
|
29
|
+
static getExitFullScreenJS(o8: boolean): string;
|
|
30
|
+
static colorResourceToHex(n8: Resource): string;
|
|
31
|
+
static colorIntToHex(k8: number, l8?: boolean): string;
|
|
32
|
+
static debounce(g8: Function, h8?: number, i8?: string): void;
|
|
32
33
|
}
|