diff --git a/api/@ohos.app.ability.DriverExtensionAbility.d.ts b/api/@ohos.app.ability.DriverExtensionAbility.d.ts index e2573372ec5691c21f44fe38eaeb4bfc434e5924..3347935ecc286123a7c44d5aa70090713c66d8a3 100644 --- a/api/@ohos.app.ability.DriverExtensionAbility.d.ts +++ b/api/@ohos.app.ability.DriverExtensionAbility.d.ts @@ -27,7 +27,8 @@ import _DriverExtensionContext from './application/DriverExtensionContext'; * * @typedef { _DriverExtensionContext } * @syscap SystemCapability.Driver.ExternalDevice - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ export type DriverExtensionContext = _DriverExtensionContext; @@ -35,16 +36,18 @@ export type DriverExtensionContext = _DriverExtensionContext; * class of driver extension ability. * @syscap SystemCapability.Driver.ExternalDevice * @StageModelOnly - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ -export default class DriverExtensionAbility { +declare class DriverExtensionAbility { /** * Indicates driver extension ability context. * * @type { DriverExtensionContext } * @syscap SystemCapability.Driver.ExternalDevice * @StageModelOnly - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ context: DriverExtensionContext; @@ -53,7 +56,8 @@ export default class DriverExtensionAbility { * @param { Want } want - Indicates the want of created driver extension. * @syscap SystemCapability.Driver.ExternalDevice * @StageModelOnly - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ onInit(want: Want): void; @@ -61,7 +65,8 @@ export default class DriverExtensionAbility { * Called back before a driver extension is destroyed. * @syscap SystemCapability.Driver.ExternalDevice * @StageModelOnly - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ onRelease(): void; @@ -71,7 +76,8 @@ export default class DriverExtensionAbility { * @returns { rpc.RemoteObject | Promise } Rpc remoteObject. * @syscap SystemCapability.Driver.ExternalDevice * @StageModelOnly - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ onConnect(want: Want): rpc.RemoteObject | Promise; @@ -85,6 +91,17 @@ export default class DriverExtensionAbility { */ onDisconnect(want: Want): void | Promise; + /** + * Called back when all abilities connected to a driver extension are disconnected. + * @param { Want } want - Indicates disconnection information about the driver extension. + * @returns { undefined | Promise } + * @syscap SystemCapability.Driver.ExternalDevice + * @StageModelOnly + * @since 20 + * @arkts 1.2 + */ + onDisconnect(want: Want): undefined | Promise; + /** * Called when dump client information is required. * It is recommended that developers don't DUMP sensitive information. @@ -92,7 +109,17 @@ export default class DriverExtensionAbility { * @returns { Array } The dump info array. * @syscap SystemCapability.Driver.ExternalDevice * @StageModelOnly - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ onDump(params: Array): Array; } + +/** + * class of driver extension ability. + * @syscap SystemCapability.Driver.ExternalDevice + * @StageModelOnly + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 + */ +export default DriverExtensionAbility; \ No newline at end of file