diff --git a/api/@ohos.nfc.cardEmulation.d.ts b/api/@ohos.nfc.cardEmulation.d.ts index a31e7366929f3b4498933fca78c841717cd06016..4617a401996e7e486ff7712a173471f510f9482b 100755 --- a/api/@ohos.nfc.cardEmulation.d.ts +++ b/api/@ohos.nfc.cardEmulation.d.ts @@ -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. *