mirror of
https://github.com/openharmony/third_party_jsframework.git
synced 2026-07-18 20:44:48 -04:00
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export const CommonEventData = {
|
||||
event: '[PC preview] unknow event',
|
||||
bundleName: '[PC preview] unknow bundleName',
|
||||
code: '[PC preview] unknow code',
|
||||
data: '[PC preview] unknow data',
|
||||
parameters: {}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { paramMock } from "../../utils"
|
||||
|
||||
export const CommonEventPublishData = {
|
||||
bundleName: '[PC preview] unknow bundleName',
|
||||
code: '[PC preview] unknow code',
|
||||
data: '[PC preview] unknow data',
|
||||
subscriberPermissions: [paramMock.paramStringMock],
|
||||
isOrdered: '[PC preview] unknow isOrdered',
|
||||
isSticky: '[PC preview] unknow isSticky',
|
||||
parameters: {}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { paramMock } from "../../utils"
|
||||
|
||||
export const CommonEventSubscribeInfo = {
|
||||
events: [paramMock.paramStringMock],
|
||||
publisherPermission: '[PC preview] unknow publisherPermission',
|
||||
publisherDeviceId: '[PC preview] unknow publisherDeviceId',
|
||||
userId: '[PC preview] unknow userId',
|
||||
priority: '[PC preview] unknow priority'
|
||||
}
|
||||
@@ -0,0 +1,163 @@
|
||||
/*
|
||||
* Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { paramMock } from "../../utils"
|
||||
import { CommonEventSubscribeInfo } from "./commonEventSubscribeInfo"
|
||||
|
||||
export const CommonEventSubscriber = {
|
||||
getCode: function (...args) {
|
||||
console.warn('CommonEventSubscriber.getCode interface mocked in the Previewer. How this interface works on the' +
|
||||
' Previewer may be different from that on a real device.');
|
||||
const len = args.length;
|
||||
if (typeof args[len - 1] === 'function') {
|
||||
args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramNumberMock);
|
||||
} else {
|
||||
return new Promise((resolve) => {
|
||||
resolve(paramMock.paramNumberMock);
|
||||
});
|
||||
}
|
||||
},
|
||||
setCode: function (...args) {
|
||||
console.warn('CommonEventSubscriber.setCode interface mocked in the Previewer. How this interface works on the' +
|
||||
' Previewer may be different from that on a real device.');
|
||||
const len = args.length;
|
||||
if (typeof args[len - 1] === 'function') {
|
||||
args[len - 1].call(this, paramMock.businessErrorMock);
|
||||
} else {
|
||||
return new Promise((resolve) => {
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
},
|
||||
getData: function (...args) {
|
||||
console.warn('CommonEventSubscriber.getData interface mocked in the Previewer. How this interface works on the' +
|
||||
' Previewer may be different from that on a real device.');
|
||||
const len = args.length;
|
||||
if (typeof args[len - 1] === 'function') {
|
||||
args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramStringMock);
|
||||
} else {
|
||||
return new Promise((resolve) => {
|
||||
resolve(paramMock.paramStringMock);
|
||||
});
|
||||
}
|
||||
},
|
||||
setData: function (...args) {
|
||||
console.warn('CommonEventSubscriber.setData interface mocked in the Previewer. How this interface works on the' +
|
||||
' Previewer may be different from that on a real device.');
|
||||
const len = args.length;
|
||||
if (typeof args[len - 1] === 'function') {
|
||||
args[len - 1].call(this, paramMock.businessErrorMock);
|
||||
} else {
|
||||
return new Promise((resolve) => {
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
},
|
||||
setCodeAndData: function (...args) {
|
||||
console.warn('CommonEventSubscriber.setCodeAndData interface mocked in the Previewer. How this interface works on the' +
|
||||
' Previewer may be different from that on a real device.');
|
||||
const len = args.length;
|
||||
if (typeof args[len - 1] === 'function') {
|
||||
args[len - 1].call(this, paramMock.businessErrorMock);
|
||||
} else {
|
||||
return new Promise((resolve) => {
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
},
|
||||
isOrderedCommonEvent: function (...args) {
|
||||
console.warn('CommonEventSubscriber.isOrderedCommonEvent interface mocked in the Previewer. How this interface works on the' +
|
||||
' Previewer may be different from that on a real device.');
|
||||
const len = args.length;
|
||||
if (typeof args[len - 1] === 'function') {
|
||||
args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramBooleanMock);
|
||||
} else {
|
||||
return new Promise((resolve) => {
|
||||
resolve(paramMock.paramBooleanMock);
|
||||
});
|
||||
}
|
||||
},
|
||||
isStickyCommonEvent: function (...args) {
|
||||
console.warn('CommonEventSubscriber.isStickyCommonEvent interface mocked in the Previewer. How this interface works on the' +
|
||||
' Previewer may be different from that on a real device.');
|
||||
const len = args.length;
|
||||
if (typeof args[len - 1] === 'function') {
|
||||
args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramBooleanMock);
|
||||
} else {
|
||||
return new Promise((resolve) => {
|
||||
resolve(paramMock.paramBooleanMock);
|
||||
});
|
||||
}
|
||||
},
|
||||
abortCommonEvent: function (...args) {
|
||||
console.warn('CommonEventSubscriber.abortCommonEvent interface mocked in the Previewer. How this interface works on the' +
|
||||
' Previewer may be different from that on a real device.');
|
||||
const len = args.length;
|
||||
if (typeof args[len - 1] === 'function') {
|
||||
args[len - 1].call(this, paramMock.businessErrorMock);
|
||||
} else {
|
||||
return new Promise((resolve) => {
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
},
|
||||
clearAbortCommonEvent: function (...args) {
|
||||
console.warn('CommonEventSubscriber.clearAbortCommonEvent interface mocked in the Previewer. How this interface works on the' +
|
||||
' Previewer may be different from that on a real device.');
|
||||
const len = args.length;
|
||||
if (typeof args[len - 1] === 'function') {
|
||||
args[len - 1].call(this, paramMock.businessErrorMock);
|
||||
} else {
|
||||
return new Promise((resolve) => {
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
},
|
||||
getAbortCommonEvent: function (...args) {
|
||||
console.warn('CommonEventSubscriber.getAbortCommonEvent interface mocked in the Previewer. How this interface works on the' +
|
||||
' Previewer may be different from that on a real device.');
|
||||
const len = args.length;
|
||||
if (typeof args[len - 1] === 'function') {
|
||||
args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramBooleanMock);
|
||||
} else {
|
||||
return new Promise((resolve) => {
|
||||
resolve(paramMock.paramBooleanMock);
|
||||
});
|
||||
}
|
||||
},
|
||||
getSubscribeInfo: function (...args) {
|
||||
console.warn('CommonEventSubscriber.getSubscribeInfo interface mocked in the Previewer. How this interface works on the' +
|
||||
' Previewer may be different from that on a real device.');
|
||||
const len = args.length;
|
||||
if (typeof args[len - 1] === 'function') {
|
||||
args[len - 1].call(this, paramMock.businessErrorMock, CommonEventSubscribeInfo);
|
||||
} else {
|
||||
return new Promise((resolve) => {
|
||||
resolve(CommonEventSubscribeInfo);
|
||||
});
|
||||
}
|
||||
},
|
||||
finishCommonEvent: function (...args) {
|
||||
console.warn('CommonEventSubscriber.finishCommonEvent interface mocked in the Previewer. How this interface works on the' +
|
||||
' Previewer may be different from that on a real device.');
|
||||
const len = args.length;
|
||||
if (typeof args[len - 1] === 'function') {
|
||||
args[len - 1].call(this, paramMock.businessErrorMock);
|
||||
} else {
|
||||
return new Promise((resolve, reject) => {
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { NotificationUserInput } from "./notificationUserInput"
|
||||
|
||||
export const NotificationActionButton = {
|
||||
title: '[PC preview] unknow title',
|
||||
wantAgent: '[PC preview] unknow wantAgent',
|
||||
extras: {},
|
||||
userInput: NotificationUserInput,
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { paramMock } from "../../utils"
|
||||
import { ContentType } from "../ohos_notification"
|
||||
import { PixelMapMock } from "../ohos_multimedia_image"
|
||||
|
||||
export const NotificationBasicContent = {
|
||||
title: '[PC preview] unknow title',
|
||||
text: '[PC preview] unknow text',
|
||||
additionalText: '[PC preview] unknow additionalText',
|
||||
}
|
||||
export const NotificationLongTextContent = {
|
||||
longText: '[PC preview] unknow longText',
|
||||
briefText: '[PC preview] unknow briefText',
|
||||
expandedTitle: '[PC preview] unknow expandedTitle',
|
||||
}
|
||||
export const NotificationMultiLineContent = {
|
||||
briefText: '[PC preview] unknow briefText',
|
||||
longTitle: '[PC preview] unknow longTitle',
|
||||
lines: [paramMock.paramStringMock],
|
||||
}
|
||||
export const NotificationPictureContent = {
|
||||
briefText: '[PC preview] unknow briefText',
|
||||
expandedTitle: '[PC preview] unknow expandedTitle',
|
||||
picture: PixelMapMock,
|
||||
}
|
||||
export const NotificationContent = {
|
||||
contentType: ContentType,
|
||||
normal: NotificationBasicContent,
|
||||
longText: NotificationLongTextContent,
|
||||
multiLine: NotificationMultiLineContent,
|
||||
picture: NotificationPictureContent,
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export const NotificationFlagStatus = {
|
||||
TYPE_NONE: 0,
|
||||
TYPE_OPEN: 1,
|
||||
TYPE_CLOSE: 2,
|
||||
}
|
||||
export const NotificationFlags = {
|
||||
soundEnabled: NotificationFlagStatus,
|
||||
vibrationEnabled: NotificationFlagStatus,
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { paramMock } from "../../utils"
|
||||
import { SlotType } from "../ohos_notification"
|
||||
import { NotificationActionButton } from "./notificationActionButton"
|
||||
import { PixelMapMock } from "../ohos_multimedia_image"
|
||||
import { NotificationTemplate } from "./notificationTemplate"
|
||||
import { NotificationFlags } from "./notificationFlags"
|
||||
import { NotificationContent } from "./notificationContent"
|
||||
|
||||
export const NotificationRequest = {
|
||||
content: NotificationContent,
|
||||
id: '[PC preview] unknow id',
|
||||
slotType: SlotType,
|
||||
isOngoing: '[PC preview] unknow isOngoing',
|
||||
isUnremovable: '[PC preview] unknow isUnremovable',
|
||||
deliveryTime: '[PC preview] unknow deliveryTime',
|
||||
tapDismissed: '[PC preview] unknow tapDismissed',
|
||||
autoDeletedTime: '[PC preview] unknow autoDeletedTime',
|
||||
wantAgent: '[PC preview] unknow wantAgent',
|
||||
extraInfo: {},
|
||||
color: '[PC preview] unknow color',
|
||||
colorEnabled: '[PC preview] unknow colorEnabled',
|
||||
isAlertOnce: '[PC preview] unknow isAlertOnce',
|
||||
isStopwatch: '[PC preview] unknow isStopwatch',
|
||||
isCountDown: '[PC preview] unknow isCountDown',
|
||||
isFloatingIcon: '[PC preview] unknow isFloatingIcon',
|
||||
label: '[PC preview] unknow label',
|
||||
badgeIconStyle: '[PC preview] unknow badgeIconStyle',
|
||||
showDeliveryTime: '[PC preview] unknow showDeliveryTime',
|
||||
actionButtons: [NotificationActionButton],
|
||||
smallIcon: PixelMapMock,
|
||||
largeIcon: PixelMapMock,
|
||||
groupName: '[PC preview] unknow groupName',
|
||||
creatorBundleName: '[PC preview] unknow creatorBundleName',
|
||||
creatorUid: '[PC preview] unknow creatorUid',
|
||||
creatorPid: '[PC preview] unknow creatorPid',
|
||||
creatorUserId: '[PC preview] unknow creatorUserId',
|
||||
classification: '[PC preview] unknow classification',
|
||||
hashCode: '[PC preview] unknow hashCode',
|
||||
isRemveAllowd: '[PC preview] unknow isRemveAllowd',
|
||||
source: '[PC preview] unknow source',
|
||||
template: NotificationTemplate,
|
||||
distributedOption: DistributedOptions,
|
||||
deviceId: '[PC preview] unknow deviceId',
|
||||
notificationFlags: NotificationFlags,
|
||||
removalWantAgent: '[PC preview] unknow removalWantAgent',
|
||||
badgeNumber: '[PC preview] unknow badgeNumber',
|
||||
}
|
||||
export const DistributedOptions = {
|
||||
isDistributed: '[PC preview] unknow isDistributed',
|
||||
supportDisplayDevices: [paramMock.paramStringMock],
|
||||
supportOperateDevices: [paramMock.paramStringMock],
|
||||
remindType: '[PC preview] unknow remindType',
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { paramMock } from "../../utils"
|
||||
import { SlotType, SlotLevel } from "../ohos_notification"
|
||||
|
||||
export const NotificationSlot = {
|
||||
type: SlotType,
|
||||
level: SlotLevel,
|
||||
desc: '[PC preview] unknow desc',
|
||||
badgeFlag: '[PC preview] unknow badgeFlag',
|
||||
bypassDnd: '[PC preview] unknow bypassDnd',
|
||||
lockscreenVisibility: '[PC preview] unknow lockscreenVisibility',
|
||||
vibrationEnabled: '[PC preview] unknow vibrationEnabled',
|
||||
sound: '[PC preview] unknow sound',
|
||||
lightEnabled: '[PC preview] unknow lightEnabled',
|
||||
lightColor: '[PC preview] unknow lightColor',
|
||||
vibrationValues: [paramMock.paramNumberMock],
|
||||
enabled: '[PC preview] unknow enabled',
|
||||
};
|
||||
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
* Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { NotificationSlot } from "./notificationSlot"
|
||||
|
||||
export const NotificationSorting = {
|
||||
slot: NotificationSlot,
|
||||
hashCode: '[PC preview] unknow hashCode',
|
||||
ranking: '[PC preview] unknow ranking',
|
||||
};
|
||||
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { paramMock } from "../../utils"
|
||||
|
||||
export const NotificationSortingMap = {
|
||||
sortings: {},
|
||||
sortedHashCode: [paramMock.paramStringMock],
|
||||
};
|
||||
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { paramMock } from "../../utils"
|
||||
|
||||
export const NotificationSubscribeInfo = {
|
||||
bundleNames: [paramMock.paramStringMock],
|
||||
userId: '[PC preview] unknow userId',
|
||||
};
|
||||
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { paramMock } from "../../utils"
|
||||
import { NotificationRequest } from "./notificationRequest"
|
||||
import { NotificationSortingMap } from "./notificationSortingMap"
|
||||
|
||||
export const NotificationSubscriber = {
|
||||
onConsume: function (...args) {
|
||||
console.warn("NotificationSubscriber.onConsume interface mocked in the Previewer. How this interface works on the" +
|
||||
" Previewer may be different from that on a real device.")
|
||||
},
|
||||
onCancel: function (...args) {
|
||||
console.warn("NotificationSubscriber.onCancel interface mocked in the Previewer. How this interface works on the" +
|
||||
" Previewer may be different from that on a real device.")
|
||||
},
|
||||
onUpdate: function (...args) {
|
||||
console.warn("NotificationSubscriber.onUpdate interface mocked in the Previewer. How this interface works on the" +
|
||||
" Previewer may be different from that on a real device.")
|
||||
},
|
||||
onConnect: function () {
|
||||
console.warn("NotificationSubscriber.onConnect interface mocked in the Previewer. How this interface works on the" +
|
||||
" Previewer may be different from that on a real device.")
|
||||
},
|
||||
onDisconnect: function () {
|
||||
console.warn("NotificationSubscriber.onDisconnect interface mocked in the Previewer. How this interface works on the" +
|
||||
" Previewer may be different from that on a real device.")
|
||||
},
|
||||
onDestroy: function () {
|
||||
console.warn("NotificationSubscriber.onDestroy interface mocked in the Previewer. How this interface works on the" +
|
||||
" Previewer may be different from that on a real device.")
|
||||
},
|
||||
onDoNotDisturbDateChange: function (...args) {
|
||||
console.warn("NotificationSubscriber.onDoNotDisturbDateChange interface mocked in the Previewer. How this interface works on the" +
|
||||
" Previewer may be different from that on a real device.")
|
||||
},
|
||||
onEnabledNotificationChanged: function (...args) {
|
||||
console.warn("NotificationSubscriber.onEnabledNotificationChanged interface mocked in the Previewer. How this interface works on the" +
|
||||
" Previewer may be different from that on a real device.")
|
||||
}
|
||||
}
|
||||
export const SubscribeCallbackData = {
|
||||
request: NotificationRequest,
|
||||
sortingMap: NotificationSortingMap,
|
||||
reason: '[PC preview] unknow reason',
|
||||
sound: '[PC preview] unknow sound',
|
||||
vibrationValues: [paramMock.paramNumberMock],
|
||||
}
|
||||
export const EnabledNotificationCallbackData = {
|
||||
bundle: '[PC preview] unknow bundle',
|
||||
uid: '[PC preview] unknow uid',
|
||||
enable: '[PC preview] unknow enable',
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
export const NotificationTemplate = {
|
||||
name: '[PC preview] unknow name',
|
||||
data: {},
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
export const NotificationUserInput = {
|
||||
inputKey: '[PC preview] unknow inputKey',
|
||||
}
|
||||
@@ -14,168 +14,197 @@
|
||||
*/
|
||||
|
||||
import { paramMock } from "../utils"
|
||||
import { CommonEventData } from "./commonEvent/commonEventData"
|
||||
import { CommonEventSubscriber } from "./commonEvent/commonEventSubscriber"
|
||||
|
||||
export const Support = {
|
||||
COMMON_EVENT_BOOT_COMPLETED: "usual.event.BOOT_COMPLETED",
|
||||
COMMON_EVENT_LOCKED_BOOT_COMPLETED: "usual.event.LOCKED_BOOT_COMPLETED",
|
||||
COMMON_EVENT_SHUTDOWN: "usual.event.SHUTDOWN",
|
||||
COMMON_EVENT_BATTERY_CHANGED: "usual.event.BATTERY_CHANGED",
|
||||
COMMON_EVENT_BATTERY_LOW: "usual.event.BATTERY_LOW",
|
||||
COMMON_EVENT_BATTERY_OKAY: "usual.event.BATTERY_OKAY",
|
||||
COMMON_EVENT_POWER_CONNECTED: "usual.event.POWER_CONNECTED",
|
||||
COMMON_EVENT_POWER_DISCONNECTED: "usual.event.POWER_DISCONNECTED",
|
||||
COMMON_EVENT_SCREEN_OFF: "usual.event.SCREEN_OFF",
|
||||
COMMON_EVENT_SCREEN_ON: "usual.event.SCREEN_ON",
|
||||
COMMON_EVENT_THERMAL_LEVEL_CHANGED: "usual.event.THERMAL_LEVEL_CHANGED",
|
||||
COMMON_EVENT_USER_PRESENT: "usual.event.USER_PRESENT",
|
||||
COMMON_EVENT_TIME_TICK: "usual.event.TIME_TICK",
|
||||
COMMON_EVENT_TIME_CHANGED: "usual.event.TIME_CHANGED",
|
||||
COMMON_EVENT_DATE_CHANGED: "usual.event.DATE_CHANGED",
|
||||
COMMON_EVENT_TIMEZONE_CHANGED: "usual.event.TIMEZONE_CHANGED",
|
||||
COMMON_EVENT_CLOSE_SYSTEM_DIALOGS: "usual.event.CLOSE_SYSTEM_DIALOGS",
|
||||
COMMON_EVENT_PACKAGE_ADDED: "usual.event.PACKAGE_ADDED",
|
||||
COMMON_EVENT_PACKAGE_REPLACED: "usual.event.PACKAGE_REPLACED",
|
||||
COMMON_EVENT_MY_PACKAGE_REPLACED: "usual.event.MY_PACKAGE_REPLACED",
|
||||
COMMON_EVENT_PACKAGE_REMOVED: "usual.event.PACKAGE_REMOVED",
|
||||
COMMON_EVENT_BUNDLE_REMOVED: "usual.event.BUNDLE_REMOVED",
|
||||
COMMON_EVENT_PACKAGE_FULLY_REMOVED: "usual.event.PACKAGE_FULLY_REMOVED",
|
||||
COMMON_EVENT_PACKAGE_CHANGED: "usual.event.PACKAGE_CHANGED",
|
||||
COMMON_EVENT_PACKAGE_RESTARTED: "usual.event.PACKAGE_RESTARTED",
|
||||
COMMON_EVENT_PACKAGE_DATA_CLEARED: "usual.event.PACKAGE_DATA_CLEARED",
|
||||
COMMON_EVENT_PACKAGES_SUSPENDED: "usual.event.PACKAGES_SUSPENDED",
|
||||
COMMON_EVENT_PACKAGES_UNSUSPENDED: "usual.event.PACKAGES_UNSUSPENDED",
|
||||
COMMON_EVENT_MY_PACKAGE_SUSPENDED: "usual.event.MY_PACKAGE_SUSPENDED",
|
||||
COMMON_EVENT_MY_PACKAGE_UNSUSPENDED: "usual.event.MY_PACKAGE_UNSUSPENDED",
|
||||
COMMON_EVENT_UID_REMOVED: "usual.event.UID_REMOVED",
|
||||
COMMON_EVENT_PACKAGE_FIRST_LAUNCH: "usual.event.PACKAGE_FIRST_LAUNCH",
|
||||
COMMON_EVENT_PACKAGE_NEEDS_VERIFICATION: "usual.event.PACKAGE_NEEDS_VERIFICATION",
|
||||
COMMON_EVENT_PACKAGE_VERIFIED: "usual.event.PACKAGE_VERIFIED",
|
||||
COMMON_EVENT_EXTERNAL_APPLICATIONS_AVAILABLE: "usual.event.EXTERNAL_APPLICATIONS_AVAILABLE",
|
||||
COMMON_EVENT_EXTERNAL_APPLICATIONS_UNAVAILABLE: "usual.event.EXTERNAL_APPLICATIONS_UNAVAILABLE",
|
||||
COMMON_EVENT_CONFIGURATION_CHANGED: "usual.event.CONFIGURATION_CHANGED",
|
||||
COMMON_EVENT_LOCALE_CHANGED: "usual.event.LOCALE_CHANGED",
|
||||
COMMON_EVENT_MANAGE_PACKAGE_STORAGE: "usual.event.MANAGE_PACKAGE_STORAGE",
|
||||
COMMON_EVENT_DRIVE_MODE: "common.event.DRIVE_MODE",
|
||||
COMMON_EVENT_HOME_MODE: "common.event.HOME_MODE",
|
||||
COMMON_EVENT_OFFICE_MODE: "common.event.OFFICE_MODE",
|
||||
COMMON_EVENT_USER_STARTED: "usual.event.USER_STARTED",
|
||||
COMMON_EVENT_USER_BACKGROUND: "usual.event.USER_BACKGROUND",
|
||||
COMMON_EVENT_USER_FOREGROUND: "usual.event.USER_FOREGROUND",
|
||||
COMMON_EVENT_USER_SWITCHED: "usual.event.USER_SWITCHED",
|
||||
COMMON_EVENT_USER_STARTING: "usual.event.USER_STARTING",
|
||||
COMMON_EVENT_USER_UNLOCKED: "usual.event.USER_UNLOCKED",
|
||||
COMMON_EVENT_USER_STOPPING: "usual.event.USER_STOPPING",
|
||||
COMMON_EVENT_USER_STOPPED: "usual.event.USER_STOPPED",
|
||||
COMMON_EVENT_HWID_LOGIN: "common.event.HWID_LOGIN",
|
||||
COMMON_EVENT_HWID_LOGOUT: "common.event.HWID_LOGOUT",
|
||||
COMMON_EVENT_HWID_TOKEN_INVALID: "common.event.HWID_TOKEN_INVALID",
|
||||
COMMON_EVENT_HWID_LOGOFF: "common.event.HWID_LOGOFF",
|
||||
COMMON_EVENT_WIFI_POWER_STATE: "usual.event.wifi.POWER_STATE",
|
||||
COMMON_EVENT_WIFI_SCAN_FINISHED: "usual.event.wifi.SCAN_FINISHED",
|
||||
COMMON_EVENT_WIFI_RSSI_VALUE: "usual.event.wifi.RSSI_VALUE",
|
||||
COMMON_EVENT_WIFI_CONN_STATE: "usual.event.wifi.CONN_STATE",
|
||||
COMMON_EVENT_WIFI_HOTSPOT_STATE: "usual.event.wifi.HOTSPOT_STATE",
|
||||
COMMON_EVENT_WIFI_AP_STA_JOIN: "usual.event.wifi.WIFI_HS_STA_JOIN",
|
||||
COMMON_EVENT_WIFI_AP_STA_LEAVE: "usual.event.wifi.WIFI_HS_STA_LEAVE",
|
||||
COMMON_EVENT_WIFI_MPLINK_STATE_CHANGE: "usual.event.wifi.mplink.STATE_CHANGE",
|
||||
COMMON_EVENT_WIFI_P2P_CONN_STATE: "usual.event.wifi.p2p.CONN_STATE_CHANGE",
|
||||
COMMON_EVENT_WIFI_P2P_STATE_CHANGED: "usual.event.wifi.p2p.STATE_CHANGE",
|
||||
COMMON_EVENT_WIFI_P2P_PEERS_STATE_CHANGED: "usual.event.wifi.p2p.DEVICES_CHANGE",
|
||||
COMMON_EVENT_WIFI_P2P_PEERS_DISCOVERY_STATE_CHANGED: "usual.event.wifi.p2p.PEER_DISCOVERY_STATE_CHANGE",
|
||||
COMMON_EVENT_WIFI_P2P_CURRENT_DEVICE_STATE_CHANGED:"usual.event.wifi.p2p.CURRENT_DEVICE_CHANGE",
|
||||
COMMON_EVENT_WIFI_P2P_GROUP_STATE_CHANGED:"usual.event.wifi.p2p.GROUP_STATE_CHANGED",
|
||||
COMMON_EVENT_BLUETOOTH_HANDSFREE_AG_CONNECT_STATE_UPDATE:
|
||||
"usual.event.bluetooth.handsfree.ag.CONNECT_STATE_UPDATE",
|
||||
COMMON_EVENT_BLUETOOTH_HANDSFREE_AG_CURRENT_DEVICE_UPDATE:
|
||||
"usual.event.bluetooth.handsfree.ag.CURRENT_DEVICE_UPDATE",
|
||||
COMMON_EVENT_BLUETOOTH_HANDSFREE_AG_AUDIO_STATE_UPDATE: "usual.event.bluetooth.handsfree.ag.AUDIO_STATE_UPDATE",
|
||||
COMMON_EVENT_BLUETOOTH_A2DPSOURCE_CONNECT_STATE_UPDATE:"usual.event.bluetooth.a2dpsource.CONNECT_STATE_UPDATE",
|
||||
COMMON_EVENT_BLUETOOTH_A2DPSOURCE_CURRENT_DEVICE_UPDATE: "usual.event.bluetooth.a2dpsource.CURRENT_DEVICE_UPDATE",
|
||||
COMMON_EVENT_BLUETOOTH_A2DPSOURCE_PLAYING_STATE_UPDATE: "usual.event.bluetooth.a2dpsource.PLAYING_STATE_UPDATE",
|
||||
COMMON_EVENT_BLUETOOTH_A2DPSOURCE_AVRCP_CONNECT_STATE_UPDATE:
|
||||
"usual.event.bluetooth.a2dpsource.AVRCP_CONNECT_STATE_UPDATE",
|
||||
COMMON_EVENT_BLUETOOTH_A2DPSOURCE_CODEC_VALUE_UPDATE: "usual.event.bluetooth.a2dpsource.CODEC_VALUE_UPDATE",
|
||||
COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_DISCOVERED: "usual.event.bluetooth.remotedevice.DISCOVERED",
|
||||
COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_CLASS_VALUE_UPDATE: "usual.event.bluetooth.remotedevice.CLASS_VALUE_UPDATE",
|
||||
COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_ACL_CONNECTED: "usual.event.bluetooth.remotedevice.ACL_CONNECTED",
|
||||
COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_ACL_DISCONNECTED: "usual.event.bluetooth.remotedevice.ACL_DISCONNECTED",
|
||||
COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_NAME_UPDATE:
|
||||
"usual.event.bluetooth.remotedevice.NAME_UPDATE",
|
||||
COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_PAIR_STATE:
|
||||
"usual.event.bluetooth.remotedevice.PAIR_STATE",
|
||||
COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_BATTERY_VALUE_UPDATE:
|
||||
"usual.event.bluetooth.remotedevice.BATTERY_VALUE_UPDATE",
|
||||
COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_SDP_RESULT:
|
||||
"usual.event.bluetooth.remotedevice.SDP_RESULT",
|
||||
COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_UUID_VALUE:
|
||||
"usual.event.bluetooth.remotedevice.UUID_VALUE",
|
||||
COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_PAIRING_REQ:
|
||||
"usual.event.bluetooth.remotedevice.PAIRING_REQ",
|
||||
COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_PAIRING_CANCEL:
|
||||
"usual.event.bluetooth.remotedevice.PAIRING_CANCEL",
|
||||
COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_CONNECT_REQ:
|
||||
"usual.event.bluetooth.remotedevice.CONNECT_REQ",
|
||||
COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_CONNECT_REPLY:
|
||||
"usual.event.bluetooth.remotedevice.CONNECT_REPLY",
|
||||
COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_CONNECT_CANCEL:
|
||||
"usual.event.bluetooth.remotedevice.CONNECT_CANCEL",
|
||||
COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_CONNECT_STATE_UPDATE:
|
||||
"usual.event.bluetooth.handsfreeunit.CONNECT_STATE_UPDATE",
|
||||
COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_AUDIO_STATE_UPDATE:
|
||||
"usual.event.bluetooth.handsfreeunit.AUDIO_STATE_UPDATE",
|
||||
COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_AG_COMMON_EVENT:
|
||||
"usual.event.bluetooth.handsfreeunit.AG_COMMON_EVENT",
|
||||
COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_AG_CALL_STATE_UPDATE:
|
||||
"usual.event.bluetooth.handsfreeunit.AG_CALL_STATE_UPDATE",
|
||||
COMMON_EVENT_BLUETOOTH_HOST_STATE_UPDATE:
|
||||
"usual.event.bluetooth.host.STATE_UPDATE",
|
||||
COMMON_EVENT_BLUETOOTH_HOST_REQ_DISCOVERABLE:
|
||||
"usual.event.bluetooth.host.REQ_DISCOVERABLE",
|
||||
COMMON_EVENT_BLUETOOTH_HOST_REQ_ENABLE: "usual.event.bluetooth.host.REQ_ENABLE",
|
||||
COMMON_EVENT_BLUETOOTH_HOST_REQ_DISABLE:
|
||||
"usual.event.bluetooth.host.REQ_DISABLE",
|
||||
COMMON_EVENT_BLUETOOTH_HOST_SCAN_MODE_UPDATE:
|
||||
"usual.event.bluetooth.host.SCAN_MODE_UPDATE",
|
||||
COMMON_EVENT_BLUETOOTH_HOST_DISCOVERY_STARTED:
|
||||
"usual.event.bluetooth.host.DISCOVERY_STARTED",
|
||||
COMMON_EVENT_BLUETOOTH_HOST_DISCOVERY_FINISHED:
|
||||
"usual.event.bluetooth.host.DISCOVERY_FINISHED",
|
||||
COMMON_EVENT_BLUETOOTH_HOST_NAME_UPDATE:
|
||||
"usual.event.bluetooth.host.NAME_UPDATE",
|
||||
COMMON_EVENT_BLUETOOTH_A2DPSINK_CONNECT_STATE_UPDATE:
|
||||
"usual.event.bluetooth.a2dpsink.CONNECT_STATE_UPDATE",
|
||||
COMMON_EVENT_BLUETOOTH_A2DPSINK_PLAYING_STATE_UPDATE:
|
||||
"usual.event.bluetooth.a2dpsink.PLAYING_STATE_UPDATE",
|
||||
COMMON_EVENT_BLUETOOTH_A2DPSINK_AUDIO_STATE_UPDATE:
|
||||
"usual.event.bluetooth.a2dpsink.AUDIO_STATE_UPDATE",
|
||||
COMMON_EVENT_NFC_ACTION_ADAPTER_STATE_CHANGED:
|
||||
"usual.event.nfc.action.ADAPTER_STATE_CHANGED",
|
||||
COMMON_EVENT_NFC_ACTION_RF_FIELD_ON_DETECTED:
|
||||
"usual.event.nfc.action.RF_FIELD_ON_DETECTED",
|
||||
COMMON_EVENT_NFC_ACTION_RF_FIELD_OFF_DETECTED:
|
||||
"usual.event.nfc.action.RF_FIELD_OFF_DETECTED",
|
||||
COMMON_EVENT_DISCHARGING: "usual.event.DISCHARGING",
|
||||
COMMON_EVENT_CHARGING: "usual.event.CHARGING",
|
||||
COMMON_EVENT_DEVICE_IDLE_MODE_CHANGED: "usual.event.DEVICE_IDLE_MODE_CHANGED",
|
||||
COMMON_EVENT_POWER_SAVE_MODE_CHANGED: "usual.event.POWER_SAVE_MODE_CHANGED",
|
||||
COMMON_EVENT_USER_ADDED: "usual.event.USER_ADDED",
|
||||
COMMON_EVENT_USER_REMOVED: "usual.event.USER_REMOVED",
|
||||
COMMON_EVENT_ABILITY_ADDED: "common.event.ABILITY_ADDED",
|
||||
COMMON_EVENT_ABILITY_REMOVED: "common.event.ABILITY_REMOVED",
|
||||
COMMON_EVENT_ABILITY_UPDATED: "common.event.ABILITY_UPDATED",
|
||||
COMMON_EVENT_LOCATION_MODE_STATE_CHANGED:
|
||||
"usual.event.location.MODE_STATE_CHANGED",
|
||||
COMMON_EVENT_IVI_SLEEP: "common.event.IVI_SLEEP",
|
||||
COMMON_EVENT_IVI_PAUSE: "common.event.IVI_PAUSE",
|
||||
COMMON_EVENT_IVI_STANDBY: "common.event.IVI_STANDBY",
|
||||
COMMON_EVENT_IVI_LASTMODE_SAVE: "common.event.IVI_LASTMODE_SAVE",
|
||||
COMMON_EVENT_IVI_VOLTAGE_ABNORMAL: "common.event.IVI_VOLTAGE_ABNORMAL",
|
||||
COMMON_EVENT_IVI_HIGH_TEMPERATURE: "common.event.IVI_HIGH_TEMPERATURE",
|
||||
COMMON_EVENT_IVI_EXTREME_TEMPERATURE: "common.event.IVI_EXTREME_TEMPERATURE",
|
||||
COMMON_EVENT_IVI_TEMPERATURE_ABNORMAL: "common.event.IVI_TEMPERATURE_ABNORMAL",
|
||||
COMMON_EVENT_IVI_VOLTAGE_RECOVERY: "common.event.IVI_VOLTAGE_RECOVERY",
|
||||
COMMON_EVENT_IVI_TEMPERATURE_RECOVERY: "common.event.IVI_TEMPERATURE_RECOVERY",
|
||||
COMMON_EVENT_IVI_ACTIVE: "common.event.IVI_ACTIVE",
|
||||
COMMON_EVENT_USB_DEVICE_ATTACHED:
|
||||
"usual.event.hardware.usb.action.USB_DEVICE_ATTACHED",
|
||||
COMMON_EVENT_USB_DEVICE_DETACHED:
|
||||
"usual.event.hardware.usb.action.USB_DEVICE_DETACHED",
|
||||
COMMON_EVENT_USB_ACCESSORY_ATTACHED:
|
||||
"usual.event.hardware.usb.action.USB_ACCESSORY_ATTACHED",
|
||||
COMMON_EVENT_USB_ACCESSORY_DETACHED:
|
||||
"usual.event.hardware.usb.action.USB_ACCESSORY_DETACHED",
|
||||
COMMON_EVENT_DISK_REMOVED: "usual.event.data.DISK_REMOVED",
|
||||
COMMON_EVENT_DISK_UNMOUNTED: "usual.event.data.DISK_UNMOUNTED",
|
||||
COMMON_EVENT_DISK_MOUNTED: "usual.event.data.DISK_MOUNTED",
|
||||
COMMON_EVENT_DISK_BAD_REMOVAL: "usual.event.data.DISK_BAD_REMOVAL",
|
||||
COMMON_EVENT_DISK_UNMOUNTABLE: "usual.event.data.DISK_UNMOUNTABLE",
|
||||
COMMON_EVENT_DISK_EJECT: "usual.event.data.DISK_EJECT",
|
||||
COMMON_EVENT_VOLUME_REMOVED: "usual.event.data.VOLUME_REMOVED",
|
||||
COMMON_EVENT_VOLUME_UNMOUNTED: "usual.event.data.VOLUME_UNMOUNTED",
|
||||
COMMON_EVENT_VOLUME_MOUNTED: "usual.event.data.VOLUME_MOUNTED",
|
||||
COMMON_EVENT_VOLUME_BAD_REMOVAL: "usual.event.data.VOLUME_BAD_REMOVAL",
|
||||
COMMON_EVENT_VOLUME_EJECT: "usual.event.data.VOLUME_EJECT",
|
||||
COMMON_EVENT_VISIBLE_ACCOUNTS_UPDATED:
|
||||
"usual.event.data.VISIBLE_ACCOUNTS_UPDATED",
|
||||
COMMON_EVENT_ACCOUNT_DELETED: "usual.event.data.ACCOUNT_DELETED",
|
||||
COMMON_EVENT_FOUNDATION_READY: "common.event.FOUNDATION_READY",
|
||||
COMMON_EVENT_AIRPLANE_MODE_CHANGED: "usual.event.AIRPLANE_MODE",
|
||||
COMMON_EVENT_SPLIT_SCREEN: "common.event.SPLIT_SCREEN"
|
||||
}
|
||||
export function mockCommonEvent() {
|
||||
const CommonEventDataMock = {
|
||||
event: '[PC preview] unknow event',
|
||||
bundleName: '[PC preview] unknow bundleName',
|
||||
code: '[PC preview] unknow code',
|
||||
data: '[PC preview] unknow data',
|
||||
parameters: {}
|
||||
}
|
||||
const CommonEventSubscribeInfoMock = {
|
||||
events: [paramMock.paramStringMock],
|
||||
publisherPermission: '[PC preview] unknow publisherPermission',
|
||||
publisherDeviceId: '[PC preview] unknow publisherDeviceId',
|
||||
userId: '[PC preview] unknow userId',
|
||||
priority: '[PC preview] unknow priority'
|
||||
}
|
||||
const CommonEventSubscriberMock = {
|
||||
getCode: function (...args) {
|
||||
console.warn('CommonEventSubscriber.getCode interface mocked in the Previewer. How this interface works on the' +
|
||||
' Previewer may be different from that on a real device.');
|
||||
const len = args.length;
|
||||
if (typeof args[len - 1] === 'function') {
|
||||
args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramNumberMock);
|
||||
} else {
|
||||
return new Promise((resolve) => {
|
||||
resolve(paramMock.paramNumberMock);
|
||||
});
|
||||
}
|
||||
},
|
||||
setCode: function (...args) {
|
||||
console.warn('CommonEventSubscriber.setCode interface mocked in the Previewer. How this interface works on the' +
|
||||
' Previewer may be different from that on a real device.');
|
||||
const len = args.length;
|
||||
if (typeof args[len - 1] === 'function') {
|
||||
args[len - 1].call(this, paramMock.businessErrorMock);
|
||||
} else {
|
||||
return new Promise((resolve) => {
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
},
|
||||
getData: function (...args) {
|
||||
console.warn('CommonEventSubscriber.getData interface mocked in the Previewer. How this interface works on the' +
|
||||
' Previewer may be different from that on a real device.');
|
||||
const len = args.length;
|
||||
if (typeof args[len - 1] === 'function') {
|
||||
args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramStringMock);
|
||||
} else {
|
||||
return new Promise((resolve) => {
|
||||
resolve(paramMock.paramStringMock);
|
||||
});
|
||||
}
|
||||
},
|
||||
setData: function (...args) {
|
||||
console.warn('CommonEventSubscriber.setData interface mocked in the Previewer. How this interface works on the' +
|
||||
' Previewer may be different from that on a real device.');
|
||||
const len = args.length;
|
||||
if (typeof args[len - 1] === 'function') {
|
||||
args[len - 1].call(this, paramMock.businessErrorMock);
|
||||
} else {
|
||||
return new Promise((resolve) => {
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
},
|
||||
setCodeAndData: function (...args) {
|
||||
console.warn('CommonEventSubscriber.setCodeAndData interface mocked in the Previewer. How this interface works on the' +
|
||||
' Previewer may be different from that on a real device.');
|
||||
const len = args.length;
|
||||
if (typeof args[len - 1] === 'function') {
|
||||
args[len - 1].call(this, paramMock.businessErrorMock);
|
||||
} else {
|
||||
return new Promise((resolve) => {
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
},
|
||||
isOrderedCommonEvent: function (...args) {
|
||||
console.warn('CommonEventSubscriber.isOrderedCommonEvent interface mocked in the Previewer. How this interface works on the' +
|
||||
' Previewer may be different from that on a real device.');
|
||||
const len = args.length;
|
||||
if (typeof args[len - 1] === 'function') {
|
||||
args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramBooleanMock);
|
||||
} else {
|
||||
return new Promise((resolve) => {
|
||||
resolve(paramMock.paramBooleanMock);
|
||||
});
|
||||
}
|
||||
},
|
||||
isStickyCommonEvent: function (...args) {
|
||||
console.warn('CommonEventSubscriber.isStickyCommonEvent interface mocked in the Previewer. How this interface works on the' +
|
||||
' Previewer may be different from that on a real device.');
|
||||
const len = args.length;
|
||||
if (typeof args[len - 1] === 'function') {
|
||||
args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramBooleanMock);
|
||||
} else {
|
||||
return new Promise((resolve) => {
|
||||
resolve(paramMock.paramBooleanMock);
|
||||
});
|
||||
}
|
||||
},
|
||||
abortCommonEvent: function (...args) {
|
||||
console.warn('CommonEventSubscriber.abortCommonEvent interface mocked in the Previewer. How this interface works on the' +
|
||||
' Previewer may be different from that on a real device.');
|
||||
const len = args.length;
|
||||
if (typeof args[len - 1] === 'function') {
|
||||
args[len - 1].call(this, paramMock.businessErrorMock);
|
||||
} else {
|
||||
return new Promise((resolve) => {
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
},
|
||||
clearAbortCommonEvent: function (...args) {
|
||||
console.warn('CommonEventSubscriber.clearAbortCommonEvent interface mocked in the Previewer. How this interface works on the' +
|
||||
' Previewer may be different from that on a real device.');
|
||||
const len = args.length;
|
||||
if (typeof args[len - 1] === 'function') {
|
||||
args[len - 1].call(this, paramMock.businessErrorMock);
|
||||
} else {
|
||||
return new Promise((resolve) => {
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
},
|
||||
getAbortCommonEvent: function (...args) {
|
||||
console.warn('CommonEventSubscriber.getAbortCommonEvent interface mocked in the Previewer. How this interface works on the' +
|
||||
' Previewer may be different from that on a real device.');
|
||||
const len = args.length;
|
||||
if (typeof args[len - 1] === 'function') {
|
||||
args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramBooleanMock);
|
||||
} else {
|
||||
return new Promise((resolve) => {
|
||||
resolve(paramMock.paramBooleanMock);
|
||||
});
|
||||
}
|
||||
},
|
||||
getSubscribeInfo: function (...args) {
|
||||
console.warn('CommonEventSubscriber.getSubscribeInfo interface mocked in the Previewer. How this interface works on the' +
|
||||
' Previewer may be different from that on a real device.');
|
||||
const len = args.length;
|
||||
if (typeof args[len - 1] === 'function') {
|
||||
args[len - 1].call(this, paramMock.businessErrorMock, CommonEventSubscribeInfoMock);
|
||||
} else {
|
||||
return new Promise((resolve) => {
|
||||
resolve(CommonEventSubscribeInfoMock);
|
||||
});
|
||||
}
|
||||
},
|
||||
finishCommonEvent: function (...args) {
|
||||
console.warn('CommonEventSubscriber.finishCommonEvent interface mocked in the Previewer. How this interface works on the' +
|
||||
' Previewer may be different from that on a real device.');
|
||||
const len = args.length;
|
||||
if (typeof args[len - 1] === 'function') {
|
||||
args[len - 1].call(this, paramMock.businessErrorMock);
|
||||
} else {
|
||||
return new Promise((resolve, reject) => {
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
},
|
||||
}
|
||||
const commonEvent = {
|
||||
publish: function (...args) {
|
||||
console.warn('commonEvent.publish interface mocked in the Previewer. How this interface works on the' +
|
||||
@@ -198,10 +227,10 @@ export function mockCommonEvent() {
|
||||
' Previewer may be different from that on a real device.');
|
||||
const len = args.length;
|
||||
if (typeof args[len - 1] === 'function') {
|
||||
args[len - 1].call(this, paramMock.businessErrorMock, CommonEventSubscriberMock);
|
||||
args[len - 1].call(this, paramMock.businessErrorMock, CommonEventSubscriber);
|
||||
} else {
|
||||
return new Promise((resolve) => {
|
||||
resolve(CommonEventSubscriberMock);
|
||||
resolve(CommonEventSubscriber);
|
||||
});
|
||||
}
|
||||
},
|
||||
@@ -210,7 +239,7 @@ export function mockCommonEvent() {
|
||||
' Previewer may be different from that on a real device.');
|
||||
const len = args.length;
|
||||
if (typeof args[len - 1] === 'function') {
|
||||
args[len - 1].call(this, paramMock.businessErrorMock, CommonEventDataMock);
|
||||
args[len - 1].call(this, paramMock.businessErrorMock, CommonEventData);
|
||||
}
|
||||
},
|
||||
unsubscribe: function (...args) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
@@ -15,17 +15,28 @@
|
||||
|
||||
import { paramMock } from "../utils"
|
||||
|
||||
export const EventPriority = {
|
||||
IMMEDIATE: 0,
|
||||
HIGH: 1,
|
||||
LOW: 2,
|
||||
IDLE: 3,
|
||||
}
|
||||
export const EventData = {
|
||||
data: '[PC preview] unknow data',
|
||||
}
|
||||
export const InnerEvent = {
|
||||
eventId: '[PC preview] unknow eventId',
|
||||
priority: EventPriority,
|
||||
}
|
||||
|
||||
export function mockEmitter() {
|
||||
const EventDataMock = {
|
||||
data: '[PC preview] unknow data',
|
||||
};
|
||||
const emitter = {
|
||||
on: function (...args) {
|
||||
console.warn("emitter.on interface mocked in the Previewer. How this interface works on the" +
|
||||
" Previewer may be different from that on a real device.");
|
||||
const len = args.length;
|
||||
if (typeof args[len - 1] === 'function') {
|
||||
args[len - 1].call(this, EventDataMock);
|
||||
args[len - 1].call(this, EventData);
|
||||
}
|
||||
},
|
||||
once: function (...args) {
|
||||
@@ -33,7 +44,7 @@ export function mockEmitter() {
|
||||
" Previewer may be different from that on a real device.");
|
||||
const len = args.length;
|
||||
if (typeof args[len - 1] === 'function') {
|
||||
args[len - 1].call(this, EventDataMock);
|
||||
args[len - 1].call(this, EventData);
|
||||
}
|
||||
},
|
||||
off: function (...args) {
|
||||
|
||||
@@ -14,303 +14,279 @@
|
||||
*/
|
||||
|
||||
import { paramMock } from "../utils"
|
||||
import { NotificationSlot } from "./notification/notificationSlot"
|
||||
import { NotificationRequest } from "./notification/notificationRequest"
|
||||
|
||||
export const SlotType = {
|
||||
UNKNOWN_TYPE: 0,
|
||||
SOCIAL_COMMUNICATION: 1,
|
||||
SERVICE_INFORMATION: 2,
|
||||
CONTENT_INFORMATION: 3,
|
||||
OTHER_TYPES: 0xFFFF,
|
||||
}
|
||||
export const ContentType = {
|
||||
NOTIFICATION_CONTENT_BASIC_TEXT: 0,
|
||||
NOTIFICATION_CONTENT_LONG_TEXT: 1,
|
||||
NOTIFICATION_CONTENT_PICTURE: 2,
|
||||
NOTIFICATION_CONTENT_CONVERSATION: 3,
|
||||
NOTIFICATION_CONTENT_MULTILINE: 4,
|
||||
}
|
||||
export const SlotLevel = {
|
||||
LEVEL_NONE: 0,
|
||||
LEVEL_MIN: 1,
|
||||
LEVEL_LOW: 2,
|
||||
LEVEL_DEFAULT: 3,
|
||||
LEVEL_HIGH: 4,
|
||||
}
|
||||
export const BundleOption = {
|
||||
bundle: '[PC preview] unknow bundle',
|
||||
uid: '[PC preview] unknow uid',
|
||||
}
|
||||
export const NotificationKey = {
|
||||
id: '[PC preview] unknow id',
|
||||
label: '[PC preview] unknow label',
|
||||
}
|
||||
export const DoNotDisturbType = {
|
||||
TYPE_NONE: 0,
|
||||
TYPE_ONCE: 1,
|
||||
TYPE_DAILY: 2,
|
||||
TYPE_CLEARLY: 3,
|
||||
}
|
||||
const Date = {
|
||||
toString: function () {
|
||||
console.warn("Date.toString interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramStringMock
|
||||
},
|
||||
toDateString: function () {
|
||||
console.warn("Date.toDateString interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramStringMock
|
||||
},
|
||||
toTimeString: function () {
|
||||
console.warn("Date.toTimeString interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramStringMock
|
||||
},
|
||||
toLocaleString: function () {
|
||||
console.warn("Date.toLocaleString interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramStringMock
|
||||
},
|
||||
toLocaleDateString: function () {
|
||||
console.warn("Date.toLocaleDateString interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramStringMock
|
||||
},
|
||||
toLocaleTimeString: function () {
|
||||
console.warn("Date.toLocaleTimeString interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramStringMock
|
||||
},
|
||||
valueOf: function () {
|
||||
console.warn("Date.valueOf interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
getTime: function () {
|
||||
console.warn("Date.getTime interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
getFullYear: function () {
|
||||
console.warn("Date.getFullYear interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
getUTCFullYear: function () {
|
||||
console.warn("Date.getUTCFullYear interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
getMonth: function () {
|
||||
console.warn("Date.getMonth interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
getUTCMonth: function () {
|
||||
console.warn("Date.getUTCMonth interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
getDate: function () {
|
||||
console.warn("Date.getDate interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
getUTCDate: function () {
|
||||
console.warn("Date.getUTCDate interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
getDay: function () {
|
||||
console.warn("Date.getDay interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
getUTCDay: function () {
|
||||
console.warn("Date.getUTCDay interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
getHours: function () {
|
||||
console.warn("Date.getHours interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
getUTCHours: function () {
|
||||
console.warn("Date.getUTCHours interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
getMinutes: function () {
|
||||
console.warn("Date.getMinutes interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
getUTCMinutes: function () {
|
||||
console.warn("Date.getUTCMinutes interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
getSeconds: function () {
|
||||
console.warn("Date.getSeconds interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
getUTCSeconds: function () {
|
||||
console.warn("Date.getUTCSeconds interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
getMilliseconds: function () {
|
||||
console.warn("Date.getMilliseconds interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
getUTCMilliseconds: function () {
|
||||
console.warn("Date.getUTCMilliseconds interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
getTimezoneOffset: function () {
|
||||
console.warn("Date.getTimezoneOffset interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
setTime: function (...args) {
|
||||
console.warn("Date.setTime interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
setMilliseconds: function (...args) {
|
||||
console.warn("Date.setMilliseconds interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
setUTCMilliseconds: function (...args) {
|
||||
console.warn("Date.setUTCMilliseconds interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
setSeconds: function (...args) {
|
||||
console.warn("Date.setSeconds interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
setUTCSeconds: function (...args) {
|
||||
console.warn("Date.setUTCSeconds interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
setMinutes: function (...args) {
|
||||
console.warn("Date.setMinutes interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
setUTCMinutes: function (...args) {
|
||||
console.warn("Date.setUTCMinutes interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
setHours: function (...args) {
|
||||
console.warn("Date.setHours interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
setUTCHours: function (...args) {
|
||||
console.warn("Date.setUTCHours interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
setDate: function (...args) {
|
||||
console.warn("Date.setDate interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
setUTCDate: function (...args) {
|
||||
console.warn("Date.setUTCDate interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
setMonth: function (...args) {
|
||||
console.warn("Date.setMonth interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
setUTCMonth: function (...args) {
|
||||
console.warn("Date.setUTCMonth interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
setFullYear: function (...args) {
|
||||
console.warn("Date.setFullYear interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
setUTCFullYear: function (...args) {
|
||||
console.warn("Date.setUTCFullYear interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
toUTCString: function () {
|
||||
console.warn("Date.toUTCString interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramStringMock
|
||||
},
|
||||
toISOString: function () {
|
||||
console.warn("Date.toISOString interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramStringMock
|
||||
},
|
||||
toJSON: function (...args) {
|
||||
console.warn("Date.toJSON interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramStringMock
|
||||
},
|
||||
}
|
||||
export const DoNotDisturbDate = {
|
||||
type: DoNotDisturbType,
|
||||
begin: Date,
|
||||
end: Date,
|
||||
}
|
||||
export const DeviceRemindType = {
|
||||
IDLE_DONOT_REMIND: 0,
|
||||
IDLE_REMIND: 1,
|
||||
ACTIVE_DONOT_REMIND: 2,
|
||||
ACTIVE_REMIND: 3,
|
||||
}
|
||||
export const SourceType = {
|
||||
TYPE_NORMAL: 0,
|
||||
TYPE_CONTINUOUS: 1,
|
||||
TYPE_TIMER: 2,
|
||||
}
|
||||
export function mockNotification() {
|
||||
const DateMock = {
|
||||
toString: function () {
|
||||
console.warn("Date.toString interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramStringMock
|
||||
},
|
||||
toDateString: function () {
|
||||
console.warn("Date.toDateString interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramStringMock
|
||||
},
|
||||
toTimeString: function () {
|
||||
console.warn("Date.toTimeString interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramStringMock
|
||||
},
|
||||
toLocaleString: function () {
|
||||
console.warn("Date.toLocaleString interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramStringMock
|
||||
},
|
||||
toLocaleDateString: function () {
|
||||
console.warn("Date.toLocaleDateString interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramStringMock
|
||||
},
|
||||
toLocaleTimeString: function () {
|
||||
console.warn("Date.toLocaleTimeString interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramStringMock
|
||||
},
|
||||
valueOf: function () {
|
||||
console.warn("Date.valueOf interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
getTime: function () {
|
||||
console.warn("Date.getTime interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
getFullYear: function () {
|
||||
console.warn("Date.getFullYear interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
getUTCFullYear: function () {
|
||||
console.warn("Date.getUTCFullYear interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
getMonth: function () {
|
||||
console.warn("Date.getMonth interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
getUTCMonth: function () {
|
||||
console.warn("Date.getUTCMonth interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
getDate: function () {
|
||||
console.warn("Date.getDate interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
getUTCDate: function () {
|
||||
console.warn("Date.getUTCDate interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
getDay: function () {
|
||||
console.warn("Date.getDay interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
getUTCDay: function () {
|
||||
console.warn("Date.getUTCDay interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
getHours: function () {
|
||||
console.warn("Date.getHours interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
getUTCHours: function () {
|
||||
console.warn("Date.getUTCHours interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
getMinutes: function () {
|
||||
console.warn("Date.getMinutes interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
getUTCMinutes: function () {
|
||||
console.warn("Date.getUTCMinutes interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
getSeconds: function () {
|
||||
console.warn("Date.getSeconds interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
getUTCSeconds: function () {
|
||||
console.warn("Date.getUTCSeconds interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
getMilliseconds: function () {
|
||||
console.warn("Date.getMilliseconds interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
getUTCMilliseconds: function () {
|
||||
console.warn("Date.getUTCMilliseconds interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
getTimezoneOffset: function () {
|
||||
console.warn("Date.getTimezoneOffset interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
setTime: function (...args) {
|
||||
console.warn("Date.setTime interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
setMilliseconds: function (...args) {
|
||||
console.warn("Date.setMilliseconds interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
setUTCMilliseconds: function (...args) {
|
||||
console.warn("Date.setUTCMilliseconds interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
setSeconds: function (...args) {
|
||||
console.warn("Date.setSeconds interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
setUTCSeconds: function (...args) {
|
||||
console.warn("Date.setUTCSeconds interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
setMinutes: function (...args) {
|
||||
console.warn("Date.setMinutes interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
setUTCMinutes: function (...args) {
|
||||
console.warn("Date.setUTCMinutes interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
setHours: function (...args) {
|
||||
console.warn("Date.setHours interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
setUTCHours: function (...args) {
|
||||
console.warn("Date.setUTCHours interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
setDate: function (...args) {
|
||||
console.warn("Date.setDate interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
setUTCDate: function (...args) {
|
||||
console.warn("Date.setUTCDate interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
setMonth: function (...args) {
|
||||
console.warn("Date.setMonth interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
setUTCMonth: function (...args) {
|
||||
console.warn("Date.setUTCMonth interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
setFullYear: function (...args) {
|
||||
console.warn("Date.setFullYear interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
setUTCFullYear: function (...args) {
|
||||
console.warn("Date.setUTCFullYear interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
},
|
||||
toUTCString: function () {
|
||||
console.warn("Date.toUTCString interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramStringMock
|
||||
},
|
||||
toISOString: function () {
|
||||
console.warn("Date.toISOString interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramStringMock
|
||||
},
|
||||
toJSON: function (...args) {
|
||||
console.warn("Date.toJSON interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramStringMock
|
||||
},
|
||||
}
|
||||
const DoNotDisturbDateMock = {
|
||||
DoNotDisturbTypeMock: '[PC preview] unknow DoNotDisturbTypeMock',
|
||||
begin: DateMock,
|
||||
end: DateMock
|
||||
}
|
||||
const NotificationSlotMock = {
|
||||
SlotTypeMock: '[PC preview] unknow SlotTypeMock',
|
||||
SlotLevelMock: '[PC preview] unknow SlotLevelMock',
|
||||
desc: '[PC preview] unknow desc',
|
||||
badgeFlag: '[PC preview] unknow badgeFlag',
|
||||
bypassDnd: '[PC preview] unknow bypassDnd',
|
||||
lockscreenVisibility: '[PC preview] unknow lockscreenVisibility',
|
||||
vibrationEnabled: '[PC preview] unknow vibrationEnabled',
|
||||
sound: '[PC preview] unknow sound',
|
||||
lightEnabled: '[PC preview] unknow lightEnabled',
|
||||
lightColor: '[PC preview] unknow lightColor',
|
||||
vibrationValues: [paramMock.paramNumberMock]
|
||||
};
|
||||
const NotificationActionButtonMock = {
|
||||
title: '[PC preview] unknow title',
|
||||
wantAgent: '[PC preview] unknow wantAgent',
|
||||
extras: {},
|
||||
userInput: '[PC preview] unknow userInput',
|
||||
}
|
||||
const NotificationRequestMock = {
|
||||
content: '[PC preview] unknow content',
|
||||
id: '[PC preview] unknow id',
|
||||
slotTypeMock: '[PC preview] unknow slotTypeMock',
|
||||
isOngoing: '[PC preview] unknow isOngoing',
|
||||
isUnremovable: '[PC preview] unknow isUnremovable',
|
||||
deliveryTime: '[PC preview] unknow deliveryTime',
|
||||
tapDismissed: '[PC preview] unknow tapDismissed',
|
||||
autoDeletedTime: '[PC preview] unknow autoDeletedTime',
|
||||
wantAgent: '[PC preview] unknow wantAgent',
|
||||
extraInfo: {},
|
||||
color: '[PC preview] unknow color',
|
||||
colorEnabled: '[PC preview] unknow colorEnabled',
|
||||
isAlertOnce: '[PC preview] unknow isAlertOnce',
|
||||
isStopwatch: '[PC preview] unknow isStopwatch',
|
||||
isCountDown: '[PC preview] unknow isCountDown',
|
||||
isFloatingIcon: '[PC preview] unknow isFloatingIcon',
|
||||
label: '[PC preview] unknow label',
|
||||
badgeIconStyle: '[PC preview] unknow badgeIconStyle',
|
||||
showDeliveryTime: '[PC preview] unknow showDeliveryTime',
|
||||
actionButtons: [NotificationActionButtonMock],
|
||||
smallIcon: '[PC preview] unknow smallIcon',
|
||||
largeIcon: '[PC preview] unknow largeIcon',
|
||||
groupName: '[PC preview] unknow groupName',
|
||||
creatorBundleName: '[PC preview] unknow creatorBundleName',
|
||||
creatorUid: '[PC preview] unknow creatorUid',
|
||||
creatorPid: '[PC preview] unknow creatorPid',
|
||||
classification: '[PC preview] unknow classification',
|
||||
hashCode: '[PC preview] unknow hashCode',
|
||||
isRemveAllowd: '[PC preview] unknow isRemveAllowd',
|
||||
source: '[PC preview] unknow source',
|
||||
template: '[PC preview] unknow template'
|
||||
};
|
||||
const DeviceRemindType = {
|
||||
IDLE_DONOT_REMIND: 0,
|
||||
IDLE_REMIND: 1,
|
||||
ACTIVE_DONOT_REMIND: 2,
|
||||
ACTIVE_REMIND: 3,
|
||||
};
|
||||
const notification = {
|
||||
SlotType: {
|
||||
UNKNOWN_TYPE: 0,
|
||||
SOCIAL_COMMUNICATION: 1,
|
||||
SERVICE_INFORMATION: 2,
|
||||
CONTENT_INFORMATION: 3,
|
||||
OTHER_TYPES: 0xFFFF,
|
||||
},
|
||||
ContentType: {
|
||||
NOTIFICATION_CONTENT_BASIC_TEXT: 0,
|
||||
NOTIFICATION_CONTENT_LONG_TEXT: 1,
|
||||
NOTIFICATION_CONTENT_PICTURE: 2,
|
||||
NOTIFICATION_CONTENT_CONVERSATION: 3,
|
||||
NOTIFICATION_CONTENT_MULTILINE: 4,
|
||||
},
|
||||
publish: function (...args) {
|
||||
console.warn('notification.publish interface mocked in the Previewer. How this interface works on the' +
|
||||
' Previewer may be different from that on a real device.');
|
||||
@@ -400,10 +376,10 @@ export function mockNotification() {
|
||||
' Previewer may be different from that on a real device.');
|
||||
const len = args.length;
|
||||
if (typeof args[len - 1] === 'function') {
|
||||
args[len - 1].call(this, paramMock.businessErrorMock, NotificationSlotMock);
|
||||
args[len - 1].call(this, paramMock.businessErrorMock, NotificationSlot);
|
||||
} else {
|
||||
return new Promise((resolve) => {
|
||||
resolve(NotificationSlotMock);
|
||||
resolve(NotificationSlot);
|
||||
});
|
||||
}
|
||||
},
|
||||
@@ -412,10 +388,10 @@ export function mockNotification() {
|
||||
' Previewer may be different from that on a real device.');
|
||||
const len = args.length;
|
||||
if (typeof args[len - 1] === 'function') {
|
||||
args[len - 1].call(this, paramMock.businessErrorMock, [NotificationSlotMock]);
|
||||
args[len - 1].call(this, paramMock.businessErrorMock, [NotificationSlot]);
|
||||
} else {
|
||||
return new Promise((resolve) => {
|
||||
resolve([NotificationSlotMock]);
|
||||
resolve([NotificationSlot]);
|
||||
});
|
||||
}
|
||||
},
|
||||
@@ -532,10 +508,10 @@ export function mockNotification() {
|
||||
' Previewer may be different from that on a real device.');
|
||||
const len = args.length;
|
||||
if (typeof args[len - 1] === 'function') {
|
||||
args[len - 1].call(this, paramMock.businessErrorMock, [NotificationSlotMock]);
|
||||
args[len - 1].call(this, paramMock.businessErrorMock, [NotificationSlot]);
|
||||
} else {
|
||||
return new Promise((resolve) => {
|
||||
resolve([NotificationSlotMock]);
|
||||
resolve([NotificationSlot]);
|
||||
});
|
||||
}
|
||||
},
|
||||
@@ -580,10 +556,10 @@ export function mockNotification() {
|
||||
' Previewer may be different from that on a real device.');
|
||||
const len = args.length;
|
||||
if (typeof args[len - 1] === 'function') {
|
||||
args[len - 1].call(this, paramMock.businessErrorMock, [NotificationRequestMock]);
|
||||
args[len - 1].call(this, paramMock.businessErrorMock, [NotificationRequest]);
|
||||
} else {
|
||||
return new Promise((resolve) => {
|
||||
resolve([NotificationRequestMock]);
|
||||
resolve([NotificationRequest]);
|
||||
});
|
||||
}
|
||||
},
|
||||
@@ -604,10 +580,10 @@ export function mockNotification() {
|
||||
' Previewer may be different from that on a real device.');
|
||||
const len = args.length;
|
||||
if (typeof args[len - 1] === 'function') {
|
||||
args[len - 1].call(this, paramMock.businessErrorMock, [NotificationRequestMock]);
|
||||
args[len - 1].call(this, paramMock.businessErrorMock, [NotificationRequest]);
|
||||
} else {
|
||||
return new Promise((resolve) => {
|
||||
resolve([NotificationRequestMock]);
|
||||
resolve([NotificationRequest]);
|
||||
});
|
||||
}
|
||||
},
|
||||
@@ -652,10 +628,10 @@ export function mockNotification() {
|
||||
" How this interface works on the Previewer may be different from that on a real device.")
|
||||
const len = args.length
|
||||
if (len > 0 && typeof args[len - 1] === 'function') {
|
||||
args[len - 1].call(this, paramMock.businessErrorMock, DoNotDisturbDateMock);
|
||||
args[len - 1].call(this, paramMock.businessErrorMock, DoNotDisturbDate);
|
||||
} else {
|
||||
return new Promise((resolve, reject) => {
|
||||
resolve(DoNotDisturbDateMock);
|
||||
resolve(DoNotDisturbDate);
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user