diff --git a/api/@internal/component/ets/paste_button.d.ts b/api/@internal/component/ets/paste_button.d.ts index 3eba6bab905fb71b471a5bcf8729eabb339cfb36..97927fefc0e9023014f24874dfdc60e212896e92 100644 --- a/api/@internal/component/ets/paste_button.d.ts +++ b/api/@internal/component/ets/paste_button.d.ts @@ -273,8 +273,6 @@ interface PasteButtonInterface { (options: PasteButtonOptions): PasteButtonAttribute; } - - /** * Callback function when the paste button is clicked. * diff --git a/api/@internal/component/ets/security_component.d.ts b/api/@internal/component/ets/security_component.d.ts index 59fcccef62a01df5177f2b2dde8d1d06166b4ba0..4b9df7a79b9a3a80e070aff17ba6d2398ca061cc 100644 --- a/api/@internal/component/ets/security_component.d.ts +++ b/api/@internal/component/ets/security_component.d.ts @@ -28,17 +28,18 @@ import { Resource } from '../../global/resource'; /** * Enumerates the layout direction of the icon and text. * - * @enum { number } + * @enum { int } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 10 */ /** * Enumerates the layout direction of the icon and text. * - * @enum { number } + * @enum { int } * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since 11 + * @since arkts {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ declare enum SecurityComponentLayoutDirection { /** @@ -52,7 +53,8 @@ declare enum SecurityComponentLayoutDirection { * * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since 11 + * @since arkts {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ HORIZONTAL = 0, @@ -67,38 +69,8 @@ declare enum SecurityComponentLayoutDirection { * * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since 11 - */ - VERTICAL = 1 -} - -/** - * Enumerates the layout direction of the icon and text. - * - * @enum { int } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since 20 - * @arkts 1.2 - */ -declare enum SecurityComponentLayoutDirection { - /** - * Horizontal layout. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - HORIZONTAL = 0, - - /** - * Vertical layout. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since 20 - * @arkts 1.2 + * @since arkts {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ VERTICAL = 1 } @@ -278,22 +250,11 @@ declare class SecurityComponentMethod { /** * Font weight of the inner text. * - * @param { number | FontWeight | string } value - Indicates the font weight of the text in the security component. + * @param { int | FontWeight | string } value - Indicates the font weight of the text in the security component. * @returns { T } Returns the attribute of the security component. * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 10 */ - /** - * Font weight of the inner text. - * - * @param { number | FontWeight | string } value - Indicates the font weight of the text in the security component. - * @returns { T } Returns the attribute of the security component. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since 11 - */ - fontWeight(value: number | FontWeight | string): T; - /** * Font weight of the inner text. * @@ -301,8 +262,8 @@ declare class SecurityComponentMethod { * @returns { T } Returns the attribute of the security component. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since 20 - * @arkts 1.2 + * @since arkts {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ fontWeight(value: int | FontWeight | string): T; @@ -473,7 +434,8 @@ declare class SecurityComponentMethod { * @returns { T } Returns the attribute of the security component. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since 15 + * @since arkts {'1.1':'15', '1.2':'20'} + * @arkts 1.1&1.2 */ borderRadius(radius: Dimension | BorderRadiuses): T; @@ -676,62 +638,62 @@ declare class SecurityComponentMethod { /** * Sets the minimum font scale factor for text. * - * @param { number | Resource } scale Minimum font scale factor to set. + * @param { double | Resource } scale Minimum font scale factor to set. * @returns { T } Returns the attributes of the security component. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since arkts {'1.1':'18', '1.2':'20'} * @arkts 1.1&1.2 */ - minFontScale(scale: number | Resource): T; + minFontScale(scale: double | Resource): T; /** * Sets the maximum font scale factor for text. * - * @param { number | Resource } scale Maximum font scale factor to set. + * @param { double | Resource } scale Maximum font scale factor to set. * @returns { T } Returns the attributes of the security component. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since arkts {'1.1':'18', '1.2':'20'} * @arkts 1.1&1.2 */ - maxFontScale(scale: number | Resource): T; + maxFontScale(scale: double | Resource): T; /** * Called when the maximum number of lines of text is set. * - * @param { number } line + * @param { int } line * @returns { T } Returns the attribute of the security component. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since arkts {'1.1':'18', '1.2':'20'} * @arkts 1.1&1.2 */ - maxLines(line: number): T; + maxLines(line: int): T; /** * Called when the minimum font size of the font is set. * - * @param { number | string | Resource } minSize + * @param { double | string | Resource } minSize * @returns { T } Returns the attribute of the security component. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since arkts {'1.1':'18', '1.2':'20'} * @arkts 1.1&1.2 */ - minFontSize(minSize: number | string | Resource): T; + minFontSize(minSize: double | string | Resource): T; /** * Called when the maximum font size of the font is set. * - * @param { number | string | Resource } maxSize + * @param { double | string | Resource } maxSize * @returns { T } Returns the attribute of the security component. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since arkts {'1.1':'18', '1.2':'20'} * @arkts 1.1&1.2 */ - maxFontSize(maxSize: number | string | Resource): T; + maxFontSize(maxSize: double | string | Resource): T; /** * Called when the height adaptive policy is set. diff --git a/api/@ohos.abilityAccessCtrl.d.ts b/api/@ohos.abilityAccessCtrl.d.ts index aea2e98aabe804af68b0d00964f3cafcf2d79e12..fa07b0eb3d4876f35f172ece1443502348e6e6f2 100644 --- a/api/@ohos.abilityAccessCtrl.d.ts +++ b/api/@ohos.abilityAccessCtrl.d.ts @@ -22,9 +22,6 @@ import { AsyncCallback, Callback } from './@ohos.base'; import { Permissions } from './permissions'; import type _Context from './application/Context'; import type _PermissionRequestResult from './security/PermissionRequestResult'; -/*** if arkts 1.1 */ -import { int } from '@ohos.base'; -/*** endif */ /** * @namespace abilityAccessCtrl @@ -93,13 +90,14 @@ declare namespace abilityAccessCtrl { /** * Checks whether a specified application has been granted the given permission. * - * @param { number } tokenID - Token ID of the application. + * @param { int } tokenID - Token ID of the application. * @param { Permissions } permissionName - Name of the permission to be verified. The Permissions type supports only valid permission names. * @returns { Promise } Returns permission verify result. * @syscap SystemCapability.Security.AccessToken - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - verifyAccessToken(tokenID: number, permissionName: Permissions): Promise; + verifyAccessToken(tokenID: int, permissionName: Permissions): Promise; /** * Checks whether a specified application has been granted the given permission. @@ -297,9 +295,9 @@ declare namespace abilityAccessCtrl { * Grants a specified user_grant permission to the given application. * * @permission ohos.permission.GRANT_SENSITIVE_PERMISSIONS - * @param { number } tokenID - Token ID of the application. + * @param { int } tokenID - Token ID of the application. * @param { Permissions } permissionName - Name of the permission to be granted. - * @param { number } permissionFlags - Flags of permission state. This parameter can be 1 or 2 or 64. + * @param { int } permissionFlags - Flags of permission state. This parameter can be 1 or 2 or 64. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. * @throws { BusinessError } 201 - Permission denied. Interface caller does not have permission "ohos.permission.GRANT_SENSITIVE_PERMISSIONS". @@ -312,17 +310,18 @@ declare namespace abilityAccessCtrl { * @throws { BusinessError } 12100007 - The service is abnormal. * @syscap SystemCapability.Security.AccessToken * @systemapi - * @since 8 + * @since arkts {'1.1':'8', '1.2':'20'} + * @arkts 1.1&1.2 */ - grantUserGrantedPermission(tokenID: number, permissionName: Permissions, permissionFlags: number): Promise; + grantUserGrantedPermission(tokenID: int, permissionName: Permissions, permissionFlags: int): Promise; /** * Grants a specified user_grant permission to the given application. * * @permission ohos.permission.GRANT_SENSITIVE_PERMISSIONS - * @param { number } tokenID - Token ID of the application. + * @param { int } tokenID - Token ID of the application. * @param { Permissions } permissionName - Name of the permission to be granted. - * @param { number } permissionFlags - Flags of permission state. This parameter can be 1 or 2 or 64. + * @param { int } permissionFlags - Flags of permission state. This parameter can be 1 or 2 or 64. * @param { AsyncCallback } callback - Asynchronous callback interface. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. * @throws { BusinessError } 201 - Permission denied. Interface caller does not have permission "ohos.permission.GRANT_SENSITIVE_PERMISSIONS". @@ -335,12 +334,13 @@ declare namespace abilityAccessCtrl { * @throws { BusinessError } 12100007 - The service is abnormal. * @syscap SystemCapability.Security.AccessToken * @systemapi - * @since 8 + * @since arkts {'1.1':'8', '1.2':'20'} + * @arkts 1.1&1.2 */ grantUserGrantedPermission( - tokenID: number, + tokenID: int, permissionName: Permissions, - permissionFlags: number, + permissionFlags: int, callback: AsyncCallback ): void; @@ -348,9 +348,9 @@ declare namespace abilityAccessCtrl { * Revoke a specified user_grant permission to the given application. * * @permission ohos.permission.REVOKE_SENSITIVE_PERMISSIONS - * @param { number } tokenID - Token ID of the application. + * @param { int } tokenID - Token ID of the application. * @param { Permissions } permissionName - Name of the permission to be revoked. - * @param { number } permissionFlags - Flags of permission state. This parameter can be 1 or 2 or 64. + * @param { int } permissionFlags - Flags of permission state. This parameter can be 1 or 2 or 64. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. * @throws { BusinessError } 201 - Permission denied. Interface caller does not have permission "ohos.permission.REVOKE_SENSITIVE_PERMISSIONS". @@ -363,17 +363,18 @@ declare namespace abilityAccessCtrl { * @throws { BusinessError } 12100007 - The service is abnormal. * @syscap SystemCapability.Security.AccessToken * @systemapi - * @since 8 + * @since arkts {'1.1':'8', '1.2':'20'} + * @arkts 1.1&1.2 */ - revokeUserGrantedPermission(tokenID: number, permissionName: Permissions, permissionFlags: number): Promise; + revokeUserGrantedPermission(tokenID: int, permissionName: Permissions, permissionFlags: int): Promise; /** * Revoke a specified user_grant permission to the given application. * * @permission ohos.permission.REVOKE_SENSITIVE_PERMISSIONS - * @param { number } tokenID - Token ID of the application. + * @param { int } tokenID - Token ID of the application. * @param { Permissions } permissionName - Name of the permission to be revoked. - * @param { number } permissionFlags - Flags of permission state. This parameter can be 1 or 2 or 64. + * @param { int } permissionFlags - Flags of permission state. This parameter can be 1 or 2 or 64. * @param { AsyncCallback } callback - Asynchronous callback interface. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. * @throws { BusinessError } 201 - Permission denied. Interface caller does not have permission "ohos.permission.REVOKE_SENSITIVE_PERMISSIONS". @@ -386,12 +387,13 @@ declare namespace abilityAccessCtrl { * @throws { BusinessError } 12100007 - The service is abnormal. * @syscap SystemCapability.Security.AccessToken * @systemapi - * @since 8 + * @since arkts {'1.1':'8', '1.2':'20'} + * @arkts 1.1&1.2 */ revokeUserGrantedPermission( - tokenID: number, + tokenID: int, permissionName: Permissions, - permissionFlags: number, + permissionFlags: int, callback: AsyncCallback ): void; @@ -399,9 +401,9 @@ declare namespace abilityAccessCtrl { * Queries specified permission flags of the given application. * * @permission ohos.permission.GET_SENSITIVE_PERMISSIONS or ohos.permission.GRANT_SENSITIVE_PERMISSIONS or ohos.permission.REVOKE_SENSITIVE_PERMISSIONS - * @param { number } tokenID - Token ID of the application. + * @param { int } tokenID - Token ID of the application. * @param { Permissions } permissionName - Name of the permission to be get. - * @returns { Promise } Return permission flags. + * @returns { Promise } Return permission flags. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. * @throws { BusinessError } 201 - Permission denied. Interface caller does not have permission specified below. * @throws { BusinessError } 202 - Not System App. Interface caller is not a system app. @@ -412,9 +414,10 @@ declare namespace abilityAccessCtrl { * @throws { BusinessError } 12100007 - The service is abnormal. * @syscap SystemCapability.Security.AccessToken * @systemapi - * @since 8 + * @since arkts {'1.1':'8', '1.2':'20'} + * @arkts 1.1&1.2 */ - getPermissionFlags(tokenID: number, permissionName: Permissions): Promise; + getPermissionFlags(tokenID: int, permissionName: Permissions): Promise; /** * Set the toggle status of one permission flag. @@ -431,7 +434,8 @@ declare namespace abilityAccessCtrl { * @throws { BusinessError } 12100007 - The service is abnormal. * @syscap SystemCapability.Security.AccessToken * @systemapi - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ setPermissionRequestToggleStatus(permissionName: Permissions, status: PermissionRequestToggleStatus): Promise; @@ -449,26 +453,28 @@ declare namespace abilityAccessCtrl { * @throws { BusinessError } 12100007 - The service is abnormal. * @syscap SystemCapability.Security.AccessToken * @systemapi - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ getPermissionRequestToggleStatus(permissionName: Permissions): Promise; /** * Queries permission management version. * - * @returns { Promise } Return permission version. + * @returns { Promise } Return permission version. * @throws { BusinessError } 202 - Not System App. Interface caller is not a system app. * @syscap SystemCapability.Security.AccessToken * @systemapi - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - getVersion(): Promise; + getVersion(): Promise; /** * Queries permissions status of the given application. * * @permission ohos.permission.GET_SENSITIVE_PERMISSIONS - * @param { number } tokenID - Token ID of the application. + * @param { int } tokenID - Token ID of the application. * @param { Array } permissionList - Indicates the list of permissions to be queried. This parameter cannot be null or empty. * @returns { Promise> } Return permission status. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. @@ -479,16 +485,17 @@ declare namespace abilityAccessCtrl { * @throws { BusinessError } 12100007 - The service is abnormal. * @syscap SystemCapability.Security.AccessToken * @systemapi - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - getPermissionsStatus(tokenID: number, permissionList: Array): Promise>; + getPermissionsStatus(tokenID: int, permissionList: Array): Promise>; /** * Registers a permission state callback so that the application can be notified upon specified permission state of specified applications changes. * * @permission ohos.permission.GET_SENSITIVE_PERMISSIONS * @param { 'permissionStateChange' } type - Event type. - * @param { Array } tokenIDList - A list of permissions that specify the permissions to be listened on. The value in the list can be: + * @param { Array } tokenIDList - A list of permissions that specify the permissions to be listened on. The value in the list can be: *
{@code empty} - Indicates that the application can be notified if the specified permission state of any applications changes. *
{@code non-empty} - Indicates that the application can only be notified if the specified permission state of the specified applications change. * @param { Array } permissionList - A list of permissions that specify the permissions to be listened on. The value in the list can be: @@ -505,11 +512,12 @@ declare namespace abilityAccessCtrl { * @throws { BusinessError } 12100008 - Out of memory. * @syscap SystemCapability.Security.AccessToken * @systemapi - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ on( type: 'permissionStateChange', - tokenIDList: Array, + tokenIDList: Array, permissionList: Array, callback: Callback ): void; @@ -529,7 +537,8 @@ declare namespace abilityAccessCtrl { * @throws { BusinessError } 12100007 - The service is abnormal. * @syscap SystemCapability.Security.AccessToken * @atomicservice - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ on( type: 'selfPermissionStateChange', @@ -542,7 +551,7 @@ declare namespace abilityAccessCtrl { * * @permission ohos.permission.GET_SENSITIVE_PERMISSIONS * @param { 'permissionStateChange' } type - Event type. - * @param { Array } tokenIDList - A list of permissions that specify the permissions to be listened on. + * @param { Array } tokenIDList - A list of permissions that specify the permissions to be listened on. * It should correspond to the value registered by function of "on", whose type is "permissionStateChange". * @param { Array } permissionList - A list of permissions that specify the permissions to be listened on. * It should correspond to the value registered by function of "on", whose type is "permissionStateChange". @@ -556,11 +565,12 @@ declare namespace abilityAccessCtrl { * @throws { BusinessError } 12100008 - Out of memory. * @syscap SystemCapability.Security.AccessToken * @systemapi - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ off( type: 'permissionStateChange', - tokenIDList: Array, + tokenIDList: Array, permissionList: Array, callback?: Callback ): void; @@ -578,7 +588,8 @@ declare namespace abilityAccessCtrl { * @throws { BusinessError } 12100007 - The service is abnormal. * @syscap SystemCapability.Security.AccessToken * @atomicservice - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ off( type: 'selfPermissionStateChange', @@ -621,14 +632,15 @@ declare namespace abilityAccessCtrl { * @syscap SystemCapability.Security.AccessToken * @stagemodelonly * @atomicservice - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ requestGlobalSwitch(context: Context, type: SwitchType): Promise; /** * Starts the permission manager page of an application. * - * @param { number } tokenID - Token ID of the application. + * @param { int } tokenID - Token ID of the application. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 202 - Not System App. Interface caller is not a system app. * @throws { BusinessError } 12100002 - The specified tokenID does not exist. @@ -636,9 +648,10 @@ declare namespace abilityAccessCtrl { * @syscap SystemCapability.Security.AccessToken * @systemapi * @stagemodelonly - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ - requestPermissionOnApplicationSetting(tokenID: number): Promise; + requestPermissionOnApplicationSetting(tokenID: int): Promise; } /** diff --git a/api/@ohos.privacyManager.d.ts b/api/@ohos.privacyManager.d.ts index 43e9ff36d0b2620a38feea9387e5ca8da5ff75dd..05bb5a599f5b1c18e9d8b3ce4a514be309c7cb4f 100644 --- a/api/@ohos.privacyManager.d.ts +++ b/api/@ohos.privacyManager.d.ts @@ -20,9 +20,6 @@ import { AsyncCallback, Callback } from './@ohos.base'; import { Permissions } from './permissions'; -/*** if arkts 1.1 */ -import { int } from '@ohos.base'; -/*** endif */ /** * @namespace privacyManager @@ -45,7 +42,7 @@ declare namespace privacyManager { * @throws { BusinessError } 202 - Not system app. Interface caller is not a system app. * @throws { BusinessError } 12100001 - Invalid parameter. The tokenID is 0, the permissionName exceeds 256 characters, or the count value is invalid. * @throws { BusinessError } 12100002 - The specified tokenID does not exist or refer to an application process. - * @throws { BusinessError } 12100003 - The specified permission does not exist or is not an user_grant permission. + * @throws { BusinessError } 12100003 - The specified permission does not exist or is not a user_grant permission. * @throws { BusinessError } 12100007 - The service is abnormal. * @throws { BusinessError } 12100008 - Out of memory. * @syscap SystemCapability.Security.AccessToken @@ -68,7 +65,7 @@ declare namespace privacyManager { * @throws { BusinessError } 12100001 - Invalid parameter. The tokenID is 0, the permissionName exceeds 256 characters, the count value is invalid, * or usedType in AddPermissionUsedRecordOptions is invalid. * @throws { BusinessError } 12100002 - The specified tokenID does not exist or refer to an application process. - * @throws { BusinessError } 12100003 - The specified permission does not exist or is not an user_grant permission. + * @throws { BusinessError } 12100003 - The specified permission does not exist or is not a user_grant permission. * @throws { BusinessError } 12100007 - The service is abnormal. * @throws { BusinessError } 12100008 - Out of memory. * @syscap SystemCapability.Security.AccessToken @@ -98,7 +95,7 @@ declare namespace privacyManager { * @throws { BusinessError } 202 - Not system app. Interface caller is not a system app. * @throws { BusinessError } 12100001 - Invalid parameter. The tokenID is 0, the permissionName exceeds 256 characters, or the count value is invalid. * @throws { BusinessError } 12100002 - The specified tokenID does not exist or refer to an application process. - * @throws { BusinessError } 12100003 - The specified permission does not exist or is not an user_grant permission. + * @throws { BusinessError } 12100003 - The specified permission does not exist or is not a user_grant permission. * @throws { BusinessError } 12100007 - The service is abnormal. * @throws { BusinessError } 12100008 - Out of memory. * @syscap SystemCapability.Security.AccessToken @@ -125,12 +122,13 @@ declare namespace privacyManager { * @throws { BusinessError } 202 - Not system app. Interface caller is not a system app. * @throws { BusinessError } 12100001 - Invalid parameter. The value of flag in request is invalid. * @throws { BusinessError } 12100002 - The specified tokenID does not exist or refer to an application process. - * @throws { BusinessError } 12100003 - The specified permission does not exist or is not an user_grant permission. + * @throws { BusinessError } 12100003 - The specified permission does not exist or is not a user_grant permission. * @throws { BusinessError } 12100007 - The service is abnormal. * @throws { BusinessError } 12100008 - Out of memory. * @syscap SystemCapability.Security.AccessToken * @systemapi - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ function getPermissionUsedRecord(request: PermissionUsedRequest): Promise; @@ -145,12 +143,13 @@ declare namespace privacyManager { * @throws { BusinessError } 202 - Not system app. Interface caller is not a system app. * @throws { BusinessError } 12100001 - Invalid parameter. The value of flag in request is invalid. * @throws { BusinessError } 12100002 - The specified tokenID does not exist or refer to an application process. - * @throws { BusinessError } 12100003 - The specified permission does not exist or is not an user_grant permission. + * @throws { BusinessError } 12100003 - The specified permission does not exist or is not a user_grant permission. * @throws { BusinessError } 12100007 - The service is abnormal. * @throws { BusinessError } 12100008 - Out of memory. * @syscap SystemCapability.Security.AccessToken * @systemapi - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ function getPermissionUsedRecord( request: PermissionUsedRequest, @@ -161,7 +160,7 @@ declare namespace privacyManager { * Start using sensitive permission. * * @permission ohos.permission.PERMISSION_USED_STATS - * @param { number } tokenID - Token ID of the application. + * @param { int } tokenID - Token ID of the application. * @param { Permissions } permissionName - Name of the permission to be started. * @returns { Promise } Promise that returns no value. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. @@ -169,44 +168,45 @@ declare namespace privacyManager { * @throws { BusinessError } 202 - Not system app. Interface caller is not a system app. * @throws { BusinessError } 12100001 - Invalid parameter. The tokenID is 0, the permissionName exceeds 256 characters, or the count value is invalid. * @throws { BusinessError } 12100002 - The specified tokenID does not exist or refer to an application process. - * @throws { BusinessError } 12100003 - The specified permission does not exist or is not an user_grant permission. + * @throws { BusinessError } 12100003 - The specified permission does not exist or is not a user_grant permission. * @throws { BusinessError } 12100004 - The API is used repeatedly with the same input. * It means the application specified by the tokenID has been using the specified permission. * @throws { BusinessError } 12100007 - The service is abnormal. * @throws { BusinessError } 12100008 - Out of memory. * @syscap SystemCapability.Security.AccessToken * @systemapi - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - function startUsingPermission(tokenID: number, permissionName: Permissions): Promise; + function startUsingPermission(tokenID: int, permissionName: Permissions): Promise; /** * Start using sensitive permission. * * @permission ohos.permission.PERMISSION_USED_STATS - * @param { number } tokenID - Token ID of the application. + * @param { int } tokenID - Token ID of the application. * @param { Permissions } permissionName - Name of the permission to be started. - * @param { number } pid - Pid of the application, default -1. - * @param { PermissionUsedType } usedType - Used type of the permission accessed, default NORMAL_TYPE. + * @param { int } [pid] - Pid of the application, default -1. + * @param { PermissionUsedType } [usedType] - Used type of the permission accessed, default NORMAL_TYPE. * @returns { Promise } Promise that returns no value. - * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. * @throws { BusinessError } 201 - Permission denied. Interface caller does not have permission "ohos.permission.PERMISSION_USED_STATS". * @throws { BusinessError } 202 - Not system app. Interface caller is not a system app. * @throws { BusinessError } 12100001 - Invalid parameter. The tokenID is 0, the permissionName exceeds 256 characters, or the count value is invalid. * @throws { BusinessError } 12100002 - The specified tokenID does not exist or refer to an application process. - * @throws { BusinessError } 12100003 - The specified permission does not exist or is not an user_grant permission. + * @throws { BusinessError } 12100003 - The specified permission does not exist or is not a user_grant permission. * @throws { BusinessError } 12100004 - The API is used repeatedly with the same input. * It means the application specified by the tokenID has been using the specified permission. * @throws { BusinessError } 12100007 - The service is abnormal. * @throws { BusinessError } 12100008 - Out of memory. * @syscap SystemCapability.Security.AccessToken * @systemapi - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ function startUsingPermission( - tokenID: number, + tokenID: int, permissionName: Permissions, - pid?: number, + pid?: int, usedType?: PermissionUsedType ): Promise; @@ -214,7 +214,7 @@ declare namespace privacyManager { * Start using sensitive permission. * * @permission ohos.permission.PERMISSION_USED_STATS - * @param { number } tokenID - Token ID of the application. + * @param { int } tokenID - Token ID of the application. * @param { Permissions } permissionName - Name of the permission to be started. * @param { AsyncCallback } callback - Asynchronous callback interface. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. @@ -222,22 +222,23 @@ declare namespace privacyManager { * @throws { BusinessError } 202 - Not system app. Interface caller is not a system app. * @throws { BusinessError } 12100001 - Invalid parameter. The tokenID is 0, the permissionName exceeds 256 characters, or the count value is invalid. * @throws { BusinessError } 12100002 - The specified tokenID does not exist or refer to an application process. - * @throws { BusinessError } 12100003 - The specified permission does not exist or is not an user_grant permission. + * @throws { BusinessError } 12100003 - The specified permission does not exist or is not a user_grant permission. * @throws { BusinessError } 12100004 - The API is used repeatedly with the same input. * It means the application specified by the tokenID has been using the specified permission. * @throws { BusinessError } 12100007 - The service is abnormal. * @throws { BusinessError } 12100008 - Out of memory. * @syscap SystemCapability.Security.AccessToken * @systemapi - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - function startUsingPermission(tokenID: number, permissionName: Permissions, callback: AsyncCallback): void; + function startUsingPermission(tokenID: int, permissionName: Permissions, callback: AsyncCallback): void; /** * Stop using sensitive permission. * * @permission ohos.permission.PERMISSION_USED_STATS - * @param { number } tokenID - Token ID of the application. + * @param { int } tokenID - Token ID of the application. * @param { Permissions } permissionName - Name of the permission to be stopped. * @returns { Promise } Promise that returns no value. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. @@ -245,48 +246,49 @@ declare namespace privacyManager { * @throws { BusinessError } 202 - Not system app. Interface caller is not a system app. * @throws { BusinessError } 12100001 - Invalid parameter. The tokenID is 0, the permissionName exceeds 256 characters, or the count value is invalid. * @throws { BusinessError } 12100002 - The specified tokenID does not exist or refer to an application process. - * @throws { BusinessError } 12100003 - The specified permission does not exist or is not an user_grant permission. + * @throws { BusinessError } 12100003 - The specified permission does not exist or is not a user_grant permission. * @throws { BusinessError } 12100004 - The API is not used in pair with 'startUsingPermission'. * @throws { BusinessError } 12100007 - The service is abnormal. * @throws { BusinessError } 12100008 - Out of memory. * @syscap SystemCapability.Security.AccessToken * @systemapi - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - function stopUsingPermission(tokenID: number, permissionName: Permissions): Promise; + function stopUsingPermission(tokenID: int, permissionName: Permissions): Promise; /** * Stop using sensitive permission. * * @permission ohos.permission.PERMISSION_USED_STATS - * @param { number } tokenID - Token ID of the application. + * @param { int } tokenID - Token ID of the application. * @param { Permissions } permissionName - Name of the permission to be stopped. - * @param { number } pid - Pid of the application, default -1. + * @param { int } [pid] - Pid of the application, default -1. * @returns { Promise } Promise that returns no value. - * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. * @throws { BusinessError } 201 - Permission denied. Interface caller does not have permission "ohos.permission.PERMISSION_USED_STATS". * @throws { BusinessError } 202 - Not system app. Interface caller is not a system app. * @throws { BusinessError } 12100001 - Invalid parameter. The tokenID is 0, the permissionName exceeds 256 characters, or the count value is invalid. * @throws { BusinessError } 12100002 - The specified tokenID does not exist or refer to an application process. - * @throws { BusinessError } 12100003 - The specified permission does not exist or is not an user_grant permission. + * @throws { BusinessError } 12100003 - The specified permission does not exist or is not a user_grant permission. * @throws { BusinessError } 12100004 - The API is not used in pair with 'startUsingPermission'. * @throws { BusinessError } 12100007 - The service is abnormal. * @throws { BusinessError } 12100008 - Out of memory. * @syscap SystemCapability.Security.AccessToken * @systemapi - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ function stopUsingPermission( - tokenID: number, + tokenID: int, permissionName: Permissions, - pid?: number + pid?: int ): Promise; /** * Stop using sensitive permission. * * @permission ohos.permission.PERMISSION_USED_STATS - * @param { number } tokenID - Token ID of the application. + * @param { int } tokenID - Token ID of the application. * @param { Permissions } permissionName - Name of the permission to be stopped. * @param { AsyncCallback } callback - Asynchronous callback interface. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. @@ -294,15 +296,16 @@ declare namespace privacyManager { * @throws { BusinessError } 202 - Not system app. Interface caller is not a system app. * @throws { BusinessError } 12100001 - Invalid parameter. The tokenID is 0, the permissionName exceeds 256 characters, or the count value is invalid. * @throws { BusinessError } 12100002 - The specified tokenID does not exist or refer to an application process. - * @throws { BusinessError } 12100003 - The specified permission does not exist or is not an user_grant permission. + * @throws { BusinessError } 12100003 - The specified permission does not exist or is not a user_grant permission. * @throws { BusinessError } 12100004 - The API is not used in pair with 'startUsingPermission'. * @throws { BusinessError } 12100007 - The service is abnormal. * @throws { BusinessError } 12100008 - Out of memory. * @syscap SystemCapability.Security.AccessToken * @systemapi - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - function stopUsingPermission(tokenID: number, permissionName: Permissions, callback: AsyncCallback): void; + function stopUsingPermission(tokenID: int, permissionName: Permissions, callback: AsyncCallback): void; /** * Subscribes to the change of active state of the specified permission. @@ -336,7 +339,7 @@ declare namespace privacyManager { * @permission ohos.permission.PERMISSION_USED_STATS * @param { 'activeStateChange' } type - Event type. This parameter cannot change. * @param { Array } permissionList - Indicates the permission list, which are specified. This parameter cannot be null or empty. - * @param { Callback } callback - Callback for listening permission change. + * @param { Callback } [callback] - Callback for listening permission change. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. * @throws { BusinessError } 201 - Permission denied. Interface caller does not have permission "ohos.permission.PERMISSION_USED_STATS". * @throws { BusinessError } 202 - Not system app. Interface caller is not a system app. @@ -359,7 +362,7 @@ declare namespace privacyManager { * Obtains the used type of the permission accessed. * * @permission ohos.permission.PERMISSION_USED_STATS - * @param { number } tokenId - Token ID of the application. By default, all token IDs of the device are returned. + * @param { int } tokenId - Token ID of the application. By default, all token IDs of the device are returned. * @param { Permissions } permissionName - Name of the permission to query. By default, all permissions of the device are returned. * @returns { Promise> } Promise used to return the information obtained. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types. @@ -370,9 +373,10 @@ declare namespace privacyManager { * @throws { BusinessError } 12100003 - The input permissionName does not exist. * @syscap SystemCapability.Security.AccessToken * @systemapi - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - function getPermissionUsedTypeInfos(tokenId?: number, permissionName?: Permissions): Promise>; + function getPermissionUsedTypeInfos(tokenId?: int, permissionName?: Permissions): Promise>; /** * Sets the toggle state of permission access records for the current user. @@ -387,7 +391,8 @@ declare namespace privacyManager { * @throws { BusinessError } 12100009 - Common inner error. * @syscap SystemCapability.Security.AccessToken * @systemapi - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ function setPermissionUsedRecordToggleStatus(status: boolean): Promise; @@ -401,7 +406,8 @@ declare namespace privacyManager { * @throws { BusinessError } 12100007 - The service is abnormal. * @syscap SystemCapability.Security.AccessToken * @systemapi - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ function getPermissionUsedRecordToggleStatus(): Promise; @@ -622,26 +628,26 @@ declare namespace privacyManager { /** * The begin time, in milliseconds * - * @type { ?int } + * @type { ?long } * @default 0 * @syscap SystemCapability.Security.AccessToken * @systemapi * @since arkts {'1.1':'9', '1.2':'20'} * @arkts 1.1&1.2 */ - beginTime?: int; + beginTime?: long; /** * The end time, in milliseconds * - * @type { ?int } + * @type { ?long } * @default 0 * @syscap SystemCapability.Security.AccessToken * @systemapi * @since arkts {'1.1':'9', '1.2':'20'} * @arkts 1.1&1.2 */ - endTime?: int; + endTime?: long; /** * The permission usage flag @@ -668,24 +674,24 @@ declare namespace privacyManager { /** * The begin time, in milliseconds * - * @type { int } + * @type { long } * @syscap SystemCapability.Security.AccessToken * @systemapi * @since arkts {'1.1':'9', '1.2':'20'} * @arkts 1.1&1.2 */ - beginTime: int; + beginTime: long; /** * The end time, in milliseconds * - * @type { int } + * @type { long } * @syscap SystemCapability.Security.AccessToken * @systemapi * @since arkts {'1.1':'9', '1.2':'20'} * @arkts 1.1&1.2 */ - endTime: int; + endTime: long; /** * The list of permission used records of bundle @@ -811,35 +817,35 @@ declare namespace privacyManager { /** * The last access time, in milliseconds * - * @type { int } + * @type { long } * @syscap SystemCapability.Security.AccessToken * @systemapi * @since arkts {'1.1':'9', '1.2':'20'} * @arkts 1.1&1.2 */ - lastAccessTime: int; + lastAccessTime: long; /** * The last reject time, in milliseconds * - * @type { int } + * @type { long } * @syscap SystemCapability.Security.AccessToken * @systemapi * @since arkts {'1.1':'9', '1.2':'20'} * @arkts 1.1&1.2 */ - lastRejectTime: int; + lastRejectTime: long; /** * The last access duration, in milliseconds * - * @type { int } + * @type { long } * @syscap SystemCapability.Security.AccessToken * @systemapi * @since arkts {'1.1':'9', '1.2':'20'} * @arkts 1.1&1.2 */ - lastAccessDuration: int; + lastAccessDuration: long; /** * The list of access records of details @@ -899,13 +905,13 @@ declare namespace privacyManager { /** * Timestamp, in milliseconds * - * @type { int } + * @type { long } * @syscap SystemCapability.Security.AccessToken * @systemapi * @since arkts {'1.1':'9', '1.2':'20'} * @arkts 1.1&1.2 */ - timestamp: int; + timestamp: long; /** * The value of successCount or failCount passed in to addPermissionUsedRecord. @@ -921,13 +927,13 @@ declare namespace privacyManager { /** * Access duration, in milliseconds * - * @type { int } + * @type { long } * @syscap SystemCapability.Security.AccessToken * @systemapi * @since arkts {'1.1':'9', '1.2':'20'} * @arkts 1.1&1.2 */ - accessDuration: int; + accessDuration: long; /** * Used type of the permission accessed. diff --git a/api/security/PermissionRequestResult.d.ts b/api/security/PermissionRequestResult.d.ts index 05d2bceacce9fb81d6e26e277b43874281135b68..16ff14dbae345a8c4c9ce98976b59e83f7178686 100644 --- a/api/security/PermissionRequestResult.d.ts +++ b/api/security/PermissionRequestResult.d.ts @@ -18,9 +18,6 @@ * @kit AbilityKit */ -/*** if arkts 1.1 */ -import { int } from '@ohos.base'; -/*** endif */ /** * The result of requestPermissionsFromUser with asynchronous callback. * @@ -46,7 +43,7 @@ import { int } from '@ohos.base'; * @since arkts {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ -export default class PermissionRequestResult { +declare class PermissionRequestResult { /** * The permissions passed in by the user. * @@ -72,28 +69,16 @@ export default class PermissionRequestResult { * @stagemodelonly * @crossplatform * @atomicservice - * @since 11 + * @since arkts {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ permissions: Array; - /** - * The permissions passed in by the user. - * - * @type { Array } - * @syscap SystemCapability.Security.AccessToken - * @stagemodelonly - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - permissions: Array = new Array(); - /** * The results for the corresponding request permissions. The value 0 indicates that a * permission is granted, the value -1 indicates not, and the value 2 indicates the request is invalid. * - * @type { Array } + * @type { Array } * @syscap SystemCapability.Security.AccessToken * @stagemodelonly * @since 9 @@ -102,25 +87,12 @@ export default class PermissionRequestResult { * The results for the corresponding request permissions. The value 0 indicates that a * permission is granted, the value -1 indicates not, and the value 2 indicates the request is invalid. * - * @type { Array } + * @type { Array } * @syscap SystemCapability.Security.AccessToken * @stagemodelonly * @crossplatform * @since 10 */ - /** - * The results for the corresponding request permissions. The value 0 indicates that a - * permission is granted, the value -1 indicates not, and the value 2 indicates the request is invalid. - * - * @type { Array } - * @syscap SystemCapability.Security.AccessToken - * @stagemodelonly - * @crossplatform - * @atomicservice - * @since 11 - */ - authResults: Array; - /** * The results for the corresponding request permissions. The value 0 indicates that a * permission is granted, the value -1 indicates not, and the value 2 indicates the request is invalid. @@ -130,10 +102,10 @@ export default class PermissionRequestResult { * @stagemodelonly * @crossplatform * @atomicservice - * @since 20 - * @arkts 1.2 + * @since arkts {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - authResults: Array = new Array(); + authResults: Array; /** * Specifies whether a dialog box is shown for each requested permission. @@ -168,3 +140,5 @@ export default class PermissionRequestResult { */ errorReasons?: Array; } + +export default PermissionRequestResult;