From 13d98f85c15093ee2eca9c8f4bec0f26e666e7a4 Mon Sep 17 00:00:00 2001 From: lyj_love_code Date: Mon, 30 Aug 2021 17:10:11 +0800 Subject: [PATCH 01/13] add ohos.hiAppEvent.d.ts Signed-off-by: lyj_love_code --- api/@ohos.hiAppEvent.d.ts | 127 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 api/@ohos.hiAppEvent.d.ts diff --git a/api/@ohos.hiAppEvent.d.ts b/api/@ohos.hiAppEvent.d.ts new file mode 100644 index 0000000000..be43408a67 --- /dev/null +++ b/api/@ohos.hiAppEvent.d.ts @@ -0,0 +1,127 @@ +/* +* Copyright (c) 2021 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 { AsyncCallback } from './phone/basic'; + +/** + * Provides the event logging function for applications to log the fault, statistical, security, + * and user behavior events reported during running. Based on event information, + * you will be able to analyze the running status of applications. + * + * @since 7 + * @device phone, tablet, tv, wearable + */ +declare namespace hiAppEvent { + /** + * Enumerate application event types. + */ + enum EventType { + /** + * Fault Event. + */ + FAULT = 1, + + /** + * Statistic event. + */ + STATISTIC = 2, + + /** + * Security event. + */ + SECURITY = 3, + + /** + * User behavior event. + */ + BEHAVIOR = 4 + } + + /** + * Preset event. + */ + namespace Event { + /** + * user login event. + */ + const USER_LOGIN: string; + + /** + * user logout event. + */ + const USER_LOGOUT: string; + + /** + * distributed service event. + */ + const DISTRIBUTED_SERVICE_START: string; + } + + /** + * Preset param. + */ + namespace Param { + /** + * user id. + */ + const USER_ID: string; + + /** + * distributed service name. + */ + const DISTRIBUTED_SERVICE_NAME: string; + + /** + * distributed service instance id. + */ + const DISTRIBUTED_SERVICE_INSTANCE_ID: string; + } + + /** + * write application event. + * + * @static + * @param {string} eventName application event name. + * @param {EventType} eventType application event type. + * @param {object} keyValues application event key-value pair params. + * @param {AsyncCallback} [callback] callback function. + * @return {void | Promise} no callback return Promise otherwise return void. + */ + function write(eventName: string, eventType: EventType, keyValues: object): Promise; + function write(eventName: string, eventType: EventType, keyValues: object, callback: AsyncCallback): void; + + /** + * application event logging configuration interface. + * + * @static + * @param {ConfigOption} config application event logging configuration item object. + * @return {boolean} configuration result. + */ + function configure(config: ConfigOption): boolean; + + interface ConfigOption { + /** + * configuration item: application event logging switch. + */ + disable?: boolean; + + /** + * configuration item: event file directory storage quota size. + */ + maxStorage?: string; + } +} + +export default hiAppEvent; \ No newline at end of file -- Gitee From 1429bbd7d2ab56d1f3d29d496abd84197a97731c Mon Sep 17 00:00:00 2001 From: lyj_love_code Date: Mon, 30 Aug 2021 17:22:27 +0800 Subject: [PATCH 02/13] fix the spelling of the hiAppEvent.d.ts Signed-off-by: lyj_love_code --- api/@ohos.hiAppEvent.d.ts | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/api/@ohos.hiAppEvent.d.ts b/api/@ohos.hiAppEvent.d.ts index be43408a67..7131243499 100644 --- a/api/@ohos.hiAppEvent.d.ts +++ b/api/@ohos.hiAppEvent.d.ts @@ -1,17 +1,17 @@ /* -* Copyright (c) 2021 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. -*/ + * Copyright (c) 2021 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 { AsyncCallback } from './phone/basic'; @@ -21,7 +21,7 @@ import { AsyncCallback } from './phone/basic'; * you will be able to analyze the running status of applications. * * @since 7 - * @device phone, tablet, tv, wearable + * @devices phone, tablet, tv, wearable */ declare namespace hiAppEvent { /** @@ -29,7 +29,7 @@ declare namespace hiAppEvent { */ enum EventType { /** - * Fault Event. + * Fault event. */ FAULT = 1, -- Gitee From 1ad6899ebd13fd9ff8dc95a355be4d73b9dfa24e Mon Sep 17 00:00:00 2001 From: lyj_love_code Date: Tue, 31 Aug 2021 09:48:46 +0800 Subject: [PATCH 03/13] move @ohos.hiAppEvent.d.ts Signed-off-by: lyj_love_code --- api/{ => phone}/@ohos.hiAppEvent.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename api/{ => phone}/@ohos.hiAppEvent.d.ts (94%) diff --git a/api/@ohos.hiAppEvent.d.ts b/api/phone/@ohos.hiAppEvent.d.ts similarity index 94% rename from api/@ohos.hiAppEvent.d.ts rename to api/phone/@ohos.hiAppEvent.d.ts index 7131243499..42b2b9734f 100644 --- a/api/@ohos.hiAppEvent.d.ts +++ b/api/phone/@ohos.hiAppEvent.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from './phone/basic'; +import { AsyncCallback } from './basic'; /** * Provides the event logging function for applications to log the fault, statistical, security, -- Gitee From 8818a4c4d2f4b28cbf0a2157c448e05d2425f36b Mon Sep 17 00:00:00 2001 From: wangchun17 Date: Tue, 31 Aug 2021 17:16:11 +0800 Subject: [PATCH 04/13] chunn.wang@huawei.com Signed-off-by: wangchun17 Change-Id: Id09ae493734b5e704d00216981e45ae7d16568ca --- BUILD.gn | 40 + .../@ohos.account.distributedaccount.d.ts | 0 api/{phone => }/@ohos.batteryinfo.d.ts | 0 api/{phone => }/@ohos.brightness.d.ts | 0 api/{phone => }/@ohos.bundle_mgr.d.ts | 0 api/{phone => }/@ohos.commonevent.d.ts | 0 .../@ohos.data.distributeddata.d.ts | 0 api/{phone => }/@ohos.data.storage.d.ts | 0 api/{phone => }/@ohos.deviceinfo.d.ts | 0 ...hos.distributedHardware.deviceManager.d.ts | 0 api/{phone => }/@ohos.feature_ability.d.ts | 0 api/{phone => }/@ohos.fileio.d.ts | 0 api/{phone => }/@ohos.intl.d.ts | 0 api/{phone => }/@ohos.multimedia.audio.d.ts | 0 api/{phone => }/@ohos.multimedia.media.d.ts | 0 .../@ohos.napi_ability_manager.d.ts | 0 api/{phone => }/@ohos.power.d.ts | 0 api/{phone => }/@ohos.resourceManager.d.ts | 0 api/{phone => }/@ohos.runninglock.d.ts | 0 api/{phone => }/@ohos.systemTime.d.ts | 0 api/{phone => }/@ohos.systemparameter.d.ts | 0 api/{phone => }/@ohos.telephony.call.d.ts | 0 api/{phone => }/@ohos.telephony.data.d.ts | 0 api/{phone => }/@ohos.telephony.observer.d.ts | 0 api/{phone => }/@ohos.telephony.radio.d.ts | 0 api/{phone => }/@ohos.telephony.sim.d.ts | 0 api/{phone => }/@ohos.telephony.sms.d.ts | 0 api/{phone => }/@ohos.update.d.ts | 0 api/{phone => }/@ohos.wifi.d.ts | 0 api/{phone => }/@ohos.window.d.ts | 0 api/@system.brightness.d.ts | 56 - api/@system.device.d.ts | 35 - api/@system.file.d.ts | 133 - api/@system.geolocation.d.ts | 49 - api/@system.prompt.d.ts | 38 - api/@system.router.d.ts | 35 - api/@system.sensor.d.ts | 98 - api/{phone => }/app/abilityinfo.d.ts | 0 api/{phone => }/app/abilitymissioninfo.d.ts | 0 api/{phone => }/app/applicationinfo.d.ts | 0 api/{phone => }/app/appprocessstate.ts | 0 api/{phone => }/app/bundleinfo.d.ts | 0 api/{phone => }/app/common.d.ts | 0 api/{phone => }/app/elementname.d.ts | 0 api/{phone => }/app/installresult.d.ts | 0 api/{phone => }/app/moduleinfo.d.ts | 0 api/{phone => }/app/processinfo.d.ts | 0 api/{phone => }/app/want.d.ts | 0 api/{phone => }/basic.d.ts | 0 .../commonevent/commoneventdata.d.ts | 0 .../commonevent/commoneventpublishdata.d.ts | 0 .../commonevent/commoneventsubscribeinfo.d.ts | 0 .../commonevent/commoneventsubscriber.d.ts | 0 .../distributeddata/kvmanager_config.d.ts | 0 .../data/distributeddata/kvstore.d.ts | 0 .../plain_ordinary_js_objects.d.ts | 0 .../data/distributeddata/single_kvstore.d.ts | 0 api/form/action/form-schema.json | 18 + api/form/css/css-json-schema.json | 283 + api/form/css/cssConfig.json | 5437 +++++++++++++++++ api/form/hml/basic/block.json | 54 + api/form/hml/basic/button.json | 400 ++ api/form/hml/basic/calendar.json | 373 ++ api/form/hml/basic/chart.json | 407 ++ api/form/hml/basic/clock.json | 284 + api/form/hml/basic/divider.json | 296 + api/form/hml/basic/image.json | 351 ++ api/form/hml/basic/input.json | 401 ++ api/form/hml/basic/progress.json | 363 ++ api/form/hml/basic/span.json | 281 + api/form/hml/basic/text.json | 313 + api/form/hml/container/badge.json | 417 ++ api/form/hml/container/div.json | 330 + api/form/hml/container/list-item.json | 380 ++ api/form/hml/container/list.json | 491 ++ api/form/hml/container/stack.json | 267 + api/form/hml/container/swiper.json | 503 ++ api/form/hml/custom/element.json | 46 + api/form/hml/hml-json-schema.json | 266 + api/{ => phone}/@system.app.d.ts | 56 +- api/{ => phone}/@system.battery.d.ts | 44 +- .../@system.bluetooth.d.ts} | 80 +- api/phone/@system.brightness.d.ts | 180 + api/{ => phone}/@system.configuration.d.ts | 25 +- api/phone/@system.device.d.ts | 266 +- api/{ => phone}/@system.fetch.d.ts | 84 +- api/phone/@system.file.d.ts | 499 ++ api/phone/@system.geolocation.d.ts | 156 + api/{ => phone}/@system.mediaquery.d.ts | 37 +- api/{ => phone}/@system.network.d.ts | 72 +- api/{ => phone}/@system.notification.d.ts | 47 +- api/{ => phone}/@system.package.d.ts | 34 +- api/phone/@system.prompt.d.ts | 270 +- api/{ => phone}/@system.request.d.ts | 172 +- api/phone/@system.router.d.ts | 18 +- api/phone/@system.sensor.d.ts | 467 ++ api/{ => phone}/@system.storage.d.ts | 116 +- api/{ => phone}/@system.vibrator.d.ts | 20 +- remove_internal.py | 42 + remove_internal.pydeps | 3 + 100 files changed, 14342 insertions(+), 791 deletions(-) rename api/{phone => }/@ohos.account.distributedaccount.d.ts (100%) mode change 100755 => 100644 rename api/{phone => }/@ohos.batteryinfo.d.ts (100%) rename api/{phone => }/@ohos.brightness.d.ts (100%) rename api/{phone => }/@ohos.bundle_mgr.d.ts (100%) mode change 100755 => 100644 rename api/{phone => }/@ohos.commonevent.d.ts (100%) mode change 100755 => 100644 rename api/{phone => }/@ohos.data.distributeddata.d.ts (100%) rename api/{phone => }/@ohos.data.storage.d.ts (100%) rename api/{phone => }/@ohos.deviceinfo.d.ts (100%) rename api/{phone => }/@ohos.distributedHardware.deviceManager.d.ts (100%) rename api/{phone => }/@ohos.feature_ability.d.ts (100%) mode change 100755 => 100644 rename api/{phone => }/@ohos.fileio.d.ts (100%) rename api/{phone => }/@ohos.intl.d.ts (100%) mode change 100755 => 100644 rename api/{phone => }/@ohos.multimedia.audio.d.ts (100%) mode change 100755 => 100644 rename api/{phone => }/@ohos.multimedia.media.d.ts (100%) mode change 100755 => 100644 rename api/{phone => }/@ohos.napi_ability_manager.d.ts (100%) mode change 100755 => 100644 rename api/{phone => }/@ohos.power.d.ts (100%) rename api/{phone => }/@ohos.resourceManager.d.ts (100%) rename api/{phone => }/@ohos.runninglock.d.ts (100%) rename api/{phone => }/@ohos.systemTime.d.ts (100%) mode change 100755 => 100644 rename api/{phone => }/@ohos.systemparameter.d.ts (100%) rename api/{phone => }/@ohos.telephony.call.d.ts (100%) mode change 100755 => 100644 rename api/{phone => }/@ohos.telephony.data.d.ts (100%) mode change 100755 => 100644 rename api/{phone => }/@ohos.telephony.observer.d.ts (100%) mode change 100755 => 100644 rename api/{phone => }/@ohos.telephony.radio.d.ts (100%) mode change 100755 => 100644 rename api/{phone => }/@ohos.telephony.sim.d.ts (100%) mode change 100755 => 100644 rename api/{phone => }/@ohos.telephony.sms.d.ts (100%) mode change 100755 => 100644 rename api/{phone => }/@ohos.update.d.ts (100%) rename api/{phone => }/@ohos.wifi.d.ts (100%) mode change 100755 => 100644 rename api/{phone => }/@ohos.window.d.ts (100%) delete mode 100755 api/@system.brightness.d.ts delete mode 100755 api/@system.device.d.ts delete mode 100755 api/@system.file.d.ts delete mode 100755 api/@system.geolocation.d.ts delete mode 100755 api/@system.prompt.d.ts delete mode 100755 api/@system.router.d.ts delete mode 100755 api/@system.sensor.d.ts rename api/{phone => }/app/abilityinfo.d.ts (100%) rename api/{phone => }/app/abilitymissioninfo.d.ts (100%) rename api/{phone => }/app/applicationinfo.d.ts (100%) rename api/{phone => }/app/appprocessstate.ts (100%) rename api/{phone => }/app/bundleinfo.d.ts (100%) rename api/{phone => }/app/common.d.ts (100%) rename api/{phone => }/app/elementname.d.ts (100%) rename api/{phone => }/app/installresult.d.ts (100%) rename api/{phone => }/app/moduleinfo.d.ts (100%) rename api/{phone => }/app/processinfo.d.ts (100%) rename api/{phone => }/app/want.d.ts (100%) rename api/{phone => }/basic.d.ts (100%) mode change 100755 => 100644 rename api/{phone => }/commonevent/commoneventdata.d.ts (100%) rename api/{phone => }/commonevent/commoneventpublishdata.d.ts (100%) rename api/{phone => }/commonevent/commoneventsubscribeinfo.d.ts (100%) rename api/{phone => }/commonevent/commoneventsubscriber.d.ts (100%) rename api/{phone => }/data/distributeddata/kvmanager_config.d.ts (100%) rename api/{phone => }/data/distributeddata/kvstore.d.ts (100%) rename api/{phone => }/data/distributeddata/plain_ordinary_js_objects.d.ts (100%) rename api/{phone => }/data/distributeddata/single_kvstore.d.ts (100%) create mode 100644 api/form/action/form-schema.json create mode 100644 api/form/css/css-json-schema.json create mode 100644 api/form/css/cssConfig.json create mode 100644 api/form/hml/basic/block.json create mode 100644 api/form/hml/basic/button.json create mode 100644 api/form/hml/basic/calendar.json create mode 100644 api/form/hml/basic/chart.json create mode 100644 api/form/hml/basic/clock.json create mode 100644 api/form/hml/basic/divider.json create mode 100644 api/form/hml/basic/image.json create mode 100644 api/form/hml/basic/input.json create mode 100644 api/form/hml/basic/progress.json create mode 100644 api/form/hml/basic/span.json create mode 100644 api/form/hml/basic/text.json create mode 100644 api/form/hml/container/badge.json create mode 100644 api/form/hml/container/div.json create mode 100644 api/form/hml/container/list-item.json create mode 100644 api/form/hml/container/list.json create mode 100644 api/form/hml/container/stack.json create mode 100644 api/form/hml/container/swiper.json create mode 100644 api/form/hml/custom/element.json create mode 100644 api/form/hml/hml-json-schema.json rename api/{ => phone}/@system.app.d.ts (42%) mode change 100755 => 100644 rename api/{ => phone}/@system.battery.d.ts (45%) mode change 100755 => 100644 rename api/{@system.cipher.d.ts => phone/@system.bluetooth.d.ts} (40%) mode change 100755 => 100644 create mode 100644 api/phone/@system.brightness.d.ts rename api/{ => phone}/@system.configuration.d.ts (58%) mode change 100755 => 100644 mode change 100755 => 100644 api/phone/@system.device.d.ts rename api/{ => phone}/@system.fetch.d.ts (31%) mode change 100755 => 100644 create mode 100644 api/phone/@system.file.d.ts create mode 100644 api/phone/@system.geolocation.d.ts rename api/{ => phone}/@system.mediaquery.d.ts (55%) mode change 100755 => 100644 rename api/{ => phone}/@system.network.d.ts (35%) mode change 100755 => 100644 rename api/{ => phone}/@system.notification.d.ts (45%) mode change 100755 => 100644 rename api/{ => phone}/@system.package.d.ts (60%) mode change 100755 => 100644 mode change 100755 => 100644 api/phone/@system.prompt.d.ts rename api/{ => phone}/@system.request.d.ts (40%) mode change 100755 => 100644 mode change 100755 => 100644 api/phone/@system.router.d.ts create mode 100644 api/phone/@system.sensor.d.ts rename api/{ => phone}/@system.storage.d.ts (37%) mode change 100755 => 100644 rename api/{ => phone}/@system.vibrator.d.ts (69%) mode change 100755 => 100644 create mode 100755 remove_internal.py create mode 100755 remove_internal.pydeps diff --git a/BUILD.gn b/BUILD.gn index e1f24e6f1e..9e3164720c 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -120,6 +120,35 @@ ohos_copy("common_api") { module_install_name = "" } +template("ohos_declaration_template") { + forward_variables_from(invoker, "*") + action_with_pydeps(target_name) { + script = "//interface/sdk-js/remove_internal.py" + outputs = [ root_out_dir + "/$target_name/" ] + args = [ + "--input", + rebase_path("//interface/sdk-js/api", root_build_dir), + "--output", + rebase_path(root_out_dir + "/ohos_declaration/$target_name/", + root_build_dir), + ] + } + _module_info_target = "/ohos_declaration/${target_name}_info" + _target_name = target_name + generate_module_info(_module_info_target) { + module_type = "jsdoc" + module_install_name = "" + module_name = _target_name + module_source_dir = root_out_dir + "/ohos_declaration/$_target_name" + install_enable = false + } +} + +ohos_declaration_template("ohos_declaration_ets") { +} +ohos_declaration_template("ohos_declaration_phone") { +} + ohos_copy("ace_platform") { sources = [ "api/config", @@ -129,3 +158,14 @@ ohos_copy("ace_platform") { module_source_dir = target_out_dir + "/$target_name" module_install_name = "" } + +ohos_copy("form_declaration") { + sources = [ + "api/form/action", + "api/form/css", + "api/form/hml", + ] + outputs = [ target_out_dir + "/$target_name/{{source_file_part}}" ] + module_source_dir = target_out_dir + "/$target_name" + module_install_name = "" +} diff --git a/api/phone/@ohos.account.distributedaccount.d.ts b/api/@ohos.account.distributedaccount.d.ts old mode 100755 new mode 100644 similarity index 100% rename from api/phone/@ohos.account.distributedaccount.d.ts rename to api/@ohos.account.distributedaccount.d.ts diff --git a/api/phone/@ohos.batteryinfo.d.ts b/api/@ohos.batteryinfo.d.ts similarity index 100% rename from api/phone/@ohos.batteryinfo.d.ts rename to api/@ohos.batteryinfo.d.ts diff --git a/api/phone/@ohos.brightness.d.ts b/api/@ohos.brightness.d.ts similarity index 100% rename from api/phone/@ohos.brightness.d.ts rename to api/@ohos.brightness.d.ts diff --git a/api/phone/@ohos.bundle_mgr.d.ts b/api/@ohos.bundle_mgr.d.ts old mode 100755 new mode 100644 similarity index 100% rename from api/phone/@ohos.bundle_mgr.d.ts rename to api/@ohos.bundle_mgr.d.ts diff --git a/api/phone/@ohos.commonevent.d.ts b/api/@ohos.commonevent.d.ts old mode 100755 new mode 100644 similarity index 100% rename from api/phone/@ohos.commonevent.d.ts rename to api/@ohos.commonevent.d.ts diff --git a/api/phone/@ohos.data.distributeddata.d.ts b/api/@ohos.data.distributeddata.d.ts similarity index 100% rename from api/phone/@ohos.data.distributeddata.d.ts rename to api/@ohos.data.distributeddata.d.ts diff --git a/api/phone/@ohos.data.storage.d.ts b/api/@ohos.data.storage.d.ts similarity index 100% rename from api/phone/@ohos.data.storage.d.ts rename to api/@ohos.data.storage.d.ts diff --git a/api/phone/@ohos.deviceinfo.d.ts b/api/@ohos.deviceinfo.d.ts similarity index 100% rename from api/phone/@ohos.deviceinfo.d.ts rename to api/@ohos.deviceinfo.d.ts diff --git a/api/phone/@ohos.distributedHardware.deviceManager.d.ts b/api/@ohos.distributedHardware.deviceManager.d.ts similarity index 100% rename from api/phone/@ohos.distributedHardware.deviceManager.d.ts rename to api/@ohos.distributedHardware.deviceManager.d.ts diff --git a/api/phone/@ohos.feature_ability.d.ts b/api/@ohos.feature_ability.d.ts old mode 100755 new mode 100644 similarity index 100% rename from api/phone/@ohos.feature_ability.d.ts rename to api/@ohos.feature_ability.d.ts diff --git a/api/phone/@ohos.fileio.d.ts b/api/@ohos.fileio.d.ts similarity index 100% rename from api/phone/@ohos.fileio.d.ts rename to api/@ohos.fileio.d.ts diff --git a/api/phone/@ohos.intl.d.ts b/api/@ohos.intl.d.ts old mode 100755 new mode 100644 similarity index 100% rename from api/phone/@ohos.intl.d.ts rename to api/@ohos.intl.d.ts diff --git a/api/phone/@ohos.multimedia.audio.d.ts b/api/@ohos.multimedia.audio.d.ts old mode 100755 new mode 100644 similarity index 100% rename from api/phone/@ohos.multimedia.audio.d.ts rename to api/@ohos.multimedia.audio.d.ts diff --git a/api/phone/@ohos.multimedia.media.d.ts b/api/@ohos.multimedia.media.d.ts old mode 100755 new mode 100644 similarity index 100% rename from api/phone/@ohos.multimedia.media.d.ts rename to api/@ohos.multimedia.media.d.ts diff --git a/api/phone/@ohos.napi_ability_manager.d.ts b/api/@ohos.napi_ability_manager.d.ts old mode 100755 new mode 100644 similarity index 100% rename from api/phone/@ohos.napi_ability_manager.d.ts rename to api/@ohos.napi_ability_manager.d.ts diff --git a/api/phone/@ohos.power.d.ts b/api/@ohos.power.d.ts similarity index 100% rename from api/phone/@ohos.power.d.ts rename to api/@ohos.power.d.ts diff --git a/api/phone/@ohos.resourceManager.d.ts b/api/@ohos.resourceManager.d.ts similarity index 100% rename from api/phone/@ohos.resourceManager.d.ts rename to api/@ohos.resourceManager.d.ts diff --git a/api/phone/@ohos.runninglock.d.ts b/api/@ohos.runninglock.d.ts similarity index 100% rename from api/phone/@ohos.runninglock.d.ts rename to api/@ohos.runninglock.d.ts diff --git a/api/phone/@ohos.systemTime.d.ts b/api/@ohos.systemTime.d.ts old mode 100755 new mode 100644 similarity index 100% rename from api/phone/@ohos.systemTime.d.ts rename to api/@ohos.systemTime.d.ts diff --git a/api/phone/@ohos.systemparameter.d.ts b/api/@ohos.systemparameter.d.ts similarity index 100% rename from api/phone/@ohos.systemparameter.d.ts rename to api/@ohos.systemparameter.d.ts diff --git a/api/phone/@ohos.telephony.call.d.ts b/api/@ohos.telephony.call.d.ts old mode 100755 new mode 100644 similarity index 100% rename from api/phone/@ohos.telephony.call.d.ts rename to api/@ohos.telephony.call.d.ts diff --git a/api/phone/@ohos.telephony.data.d.ts b/api/@ohos.telephony.data.d.ts old mode 100755 new mode 100644 similarity index 100% rename from api/phone/@ohos.telephony.data.d.ts rename to api/@ohos.telephony.data.d.ts diff --git a/api/phone/@ohos.telephony.observer.d.ts b/api/@ohos.telephony.observer.d.ts old mode 100755 new mode 100644 similarity index 100% rename from api/phone/@ohos.telephony.observer.d.ts rename to api/@ohos.telephony.observer.d.ts diff --git a/api/phone/@ohos.telephony.radio.d.ts b/api/@ohos.telephony.radio.d.ts old mode 100755 new mode 100644 similarity index 100% rename from api/phone/@ohos.telephony.radio.d.ts rename to api/@ohos.telephony.radio.d.ts diff --git a/api/phone/@ohos.telephony.sim.d.ts b/api/@ohos.telephony.sim.d.ts old mode 100755 new mode 100644 similarity index 100% rename from api/phone/@ohos.telephony.sim.d.ts rename to api/@ohos.telephony.sim.d.ts diff --git a/api/phone/@ohos.telephony.sms.d.ts b/api/@ohos.telephony.sms.d.ts old mode 100755 new mode 100644 similarity index 100% rename from api/phone/@ohos.telephony.sms.d.ts rename to api/@ohos.telephony.sms.d.ts diff --git a/api/phone/@ohos.update.d.ts b/api/@ohos.update.d.ts similarity index 100% rename from api/phone/@ohos.update.d.ts rename to api/@ohos.update.d.ts diff --git a/api/phone/@ohos.wifi.d.ts b/api/@ohos.wifi.d.ts old mode 100755 new mode 100644 similarity index 100% rename from api/phone/@ohos.wifi.d.ts rename to api/@ohos.wifi.d.ts diff --git a/api/phone/@ohos.window.d.ts b/api/@ohos.window.d.ts similarity index 100% rename from api/phone/@ohos.window.d.ts rename to api/@ohos.window.d.ts diff --git a/api/@system.brightness.d.ts b/api/@system.brightness.d.ts deleted file mode 100755 index 8b7348232d..0000000000 --- a/api/@system.brightness.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2021 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 interface BrightnessResponse { - value: number; -} -export interface GetBrightnessOptions { - success?: (data: BrightnessResponse) => void; - fail?: (data: string, code: number) => void; - complete?: () => void; -} -export interface SetBrightnessOptions { - value: number; - success?: () => void; - fail?: (data: string, code: number) => void; - complete?: () => void; -} -export interface BrightnessModeResponse { - mode: number; -} -export interface GetBrightnessModeOptions { - success?: (data: BrightnessModeResponse) => void; - fail?: (data: string, code: number) => void; - complete?: () => void; -} -export interface SetBrightnessModeOptions { - mode: number; - success?: () => void; - fail?: (data: string, code: number) => void; - complete?: () => void; -} -export interface SetKeepScreenOnOptions { - keepScreenOn: boolean; - success?: () => void; - fail?: (data: string, code: number) => void; - complete?: () => void; -} -export default class Brightness { - static getValue(options?: GetBrightnessOptions): void; - static setValue(options: SetBrightnessOptions): void; - static getMode(options?: GetBrightnessModeOptions): void; - static setMode(options: SetBrightnessModeOptions): void; - static setKeepScreenOn(options: SetKeepScreenOnOptions): void; -} diff --git a/api/@system.device.d.ts b/api/@system.device.d.ts deleted file mode 100755 index 83aa8c6ec4..0000000000 --- a/api/@system.device.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2021 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 interface DeviceResponse { - brand: string; - manufacturer: string; - model: string; - product: string; - language: string; - region: string; - windowWidth: number; - windowHeight: number; - screenDensity: number; - screenShape: "rect" | "circle"; -} -export interface GetDeviceOptions { - success?: (data: DeviceResponse) => void; - fail?: (data: any, code: number) => void; - complete?: () => void; -} -export default class Device { - static getInfo(options?: GetDeviceOptions): void; -} diff --git a/api/@system.file.d.ts b/api/@system.file.d.ts deleted file mode 100755 index fa9fd86dfb..0000000000 --- a/api/@system.file.d.ts +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright (c) 2021 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 interface FileResponse { - uri: string; - length: number; - lastModifiedTime: number; - type: "dir" | "file"; - subFiles?: Array; -} -export interface FileMoveOption { - srcUri: string; - dstUri: string; - success?: (uri: string) => void; - fail?: (data: string, code: number) => void; - complete?: () => void; -} -export interface FileListResponse { - fileList: Array; -} -export interface FileListOption { - uri: string; - success?: (data: FileListResponse) => void; - fail?: (data: string, code: number) => void; - complete?: () => void; -} -export interface FileCopyOption { - srcUri: string; - dstUri: string; - success?: (uri: string) => void; - fail?: (data: string, code: number) => void; - complete?: () => void; -} -export interface FileGetOption { - uri: string; - recursive?: boolean; - success?: (file: FileResponse) => void; - fail?: (data: string, code: number) => void; - complete?: () => void; -} -export interface FileDeleteOption { - uri: string; - success?: () => void; - fail?: (data: string, code: number) => void; - complete?: () => void; -} -export interface FileWriteTextOption { - uri: string; - text: string; - encoding?: string; - append?: boolean; - success?: () => void; - fail?: (data: string, code: number) => void; - complete?: () => void; -} -export interface FileReadTextResponse { - text: string; -} -export interface FileReadTextOption { - uri: string; - encoding?: string; - position?: number; - length?: number; - success?: (data: FileReadTextResponse) => void; - fail?: (data: string, code: number) => void; - complete?: () => void; -} -export interface FileWriteArrayBufferOption { - uri: string; - buffer: Uint8Array; - position?: number; - append?: boolean; - success?: () => void; - fail?: (data: string, code: number) => void; - complete?: () => void; -} -export interface FileReadArrayBufferResponse { - buffer: Uint8Array; -} -export interface FileReadArrayBufferOption { - uri: string; - position?: number; - length?: number; - success?: (data: FileReadArrayBufferResponse) => void; - fail?: (data: string, code: number) => void; - complete?: () => void; -} -export interface FileAccessOption { - uri: string; - success?: () => void; - fail?: (data: string, code: number) => void; - complete?: () => void; -} -export interface FileMkdirOption { - uri: string; - recursive?: boolean; - success?: () => void; - fail?: (data: string, code: number) => void; - complete?: () => void; -} -export interface FileRmdirOption { - uri: string; - recursive?: boolean; - success?: () => void; - fail?: (data: string, code: number) => void; - complete?: () => void; -} -export default class File { - static move(options: FileMoveOption): void; - static copy(options: FileCopyOption): void; - static list(options: FileListOption): void; - static get(options: FileGetOption): void; - static delete(options: FileDeleteOption): void; - static writeText(options: FileWriteTextOption): void; - static readText(options: FileReadTextOption): void; - static writeArrayBuffer(options: FileWriteArrayBufferOption): void; - static readArrayBuffer(options: FileReadArrayBufferOption): void; - static access(options: FileAccessOption): void; - static mkdir(options: FileMkdirOption): void; - static rmdir(options: FileRmdirOption): void; -} diff --git a/api/@system.geolocation.d.ts b/api/@system.geolocation.d.ts deleted file mode 100755 index e2ca9ac56c..0000000000 --- a/api/@system.geolocation.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2021 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 interface GeolocationResponse { - longitude: number; - latitude: number; - altitude: number; - accuracy: number; - time: number; -} -export interface GetLocationOption { - timeout?: number; - coordType?: string; - success?: (data: GeolocationResponse) => void; - fail?: (data: string, code: number) => void; - complete?: () => void; -} -export interface GetLocationTypeResponse { - types: Array; -} -export interface GetLocationTypeOption { - success?: (data: GetLocationTypeResponse) => void; - fail?: (data: string, code: number) => void; - complete?: () => void; -} -export interface SubscribeLocationOption { - coordType?: string; - success: (data: GeolocationResponse) => void; - fail?: (data: string, code: number) => void; -} -export default class Geolocation { - static getLocation(options?: GetLocationOption): void; - static getLocationType(options?: GetLocationTypeOption): void; - static subscribe(options: SubscribeLocationOption): void; - static unsubscribe(): void; - static getSupportedCoordTypes(): Array; -} diff --git a/api/@system.prompt.d.ts b/api/@system.prompt.d.ts deleted file mode 100755 index 2c395c5c0f..0000000000 --- a/api/@system.prompt.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2021 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 interface ShowToastOptions { - message: string; - duration?: number; -} -export interface Button { - text: string; - color: string; -} -export interface ShowDialogSuccessResponse { - index: number; -} -export interface ShowDialogOptions { - title?: string; - message?: string; - buttons?: [Button, Button?, Button?]; - success?: (data: ShowDialogSuccessResponse) => void; - cancel?: (data: string, code: string) => void; - complete?: (data: string) => void; -} -export default class Prompt { - static showToast(options: ShowToastOptions): void; - static showDialog(options: ShowDialogOptions): void; -} diff --git a/api/@system.router.d.ts b/api/@system.router.d.ts deleted file mode 100755 index 8cb0efc2af..0000000000 --- a/api/@system.router.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2021 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 interface RouterOptions { - uri: string; - params?: Object; -} -export interface BackRouterOptions { - path?: string; -} -export interface RouterState { - index: number; - name: string; - path: string; -} -export default class Router { - static push(options: RouterOptions): void; - static replace(options: RouterOptions): void; - static back(options?: BackRouterOptions): void; - static clear(): void; - static getLength(): string; - static getState(): RouterState; -} diff --git a/api/@system.sensor.d.ts b/api/@system.sensor.d.ts deleted file mode 100755 index be6b11bbee..0000000000 --- a/api/@system.sensor.d.ts +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2021 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 interface AccelerometerResponse { - x: number; - y: number; - z: number; -} -export interface subscribeAccelerometerOptions { - interval: string; - success: (data: AccelerometerResponse) => void; - fail?: (data: string, code: number) => void; -} -export interface CompassResponse { - direction: number; -} -export interface SubscribeCompassOptions { - success: (data: CompassResponse) => void; - fail?: (data: string, code: number) => void; -} -export interface ProximityResponse { - distance: number; -} -export interface SubscribeProximityOptions { - success: (data: ProximityResponse) => void; - fail?: (data: string, code: number) => void; -} -export interface LightResponse { - intensity: number; -} -export interface SubscribeLightOptions { - success: (data: LightResponse) => void; - fail?: (data: string, code: number) => void; -} -export interface StepCounterResponse { - steps: number; -} -export interface SubscribeStepCounterOptions { - success: (data: StepCounterResponse) => void; - fail?: (data: string, code: number) => void; -} -export interface BarometerResponse { - pressure: number; -} -export interface SubscribeBarometerOptions { - success: (data: BarometerResponse) => void; - fail?: (data: string, code: number) => void; -} -export interface HeartRateResponse { - heartRate: number; -} -export interface SubscribeHeartRateOptions { - success: (data: HeartRateResponse) => void; - fail?: (data: string, code: number) => void; -} -export interface OnBodyStateResponse { - value: boolean; -} -export interface SubscribeOnBodyStateOptions { - success: (data: OnBodyStateResponse) => void; - fail?: (data: string, code: number) => void; -} -export interface GetOnBodyStateOptions { - success: (data: OnBodyStateResponse) => void; - fail?: (data: string, code: number) => void; - complete?: () => void; -} -export default class Sensor { - static subscribeAccelerometer(options: subscribeAccelerometerOptions): void; - static unsubscribeAccelerometer(): void; - static subscribeCompass(options: SubscribeCompassOptions): void; - static unsubscribeCompass(): void; - static subscribeProximity(options: SubscribeProximityOptions): void; - static unsubscribeProximity(): void; - static subscribeLight(options: SubscribeLightOptions): void; - static unsubscribeLight(): void; - static subscribeStepCounter(options: SubscribeStepCounterOptions): void; - static unsubscribeStepCounter(): void; - static subscribeBarometer(options: SubscribeBarometerOptions): void; - static unsubscribeBarometer(): void; - static subscribeHeartRate(options: SubscribeHeartRateOptions): void; - static unsubscribeHeartRate(): void; - static subscribeOnBodyState(options: SubscribeOnBodyStateOptions): void; - static unsubscribeOnBodyState(): void; - static getOnBodyState(options: GetOnBodyStateOptions): void; -} diff --git a/api/phone/app/abilityinfo.d.ts b/api/app/abilityinfo.d.ts similarity index 100% rename from api/phone/app/abilityinfo.d.ts rename to api/app/abilityinfo.d.ts diff --git a/api/phone/app/abilitymissioninfo.d.ts b/api/app/abilitymissioninfo.d.ts similarity index 100% rename from api/phone/app/abilitymissioninfo.d.ts rename to api/app/abilitymissioninfo.d.ts diff --git a/api/phone/app/applicationinfo.d.ts b/api/app/applicationinfo.d.ts similarity index 100% rename from api/phone/app/applicationinfo.d.ts rename to api/app/applicationinfo.d.ts diff --git a/api/phone/app/appprocessstate.ts b/api/app/appprocessstate.ts similarity index 100% rename from api/phone/app/appprocessstate.ts rename to api/app/appprocessstate.ts diff --git a/api/phone/app/bundleinfo.d.ts b/api/app/bundleinfo.d.ts similarity index 100% rename from api/phone/app/bundleinfo.d.ts rename to api/app/bundleinfo.d.ts diff --git a/api/phone/app/common.d.ts b/api/app/common.d.ts similarity index 100% rename from api/phone/app/common.d.ts rename to api/app/common.d.ts diff --git a/api/phone/app/elementname.d.ts b/api/app/elementname.d.ts similarity index 100% rename from api/phone/app/elementname.d.ts rename to api/app/elementname.d.ts diff --git a/api/phone/app/installresult.d.ts b/api/app/installresult.d.ts similarity index 100% rename from api/phone/app/installresult.d.ts rename to api/app/installresult.d.ts diff --git a/api/phone/app/moduleinfo.d.ts b/api/app/moduleinfo.d.ts similarity index 100% rename from api/phone/app/moduleinfo.d.ts rename to api/app/moduleinfo.d.ts diff --git a/api/phone/app/processinfo.d.ts b/api/app/processinfo.d.ts similarity index 100% rename from api/phone/app/processinfo.d.ts rename to api/app/processinfo.d.ts diff --git a/api/phone/app/want.d.ts b/api/app/want.d.ts similarity index 100% rename from api/phone/app/want.d.ts rename to api/app/want.d.ts diff --git a/api/phone/basic.d.ts b/api/basic.d.ts old mode 100755 new mode 100644 similarity index 100% rename from api/phone/basic.d.ts rename to api/basic.d.ts diff --git a/api/phone/commonevent/commoneventdata.d.ts b/api/commonevent/commoneventdata.d.ts similarity index 100% rename from api/phone/commonevent/commoneventdata.d.ts rename to api/commonevent/commoneventdata.d.ts diff --git a/api/phone/commonevent/commoneventpublishdata.d.ts b/api/commonevent/commoneventpublishdata.d.ts similarity index 100% rename from api/phone/commonevent/commoneventpublishdata.d.ts rename to api/commonevent/commoneventpublishdata.d.ts diff --git a/api/phone/commonevent/commoneventsubscribeinfo.d.ts b/api/commonevent/commoneventsubscribeinfo.d.ts similarity index 100% rename from api/phone/commonevent/commoneventsubscribeinfo.d.ts rename to api/commonevent/commoneventsubscribeinfo.d.ts diff --git a/api/phone/commonevent/commoneventsubscriber.d.ts b/api/commonevent/commoneventsubscriber.d.ts similarity index 100% rename from api/phone/commonevent/commoneventsubscriber.d.ts rename to api/commonevent/commoneventsubscriber.d.ts diff --git a/api/phone/data/distributeddata/kvmanager_config.d.ts b/api/data/distributeddata/kvmanager_config.d.ts similarity index 100% rename from api/phone/data/distributeddata/kvmanager_config.d.ts rename to api/data/distributeddata/kvmanager_config.d.ts diff --git a/api/phone/data/distributeddata/kvstore.d.ts b/api/data/distributeddata/kvstore.d.ts similarity index 100% rename from api/phone/data/distributeddata/kvstore.d.ts rename to api/data/distributeddata/kvstore.d.ts diff --git a/api/phone/data/distributeddata/plain_ordinary_js_objects.d.ts b/api/data/distributeddata/plain_ordinary_js_objects.d.ts similarity index 100% rename from api/phone/data/distributeddata/plain_ordinary_js_objects.d.ts rename to api/data/distributeddata/plain_ordinary_js_objects.d.ts diff --git a/api/phone/data/distributeddata/single_kvstore.d.ts b/api/data/distributeddata/single_kvstore.d.ts similarity index 100% rename from api/phone/data/distributeddata/single_kvstore.d.ts rename to api/data/distributeddata/single_kvstore.d.ts diff --git a/api/form/action/form-schema.json b/api/form/action/form-schema.json new file mode 100644 index 0000000000..cc2104a42b --- /dev/null +++ b/api/form/action/form-schema.json @@ -0,0 +1,18 @@ +{ + "type": "object", + "additionalProperties": false, + "properties":{ + "data": { + "type": "object", + "description": "Defines variables." + }, + "actions": { + "type": "object", + "description": "Defines events." + }, + "apiVersion": { + "type": "object", + "description": "Defines api version compatibility information." + } + } +} diff --git a/api/form/css/css-json-schema.json b/api/form/css/css-json-schema.json new file mode 100644 index 0000000000..40ef282b69 --- /dev/null +++ b/api/form/css/css-json-schema.json @@ -0,0 +1,283 @@ +{ + "type": "object", + "properties": { + "properties": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "supportedDevices": { + "type": "array", + "description": "本字段非必填,如果为空,表示该属性支持所有的设备类型", + "items": { + "type": "string", + "enum": ["tv", "phone", "tablet", "wearable", "liteWearable", "smartVision"] + } + }, + "syntax": { + "type": "array", + "description": "语法", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "支持