From 0501a64e84e38712d48988b249b18000bb282876 Mon Sep 17 00:00:00 2001 From: BrainL Date: Fri, 15 Aug 2025 14:43:23 +0800 Subject: [PATCH 1/2] readonly change to get name() Signed-off-by: BrainL --- api/@ohos.file.fileuri.d.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/api/@ohos.file.fileuri.d.ts b/api/@ohos.file.fileuri.d.ts index 93d80cdf64..049d3d33ab 100644 --- a/api/@ohos.file.fileuri.d.ts +++ b/api/@ohos.file.fileuri.d.ts @@ -84,7 +84,8 @@ declare namespace fileUri { /** * Obtains the file name of uri. * - * @type { string } + * @returns { string } + * string: Return the file name of uri. * @readonly * @throws { BusinessError } 13900005 - I/O error * @throws { BusinessError } 13900042 - Unknown error @@ -94,15 +95,17 @@ declare namespace fileUri { /** * Obtains the file name of uri. * - * @type { string } + * @returns { string } + * string: Return the file name of uri. * @readonly * @throws { BusinessError } 13900005 - I/O error * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.AppFileService * @atomicservice - * @since 15 + * @since arkts {'1.1':'15', '1.2':'20'} + * @arkts 1.1&1.2 */ - readonly name: string; + get name(): string; /** * Get the full directory uri where the file URI is located -- Gitee From e06e4e05039dbd43d34356eee6ea709d0c8b929a Mon Sep 17 00:00:00 2001 From: BrainL Date: Fri, 15 Aug 2025 16:11:37 +0800 Subject: [PATCH 2/2] interface modify Signed-off-by: BrainL --- api/@ohos.distributedDeviceManager.d.ts | 417 ++++++++++++++++++++++-- api/@ohos.file.keyManager.d.ts | 14 +- 2 files changed, 389 insertions(+), 42 deletions(-) diff --git a/api/@ohos.distributedDeviceManager.d.ts b/api/@ohos.distributedDeviceManager.d.ts index 31588f25ed..d542f85a0e 100644 --- a/api/@ohos.distributedDeviceManager.d.ts +++ b/api/@ohos.distributedDeviceManager.d.ts @@ -34,7 +34,8 @@ declare namespace distributedDeviceManager { * Basic description information of a distributed device. * @interface DeviceBasicInfo * @syscap SystemCapability.DistributedHardware.DeviceManager - * @since 10 + * @since arkts {'1.1':'10','1.2':'20'} + * @arkts 1.1&1.2 */ interface DeviceBasicInfo { /** @@ -43,7 +44,8 @@ declare namespace distributedDeviceManager { * the obtained ID will change. * @type { string } * @syscap SystemCapability.DistributedHardware.DeviceManager - * @since 10 + * @since arkts {'1.1':'10','1.2':'20'} + * @arkts 1.1&1.2 */ deviceId: string; @@ -51,7 +53,8 @@ declare namespace distributedDeviceManager { * Device name. * @type { string } * @syscap SystemCapability.DistributedHardware.DeviceManager - * @since 10 + * @since arkts {'1.1':'10','1.2':'20'} + * @arkts 1.1&1.2 */ deviceName: string; @@ -60,7 +63,8 @@ declare namespace distributedDeviceManager { * which can be {@code phone}, {@code tablet}, {@code tv}, {@code smartVision}, {@code car}. * @type { string } * @syscap SystemCapability.DistributedHardware.DeviceManager - * @since 10 + * @since arkts {'1.1':'10','1.2':'20'} + * @arkts 1.1&1.2 */ deviceType: string; @@ -68,41 +72,155 @@ declare namespace distributedDeviceManager { * Device network id. * @type { ?string } * @syscap SystemCapability.DistributedHardware.DeviceManager - * @since 10 + * @since arkts {'1.1':'10','1.2':'20'} + * @arkts 1.1&1.2 */ networkId?: string; } /** * The state of the nearby devices. - * @enum { number } + * @enum { int } * @syscap SystemCapability.DistributedHardware.DeviceManager - * @since 10 + * @since arkts {'1.1':'10','1.2':'20'} + * @arkts 1.1&1.2 */ enum DeviceStateChange { /** * This state indicates the device is online but the state is unknown,The distributed function cannot used until * state changes to AVAILABLE. * @syscap SystemCapability.DistributedHardware.DeviceManager - * @since 10 + * @since arkts {'1.1':'10','1.2':'20'} + * @arkts 1.1&1.2 */ UNKNOWN = 0, /** * This state indicates the device has been synchronized to the database, Now the distributed function can be used. * @syscap SystemCapability.DistributedHardware.DeviceManager - * @since 10 + * @since arkts {'1.1':'10','1.2':'20'} + * @arkts 1.1&1.2 */ AVAILABLE = 1, /** * This state indicates the device is offline. * @syscap SystemCapability.DistributedHardware.DeviceManager - * @since 10 + * @since arkts {'1.1':'10','1.2':'20'} + * @arkts 1.1&1.2 */ UNAVAILABLE = 2, } + /** + * Device status change result. + * @interface DeviceStateChangeResult + * @syscap SystemCapability.DistributedHardware.DeviceManager + * @since arkts {'1.1':'10','1.2':'20'} + * @arkts 1.1&1.2 + */ + interface DeviceStateChangeResult { + /** + * The state of the nearby devices. + * @type { DeviceStateChange } + * @syscap SystemCapability.DistributedHardware.DeviceManager + * @since arkts {'1.1':'10','1.2':'20'} + * @arkts 1.1&1.2 + */ + action: DeviceStateChange; + /** + * Basic description information of a distributed device. + * @type { DeviceBasicInfo } + * @syscap SystemCapability.DistributedHardware.DeviceManager + * @since arkts {'1.1':'10','1.2':'20'} + * @arkts 1.1&1.2 + */ + device: DeviceBasicInfo; + } + + /** + * Device name change result. + * @interface DeviceNameChangeResult + * @syscap SystemCapability.DistributedHardware.DeviceManager + * @since arkts {'1.1':'10','1.2':'20'} + * @arkts 1.1&1.2 + */ + interface DeviceNameChangeResult { + /** + * Device name. + * @type { string } + * @syscap SystemCapability.DistributedHardware.DeviceManager + * @since arkts {'1.1':'10','1.2':'20'} + * @arkts 1.1&1.2 + */ + deviceName: string; + } + + /** + * Discovery failure result. + * @interface DiscoveryFailureResult + * @syscap SystemCapability.DistributedHardware.DeviceManager + * @since arkts {'1.1':'10','1.2':'20'} + * @arkts 1.1&1.2 + */ + interface DiscoveryFailureResult { + /** + * Discovery failure cause code. + * @type { int } + * @syscap SystemCapability.DistributedHardware.DeviceManager + * @since arkts {'1.1':'10','1.2':'20'} + * @arkts 1.1&1.2 + */ + reason: int; + } + + /** + * Discovery successful result. + * @interface DiscoverySuccessResult + * @syscap SystemCapability.DistributedHardware.DeviceManager + * @since arkts {'1.1':'10','1.2':'20'} + * @arkts 1.1&1.2 + */ + interface DiscoverySuccessResult { + /** + * Basic description information of a distributed device. + * @type { DeviceBasicInfo } + * @syscap SystemCapability.DistributedHardware.DeviceManager + * @since arkts {'1.1':'10','1.2':'20'} + * @arkts 1.1&1.2 + */ + device: DeviceBasicInfo; + } + + /** + * Reply result. + * @interface ReplyResult + * @syscap SystemCapability.DistributedHardware.DeviceManager + * @systemapi + * @since arkts {'1.1':'10','1.2':'20'} + * @arkts 1.1&1.2 + */ + interface ReplyResult { + /** + * Param of ui state changes. + * @type { string } + * @syscap SystemCapability.DistributedHardware.DeviceManager + * @systemapi + * @since arkts {'1.1':'10','1.2':'20'} + * @arkts 1.1&1.2 + */ + param: string; + } + + /** + * ServiceDie data. + * @interface ServiceDieData + * @syscap SystemCapability.DistributedHardware.DeviceManager + * @since arkts {'1.1':'10','1.2':'20'} + * @arkts 1.1&1.2 + */ + interface ServiceDieData {} + /** * Device profile information filter options. * @interface DeviceProfileInfoFilterOptions @@ -134,7 +252,8 @@ declare namespace distributedDeviceManager { * @interface ServiceProfileInfo * @syscap SystemCapability.DistributedHardware.DeviceManager * @systemapi - * @since 15 + * @since arkts {'1.1':'15','1.2':'20'} + * @arkts 1.1&1.2 */ interface ServiceProfileInfo { /** @@ -142,7 +261,8 @@ declare namespace distributedDeviceManager { * @type { string } * @syscap SystemCapability.DistributedHardware.DeviceManager * @systemapi - * @since 15 + * @since arkts {'1.1':'15','1.2':'20'} + * @arkts 1.1&1.2 */ deviceId: string; @@ -179,7 +299,8 @@ declare namespace distributedDeviceManager { * @interface DeviceProfileInfo * @syscap SystemCapability.DistributedHardware.DeviceManager * @systemapi - * @since 15 + * @since arkts {'1.1':'15','1.2':'20'} + * @arkts 1.1&1.2 */ interface DeviceProfileInfo { /** @@ -187,7 +308,8 @@ declare namespace distributedDeviceManager { * @type { string } * @syscap SystemCapability.DistributedHardware.DeviceManager * @systemapi - * @since 15 + * @since arkts {'1.1':'15','1.2':'20'} + * @arkts 1.1&1.2 */ deviceId: string; @@ -223,7 +345,8 @@ declare namespace distributedDeviceManager { * @type { string } * @syscap SystemCapability.DistributedHardware.DeviceManager * @systemapi - * @since 15 + * @since arkts {'1.1':'15','1.2':'20'} + * @arkts 1.1&1.2 */ deviceType: string; @@ -241,7 +364,8 @@ declare namespace distributedDeviceManager { * @type { string } * @syscap SystemCapability.DistributedHardware.DeviceManager * @systemapi - * @since 15 + * @since arkts {'1.1':'15','1.2':'20'} + * @arkts 1.1&1.2 */ deviceName: string; @@ -616,7 +740,8 @@ declare namespace distributedDeviceManager { * 2. Incorrect parameter type; * 3. Parameter verification failed. * @syscap SystemCapability.DistributedHardware.DeviceManager - * @since 10 + * @since arkts {'1.1':'10','1.2':'20'} + * @arkts 1.1&1.2 */ function createDeviceManager(bundleName: string): DeviceManager; @@ -688,7 +813,8 @@ declare namespace distributedDeviceManager { * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. * @throws { BusinessError } 11600101 - Failed to execute the function. * @syscap SystemCapability.DistributedHardware.DeviceManager - * @since 10 + * @since arkts {'1.1':'10','1.2':'20'} + * @arkts 1.1&1.2 */ getLocalDeviceNetworkId(): string; @@ -726,7 +852,8 @@ declare namespace distributedDeviceManager { * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. * @throws { BusinessError } 11600101 - Failed to execute the function. * @syscap SystemCapability.DistributedHardware.DeviceManager - * @since 10 + * @since arkts {'1.1':'10','1.2':'20'} + * @arkts 1.1&1.2 */ getLocalDeviceId(): string; @@ -744,7 +871,8 @@ declare namespace distributedDeviceManager { * 4. The size of specified networkId is greater than 255. * @throws { BusinessError } 11600101 - Failed to execute the function. * @syscap SystemCapability.DistributedHardware.DeviceManager - * @since 10 + * @since arkts {'1.1':'10','1.2':'20'} + * @arkts 1.1&1.2 */ getDeviceName(networkId: string): string; @@ -753,7 +881,7 @@ declare namespace distributedDeviceManager { * * @permission ohos.permission.DISTRIBUTED_DATASYNC * @param { string } networkId - Device network id. - * @returns { number } - Returns device type. + * @returns { int } - Returns device type. * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1. Mandatory parameters are left unspecified; @@ -762,9 +890,10 @@ declare namespace distributedDeviceManager { * 4. The size of specified networkId is greater than 255. * @throws { BusinessError } 11600101 - Failed to execute the function. * @syscap SystemCapability.DistributedHardware.DeviceManager - * @since 10 + * @since arkts {'1.1':'10','1.2':'20'} + * @arkts 1.1&1.2 */ - getDeviceType(networkId: string): number; + getDeviceType(networkId: string): int; /** * Start to discover nearby devices. @@ -849,7 +978,8 @@ declare namespace distributedDeviceManager { * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. * @throws { BusinessError } 11600101 - Failed to execute the function. * @syscap SystemCapability.DistributedHardware.DeviceManager - * @since 10 + * @since arkts {'1.1':'10','1.2':'20'} + * @arkts 1.1&1.2 */ unbindTarget(deviceId: string): void; @@ -889,7 +1019,26 @@ declare namespace distributedDeviceManager { * @syscap SystemCapability.DistributedHardware.DeviceManager * @since 10 */ - on(type: 'deviceStateChange', callback: Callback<{ action: DeviceStateChange; device: DeviceBasicInfo; }>): void; + /** + * Register a device state callback so that the application can be notified upon device state changes based on + * the application bundle name. + * + * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @param { 'deviceStateChange' } type - Device state change. + * @param { Callback } callback + * Indicates the device state callback to register. + * @throws { BusinessError } 201 - Permission verification failed. + * The application does not have the permission required to call the API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter type; + * 3. Parameter verification failed; + * 4. The size of specified type is greater than 255. + * @syscap SystemCapability.DistributedHardware.DeviceManager + * @since arkts {'1.1':'10','1.2':'20'} + * @arkts 1.1&1.2 + */ + on(type: 'deviceStateChange', callback: Callback): void; /** * UnRegister device state callback based on the application bundle name. @@ -907,7 +1056,25 @@ declare namespace distributedDeviceManager { * @syscap SystemCapability.DistributedHardware.DeviceManager * @since 10 */ - off(type: 'deviceStateChange', callback?: Callback<{ action: DeviceStateChange; device: DeviceBasicInfo; }>): void; + /** + * UnRegister device state callback based on the application bundle name. + * + * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @param { 'deviceStateChange' } type - Device state change. + * @param { Callback } [callback] + * Indicates the device state callback to unregister. + * @throws { BusinessError } 201 - Permission verification failed. + * The application does not have the permission required to call the API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter type; + * 3. Parameter verification failed; + * 4. The size of specified type is greater than 255. + * @syscap SystemCapability.DistributedHardware.DeviceManager + * @since arkts {'1.1':'10','1.2':'20'} + * @arkts 1.1&1.2 + */ + off(type: 'deviceStateChange', callback?: Callback): void; /** * Register a device discovery result callback so that the application can be notified when discovery success. @@ -924,7 +1091,24 @@ declare namespace distributedDeviceManager { * @syscap SystemCapability.DistributedHardware.DeviceManager * @since 10 */ - on(type: 'discoverSuccess', callback: Callback<{ device: DeviceBasicInfo; }>): void; + /** + * Register a device discovery result callback so that the application can be notified when discovery success. + * + * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @param { 'discoverSuccess' } type - Successfully discovered device. + * @param { Callback } callback - Indicates the device discovery callback to register. + * @throws { BusinessError } 201 - Permission verification failed. + * The application does not have the permission required to call the API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter type; + * 3. Parameter verification failed; + * 4. The size of specified type is greater than 255. + * @syscap SystemCapability.DistributedHardware.DeviceManager + * @since arkts {'1.1':'10','1.2':'20'} + * @arkts 1.1&1.2 + */ + on(type: 'discoverSuccess', callback: Callback): void; /** * UnRegister the device discovery result callback. @@ -941,7 +1125,24 @@ declare namespace distributedDeviceManager { * @syscap SystemCapability.DistributedHardware.DeviceManager * @since 10 */ - off(type: 'discoverSuccess', callback?: Callback<{ device: DeviceBasicInfo; }>): void; + /** + * UnRegister the device discovery result callback. + * + * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @param { 'discoverSuccess' } type - Successfully discovered device. + * @param { Callback } [callback] - Indicates the device discovery callback to unregister. + * @throws { BusinessError } 201 - Permission verification failed. + * The application does not have the permission required to call the API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter type; + * 3. Parameter verification failed; + * 4. The size of specified type is greater than 255. + * @syscap SystemCapability.DistributedHardware.DeviceManager + * @since arkts {'1.1':'10','1.2':'20'} + * @arkts 1.1&1.2 + */ + off(type: 'discoverSuccess', callback?: Callback): void; /** * Register a device name change callback so that the application can be notified when discovery success. @@ -958,7 +1159,24 @@ declare namespace distributedDeviceManager { * @syscap SystemCapability.DistributedHardware.DeviceManager * @since 10 */ - on(type: 'deviceNameChange', callback: Callback<{ deviceName: string; }>): void; + /** + * Register a device name change callback so that the application can be notified when discovery success. + * + * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @param { 'deviceNameChange' } type - Changed device name. + * @param { Callback } callback - Indicates the device name change callback to register. + * @throws { BusinessError } 201 - Permission verification failed. + * The application does not have the permission required to call the API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter type; + * 3. Parameter verification failed; + * 4. The size of specified type is greater than 255. + * @syscap SystemCapability.DistributedHardware.DeviceManager + * @since arkts {'1.1':'10','1.2':'20'} + * @arkts 1.1&1.2 + */ + on(type: 'deviceNameChange', callback: Callback): void; /** * UnRegister the device name change result callback. @@ -975,7 +1193,24 @@ declare namespace distributedDeviceManager { * @syscap SystemCapability.DistributedHardware.DeviceManager * @since 10 */ - off(type: 'deviceNameChange', callback?: Callback<{ deviceName: string; }>): void; + /** + * UnRegister the device name change result callback. + * + * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @param { 'deviceNameChange' } type - Changed device name. + * @param { Callback } [callback] - Indicates the device name change callback to unregister. + * @throws { BusinessError } 201 - Permission verification failed. + * The application does not have the permission required to call the API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter type; + * 3. Parameter verification failed; + * 4. The size of specified type is greater than 255. + * @syscap SystemCapability.DistributedHardware.DeviceManager + * @since arkts {'1.1':'10','1.2':'20'} + * @arkts 1.1&1.2 + */ + off(type: 'deviceNameChange', callback?: Callback): void; /** * Register a device discovery result callback so that the application can be notified when discover failed. @@ -993,7 +1228,25 @@ declare namespace distributedDeviceManager { * @syscap SystemCapability.DistributedHardware.DeviceManager * @since 10 */ - on(type: 'discoverFailure', callback: Callback<{ reason: number; }>): void; + /** + * Register a device discovery result callback so that the application can be notified when discover failed. + * + * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @param { 'discoverFailure' } type - Discovery Device Failure. + * @param { Callback } callback + * Indicates the device found result callback to register. + * @throws { BusinessError } 201 - Permission verification failed. + * The application does not have the permission required to call the API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter type; + * 3. Parameter verification failed; + * 4. The size of specified type is greater than 255. + * @syscap SystemCapability.DistributedHardware.DeviceManager + * @since arkts {'1.1':'10','1.2':'20'} + * @arkts 1.1&1.2 + */ + on(type: 'discoverFailure', callback: Callback): void; /** * UnRegister the device discovery result callback. @@ -1011,7 +1264,25 @@ declare namespace distributedDeviceManager { * @syscap SystemCapability.DistributedHardware.DeviceManager * @since 10 */ - off(type: 'discoverFailure', callback?: Callback<{ reason: number; }>): void; + /** + * UnRegister the device discovery result callback. + * + * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @param { 'discoverFailure' } type - Discovery Device Failure. + * @param { Callback } [callback] + * Indicates the device found result callback to unregister. + * @throws { BusinessError } 201 - Permission verification failed. + * The application does not have the permission required to call the API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter type; + * 3. Parameter verification failed; + * 4. The size of specified type is greater than 255. + * @syscap SystemCapability.DistributedHardware.DeviceManager + * @since arkts {'1.1':'10','1.2':'20'} + * @arkts 1.1&1.2 + */ + off(type: 'discoverFailure', callback?: Callback): void; /** * Register a serviceError callback so that the application can be notified when devicemanager service died @@ -1028,7 +1299,24 @@ declare namespace distributedDeviceManager { * @syscap SystemCapability.DistributedHardware.DeviceManager * @since 10 */ - on(type: 'serviceDie', callback?: Callback<{}>): void; + /** + * Register a serviceError callback so that the application can be notified when devicemanager service died + * + * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @param { 'serviceDie' } type - Service death. + * @param { Callback } [callback] - Indicates the service error callback to register. + * @throws { BusinessError } 201 - Permission verification failed. + * The application does not have the permission required to call the API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter type; + * 3. Parameter verification failed; + * 4. The size of specified type is greater than 255. + * @syscap SystemCapability.DistributedHardware.DeviceManager + * @since arkts {'1.1':'10','1.2':'20'} + * @arkts 1.1&1.2 + */ + on(type: 'serviceDie', callback?: Callback): void; /** * UnRegister the service error callback. @@ -1045,7 +1333,24 @@ declare namespace distributedDeviceManager { * @syscap SystemCapability.DistributedHardware.DeviceManager * @since 10 */ - off(type: 'serviceDie', callback?: Callback<{}>): void; + /** + * UnRegister the service error callback. + * + * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @param { 'serviceDie' } type - Service death. + * @param { Callback } [callback] - Indicates the service error callback to unregister. + * @throws { BusinessError } 201 - Permission verification failed. + * The application does not have the permission required to call the API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter type; + * 3. Parameter verification failed; + * 4. The size of specified type is greater than 255. + * @syscap SystemCapability.DistributedHardware.DeviceManager + * @since arkts {'1.1':'10','1.2':'20'} + * @arkts 1.1&1.2 + */ + off(type: 'serviceDie', callback?: Callback): void; /** * Register a callback from deviceManager service so that the devicemanager ui can be notified when uiStateChanges. @@ -1058,12 +1363,32 @@ declare namespace distributedDeviceManager { * 2. Incorrect parameter type; * 3. Parameter verification failed; * 4. The size of specified type is greater than 255. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. * @syscap SystemCapability.DistributedHardware.DeviceManager * @systemapi this method can be used only by system applications. * @since 10 */ - on(type: 'replyResult', callback: Callback<{ param: string; }>): void; + /** + * Register a callback from deviceManager service so that the devicemanager ui can be notified when uiStateChanges. + * + * @permission ohos.permission.ACCESS_SERVICE_DM + * @param { 'replyResult' } type - Ui reply result to register. + * @param { Callback } callback - Indicates the devicemanager ui state to register. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter type; + * 3. Parameter verification failed; + * 4. The size of specified type is greater than 255. + * @throws { BusinessError } 201 - Permission verification failed. + * The application does not have the permission required to call the API. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @syscap SystemCapability.DistributedHardware.DeviceManager + * @systemapi this method can be used only by system applications. + * @since arkts {'1.1':'10','1.2':'20'} + * @arkts 1.1&1.2 + */ + on(type: 'replyResult', callback: Callback): void; /** * Unregister uiStateChange, this interface can only be used by devicemanager ui. @@ -1076,12 +1401,32 @@ declare namespace distributedDeviceManager { * 2. Incorrect parameter type; * 3. Parameter verification failed; * 4. The size of specified type is greater than 255. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. * @syscap SystemCapability.DistributedHardware.DeviceManager * @systemapi this method can be used only by system applications. * @since 10 */ - off(type: 'replyResult', callback?: Callback<{ param: string; }>): void; + /** + * Unregister uiStateChange, this interface can only be used by devicemanager ui. + * + * @permission ohos.permission.ACCESS_SERVICE_DM + * @param { 'replyResult' } type - Ui reply result to unregister. + * @param { Callback } [callback] - Indicates the devicemanager ui state to unregister. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter type; + * 3. Parameter verification failed; + * 4. The size of specified type is greater than 255. + * @throws { BusinessError } 201 - Permission verification failed. + * The application does not have the permission required to call the API. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @syscap SystemCapability.DistributedHardware.DeviceManager + * @systemapi this method can be used only by system applications. + * @since arkts {'1.1':'10','1.2':'20'} + * @arkts 1.1&1.2 + */ + off(type: 'replyResult', callback?: Callback): void; /** * Get the device list under the same account. diff --git a/api/@ohos.file.keyManager.d.ts b/api/@ohos.file.keyManager.d.ts index 058ad8dd99..864eeabb70 100644 --- a/api/@ohos.file.keyManager.d.ts +++ b/api/@ohos.file.keyManager.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Huawei Device Co., Ltd. + * Copyright (c) 2024-2025 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 @@ -23,26 +23,28 @@ * * @namespace keyManager * @syscap SystemCapability.FileManagement.StorageService.Encryption - * @since 15 + * @since arkts {'1.1':'15', '1.2':'20'} + * @arkts 1.1&1.2 */ declare namespace keyManager { /** * Initiate the deactivation of user key for the specified user when user screen is locked. * * @permission ohos.permission.STORAGE_MANAGER_CRYPT - * @param { number } userId + * @param { long } userId * @throws { BusinessError } 201 - Permission verification failed. * @throws { BusinessError } 202 - The caller is not a system application. * @throws { BusinessError } 401 - The input parameter is invalid. Possible causes: Mandatory - parameters are left unspecified; Or input parameter has type different from the type the interface requires. + * parameters are left unspecified; Or input parameter has type different from the type the interface requires. * @throws { BusinessError } 13600001 - IPC error. * @throws { BusinessError } 13600008 - No such object. Possible causes: Cannot find userkey for the specified user. * @throws { BusinessError } 13600009 - User ID out of range. Possible causes: input parameter userId < 100 or userId > 10736. * @syscap SystemCapability.FileManagement.StorageService.Encryption * @systemapi - * @since 15 + * @since arkts {'1.1':'15', '1.2':'20'} + * @arkts 1.1&1.2 */ - function deactivateUserKey(userId: number):void; + function deactivateUserKey(userId: long):void; } export default keyManager; \ No newline at end of file -- Gitee