From 703ca0349ad492642bfecd938f9e1d71149b4f20 Mon Sep 17 00:00:00 2001 From: zhaoyuan Date: Mon, 27 Sep 2021 14:19:50 +0000 Subject: [PATCH 1/2] fixed 2febd82 from https://gitee.com/skyblackleon/interface_sdk-js/pulls/110 update d.ts Signed-off-by: zhaoyuan --- api/@ohos.commonEvent.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.commonEvent.d.ts b/api/@ohos.commonEvent.d.ts index 19d056ce6d..c3dc0d5b8f 100644 --- a/api/@ohos.commonEvent.d.ts +++ b/api/@ohos.commonEvent.d.ts @@ -886,4 +886,4 @@ declare namespace commonEvent { } } -export default commonEvent; \ No newline at end of file +export default commonEvent; -- Gitee From 38e81ab6fa09ef17b38cf842bba2758435e61daf Mon Sep 17 00:00:00 2001 From: zhaoyuan Date: Mon, 27 Sep 2021 14:12:43 +0000 Subject: [PATCH 2/2] fixed 333e323 from https://gitee.com/skyblackleon/interface_sdk-js/pulls/110 update d.ts files Signed-off-by: zhaoyuan --- api/@ohos.commonEvent.d.ts | 1 + api/@ohos.wantAgent.d.ts | 80 ++++++++++++++++++- api/commonEvent/commonEventData.d.ts | 8 ++ api/commonEvent/commonEventPublishData.d.ts | 8 ++ api/notification/notificationContent.d.ts | 21 ++++- api/notification/notificationRequest.d.ts | 3 + api/notification/notificationSorting.d.ts | 1 + api/notification/notificationSortingMap.d.ts | 1 + api/notification/notificationSubscribeInfo.ts | 1 + api/wantAgent/triggerInfo.d.ts | 31 +++++++ api/wantAgent/wantAgentInfo.d.ts | 3 +- 11 files changed, 152 insertions(+), 6 deletions(-) create mode 100644 api/wantAgent/triggerInfo.d.ts diff --git a/api/@ohos.commonEvent.d.ts b/api/@ohos.commonEvent.d.ts index c3dc0d5b8f..d72b2bcef5 100644 --- a/api/@ohos.commonEvent.d.ts +++ b/api/@ohos.commonEvent.d.ts @@ -45,6 +45,7 @@ declare namespace commonEvent { */ function publish(event: string, options: CommonEventPublishData, callback: AsyncCallback): void; + /** * create the CommonEventSubscriber for the SubscriberInfo. * diff --git a/api/@ohos.wantAgent.d.ts b/api/@ohos.wantAgent.d.ts index 2bdd0a1f0b..f7eab8a04f 100644 --- a/api/@ohos.wantAgent.d.ts +++ b/api/@ohos.wantAgent.d.ts @@ -16,6 +16,7 @@ import { AsyncCallback , Callback} from './basic'; import { Want } from './ability/want'; import { WantAgentInfo } from './wantAgent/wantAgentInfo'; +import { TriggerInfo } from './wantAgent/triggerInfo'; /** * Provide the method obtain trigger, cancel, and compare and to obtain @@ -23,17 +24,78 @@ import { WantAgentInfo } from './wantAgent/wantAgentInfo'; * * @name wantAgent * @since 7 - * @devices phone, tablet + * @devices phone, tablet, tv, wearable, car + * @import wantAgent from '@ohos.wantAgent'; * @permission N/A */ declare namespace wantAgent { + /** + * Obtains the bundle name of an {@link WantAgent}. + * + * @param agent Indicates the {@link WantAgent} whose bundle name is to be obtained. + * @return Returns the bundle name of the {@link WantAgent} if any. + * @since 7 + */ + function getBundleName(agent: WantAgent, callback: AsyncCallback): void; + function getBundleName(agent: WantAgent): Promise; + + /** + * Obtains the bundle name of an {@link WantAgent}. + * + * @param agent Indicates the {@link WantAgent} whose UID is to be obtained. + * @return Returns the UID of the {@link WantAgent} if any; returns {@code -1} otherwise. + * @since 7 + */ + function getUid(agent: WantAgent, callback: AsyncCallback): void; + function getUid(agent: WantAgent): Promise; + + /** + * Obtains the {@link Want} of an {@link WantAgent}. + * + * @param agent Indicates the {@link WantAgent} whose UID is to be obtained. + * @return Returns the {@link Want} of the {@link WantAgent}. + * @systemapi Hide this for inner system use. + * @since 7 + */ + function getWant(agent: WantAgent, callback: AsyncCallback): void; + function getWant(agent: WantAgent): Promise; + + /** + * Cancels an {@link WantAgent}. Only the application that creates the {@link IntentAgent} can cancel it. + * + * @param agent Indicates the {@link WantAgent} to cancel. + * @since 7 + */ + function cancel(agent: WantAgent, callback: AsyncCallback): void; + function cancel(agent: WantAgent): Promise; + + /** + * Obtains the bundle name of an {@link WantAgent}. + * + * @param agent Indicates the {@link WantAgent} whose bundle name is to be obtained. + * @param triggerInfo Indicates the {@link TriggerInfo} object that contains triggering parameters. + * @param callback Indicates the callback method to be called after the {@link WantAgent} is triggered. + * @since 7 + */ + function trigger(agent: WantAgent, triggerInfo: TriggerInfo, callback?: Callback): void; + + /** + * Checks whether two {@link WantAgent} objects are the same. + * + * @param agent Indicates one of the {@link WantAgent} object to compare. + * @param otherAgent Indicates the other {@link WantAgent} object to compare. + * @return Returns {@code true} If the two objects are the same; returns {@code false} otherwise. + * @since 7 + */ + function equal(agent: WantAgent, otherAgent: WantAgent, callback: AsyncCallback): void; + function equal(agent: WantAgent, otherAgent: WantAgent): Promise; + /** * Obtains an {@link WantAgent} object. * * @param info Indicates the {@link WantAgentInfo} object that contains parameters of the * {@link WantAgent} object to create. * @return Returns the created {@link WantAgent} object. - * * @since 7 */ function getWantAgent(info: WantAgentInfo, callback: AsyncCallback): void; @@ -69,6 +131,20 @@ declare namespace wantAgent { START_SERVICE, SEND_COMMON_EVENT } + + /** + * A callback for the {@link trigger()} method. After the method execution is complete, + * the callback process will start. + * + * @since 7 + */ + export interface CompleteData { + info: WantAgent; + want: Want; + finalCode: number; + finalData: string; + extraInfo?: {[key: string]: any}; + } } export type WantAgent = object; diff --git a/api/commonEvent/commonEventData.d.ts b/api/commonEvent/commonEventData.d.ts index 6447604ca6..6e985c7156 100644 --- a/api/commonEvent/commonEventData.d.ts +++ b/api/commonEvent/commonEventData.d.ts @@ -49,4 +49,12 @@ export interface CommonEventData { * @since 7 */ data?: string; + + /** + * The description of the parameters in a common event. + * + * @default - + * @since 7 + */ + parameters?: {[key: string]: any}; } diff --git a/api/commonEvent/commonEventPublishData.d.ts b/api/commonEvent/commonEventPublishData.d.ts index b9e46b93b0..4c1dd0b5dd 100644 --- a/api/commonEvent/commonEventPublishData.d.ts +++ b/api/commonEvent/commonEventPublishData.d.ts @@ -66,4 +66,12 @@ export interface CommonEventPublishData { * @since 7 */ isSticky?: boolean; + + /** + * The description of the parameters in a common event. + * + * @default - + * @since 7 + */ + parameters?: {[key: string]: any}; } \ No newline at end of file diff --git a/api/notification/notificationContent.d.ts b/api/notification/notificationContent.d.ts index 134218f5ef..7624cd304a 100644 --- a/api/notification/notificationContent.d.ts +++ b/api/notification/notificationContent.d.ts @@ -14,6 +14,7 @@ */ import notification from '../@ohos.notification'; +import image from './@ohos.multimedia.image'; /** * Constructs basic notifications. @@ -61,9 +62,24 @@ export interface NotificationMultiLineContent extends NotificationBasicContent { } /** - * Constructs a notification that includes multiple lines of text. + * Constructs a notification that includes a picture. * - * @name NotificationMultiLineContent + * @name NotificationPictureContent + * @since 7 + * @sysCap SystemCapability.Notification.ANS + * @devices phone, tablet, tv, wearable, car + * @permission N/A + */ +export interface NotificationPictureContent extends NotificationBasicContent { + briefText: string; + expandedTitle: string; + picture: image.PixelMap; +} + +/** + * Constructs a notification. + * + * @name NotificationContent * @since 7 * @sysCap SystemCapability.Notification.ANS * @devices phone, tablet, tv, wearable, car @@ -74,4 +90,5 @@ export interface NotificationContent { normal?: NotificationBasicContent; longText?: NotificationLongTextContent; multiLine?: NotificationMultiLineContent; + picture?: NotificationPictureContent; } diff --git a/api/notification/notificationRequest.d.ts b/api/notification/notificationRequest.d.ts index 0914b648d2..f3e2657fe0 100644 --- a/api/notification/notificationRequest.d.ts +++ b/api/notification/notificationRequest.d.ts @@ -14,6 +14,7 @@ */ import notification from '../@ohos.notification'; +import image from '../@ohos.multimedia.image'; import { WantAgent } from '../@ohos.wantAgent'; import { NotificationContent } from './notificationContent'; import { NotificationActionButton } from './notificationActionButton'; @@ -48,6 +49,8 @@ export interface NotificationRequest { badgeIconStyle?: number; showDeliveryTime?: boolean; actionButtons?: Array; + smallIcon?: image.PixelMap; + largeIcon?: image.PixelMap; readonly creatorBundleName?: string; readonly creatorUid?: number; readonly creatorPid?: number; diff --git a/api/notification/notificationSorting.d.ts b/api/notification/notificationSorting.d.ts index 1a34e32fa2..a4d9171451 100644 --- a/api/notification/notificationSorting.d.ts +++ b/api/notification/notificationSorting.d.ts @@ -22,6 +22,7 @@ import { NotificationSlot } from './notificationSlot'; * @sysCap SystemCapability.Notification.ANS * @devices phone, tablet, tv, wearable, car * @permission N/A + * @systemapi Hide this for inner system use. * @since 7 */ export interface NotificationSorting { diff --git a/api/notification/notificationSortingMap.d.ts b/api/notification/notificationSortingMap.d.ts index 829ddaf15c..2b2a73b4e4 100644 --- a/api/notification/notificationSortingMap.d.ts +++ b/api/notification/notificationSortingMap.d.ts @@ -23,6 +23,7 @@ import { NotificationSorting } from './notificationSorting'; * @sysCap SystemCapability.Notification.ANS * @devices phone, tablet, tv, wearable, car * @permission N/A + * @systemapi Hide this for inner system use. */ interface NotificationSortingMap { readonly sortings: {[key: string]: NotificationSorting}; diff --git a/api/notification/notificationSubscribeInfo.ts b/api/notification/notificationSubscribeInfo.ts index ea1f69fc2a..d7ee89bd9a 100644 --- a/api/notification/notificationSubscribeInfo.ts +++ b/api/notification/notificationSubscribeInfo.ts @@ -21,6 +21,7 @@ * @sysCap SystemCapability.Notification.ANS * @devices phone, tablet, tv, wearable, car * @permission N/A + * @systemapi Hide this for inner system use. */ export interface NotificationSubscribeInfo { bundleNames?: Array; diff --git a/api/wantAgent/triggerInfo.d.ts b/api/wantAgent/triggerInfo.d.ts new file mode 100644 index 0000000000..20dfdeab1f --- /dev/null +++ b/api/wantAgent/triggerInfo.d.ts @@ -0,0 +1,31 @@ +/* + * 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 { Want } from '../ability/want'; + +/** + * the info when object of WantAgent trigger + * + * @name TriggerInfo + * @since 7 + * @devices phone, tablet, tv, wearable, car + * @permission N/A + */ +export interface TriggerInfo { + code: number; + want?: Want; + permission?: string; + extraInfo?: {[key: string]: any}; +} \ No newline at end of file diff --git a/api/wantAgent/wantAgentInfo.d.ts b/api/wantAgent/wantAgentInfo.d.ts index 4cc5aa2948..d4d1c87052 100644 --- a/api/wantAgent/wantAgentInfo.d.ts +++ b/api/wantAgent/wantAgentInfo.d.ts @@ -21,8 +21,7 @@ import wantAgent from '../@ohos.wantAgent' * * @name WantAgentInfo * @since 7 - * @sysCap ans - * @devices phone, tablet + * @devices phone, tablet, tv, wearable, car * @permission N/A */ export interface WantAgentInfo { -- Gitee