mirror of
https://gitee.com/openharmony/interface_sdk-js
synced 2024-10-07 06:03:30 +00:00
Check is default service for card emulation type.
Signed-off-by: zhangxiuping <zhangxiuping@huawei.com>
This commit is contained in:
parent
89c42c9ec1
commit
f6c98631ee
28
api/@ohos.nfc.cardEmulation.d.ts
vendored
28
api/@ohos.nfc.cardEmulation.d.ts
vendored
@ -13,6 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { AsyncCallback } from './basic';
|
||||
import { ElementName } from './bundle/elementName';
|
||||
|
||||
/**
|
||||
* Provides methods to operate or manage NFC card emulation.
|
||||
@ -34,6 +35,19 @@ declare namespace cardEmulation {
|
||||
ESE = 2,
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the card emulation type, payment or other.
|
||||
*
|
||||
* @since 9
|
||||
*/
|
||||
enum CardType {
|
||||
/** payment type of card emulation */
|
||||
PAYMENT = "payment",
|
||||
|
||||
/** other type of card emulation */
|
||||
OTHER = "other",
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether a specified type of card emulation is supported.
|
||||
*
|
||||
@ -47,6 +61,20 @@ declare namespace cardEmulation {
|
||||
*/
|
||||
function isSupported(feature: number): boolean;
|
||||
|
||||
/**
|
||||
* Checks whether a service is default for given type.
|
||||
*
|
||||
* @param { ElementName } elementName - The element name of the service ability
|
||||
* @param { CardType } type - The type to query, pyament or other.
|
||||
* @return { boolean } Returns true if the service is default, otherwise false.
|
||||
* @permission ohos.permission.NFC_CARD_EMULATION
|
||||
* @throws { BusinessError } 201 - Permission denied.
|
||||
* @throws { BusinessError } 401 - The parameter check failed.
|
||||
* @throws { BusinessError } 801 - Capability not supported.
|
||||
* @since 9
|
||||
*/
|
||||
function isDefaultService(elementName: ElementName, type: CardType): boolean;
|
||||
|
||||
/**
|
||||
* A class for NFC host application.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user