From b8e5db2ef55c0f6bdcab77a14a9209ca6b7ff3b4 Mon Sep 17 00:00:00 2001 From: wuchunbo Date: Mon, 17 Jan 2022 12:09:26 +0800 Subject: [PATCH 01/19] add set table to be distributed API Signed-off-by: wuchunbo --- api/@ohos.data.rdb.d.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/api/@ohos.data.rdb.d.ts b/api/@ohos.data.rdb.d.ts index 498bebb88a..c42f6b7e6e 100644 --- a/api/@ohos.data.rdb.d.ts +++ b/api/@ohos.data.rdb.d.ts @@ -194,6 +194,18 @@ declare namespace rdb { */ rollBack(callback: AsyncCallback):void; rollBack(): Promise; + + /** + * set table to be distributed table + * + * @note N/A + * @since 8 + * @sysCap SystemCapability.Data.DATA_APPDATAMGR + * @param tables the tables name you want to set + * @devices phone, tablet, tv, wearable, car + */ + setTableDistributed(tables: Array, callback: AsyncCallback): void; + setTableDistributed(tables: Array): Promise } /** -- Gitee From df3b1920c15609b3c0279df6ce0f84b5fc969572 Mon Sep 17 00:00:00 2001 From: aajwy <13051180828@163.com> Date: Mon, 17 Jan 2022 06:36:54 +0000 Subject: [PATCH 02/19] hilog js api dts Signed-off-by: aajwy <13051180828@163.com> --- api/@ohos.hilog.ts | 102 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100755 api/@ohos.hilog.ts diff --git a/api/@ohos.hilog.ts b/api/@ohos.hilog.ts new file mode 100755 index 0000000000..75f30d6ea7 --- /dev/null +++ b/api/@ohos.hilog.ts @@ -0,0 +1,102 @@ +/* + * 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. + */ + +/** +* Provides interfaces to generate system logs. +* +* @devices tv, phone, tablet, wearable, car +* @since 7 +* @Syscap SystemCapability.HiviewDFX +*/ + +declare namespace hilog { + /** + * Outputs debug-level logs. + * + * @param domain Indicates the service domain, which is a hexadecimal integer ranging from 0x0 to 0xFFFFF + * @param tag Identifies the log tag. + * @param format Indicates the log format string. + * @param args Indicates the log parameters. + * @devices tv, phone, tablet, wearable, car + * @since 7 + */ + function debug(domain: number, tag: string, format: string, ...args: any[]) : void; + /** + * Outputs info-level logs. + * + * @param domain Indicates the service domain, which is a hexadecimal integer ranging from 0x0 to 0xFFFFF + * @param tag Identifies the log tag. + * @param format Indicates the log format string. + * @param args Indicates the log parameters. + * @devices tv, phone, tablet, wearable, car + * @since 7 + */ + function info(domain: number, tag: string, format: string, ...args: any[]) : void; + /** + * Outputs warning-level logs. + * + * @param domain Indicates the service domain, which is a hexadecimal integer ranging from 0x0 to 0xFFFFF + * @param tag Identifies the log tag. + * @param format Indicates the log format string. + * @param args Indicates the log parameters. + * @devices tv, phone, tablet, wearable, car + * @since 7 + */ + function warn(domain: number, tag: string, format: string, ...args: any[]) : void; + /** + * Outputs error-level logs. + * + * @param domain Indicates the service domain, which is a hexadecimal integer ranging from 0x0 to 0xFFFFF + * @param tag Identifies the log tag. + * @param format Indicates the log format string. + * @param args Indicates the log parameters. + * @devices tv, phone, tablet, wearable, car + * @since 7 + */ + function error(domain: number, tag: string, format: string, ...args: any[]) : void; + /** + * Outputs fatal-level logs. + * + * @param domain Indicates the service domain, which is a hexadecimal integer ranging from 0x0 to 0xFFFFF + * @param tag Identifies the log tag. + * @param format Indicates the log format string. + * @param args Indicates the log parameters. + * @devices tv, phone, tablet, wearable, car + * @since 7 + */ + function fatal(domain: number, tag: string, format: string, ...args: any[]) : void; + /** + * Checks whether logs of the specified tag, and level can be printed. + * + * @param domain Indicates the service domain, which is a hexadecimal integer ranging from 0x0 to 0xFFFFF + * @param tag Identifies the log tag. + * @param level log level + * @devices tv, phone, tablet, wearable, car + * @since 7 + */ + function isLoggable(domain: number, tag: string, level: LogLevel) : boolean; + /** + * Log level define + */ + enum LogLevel { + DEBUG = 3, + INFO = 4, + WARN = 5, + ERROR = 6, + FATAL = 7, + } +} + +export default hilog; \ No newline at end of file -- Gitee From 27bc5ea607a42531339da1ca5a0b3e00b969c27b Mon Sep 17 00:00:00 2001 From: xueyuanzhao Date: Mon, 17 Jan 2022 16:45:57 +0800 Subject: [PATCH 03/19] Signed-off-by:xueyuanzhao Signed-off-by: xueyuanzhao --- api/@ohos.multimodalInput.inputConsumer.d.ts | 72 ++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 api/@ohos.multimodalInput.inputConsumer.d.ts diff --git a/api/@ohos.multimodalInput.inputConsumer.d.ts b/api/@ohos.multimodalInput.inputConsumer.d.ts new file mode 100644 index 0000000000..da5247cd27 --- /dev/null +++ b/api/@ohos.multimodalInput.inputConsumer.d.ts @@ -0,0 +1,72 @@ +/* +* 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 './basic'; + + /** + * The event of key input management module is configured to subscribe and unsubscribe system keys. + * + * @since 8 + * @sysCap SystemCapability.MultimodalInput.MULTIMODAL_INPUT + * @devices phone, tablet, tv, wearable + * @import import inputConsumer from '@ohos.multimodalInput.inputConsumer'; + * @permission N/A + */ + +declare namespace inputDevice { + /** + * Defines event of key that user want to subscribe or unsubscribe. + * + * @sysCap SystemCapability.MultimodalInput.MULTIMODAL_INPUT + * @param preKeys The pre-keys that want to subscribe or unsubscribe. + * @param finalKey The post position key that want to subscribe or unsubscribe. + * @param isFinalKeyDown The final key press down or up. + * @param finalKeyDownDuration Duration of final key press. + */ + interface KeyOptions { + preKeys: Array; + finalKey: number; + isFinalKeyDown: boolean; + finalKeyDownDuration: number; + } + + /** + * Subscribe system keys. + * + * @since 8 + * @sysCap SystemCapability.MultimodalInput.MULTIMODAL_INPUT + * @devices phone, tablet, tv, wearable + * @permission N/A + * @param type type of the keyevent about input which is to be subscribed. + * @param keyOption the key events about input which is to be subscribed. + * @param callback callback function, receive reported data. + */ + function on(type: string, keyOption: KeyOptions, callback: AsyncCallback): void; + + /** + * Subscribe system keys. + * + * @since 8 + * @sysCap SystemCapability.MultimodalInput.MULTIMODAL_INPUT + * @devices phone, tablet, tv, wearable + * @permission N/A + * @param type type of the keyevent about input which is to be subscribed. + * @param keyOption the key events about input which is to be subscribed. + * @param callback callback function, receive reported data. + */ + function off(type: string, keyOption: KeyOptions, callback: AsyncCallback): void; +} + +export default inputConsumer; \ No newline at end of file -- Gitee From ee5cdb9b122772ffec1ccf4dd91e853dacc19ffc Mon Sep 17 00:00:00 2001 From: wuchunbo Date: Mon, 17 Jan 2022 17:18:38 +0800 Subject: [PATCH 04/19] change API name to setDistributedTables Signed-off-by: wuchunbo --- api/@ohos.data.rdb.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/@ohos.data.rdb.d.ts b/api/@ohos.data.rdb.d.ts index c42f6b7e6e..5d67330d6c 100644 --- a/api/@ohos.data.rdb.d.ts +++ b/api/@ohos.data.rdb.d.ts @@ -204,8 +204,8 @@ declare namespace rdb { * @param tables the tables name you want to set * @devices phone, tablet, tv, wearable, car */ - setTableDistributed(tables: Array, callback: AsyncCallback): void; - setTableDistributed(tables: Array): Promise + setDistributedTables(tables: Array, callback: AsyncCallback): void; + setDistributedTables(tables: Array): Promise } /** -- Gitee From c7ad6d3d09d3b0d0a4c5c2b6a88541602c7700d7 Mon Sep 17 00:00:00 2001 From: lixingchi1 Date: Mon, 17 Jan 2022 11:56:56 +0800 Subject: [PATCH 05/19] lixingchi1@huawei.com Signed-off-by: lixingchi1 --- BUILD.gn | 1 + api/@internal/component/ets/index.d.ts | 1 + api/@internal/component/ets/web.d.ts | 54 ++++++++++++++++++++++++++ 3 files changed, 56 insertions(+) create mode 100644 api/@internal/component/ets/web.d.ts diff --git a/BUILD.gn b/BUILD.gn index 38c871c843..a6eb9c2bdb 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -102,6 +102,7 @@ ohos_copy("ets_component") { "api/@internal/component/ets/toggle.d.ts", "api/@internal/component/ets/units.d.ts", "api/@internal/component/ets/video.d.ts", + "api/@internal/component/ets/web.d.ts", "api/@internal/component/ets/xcomponent.d.ts", ] outputs = [ target_out_dir + "/$target_name/{{source_file_part}}" ] diff --git a/api/@internal/component/ets/index.d.ts b/api/@internal/component/ets/index.d.ts index 3c4fc1ec96..b6db78203a 100644 --- a/api/@internal/component/ets/index.d.ts +++ b/api/@internal/component/ets/index.d.ts @@ -93,5 +93,6 @@ /// /// /// +/// /// /// diff --git a/api/@internal/component/ets/web.d.ts b/api/@internal/component/ets/web.d.ts new file mode 100644 index 0000000000..a45cfc58a7 --- /dev/null +++ b/api/@internal/component/ets/web.d.ts @@ -0,0 +1,54 @@ +declare class WebController { + constructor(); + /** + * Means to load a piece of code and execute JS code in the context of the currently displayed page + * @since 8 + */ + evaluateJavaScript(jscode: string); + /** + * Indicates that a piece of code is loaded + * @since 8 + */ + loadDataWithBaseURL(value : {baseUrl: string, data: string, mimeType:string, encoding:string, historyUrl: string}); + /** + * Load the given URL + * @since 8 + */ + loadUrl(url : string); +} +declare interface WebOptions { + /** + * Set the address of the web page to be displayed + * @since 8 + */ + src: string | Resource; + controller: WebController; +} +interface Web extends WebAttribute { + (value: WebOptions): Web; +} +declare class WebAttribute extends CommonMethod { + /** + * Triggered at the end of web page loading + * @since 8 + */ + onPageFinish(callback: (event?:{ url: string }) => void): T; + /** + * Get WebView focus callback event + * @since 8 + */ + onRequestFocus(event: () => void): T; + /** + * Set whether WebView allows JavaScript scripts to execute + * @since 8 + */ + javaScriptEnabled(value: boolean): T; + /** + * Enable or disable local file system access in WebView + * @since 8 + */ + fileAccessEnabled(value: boolean): T; +} +declare class WebExtend extends WebAttribute { +} +declare const Web: Web; -- Gitee From fbe6cfef10844842c2f747814e28e035c090cd67 Mon Sep 17 00:00:00 2001 From: xueyuanzhao Date: Mon, 17 Jan 2022 17:24:26 +0800 Subject: [PATCH 06/19] Signed-off-by:xueyuanzhao Signed-off-by: xueyuanzhao --- api/@ohos.multimodalInput.inputConsumer.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/api/@ohos.multimodalInput.inputConsumer.d.ts b/api/@ohos.multimodalInput.inputConsumer.d.ts index da5247cd27..37b79e82af 100644 --- a/api/@ohos.multimodalInput.inputConsumer.d.ts +++ b/api/@ohos.multimodalInput.inputConsumer.d.ts @@ -25,7 +25,7 @@ import { AsyncCallback } from './basic'; * @permission N/A */ -declare namespace inputDevice { +declare namespace inputConsumer { /** * Defines event of key that user want to subscribe or unsubscribe. * @@ -37,9 +37,9 @@ declare namespace inputDevice { */ interface KeyOptions { preKeys: Array; - finalKey: number; - isFinalKeyDown: boolean; - finalKeyDownDuration: number; + finalKey: number; + isFinalKeyDown: boolean; + finalKeyDownDuration: number; } /** -- Gitee From e6647d7c85f693f1f6596338d70f83978663a5b4 Mon Sep 17 00:00:00 2001 From: xueyuanzhao Date: Mon, 17 Jan 2022 17:25:59 +0800 Subject: [PATCH 07/19] Signed-off-by:xueyuanzhao Signed-off-by: xueyuanzhao --- api/@ohos.multimodalInput.inputConsumer.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/api/@ohos.multimodalInput.inputConsumer.d.ts b/api/@ohos.multimodalInput.inputConsumer.d.ts index 37b79e82af..100ba90e03 100644 --- a/api/@ohos.multimodalInput.inputConsumer.d.ts +++ b/api/@ohos.multimodalInput.inputConsumer.d.ts @@ -50,8 +50,8 @@ declare namespace inputConsumer { * @devices phone, tablet, tv, wearable * @permission N/A * @param type type of the keyevent about input which is to be subscribed. - * @param keyOption the key events about input which is to be subscribed. - * @param callback callback function, receive reported data. + * @param keyOption the key events about input which is to be subscribed. + * @param callback callback function, receive reported data. */ function on(type: string, keyOption: KeyOptions, callback: AsyncCallback): void; @@ -63,8 +63,8 @@ declare namespace inputConsumer { * @devices phone, tablet, tv, wearable * @permission N/A * @param type type of the keyevent about input which is to be subscribed. - * @param keyOption the key events about input which is to be subscribed. - * @param callback callback function, receive reported data. + * @param keyOption the key events about input which is to be subscribed. + * @param callback callback function, receive reported data. */ function off(type: string, keyOption: KeyOptions, callback: AsyncCallback): void; } -- Gitee From 2b2c98dc463b3c36d4993ef25e9705222179f391 Mon Sep 17 00:00:00 2001 From: wuchunbo Date: Mon, 17 Jan 2022 17:26:04 +0800 Subject: [PATCH 08/19] fix syntax error Signed-off-by: wuchunbo --- api/@ohos.data.rdb.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.data.rdb.d.ts b/api/@ohos.data.rdb.d.ts index 5d67330d6c..0b38d7da87 100644 --- a/api/@ohos.data.rdb.d.ts +++ b/api/@ohos.data.rdb.d.ts @@ -205,7 +205,7 @@ declare namespace rdb { * @devices phone, tablet, tv, wearable, car */ setDistributedTables(tables: Array, callback: AsyncCallback): void; - setDistributedTables(tables: Array): Promise + setDistributedTables(tables: Array): Promise; } /** -- Gitee From 316baa52b930a5d0ea765bd57959aae2dbee5a14 Mon Sep 17 00:00:00 2001 From: laibo Date: Mon, 17 Jan 2022 17:26:33 +0800 Subject: [PATCH 09/19] laibo2@huawei.com Signed-off-by: laibo --- api/@internal/component/ets/common.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/@internal/component/ets/common.d.ts b/api/@internal/component/ets/common.d.ts index 875e800ff3..758644f083 100644 --- a/api/@internal/component/ets/common.d.ts +++ b/api/@internal/component/ets/common.d.ts @@ -1297,13 +1297,13 @@ declare class CommonMethod { * When the parameter is of the boolean type, this parameter specifies whether to crop based on the edge contour. * @since 7 */ - clip(value: boolean | CircleInterface | EllipseInterface | PathInterface | RectInterface): T; + clip(value: boolean | CircleAttribute | EllipseAttribute | PathAttribute | RectAttribute): T; /** * Applies a mask of the specified shape to the current assembly. * @since 7 */ - mask(value: CircleInterface | EllipseInterface | PathInterface | RectInterface): T; + mask(value: CircleAttribute | EllipseAttribute | PathAttribute | RectAttribute): T; /** * Key. User can set an key to the component to identify it. -- Gitee From 16bbc7d6d6ca79a4a78c882c3b1f38f4d82c7217 Mon Sep 17 00:00:00 2001 From: wuchunbo Date: Mon, 17 Jan 2022 17:28:25 +0800 Subject: [PATCH 10/19] change comment Signed-off-by: wuchunbo --- api/@ohos.data.rdb.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.data.rdb.d.ts b/api/@ohos.data.rdb.d.ts index 0b38d7da87..dfbcea11da 100644 --- a/api/@ohos.data.rdb.d.ts +++ b/api/@ohos.data.rdb.d.ts @@ -196,7 +196,7 @@ declare namespace rdb { rollBack(): Promise; /** - * set table to be distributed table + * Set table to be distributed table. * * @note N/A * @since 8 -- Gitee From 99c87105e6892f785362aefa83cc424c0fe79756 Mon Sep 17 00:00:00 2001 From: puyajun Date: Mon, 17 Jan 2022 17:32:08 +0800 Subject: [PATCH 11/19] puyajun@huawei.com Signed-off-by: puyajun --- api/@internal/component/ets/common.d.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/api/@internal/component/ets/common.d.ts b/api/@internal/component/ets/common.d.ts index 875e800ff3..95ef6f78b2 100644 --- a/api/@internal/component/ets/common.d.ts +++ b/api/@internal/component/ets/common.d.ts @@ -36,6 +36,12 @@ declare const Observed: ClassDecorator; */ declare const Preview: ClassDecorator & ((value: PreviewParams) => ClassDecorator); +/** + * Defining BuilderParam PropertyDecorator + * @since 7 + */ +declare const BuilderParam: PropertyDecorator; + /** * Defining State PropertyDecorator. * @since 7 @@ -90,6 +96,7 @@ declare const StorageLink: (value: string) => PropertyDecorator; */ declare const Watch: (value: string) => PropertyDecorator; + /** * Defining Builder MethodDecorator * @since 7 -- Gitee From 06d3c6e246b77f1667a318aea89f935c9be53819 Mon Sep 17 00:00:00 2001 From: puhui Date: Mon, 17 Jan 2022 22:25:55 +0800 Subject: [PATCH 12/19] =?UTF-8?q?DM=20API=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: puhui --- ...hos.distributedHardware.deviceManager.d.ts | 98 ++++++++++++++++--- 1 file changed, 83 insertions(+), 15 deletions(-) diff --git a/api/@ohos.distributedHardware.deviceManager.d.ts b/api/@ohos.distributedHardware.deviceManager.d.ts index 646861dc96..69179ba17e 100644 --- a/api/@ohos.distributedHardware.deviceManager.d.ts +++ b/api/@ohos.distributedHardware.deviceManager.d.ts @@ -15,9 +15,18 @@ import { AsyncCallback, Callback } from './basic'; +/** + * Providers interfaces to creat a {@link deviceManager} instances. + * + * @since 7 + * @Syscap SystemCapability.DISTRIBUTEDHARDWARE.deviceManager + * + */ declare namespace deviceManager { /** * DeviceInfo + * + * @systemapi this method can be used only by system applications. */ interface DeviceInfo { /** @@ -34,6 +43,13 @@ declare namespace deviceManager { * Device type of the device. */ deviceType: DeviceType; + + /** + * NetworkId of the device. + * + * @since 8 + */ + networkId: string; } /** @@ -78,6 +94,8 @@ declare namespace deviceManager { /** * Device state change event definition + * + * @systemapi this method can be used only by system applications. */ enum DeviceStateChangeAction { /** @@ -242,16 +260,6 @@ declare namespace deviceManager { */ authType: number; - /** - * App application Icon. - */ - appIcon?: Uint8Array; - - /** - * App application thumbnail. - */ - appThumbnail?: Uint8Array; - /** * Authentication extra infos. */ @@ -288,6 +296,7 @@ declare namespace deviceManager { * * @param bundleName Indicates the bundle name of the application. * @param callback Indicates the callback to be invoked upon {@code DeviceManager} instance creation. + * @systemapi this method can be used only by system applications. */ function createDeviceManager(bundleName: string, callback: AsyncCallback): void; @@ -297,19 +306,66 @@ declare namespace deviceManager { interface DeviceManager { /** * Releases the {@code DeviceManager} instance after the methods for device management are no longer used. + * + * @systemapi this method can be used only by system applications. */ release(): void; /** * Obtains a list of trusted devices. * - * @param options Indicates the extra parameters to be passed to this method for device filtering or sorting. - * This parameter can be null. For details about available values, see {@link #TARGET_PACKAGE_NAME} and - * {@link #SORT_TYPE}. * @return Returns a list of trusted devices. + * @systemapi this method can be used only by system applications. */ getTrustedDeviceListSync(): Array; + /** + * Obtains a list of trusted devices. + * + * @since 8 + * @param callback Indicates the callback to be invoked upon getTrustedDeviceList + * @return Returns a list of trusted devices. + * @systemapi this method can be used only by system applications. + */ + getTrustedDeviceList(callback:AsyncCallback>): void; + + /** + * Obtains a list of trusted devices. + * + * @since 8 + * @return Returns a list of trusted devices. + * @systemapi this method can be used only by system applications. + */ + getTrustedDeviceList(): Promise>; + + /** + * Obtains local device info + * + * @since 8 + * @return Returns local device info. + * @systemapi this method can be used only by system applications. + */ + getLocalDeviceInfoSync(): DeviceInfo; + + /** + * Obtains local device info + * + * @since 8 + * @param callback Indicates the callback to be invoked upon getLocalDeviceInfo + * @return Returns local device info. + * @systemapi this method can be used only by system applications. + */ + getLocalDeviceInfo(callback:AsyncCallback): void; + + /** + * Obtains local device info + * + * @since 8 + * @return Returns local device info. + * @systemapi this method can be used only by system applications. + */ + getLocalDeviceInfo(): Promise; + /** * Start to discover device. * @@ -330,12 +386,21 @@ declare namespace deviceManager { * Authenticate the specified device. * * @param deviceInfo deviceInfo of device to authenticate - * @param authparam authparam of device to authenticate + * @param authParam authParam of device to authenticate * @param callback Indicates the callback to be invoked upon authenticateDevice * @systemapi this method can be used only by system applications. */ authenticateDevice(deviceInfo: DeviceInfo, authParam: AuthParam, callback: AsyncCallback<{deviceId: string, pinTone ?: number}>): void; + /** + * unAuthenticate the specified device. + * + * @since 8 + * @param deviceInfo deviceInfo of device to unAuthenticate + * @systemapi this method can be used only by system applications. + */ + unAuthenticateDevice(deviceInfo: DeviceInfo): void + /** * verify auth info, such as pin code. * @@ -345,13 +410,13 @@ declare namespace deviceManager { */ verifyAuthInfo(authInfo: AuthInfo, callback: AsyncCallback<{deviceId: string, level: number}>): void; - /** * Register a device state callback so that the application can be notified upon device state changes based on * the application bundle name. * * @param bundleName Indicates the bundle name of the application. * @param callback Indicates the device state callback to register. + * @systemapi this method can be used only by system applications. */ on(type: 'deviceStateChange', callback: Callback<{ action: DeviceStateChangeAction, device: DeviceInfo }>): void; @@ -360,6 +425,7 @@ declare namespace deviceManager { * * @param bundleName Indicates the bundle name of the application. * @param callback Indicates the device state callback to register. + * @systemapi this method can be used only by system applications. */ off(type: 'deviceStateChange', callback?: Callback<{ action: DeviceStateChangeAction, device: DeviceInfo }>): void; @@ -399,6 +465,7 @@ declare namespace deviceManager { * Register a serviceError callback so that the application can be notified when devicemanager service died * * @param callback Indicates the service error callback to register. + * @systemapi this method can be used only by system applications. */ on(type: 'serviceDie', callback: () => void): void; @@ -406,6 +473,7 @@ declare namespace deviceManager { * UnRegister a serviceError callback so that the application can be notified when devicemanager service died * * @param callback Indicates the service error callback to register. + * @systemapi this method can be used only by system applications. */ off(type: 'serviceDie', callback?: () => void): void; } -- Gitee From 9f3eadfd86311fa6f7b49bfbf1d92a6a892be266 Mon Sep 17 00:00:00 2001 From: tusi_fly Date: Tue, 18 Jan 2022 10:52:59 +0800 Subject: [PATCH 13/19] contentStorage Signed-off-by: tusi_fly Change-Id: I472b8b618021b80ecab168597bba280aebdecf0c --- api/@internal/component/ets/common.d.ts | 14 ++++ .../component/ets/stateManagement.d.ts | 83 +++++++++++++++++++ 2 files changed, 97 insertions(+) diff --git a/api/@internal/component/ets/common.d.ts b/api/@internal/component/ets/common.d.ts index 788077c39f..ca5a28f447 100644 --- a/api/@internal/component/ets/common.d.ts +++ b/api/@internal/component/ets/common.d.ts @@ -180,6 +180,20 @@ declare function $r(value: string, ...params: any[]): Resource; */ declare function $rawfile(value: string): Resource; +/** + * global getContentStorage function + * @since 8 + */ +declare function getContentStorage(value: any): ContentStorage; + +declare type Context = any; + +/** + * global getContext function + * @since 8 + */ +declare function getContext(value: any): Context; + interface AnimateToParam { duration?: number; tempo?: number; diff --git a/api/@internal/component/ets/stateManagement.d.ts b/api/@internal/component/ets/stateManagement.d.ts index ca532e1754..0fea7d5697 100644 --- a/api/@internal/component/ets/stateManagement.d.ts +++ b/api/@internal/component/ets/stateManagement.d.ts @@ -502,6 +502,89 @@ declare abstract class SubscribaleAbstract { public removeOwningPropertyById(subscriberId: number): void; } +/** + * @since 8 + */ + declare class ContentStorage { + /** + * Called when a link is set. + * @since 8 + */ + link(propName: string): any; + + /** + * Called when a hyperlink is set. + * @since 8 + */ + setAndLink(propName: string, defaultValue: T): SubscribedAbstractProperty; + + /** + * Called when a property is set. + * @since 8 + */ + prop(propName: string): any; + + /** + * Called when dynamic properties are set. + * @since 8 + */ + setAndProp(propName: string, defaultValue: S): SubscribedAbstractProperty; + + /** + * Called when owning or not. + * @since 8 + */ + has(propName: string): boolean; + + /** + * Called when data is obtained. + * @since 8 + */ + get(propName: string): T | undefined; + + /** + * Called when setting. + * @since 8 + */ + set(propName: string, newValue: T): boolean; + + /** + * Called when setting or creating. + * @since 8 + */ + setOrCreate(propName: string, newValue: T): void; + + /** + * Called when a deletion is made. + * @since 8 + */ + delete(propName: string): boolean; + + /** + * Called when a dictionary is sorted. + * @since 8 + */ + keys(): IterableIterator; + + /** + * Called when a cleanup occurs. + * @since 8 + */ + clear(): boolean; + + /** + * Called when the data can be changed. + * @since 8 + */ + isMutable(propName: string): boolean; + + /** + * Called when you check how much data is stored. + * @since 8 + */ + size(): number; +} + /** * @since 7 */ -- Gitee From f18b8482c13939f8932f66e53cd9667e9db38774 Mon Sep 17 00:00:00 2001 From: youqijing Date: Mon, 17 Jan 2022 22:31:11 +0800 Subject: [PATCH 14/19] Add screenshot JS interface Signed-off-by: youqijing Change-Id: I2b41ebfa7d9c9f89e1a870bcb698b095a1f15d84 --- api/@ohos.screenshot.d.ts | 83 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 api/@ohos.screenshot.d.ts diff --git a/api/@ohos.screenshot.d.ts b/api/@ohos.screenshot.d.ts new file mode 100644 index 0000000000..94f912c243 --- /dev/null +++ b/api/@ohos.screenshot.d.ts @@ -0,0 +1,83 @@ +/* + * 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 { AsyncCallback, ErrorCallback } from './basic'; +import image from './@ohos.multimedia.image'; + +/** + * interface for screenshot + * @devices tv, phone, tablet, wearable, car + * @systemapi Hide this for inner system use. + * @since 7 + */ +declare namespace screenshot { + /** + * Takes a screenshot and saves it as a PixelMap object + * @param options Screenshot options, which consist of screenRect, imageSize, and rotation. You need to set these parameters + * @devices tv, phone, tablet, wearable, car + * @permission ohos.permission.CAPTURE_SCREEN + * @since 7 + */ + function save(options?: ScreenshotOptions): Promise; + + /** + * Describes the region of the screen to capture + * @devices tv, phone, tablet, wearable, car + * @since 7 + */ + interface Rect { + left: number; + top: number; + width: number; + height: number; + } + + /** + * Describes the size of the screen region to capture + * @devices tv, phone, tablet, wearable, car + * @since 7 + */ + interface Size { + width: number; + height: number; + } + + /** + * Describes screenshot options + * @devices tv, phone, tablet, wearable, car + * @since 7 + */ + interface ScreenshotOptions { + /** + * Region of the screen to capture. If this parameter is null, the full screen will be captured + */ + screenRect?: Rect; + /** + * Region of the screen to capture. If this parameter is null, the full screen will be captured + */ + imageSize?: Size; + /** + * Rotation angle of the screenshot. The value can be 0, 90, 180, or 270. The default value is 0 + */ + rotation?: number; + /** + * The specify screen to be captured. + * @since 8 + */ + displayId?: number; + } +} + +export default screenshot; -- Gitee From cdcba440f26023be2a4e20cbe7ebcdc4d0ada38b Mon Sep 17 00:00:00 2001 From: liweifeng Date: Tue, 18 Jan 2022 14:50:11 +0800 Subject: [PATCH 15/19] startAbilityForResult add startOptins Signed-off-by: liweifeng Change-Id: Idc00a3c3cfa36429dcbd1dbf357db6d75b457cbf --- api/application/AbilityContext.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/application/AbilityContext.d.ts b/api/application/AbilityContext.d.ts index 3cec14e13d..345363d17e 100644 --- a/api/application/AbilityContext.d.ts +++ b/api/application/AbilityContext.d.ts @@ -70,7 +70,8 @@ export default class AbilityContext extends Context { * @return Returns the {@link AbilityResult}. */ startAbilityForResult(want: Want, callback: AsyncCallback): void; - startAbilityForResult(want: Want): Promise; + startAbilityForResult(want: Want, options: StartOptions, callback: AsyncCallback): void; + startAbilityForResult(want: Want, options?: StartOptions): Promise; /** * Destroys this Page ability. -- Gitee From ba3532ee40364c4d1c88446b802efd47627e9037 Mon Sep 17 00:00:00 2001 From: dujingcheng Date: Tue, 18 Jan 2022 08:33:15 +0000 Subject: [PATCH 16/19] param api8 Signed-off-by: dujingcheng --- api/@ohos.bundle.d.ts | 9 +++++++++ 1 file changed, 9 insertions(+) mode change 100755 => 100644 api/@ohos.bundle.d.ts diff --git a/api/@ohos.bundle.d.ts b/api/@ohos.bundle.d.ts old mode 100755 new mode 100644 index cbdab0cafc..69de064da1 --- a/api/@ohos.bundle.d.ts +++ b/api/@ohos.bundle.d.ts @@ -256,8 +256,17 @@ declare namespace bundle { STATUS_UNINSTALL_FAILURE_CONFLICT = 10, STATUS_INSTALL_FAILURE_DOWNLOAD_TIMEOUT = 0x0B, STATUS_INSTALL_FAILURE_DOWNLOAD_FAILED = 0x0C, + /** + * @since 8 + */ STATUS_RECOVER_FAILURE_INVALID = 0x0D, + /** + * @since 7 + */ STATUS_ABILITY_NOT_FOUND = 0x40, + /** + * @since 7 + */ STATUS_BMS_SERVICE_ERROR = 0x41 } -- Gitee From 4816c78ea1b57265958e831b9db14cf5fab0f398 Mon Sep 17 00:00:00 2001 From: yangfan Date: Tue, 18 Jan 2022 20:09:25 +0800 Subject: [PATCH 17/19] =?UTF-8?q?=E6=B7=BB=E5=8A=A0row/column=E7=9A=84just?= =?UTF-8?q?ifyContent=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yangfan --- api/@internal/component/ets/column.d.ts | 6 ++++++ api/@internal/component/ets/row.d.ts | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/api/@internal/component/ets/column.d.ts b/api/@internal/component/ets/column.d.ts index 8a6feea284..f1045dccf4 100644 --- a/api/@internal/component/ets/column.d.ts +++ b/api/@internal/component/ets/column.d.ts @@ -37,6 +37,12 @@ declare class ColumnAttribute extends CommonMethod { * @since 7 */ alignItems(value: HorizontalAlign): ColumnAttribute; + + /** + * Sets the alignment format of the subassembly in the vertical direction. + * @since 8 + */ + justifyContent(value: FlexAlign): ColumnAttribute; } declare const Column: ColumnInterface; diff --git a/api/@internal/component/ets/row.d.ts b/api/@internal/component/ets/row.d.ts index 412041e9df..6d723e4b8b 100644 --- a/api/@internal/component/ets/row.d.ts +++ b/api/@internal/component/ets/row.d.ts @@ -34,6 +34,12 @@ declare class RowAttribute extends CommonMethod { * @since 7 */ alignItems(value: VerticalAlign): RowAttribute; + + /** + * Called when the horizontal alignment is set. + * @since 8 + */ + justifyContent(value: FlexAlign): RowAttribute; } declare const Row: RowInterface; -- Gitee From 211c7b9fdbba49dfbdd8dc1e4e821b7bc96ab2d1 Mon Sep 17 00:00:00 2001 From: shilei Date: Tue, 18 Jan 2022 14:53:45 +0000 Subject: [PATCH 18/19] add query extension info interface Signed-off-by: shilei Change-Id: I5ccb6c27d7c196317e855c511a197c34f3d9ed30 --- api/@ohos.bundle.d.ts | 250 +++++++++++++++++++-------- api/ability/want.d.ts | 18 ++ api/bundle/abilityInfo.d.ts | 15 ++ api/bundle/applicationInfo.d.ts | 33 +++- api/bundle/bundleInfo.d.ts | 15 ++ api/bundle/extensionAbilityInfo.d.ts | 125 ++++++++++++++ api/bundle/hapModuleInfo.d.ts | 15 ++ api/bundle/metadata.d.ts | 44 +++++ 8 files changed, 444 insertions(+), 71 deletions(-) create mode 100644 api/bundle/extensionAbilityInfo.d.ts create mode 100644 api/bundle/metadata.d.ts diff --git a/api/@ohos.bundle.d.ts b/api/@ohos.bundle.d.ts index 69de064da1..f279a2e915 100644 --- a/api/@ohos.bundle.d.ts +++ b/api/@ohos.bundle.d.ts @@ -17,6 +17,7 @@ import { AsyncCallback, Callback } from './basic'; import { ApplicationInfo } from './bundle/applicationInfo'; import { BundleInfo } from './bundle/bundleInfo'; import { AbilityInfo } from './bundle/abilityInfo'; +import { ExtensionAbilityInfo } from './bundle/extensionAbilityInfo'; import { Want } from './ability/want'; import { BundleInstaller } from './bundle/bundleInstaller'; import { ShortcutInfo } from './bundle/shortcutInfo'; @@ -49,27 +50,46 @@ declare namespace bundle { GET_BUNDLE_WITH_REQUESTED_PERMISSION = 0x00000010, GET_ALL_APPLICATION_INFO = 0xFFFF0000, /** - * @since 8 - */ + * @since 8 + */ GET_ABILITY_INFO_WITH_METADATA = 0x00000020, /** - * @since 8 - */ - GET_APPLICATION_INFO_WITH_METADATA = 0x00000040, + * @since 8 + */ + GET_BUNDLE_WITH_EXTENSION_ABILITY = 0x00000020, /** - * @since 8 - */ + * @since 8 + */ + GET_APPLICATION_INFO_WITH_METADATA = 0x00000040, + /** + * @since 8 + */ GET_ABILITY_INFO_SYSTEMAPP_ONLY = 0x00000080, /** - * @since 8 - */ + * @since 8 + */ GET_ABILITY_INFO_WITH_DISABLE = 0x00000100, - /** - * @since 8 - */ + /** + * @since 8 + */ GET_APPLICATION_INFO_WITH_DISABLE = 0x00000200, } + /** + * @name ExtensionFlag + * @since 8 + * @SysCap SystemCapability.Appexecfwk + * @import NA + * @permission NA + * @devices phone, tablet, tv, wearable + */ + enum ExtensionFlag { + GET_EXTENSION_INFO_DEFAULT = 0x00000000, + GET_EXTENSION_INFO_WITH_PERMISSION = 0x00000002, + GET_EXTENSION_INFO_WITH_APPLICATION = 0x00000004, + GET_EXTENSION_INFO_WITH_METADATA = 0x00000020, + } + /** * @name ColorMode * @since 7 @@ -107,31 +127,31 @@ declare namespace bundle { */ export enum AbilityType { /** - * @default Indicates an unknown ability type - * @since 7 - * @SysCap SystemCapability.Appexecfwk - */ + * @default Indicates an unknown ability type + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ UNKNOWN, /** - * @default Indicates that the ability has a UI - * @since 7 - * @SysCap SystemCapability.Appexecfwk - */ + * @default Indicates that the ability has a UI + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ PAGE, /** - * @default Indicates that the ability does not have a UI - * @since 7 - * @SysCap SystemCapability.Appexecfwk - */ + * @default Indicates that the ability does not have a UI + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ SERVICE, /** - * @default Indicates that the ability is used to provide data access services - * @since 7 - * @SysCap SystemCapability.Appexecfwk - */ + * @default Indicates that the ability is used to provide data access services + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ DATA, } @@ -158,31 +178,31 @@ declare namespace bundle { */ export enum DisplayOrientation { /** - * @default Indicates that the system automatically determines the display orientation - * @since 7 - * @SysCap SystemCapability.Appexecfwk - */ + * @default Indicates that the system automatically determines the display orientation + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ UNSPECIFIED, /** - * @default Indicates the landscape orientation - * @since 7 - * @SysCap SystemCapability.Appexecfwk - */ + * @default Indicates the landscape orientation + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ LANDSCAPE, /** - * @default Indicates the portrait orientation - * @since 7 - * @SysCap SystemCapability.Appexecfwk - */ + * @default Indicates the portrait orientation + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ PORTRAIT, /** - * @default Indicates the page ability orientation is the same as that of the nearest ability in the stack - * @since 7 - * @SysCap SystemCapability.Appexecfwk - */ + * @default Indicates the page ability orientation is the same as that of the nearest ability in the stack + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ FOLLOW_RECENT, } @@ -196,20 +216,91 @@ declare namespace bundle { */ export enum LaunchMode { /** - * @default Indicates that the ability has only one instance - * @since 7 - * @SysCap SystemCapability.Appexecfwk - */ + * @default Indicates that the ability has only one instance + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ SINGLETON = 0, /** - * @default Indicates that the ability can have multiple instances - * @since 7 - * @SysCap SystemCapability.Appexecfwk - */ + * @default Indicates that the ability can have multiple instances + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ STANDARD = 1, } + /** + * @name ExtensionAbilityType + * @since 8 + * @SysCap SystemCapability.Appexecfwk + * @import NA + * @permission NA + * @devices phone, tablet, tv, wearable + */ + export enum ExtensionAbilityType { + /** + * @default Indicates extension info with type of form + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + FORM = 0, + /** + * @default Indicates extension info with type of work schedule + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + WORK_SCHEDULER = 1, + /** + * @default Indicates extension info with type of input method + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + INPUTMETHOD = 2, + /** + * @default Indicates extension info with type of service + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + SERVICE = 3, + /** + * @default Indicates extension info with type of accessibility + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + ACCESSIBILITY = 4, + /** + * @default Indicates extension info with type of datashare + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + DATASHARE = 5, + /** + * @default Indicates extension info with type of fileshare + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + FILESHARE = 6, + /** + * @default Indicates extension info with type of staticsubscriber + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + STATICSUBSCRIBER = 7, + /** + * @default Indicates extension info with type of wallpaper + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + WALLPAPER = 8, + /** + * @default Indicates extension info with type of unspecified + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + UNSPECIFIED = 9, + } + /** * @name BundleOptions * @since 7 @@ -220,17 +311,17 @@ declare namespace bundle { */ export interface BundleOptions { /** - * @default Indicates the user id - * @since 7 - * @SysCap SystemCapability.Appexecfwk - */ + * @default Indicates the user id + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ userId?: number; /** - * @default Indicates the network id - * @since 7 - * @SysCap SystemCapability.Appexecfwk - */ + * @default Indicates the network id + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ networkId?: string; } @@ -267,7 +358,11 @@ declare namespace bundle { /** * @since 7 */ - STATUS_BMS_SERVICE_ERROR = 0x41 + STATUS_BMS_SERVICE_ERROR = 0x41, + /** + * @since 8 + */ + STATUS_FAILED_NO_SPACE_LEFT = 0x42 } /** @@ -305,7 +400,7 @@ declare namespace bundle { * @since 7 * @SysCap SystemCapability.Appexecfwk * @param bundleName Indicates the application bundle name to be queried. - * @param flags Indicates the flag used to specify information contained in the ApplicationInfo object + * @param bundleFlags Indicates the flag used to specify information contained in the ApplicationInfo object * that will be returned. * @param userId Indicates the user ID. * @return Returns the ApplicationInfo object. @@ -333,9 +428,9 @@ declare namespace bundle { * @devices phone, tablet, tv, wearable * @since 7 * @SysCap SystemCapability.Appexecfwk - * @param intent Indicates the Intent containing the application bundle name to + * @param want Indicates the Want containing the application bundle name to * be queried. - * @param flags Indicates the flag used to specify information contained in the AbilityInfo objects that + * @param bundleFlags Indicates the flag used to specify information contained in the AbilityInfo objects that * will be returned. * @param userId Indicates the user ID. * @return Returns a list of AbilityInfo objects. @@ -367,7 +462,7 @@ declare namespace bundle { * @devices phone, tablet, tv, wearable * @since 7 * @SysCap SystemCapability.Appexecfwk - * @param flags Indicates the flag used to specify information contained in the ApplicationInfo objects + * @param bundleFlags Indicates the flag used to specify information contained in the ApplicationInfo objects * that will be returned. * @param userId Indicates the user ID. * @return Returns a list of ApplicationInfo objects. @@ -384,7 +479,7 @@ declare namespace bundle { * @SysCap SystemCapability.Appexecfwk * @param hapFilePath Indicates the path storing the HAP. The path should be the relative path to the data * directory of the current application. - * @param flags Indicates the flag used to specify information contained in the BundleInfo object to be + * @param bundleFlags Indicates the flag used to specify information contained in the BundleInfo object to be * returned. * @return Returns the BundleInfo object. */ @@ -394,16 +489,16 @@ declare namespace bundle { /** /** - * Obtains the Intent for starting the main ability of an application based on the + * Obtains the Want for starting the main ability of an application based on the * given bundle name. The main ability of an application is the ability that has the - * #ACTION_HOME and #ENTITY_HOME intent + * #ACTION_HOME and #ENTITY_HOME Want * filters set in the application's config.json file. * * @devices phone, tablet, tv, wearable * @since 7 * @SysCap SystemCapability.Appexecfwk * @param bundleName Indicates the bundle name of the application. - * @return Returns the Intent for starting the application's main ability if any; returns null if + * @return Returns the Want for starting the application's main ability if any; returns null if * the given bundle does not exist or does not contain any main ability. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED */ @@ -479,6 +574,23 @@ declare namespace bundle { */ function setAbilityEnabled(info: AbilityInfo, isEnable: boolean, callback: AsyncCallback): void; function setAbilityEnabled(info: AbilityInfo, isEnable: boolean): Promise; + + /** + * Query extension info of by utilizing a Want. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @SysCap SystemCapability.Appexecfwk + * @param want Indicates the Want containing the application bundle name to be queried. + * @param extensionFlags Indicates the flag used to specify information contained in the ExtensionInfo objects that + * will be returned. + * @param userId Indicates the user ID. + * @return Returns a list of ExtensionInfo objects. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED, ohos.permission.GET_BUNDLE_INFO + */ + function queryExtensionAbilityInfosByWant(want: Want, extensionFlags: number, userId: number, callback: AsyncCallback>): void; + function queryExtensionAbilityInfosByWant(want: Want, extensionFlags: number, callback: AsyncCallback>): void; + function queryExtensionAbilityInfosByWant(want: Want, extensionFlags: number, userId?: number): Promise>; } export default bundle; \ No newline at end of file diff --git a/api/ability/want.d.ts b/api/ability/want.d.ts index af2183ded2..6935e76963 100644 --- a/api/ability/want.d.ts +++ b/api/ability/want.d.ts @@ -102,4 +102,22 @@ export declare interface Want { * @default - */ entities?: Array; + + /** + * The description of a extension ability name in a Want. + * @devices phone, tablet + * @since 8 + * @sysCap AAFwk + * @default - + */ + extensionAbilityName?: string; + + /** + * The description of a extension ability type in a Want. + * @devices phone, tablet + * @since 8 + * @sysCap AAFwk + * @default - + */ + extensionAbilityType?: number; } \ No newline at end of file diff --git a/api/bundle/abilityInfo.d.ts b/api/bundle/abilityInfo.d.ts index a7cf71866b..863800d290 100644 --- a/api/bundle/abilityInfo.d.ts +++ b/api/bundle/abilityInfo.d.ts @@ -15,6 +15,7 @@ import { ApplicationInfo } from './applicationInfo'; import { CustomizeData } from './customizeData' +import { Metadata } from './metadata' import bundle from './../@ohos.bundle'; /** @@ -248,4 +249,18 @@ export interface AbilityInfo { * @SysCap SystemCapability.Appexecfwk */ readonly metaData: Array; + + /** + * @default Indicates the metadata of ability + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly metadata: Array; + + /** + * @default Indicates the metadata of ability + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly enabled: boolean; } diff --git a/api/bundle/applicationInfo.d.ts b/api/bundle/applicationInfo.d.ts index d57fbd7bc8..49c2482bfa 100644 --- a/api/bundle/applicationInfo.d.ts +++ b/api/bundle/applicationInfo.d.ts @@ -15,6 +15,7 @@ import { ModuleInfo } from './moduleInfo'; import { CustomizeData } from './customizeData' +import { Metadata } from './metadata' /** * @name Obtains configuration information about an application @@ -148,12 +149,40 @@ export interface ApplicationInfo { * @since 8 * @SysCap SystemCapability.Appexecfwk */ - readonly metaData: Map>; + readonly metaData: Map>; + + /** + * @default Indicates the metadata of module + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly metadata: Array /** * @default Indicates whether or not this application may be removable * @since 8 * @SysCap SystemCapability.Appexecfwk */ - readonly removable: boolean; + readonly removable: boolean; + + /** + * @default Indicates the access token of the application + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly accessTokenId: number; + + /** + * @default Indicates the uid of the application + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly uid: number; + + /** + * @default Indicates entity type of the application + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly entityType: string; } \ No newline at end of file diff --git a/api/bundle/bundleInfo.d.ts b/api/bundle/bundleInfo.d.ts index 6353eaef99..09072dff6a 100644 --- a/api/bundle/bundleInfo.d.ts +++ b/api/bundle/bundleInfo.d.ts @@ -15,6 +15,7 @@ import { AbilityInfo } from './abilityInfo'; import { ApplicationInfo } from './applicationInfo'; +import { ExtensionAbilityInfo } from './extensionAbilityInfo'; import { HapModuleInfo } from './hapModuleInfo'; /** @@ -234,4 +235,18 @@ export interface BundleInfo { * @SysCap SystemCapability.Appexecfwk */ readonly entryInstallationFree: boolean; + + /** + * @default Indicates whether free installation of the entry is supported + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly reqPermissionStates: Array; + + /** + * @default Obtains configuration information about an ability + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly extensionAbilityInfo: Array; } diff --git a/api/bundle/extensionAbilityInfo.d.ts b/api/bundle/extensionAbilityInfo.d.ts new file mode 100644 index 0000000000..57888bb5c5 --- /dev/null +++ b/api/bundle/extensionAbilityInfo.d.ts @@ -0,0 +1,125 @@ +/* + * 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 { ApplicationInfo } from './applicationInfo'; +import { Metadata } from './metadata' +import bundle from './../@ohos.bundle'; + +/** + * @name Obtains extension information about a bundle + * @since 8 + * @SysCap SystemCapability.Appexecfwk + * @permission NA + * @devices phone, tablet, tv, wearable, car + */ +export interface ExtensionAbilityInfo { + /** + * @default Indicates the name of the bundle + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly bundleName: string; + + /** + * @default Indicates the name of the module + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly moduleName: string; + + /** + * @default Indicates the name of the extension info + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly name: string; + + /** + * @default Indicates the label id of the entension info + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly labelId: number; + + /** + * @default Indicates the description id of the entension info + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly descriptionId: number; + + /** + * @default Indicates the icon id of the entension info + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly iconId: number; + + /** + * @default Indicates whether the entensionInfo can be visible or not + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly isVisible: boolean; + + /** + * @default Enumerates types of the entension info + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly extensionAbilityType: bundle.ExtensionAbilityType; + + /** + * @default The permissions that others need to use this extension info + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly permissions: Array; + + /** + * @default Obtains configuration information about an application + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly applicationInfo: ApplicationInfo; + + /** + * @default Indicates the metadata of bundle + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly metadata: Array; + + /** + * @default Indicates the src language to express extension info + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly enabled: boolean; + + /** + * @default Indicates the read permission extension ability info + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly readPermission: string; + + /** + * @default Indicates the write permission of extension ability info + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly writePermission: string; +} diff --git a/api/bundle/hapModuleInfo.d.ts b/api/bundle/hapModuleInfo.d.ts index a62a66955d..067bc26756 100644 --- a/api/bundle/hapModuleInfo.d.ts +++ b/api/bundle/hapModuleInfo.d.ts @@ -14,6 +14,7 @@ */ import { AbilityInfo } from "./abilityInfo"; +import { ExtensionAbilityInfo } from "./extensionAbilityInfo"; /** * @name Obtains configuration information about an module. @@ -113,4 +114,18 @@ export interface HapModuleInfo { * @SysCap SystemCapability.Appexecfwk */ readonly installationFree: boolean; + + /** + * @default Indicates main elementName of the module + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly mainElementName: string; + + /** + * @default Obtains configuration information about extension ability + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly extensionAbilityInfo: Array; } \ No newline at end of file diff --git a/api/bundle/metadata.d.ts b/api/bundle/metadata.d.ts new file mode 100644 index 0000000000..43f3dba9ea --- /dev/null +++ b/api/bundle/metadata.d.ts @@ -0,0 +1,44 @@ +/* + * 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. + */ + + /** + * @name Indicates the Metadata + * @since 8 + * @SysCap SystemCapability.Appexecfwk + * @permission NA + * @devices phone, tablet, tv, wearable, car + */ + export interface Metadata { + /** + * @default Indicates the metadata name + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + name: string; + + /** + * @default Indicates the metadata value + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + value: string; + + /** + * @default Indicates the metadata resource + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + resource: string; + } \ No newline at end of file -- Gitee From 770f93b4d004dcae6387eb29c6237d732ac57726 Mon Sep 17 00:00:00 2001 From: lixingchi1 Date: Wed, 19 Jan 2022 14:58:15 +0800 Subject: [PATCH 19/19] lixingchi1@huawei.com Signed-off-by: lixingchi1 --- api/@internal/component/ets/web.d.ts | 37 ++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/api/@internal/component/ets/web.d.ts b/api/@internal/component/ets/web.d.ts index a45cfc58a7..636060804a 100644 --- a/api/@internal/component/ets/web.d.ts +++ b/api/@internal/component/ets/web.d.ts @@ -1,21 +1,29 @@ declare class WebController { + /** + * Constructor. + * @since 8 + */ constructor(); + /** * Means to load a piece of code and execute JS code in the context of the currently displayed page * @since 8 */ evaluateJavaScript(jscode: string); + /** * Indicates that a piece of code is loaded * @since 8 */ loadDataWithBaseURL(value : {baseUrl: string, data: string, mimeType:string, encoding:string, historyUrl: string}); + /** * Load the given URL * @since 8 */ loadUrl(url : string); } + declare interface WebOptions { /** * Set the address of the web page to be displayed @@ -24,31 +32,40 @@ declare interface WebOptions { src: string | Resource; controller: WebController; } -interface Web extends WebAttribute { - (value: WebOptions): Web; + +interface WebInterface { + /** + * Set Value. + * @since 8 + */ + (value: WebOptions): WebAttribute; } -declare class WebAttribute extends CommonMethod { + +declare class WebAttribute extends CommonMethod { /** * Triggered at the end of web page loading * @since 8 */ - onPageFinish(callback: (event?:{ url: string }) => void): T; + onPageFinish(callback: (event?:{ url: string }) => void): WebAttribute; + /** * Get WebView focus callback event * @since 8 */ - onRequestFocus(event: () => void): T; + onRequestFocus(event: () => void): WebAttribute; + /** * Set whether WebView allows JavaScript scripts to execute * @since 8 */ - javaScriptEnabled(value: boolean): T; + javaScriptEnabled(value: boolean): WebAttribute; + /** * Enable or disable local file system access in WebView * @since 8 */ - fileAccessEnabled(value: boolean): T; + fileAccessEnabled(value: boolean): WebAttribute; } -declare class WebExtend extends WebAttribute { -} -declare const Web: Web; + +declare const Web: WebInterface; +declare const WebInstance: WebAttribute; -- Gitee