Ai
46 Star 180 Fork 4.8K

OpenHarmony/interface_sdk-js
关闭

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
commonEventSubscriber.d.ts 25.60 KB
一键复制 编辑 原始数据 按行查看 历史
李春雷 提交于 2025-07-25 09:29 +08:00 . ces模块的sdk从0603挑单到master分支
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624
/*
* Copyright (c) 2021-2023 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.
*/
/**
* @file The subscriber of common event
* @kit BasicServicesKit
*/
/*** if arkts 1.1 */
import { AsyncCallback } from './../@ohos.base';
import { CommonEventSubscribeInfo } from './commonEventSubscribeInfo';
/*** endif */
/*** if arkts 1.2 */
import { AsyncCallback } from './../@ohos.base';
import { CommonEventSubscribeInfo } from './commonEventSubscribeInfo';
/*** endif */
/**
* The CommonEventSubscriber module provides APIs for describing the common event subscriber.
*
* @interface CommonEventSubscriber
* @syscap SystemCapability.Notification.CommonEvent
* @since 7
*/
/**
* The CommonEventSubscriber module provides APIs for describing the common event subscriber.
*
* @interface CommonEventSubscriber
* @syscap SystemCapability.Notification.CommonEvent
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
export interface CommonEventSubscriber {
/**
* Obtains the result code of an ordered common event. This API uses an asynchronous callback to return the result.
*
* @param { AsyncCallback<number> } callback - Callback used to return the result.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* <br>2. Incorrect parameter types. 3. Parameter verification failed.
* @syscap SystemCapability.Notification.CommonEvent
* @since 7
*/
/**
* Obtains the result code of an ordered common event. This API uses an asynchronous callback to return the result.
*
* @param { AsyncCallback<number> } callback - Callback used to return the result.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* <br>2. Incorrect parameter types. 3. Parameter verification failed.
* @syscap SystemCapability.Notification.CommonEvent
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
getCode(callback: AsyncCallback<number>): void;
/**
* Obtains the result code of an ordered common event. This API uses a promise to return the result.
*
* @returns { Promise<number> } Promise used to return the result.
* @syscap SystemCapability.Notification.CommonEvent
* @since 7
*/
/**
* Obtains the result code of an ordered common event. This API uses a promise to return the result.
*
* @returns { Promise<number> } Promise used to return the result.
* @syscap SystemCapability.Notification.CommonEvent
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
getCode(): Promise<number>;
/**
* Obtains the result code of an ordered common event.
*
* @returns { number } Common event code.
* @syscap SystemCapability.Notification.CommonEvent
* @since 10
*/
/**
* Obtains the result code of an ordered common event.
*
* @returns { number } Common event code.
* @syscap SystemCapability.Notification.CommonEvent
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
getCodeSync(): number;
/**
* Sets the result code of an ordered common event. This API uses an asynchronous callback to return the result.
*
* @param { number } code - Common event code.
* @param { AsyncCallback<void> } callback - Callback used to return the result.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* <br>2. Incorrect parameter types. 3. Parameter verification failed.
* @syscap SystemCapability.Notification.CommonEvent
* @since 7
*/
/**
* Sets the result code of an ordered common event. This API uses an asynchronous callback to return the result.
*
* @param { number } code - Common event code.
* @param { AsyncCallback<void> } callback - Callback used to return the result.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* <br>2. Incorrect parameter types. 3. Parameter verification failed.
* @syscap SystemCapability.Notification.CommonEvent
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
setCode(code: number, callback: AsyncCallback<void>): void;
/**
* Sets the result code of an ordered common event. This API uses a promise to return the result.
*
* @param { number } code - Common event code.
* @returns { Promise<void> } Promise that returns no value.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* <br>2. Incorrect parameter types. 3. Parameter verification failed.
* @syscap SystemCapability.Notification.CommonEvent
* @since 7
*/
/**
* Sets the result code of an ordered common event. This API uses a promise to return the result.
*
* @param { number } code - Common event code.
* @returns { Promise<void> } Promise that returns no value.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* <br>2. Incorrect parameter types. 3. Parameter verification failed.
* @syscap SystemCapability.Notification.CommonEvent
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
setCode(code: number): Promise<void>;
/**
* Sets the result code of an ordered common event.
*
* @param { number } code - Common event code.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* <br>2. Incorrect parameter types. 3. Parameter verification failed.
* @syscap SystemCapability.Notification.CommonEvent
* @since 10
*/
/**
* Sets the result code of an ordered common event.
*
* @param { number } code - Common event code.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* <br>2. Incorrect parameter types. 3. Parameter verification failed.
* @syscap SystemCapability.Notification.CommonEvent
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
setCodeSync(code: number): void;
/**
* Obtains the result data of an ordered common event. This API uses an asynchronous callback to return the result.
*
* @param { AsyncCallback<string> } callback - Callback used to return the result.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* <br>2. Incorrect parameter types. 3. Parameter verification failed.
* @syscap SystemCapability.Notification.CommonEvent
* @since 7
*/
/**
* Obtains the result data of an ordered common event. This API uses an asynchronous callback to return the result.
*
* @param { AsyncCallback<string> } callback - Callback used to return the result.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* <br>2. Incorrect parameter types. 3. Parameter verification failed.
* @syscap SystemCapability.Notification.CommonEvent
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
getData(callback: AsyncCallback<string>): void;
/**
* Obtains the result data of an ordered common event. This API uses a promise to return the result.
*
* @returns { Promise<string> } Promise used to return the result.
* @syscap SystemCapability.Notification.CommonEvent
* @since 7
*/
/**
* Obtains the result data of an ordered common event. This API uses a promise to return the result.
*
* @returns { Promise<string> } Promise used to return the result.
* @syscap SystemCapability.Notification.CommonEvent
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
getData(): Promise<string>;
/**
* Obtains the result data of an ordered common event.
*
* @returns { string } Common event data.
* @syscap SystemCapability.Notification.CommonEvent
* @since 10
*/
/**
* Obtains the result data of an ordered common event.
*
* @returns { string } Common event data.
* @syscap SystemCapability.Notification.CommonEvent
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
getDataSync(): string;
/**
* Sets the result data for an ordered common event. This API uses an asynchronous callback to return the result.
*
* @param { string } data - Common event data.
* @param { AsyncCallback<void> } callback - Callback used to return the result.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* <br>2. Incorrect parameter types. 3. Parameter verification failed.
* @syscap SystemCapability.Notification.CommonEvent
* @since 7
*/
/**
* Sets the result data for an ordered common event. This API uses an asynchronous callback to return the result.
*
* @param { string } data - Common event data.
* @param { AsyncCallback<void> } callback - Callback used to return the result.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* <br>2. Incorrect parameter types. 3. Parameter verification failed.
* @syscap SystemCapability.Notification.CommonEvent
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
setData(data: string, callback: AsyncCallback<void>): void;
/**
* Sets the result data for an ordered common event. This API uses a promise to return the result.
*
* @param { string } data - Common event data.
* @returns { Promise<void> } Promise that returns no value.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* <br>2. Incorrect parameter types. 3. Parameter verification failed.
* @syscap SystemCapability.Notification.CommonEvent
* @since 7
*/
/**
* Sets the result data for an ordered common event. This API uses a promise to return the result.
*
* @param { string } data - Common event data.
* @returns { Promise<void> } Promise that returns no value.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* <br>2. Incorrect parameter types. 3. Parameter verification failed.
* @syscap SystemCapability.Notification.CommonEvent
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
setData(data: string): Promise<void>;
/**
* Sets the result data for an ordered common event.
*
* @param { string } data - Common event data.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* <br>2. Incorrect parameter types. 3. Parameter verification failed.
* @syscap SystemCapability.Notification.CommonEvent
* @since 10
*/
/**
* Sets the result data for an ordered common event.
*
* @param { string } data - Common event data.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* <br>2. Incorrect parameter types. 3. Parameter verification failed.
* @syscap SystemCapability.Notification.CommonEvent
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
setDataSync(data: string): void;
/**
* Sets the result code and data of an ordered common event. This API uses an asynchronous callback to return the result.
*
* @param { number } code - Common event code.
* @param { string } data - Common event data.
* @param { AsyncCallback<void> } callback - Callback used to return the result.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* <br>2. Incorrect parameter types. 3. Parameter verification failed.
* @syscap SystemCapability.Notification.CommonEvent
* @since 7
*/
/**
* Sets the result code and data of an ordered common event. This API uses an asynchronous callback to return the result.
*
* @param { number } code - Common event code.
* @param { string } data - Common event data.
* @param { AsyncCallback<void> } callback - Callback used to return the result.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* <br>2. Incorrect parameter types. 3. Parameter verification failed.
* @syscap SystemCapability.Notification.CommonEvent
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
setCodeAndData(code: number, data: string, callback: AsyncCallback<void>): void;
/**
* Sets the result code and data of an ordered common event. This API uses a promise to return the result.
*
* @param { number } code - Common event code.
* @param { string } data - Common event data.
* @returns { Promise<void> } The promise returned by the function.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* <br>2. Incorrect parameter types. 3. Parameter verification failed.
* @syscap SystemCapability.Notification.CommonEvent
* @since 7
*/
/**
* Sets the result code and data of an ordered common event. This API uses a promise to return the result.
*
* @param { number } code - Common event code.
* @param { string } data - Common event data.
* @returns { Promise<void> } The promise returned by the function.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* <br>2. Incorrect parameter types. 3. Parameter verification failed.
* @syscap SystemCapability.Notification.CommonEvent
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
setCodeAndData(code: number, data: string): Promise<void>;
/**
* Sets the result code and data of an ordered common event.
*
* @param { number } code - Common event code.
* @param { string } data - Common event data.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* <br>2. Incorrect parameter types. 3. Parameter verification failed.
* @syscap SystemCapability.Notification.CommonEvent
* @since 10
*/
/**
* Sets the result code and data of an ordered common event.
*
* @param { number } code - Common event code.
* @param { string } data - Common event data.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* <br>2. Incorrect parameter types. 3. Parameter verification failed.
* @syscap SystemCapability.Notification.CommonEvent
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
setCodeAndDataSync(code: number, data: string): void;
/**
* Checks whether the current common event is an ordered common event. This API uses an asynchronous callback to return the result.
*
* @param { AsyncCallback<boolean> } callback - Callback used to return the result. Returns true if the common event is an ordered one;
* returns false otherwise.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* <br>2. Incorrect parameter types. 3. Parameter verification failed.
* @syscap SystemCapability.Notification.CommonEvent
* @since arkts {'1.1':'7', '1.2':'20'}
* @arkts 1.1&1.2
*/
isOrderedCommonEvent(callback: AsyncCallback<boolean>): void;
/**
* Checks whether the current common event is an ordered common event. This API uses a promise to return the result.
*
* @returns { Promise<boolean> } Promise used to return the result. Returns true if the common event is an ordered one; returns false otherwise.
* @syscap SystemCapability.Notification.CommonEvent
* @since arkts {'1.1':'7', '1.2':'20'}
* @arkts 1.1&1.2
*/
isOrderedCommonEvent(): Promise<boolean>;
/**
* Checks whether the current common event is an ordered common event.
*
* @returns { boolean } Returns true if the common event is an ordered one; returns false otherwise.
* @syscap SystemCapability.Notification.CommonEvent
* @since arkts {'1.1':'10', '1.2':'20'}
* @arkts 1.1&1.2
*/
isOrderedCommonEventSync(): boolean;
/**
* Checks whether a common event is a sticky one. This API uses an asynchronous callback to return the result.
*
* @param { AsyncCallback<boolean> } callback - Callback used to return the result. Returns true if the common event is a sticky one; returns false otherwise.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* <br>2. Incorrect parameter types. 3. Parameter verification failed.
* @syscap SystemCapability.Notification.CommonEvent
* @since arkts {'1.1':'7', '1.2':'20'}
* @arkts 1.1&1.2
*/
isStickyCommonEvent(callback: AsyncCallback<boolean>): void;
/**
* Checks whether a common event is a sticky one. This API uses a promise to return the result.
*
* @returns { Promise<boolean> } Promise used to return the result. Returns true if the common event is a sticky one; returns false otherwise.
* @syscap SystemCapability.Notification.CommonEvent
* @since arkts {'1.1':'7', '1.2':'20'}
* @arkts 1.1&1.2
*/
isStickyCommonEvent(): Promise<boolean>;
/**
* Checks whether a common event is a sticky one.
*
* @returns { boolean } Returns true if the common event is a sticky one; returns false otherwise.
* @syscap SystemCapability.Notification.CommonEvent
* @since arkts {'1.1':'10', '1.2':'20'}
* @arkts 1.1&1.2
*/
isStickyCommonEventSync(): boolean;
/**
* Aborts an ordered common event when used with finishCommonEvent. After the abort, the common event is not sent to the
* next subscriber. This API uses an asynchronous callback to return the result.
*
* @param { AsyncCallback<void> } callback - Callback used to return the result.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* <br>2. Incorrect parameter types. 3. Parameter verification failed.
* @syscap SystemCapability.Notification.CommonEvent
* @since arkts {'1.1':'7', '1.2':'20'}
* @arkts 1.1&1.2
*/
abortCommonEvent(callback: AsyncCallback<void>): void;
/**
* Aborts an ordered common event when used with finishCommonEvent. After the abort, the common event is not sent to the
* next subscriber. This API uses a promise to return the result.
*
* @returns { Promise<void> } Promise that returns no value.
* @syscap SystemCapability.Notification.CommonEvent
* @since arkts {'1.1':'7', '1.2':'20'}
* @arkts 1.1&1.2
*/
abortCommonEvent(): Promise<void>;
/**
* Aborts an ordered common event when used with finishCommonEvent. After the abort, the common event is not sent to the next subscriber.
*
* @syscap SystemCapability.Notification.CommonEvent
* @since arkts {'1.1':'10', '1.2':'20'}
* @arkts 1.1&1.2
*/
abortCommonEventSync(): void;
/**
* Clears the aborted state of an ordered common event when used with finishCommonEvent.
* After the clearance, the common event is sent to the next subscriber. This API uses an asynchronous callback to return the result.
*
* @param { AsyncCallback<void> } callback - Callback used to return the result.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* <br>2. Incorrect parameter types. 3. Parameter verification failed.
* @syscap SystemCapability.Notification.CommonEvent
* @since arkts {'1.1':'7', '1.2':'20'}
* @arkts 1.1&1.2
*/
clearAbortCommonEvent(callback: AsyncCallback<void>): void;
/**
* Clears the aborted state of an ordered common event when used with finishCommonEvent.
* After the clearance, the common event is sent to the next subscriber. This API uses a promise to return the result.
*
* @returns { Promise<void> } Promise that returns no value.
* @syscap SystemCapability.Notification.CommonEvent
* @since arkts {'1.1':'7', '1.2':'20'}
* @arkts 1.1&1.2
*/
clearAbortCommonEvent(): Promise<void>;
/**
* Clears the aborted state of an ordered common event when used with finishCommonEvent.After the clearance, the common event is sent to the next subscriber.
*
* @syscap SystemCapability.Notification.CommonEvent
* @since arkts {'1.1':'10', '1.2':'20'}
* @arkts 1.1&1.2
*/
clearAbortCommonEventSync(): void;
/**
* Checks whether this ordered common event should be aborted. This API uses an asynchronous callback to return the result.
*
* @param { AsyncCallback<boolean> } callback - Callback used to return the result. Returns true if the ordered common event
* is in the aborted state; returns false otherwise.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* <br>2. Incorrect parameter types. 3. Parameter verification failed.
* @syscap SystemCapability.Notification.CommonEvent
* @since arkts {'1.1':'7', '1.2':'20'}
* @arkts 1.1&1.2
*/
getAbortCommonEvent(callback: AsyncCallback<boolean>): void;
/**
* Checks whether this ordered common event should be aborted. This API uses a promise to return the result.
*
* @returns { Promise<boolean> } Checks whether this ordered common event should be aborted. This API uses a promise to return the result.
* @syscap SystemCapability.Notification.CommonEvent
* @since arkts {'1.1':'7', '1.2':'20'}
* @arkts 1.1&1.2
*/
getAbortCommonEvent(): Promise<boolean>;
/**
* Checks whether this ordered common event should be aborted.
*
* @returns { boolean } Returns true if the ordered common event is in the aborted state; returns false otherwise.
* @syscap SystemCapability.Notification.CommonEvent
* @since arkts {'1.1':'10', '1.2':'20'}
* @arkts 1.1&1.2
*/
getAbortCommonEventSync(): boolean;
/**
* Obtains the subscriber information. This API uses an asynchronous callback to return the result.
*
* @param { AsyncCallback<CommonEventSubscribeInfo> } callback - Callback used to return the result.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* <br>2. Incorrect parameter types. 3. Parameter verification failed.
* @syscap SystemCapability.Notification.CommonEvent
* @since 7
*/
/**
* Obtains the subscriber information. This API uses an asynchronous callback to return the result.
*
* @param { AsyncCallback<CommonEventSubscribeInfo> } callback - Callback used to return the result.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* <br>2. Incorrect parameter types. 3. Parameter verification failed.
* @syscap SystemCapability.Notification.CommonEvent
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
getSubscribeInfo(callback: AsyncCallback<CommonEventSubscribeInfo>): void;
/**
* Obtains the subscriber information. This API uses a promise to return the result.
*
* @returns { Promise<CommonEventSubscribeInfo> } Promise used to return the result.
* @syscap SystemCapability.Notification.CommonEvent
* @since 7
*/
/**
* Obtains the subscriber information. This API uses a promise to return the result.
*
* @returns { Promise<CommonEventSubscribeInfo> } Promise used to return the result.
* @syscap SystemCapability.Notification.CommonEvent
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
getSubscribeInfo(): Promise<CommonEventSubscribeInfo>;
/**
* Obtains the subscriber information.
*
* @returns { CommonEventSubscribeInfo } Subscriber information.
* @syscap SystemCapability.Notification.CommonEvent
* @since 10
*/
/**
* Obtains the subscriber information.
*
* @returns { CommonEventSubscribeInfo } Subscriber information.
* @syscap SystemCapability.Notification.CommonEvent
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
getSubscribeInfoSync(): CommonEventSubscribeInfo;
/**
* Finishes this ordered common event. This API uses an asynchronous callback to return the result.
*
* @param { AsyncCallback<void> } callback - Callback used to return the result.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* <br>2. Incorrect parameter types. 3. Parameter verification failed.
* @syscap SystemCapability.Notification.CommonEvent
* @since arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
finishCommonEvent(callback: AsyncCallback<void>): void;
/**
* Finishes this ordered common event. This API uses a promise to return the result.
*
* @returns { Promise<void> } Promise that returns no value.
* @syscap SystemCapability.Notification.CommonEvent
* @since arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
finishCommonEvent(): Promise<void>;
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/openharmony/interface_sdk-js.git
git@gitee.com:openharmony/interface_sdk-js.git
openharmony
interface_sdk-js
interface_sdk-js
master

搜索帮助