1/* 2 * Copyright (c) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15import { paramMock } from "../utils" 16import { WantClass } from "./ohos_application_Want" 17 18export const FormInfo = { 19 bundleName: '[PC preview] unknow bundleName', 20 moduleName: '[PC preview] unknow moduleName', 21 abilityName: '[PC preview] unknow abilityName', 22 name: '[PC preview] unknow name', 23 description: '[PC preview] unknow description', 24 type: FormType, 25 jsComponentName: '[PC preview] unknow jsComponentName', 26 colorMode: ColorMode, 27 isDefault: '[PC preview] unknow isDefault', 28 updateEnabled: '[PC preview] unknow updateEnabled', 29 formVisibleNotify: '[PC preview] unknow formVisibleNotify', 30 relatedBundleName: '[PC preview] unknow relatedBundleName', 31 scheduledUpdateTime: '[PC preview] unknow scheduledUpdateTime', 32 formConfigAbility: '[PC preview] unknow formConfigAbility', 33 updateDuration: '[PC preview] unknow updateDuration', 34 defaultDimension: '[PC preview] unknow defaultDimension', 35 supportDimensions: [paramMock.paramNumberMock], 36 customizeData: {"key": paramMock.paramStringMock}, 37} 38export const FormType = { 39 JS: 1, 40} 41export const ColorMode = { 42 MODE_AUTO: -1, 43 MODE_DARK: 0, 44 MODE_LIGHT: 1 45} 46export const FormStateInfo = { 47 formState: FormState, 48 want: new WantClass(), 49} 50export const FormState = { 51 UNKNOWN: -1, 52 DEFAULT: 0, 53 READY: 1, 54} 55export const FormParam = { 56 IDENTITY_KEY: "ohos.extra.param.key.form_identity", 57 DIMENSION_KEY: "ohos.extra.param.key.form_dimension", 58 NAME_KEY: "ohos.extra.param.key.form_name", 59 MODULE_NAME_KEY: "ohos.extra.param.key.module_name", 60 WIDTH_KEY: "ohos.extra.param.key.form_width", 61 HEIGHT_KEY: "ohos.extra.param.key.form_height", 62 TEMPORARY_KEY: "ohos.extra.param.key.form_temporary", 63 BUNDLE_NAME_KEY: "ohos.extra.param.key.bundle_name", 64 ABILITY_NAME_KEY: "ohos.extra.param.key.ability_name", 65 DEVICE_ID_KEY: "ohos.extra.param.key.device_id" 66} 67export const FormInfoFilter = { 68 moduleName: '[PC preview] unknow moduleName', 69} 70export const FormDimension = { 71 Dimension_1_2: 1, 72 Dimension_2_2: '[PC preview] unknow Dimension_2_2', 73 Dimension_2_4: '[PC preview] unknow Dimension_2_4', 74 Dimension_4_4: '[PC preview] unknow Dimension_4_4', 75 Dimension_2_1: '[PC preview] unknow Dimension_2_1', 76} 77export function mockFormInfo() { 78 const formInfo = { 79 FormInfo, 80 FormType, 81 ColorMode, 82 FormStateInfo, 83 FormState, 84 FormParam, 85 FormInfoFilter, 86 FormDimension 87 } 88 return formInfo; 89}