diff --git a/api/@ohos.account.appAccount.d.ts b/api/@ohos.account.appAccount.d.ts index d814c3546f1dac2d7251f74f572a4eebfa5d610f..4f0ae6f5fcf023e56cb016154e405531d2315d91 100644 --- a/api/@ohos.account.appAccount.d.ts +++ b/api/@ohos.account.appAccount.d.ts @@ -21,6 +21,9 @@ import type { AsyncCallback, Callback } from './@ohos.base'; import type Want from './@ohos.app.ability.Want'; import type rpc from './@ohos.rpc'; +/*** if arkts 1.2 */ +import type { RecordData } from './@ohos.base'; +/*** endif */ /** * This module provides the capability to manage application accounts. @@ -1271,6 +1274,32 @@ declare namespace appAccount { callback: AuthCallback ): void; + /** + * Authenticates an application account to get an auth token. + * + * @param { string } name - Indicates the account name of your application or third-party applications. + * @param { string } owner - Indicates the account owner of your application or third-party applications. + * @param { string } authType - Indicates the authentication type. + * @param { RecordData } options - Indicates the authenticator-specific options for the request. + * @param { AuthCallback } callback - Indicates the authenticator callback. + * @throws { BusinessError } 12300001 - System service exception. + * @throws { BusinessError } 12300002 - Invalid name, owner, authType or options. + * @throws { BusinessError } 12300003 - Account not found. + * @throws { BusinessError } 12300010 - Account service busy. + * @throws { BusinessError } 12300113 - Authenticator service not found. + * @throws { BusinessError } 12300114 - Authenticator service exception. + * @syscap SystemCapability.Account.AppAccount + * @since 20 + * @arkts 1.2 + */ + auth( + name: string, + owner: string, + authType: string, + options: RecordData, + callback: AuthCallback + ): void; + /** * Gets an oauth token with the specified authentication type from a particular application account. * @@ -2175,6 +2204,7 @@ declare namespace appAccount { * @syscap SystemCapability.Account.AppAccount * @since 8 * @deprecated since 9 + * @useinstead appAccount.AuthTokenInfo.authType */ authType: string; @@ -2185,6 +2215,7 @@ declare namespace appAccount { * @syscap SystemCapability.Account.AppAccount * @since 8 * @deprecated since 9 + * @useinstead appAccount.AuthTokenInfo.token */ token: string; } @@ -2245,20 +2276,22 @@ declare namespace appAccount { /** * The icon id of an authenticator. * - * @type { number } + * @type { long } * @syscap SystemCapability.Account.AppAccount - * @since 8 + * @since arkts {'1.1':'8', '1.2':'20'} + * @arkts 1.1&1.2 */ - iconId: number; + iconId: long; /** * The label id of an authenticator. * - * @type { number } + * @type { long } * @syscap SystemCapability.Account.AppAccount - * @since 8 + * @since arkts {'1.1':'8', '1.2':'20'} + * @arkts 1.1&1.2 */ - labelId: number; + labelId: long; } /** @@ -2344,6 +2377,19 @@ declare namespace appAccount { * @since 9 */ parameters?: Record; + + /** + * The authenticator-specific parameters. + * The list of reserved parameter name: + * 1. Constants.KEY_CALLER_BUNDLE_NAME; + * The above parameters are set by the appAccount management service and can be used for identify the caller. + * + * @type { ?RecordData } + * @syscap SystemCapability.Account.AppAccount + * @since 20 + * @arkts 1.2 + */ + parameters?: RecordData; } /** @@ -2419,6 +2465,19 @@ declare namespace appAccount { * @since 9 */ parameters?: Record; + + /** + * The authenticator-specific parameters. + * The list of reserved parameter name: + * 1. Constants.KEY_CALLER_BUNDLE_NAME; + * The above parameters are set by the appAccount management service and can be used for identify the caller. + * + * @type { ?RecordData } + * @syscap SystemCapability.Account.AppAccount + * @since 20 + * @arkts 1.2 + */ + parameters?: RecordData; } /** @@ -2438,6 +2497,16 @@ declare namespace appAccount { */ properties?: Record; + /** + * The properties to be set. + * + * @type { ?RecordData } + * @syscap SystemCapability.Account.AppAccount + * @since 20 + * @arkts 1.2 + */ + properties?: RecordData; + /** * The authenticator-specific parameters. * The list of reserved parameter name: @@ -2449,6 +2518,19 @@ declare namespace appAccount { * @since 9 */ parameters?: Record; + + /** + * The authenticator-specific parameters. + * The list of reserved parameter name: + * 1. Constants.KEY_CALLER_BUNDLE_NAME; + * The above parameters are set by the appAccount management service and can be used for identify the caller. + * + * @type { ?RecordData } + * @syscap SystemCapability.Account.AppAccount + * @since 20 + * @arkts 1.2 + */ + parameters?: RecordData; } /** @@ -2610,174 +2692,174 @@ declare namespace appAccount { */ enum ResultCode { /** - * Indicates the success result. - * - * @syscap SystemCapability.Account.AppAccount - * @since 8 - * @deprecated since 9 - */ + * Indicates the success result. + * + * @syscap SystemCapability.Account.AppAccount + * @since 8 + * @deprecated since 9 + */ SUCCESS = 0, /** - * Indicates the result of account not exist. - * - * @syscap SystemCapability.Account.AppAccount - * @since 8 - * @deprecated since 9 - */ + * Indicates the result of account not exist. + * + * @syscap SystemCapability.Account.AppAccount + * @since 8 + * @deprecated since 9 + */ ERROR_ACCOUNT_NOT_EXIST = 10001, /** - * Indicates the result of account service exception. - * - * @syscap SystemCapability.Account.AppAccount - * @since 8 - * @deprecated since 9 - */ + * Indicates the result of account service exception. + * + * @syscap SystemCapability.Account.AppAccount + * @since 8 + * @deprecated since 9 + */ ERROR_APP_ACCOUNT_SERVICE_EXCEPTION = 10002, /** - * Indicates the result of password is invalid. - * - * @syscap SystemCapability.Account.AppAccount - * @since 8 - * @deprecated since 9 - */ + * Indicates the result of password is invalid. + * + * @syscap SystemCapability.Account.AppAccount + * @since 8 + * @deprecated since 9 + */ ERROR_INVALID_PASSWORD = 10003, /** - * Indicates the result of request is invalid. - * - * @syscap SystemCapability.Account.AppAccount - * @since 8 - * @deprecated since 9 - */ + * Indicates the result of request is invalid. + * + * @syscap SystemCapability.Account.AppAccount + * @since 8 + * @deprecated since 9 + */ ERROR_INVALID_REQUEST = 10004, /** - * Indicates the result of response is invalid. - * - * @syscap SystemCapability.Account.AppAccount - * @since 8 - * @deprecated since 9 - */ + * Indicates the result of response is invalid. + * + * @syscap SystemCapability.Account.AppAccount + * @since 8 + * @deprecated since 9 + */ ERROR_INVALID_RESPONSE = 10005, /** - * Indicates the result of network exception. - * - * @syscap SystemCapability.Account.AppAccount - * @since 8 - * @deprecated since 9 - */ + * Indicates the result of network exception. + * + * @syscap SystemCapability.Account.AppAccount + * @since 8 + * @deprecated since 9 + */ ERROR_NETWORK_EXCEPTION = 10006, /** - * Indicates the result of network exception. - * - * @syscap SystemCapability.Account.AppAccount - * @since 8 - * @deprecated since 9 - */ + * Indicates the result of network exception. + * + * @syscap SystemCapability.Account.AppAccount + * @since 8 + * @deprecated since 9 + */ ERROR_OAUTH_AUTHENTICATOR_NOT_EXIST = 10007, /** - * Indicates the result of auth has been canceled. - * - * @syscap SystemCapability.Account.AppAccount - * @since 8 - * @deprecated since 9 - */ + * Indicates the result of auth has been canceled. + * + * @syscap SystemCapability.Account.AppAccount + * @since 8 + * @deprecated since 9 + */ ERROR_OAUTH_CANCELED = 10008, /** - * Indicates the result of auth list is too large. - * - * @syscap SystemCapability.Account.AppAccount - * @since 8 - * @deprecated since 9 - */ + * Indicates the result of auth list is too large. + * + * @syscap SystemCapability.Account.AppAccount + * @since 8 + * @deprecated since 9 + */ ERROR_OAUTH_LIST_TOO_LARGE = 10009, /** - * Indicates the result of auth service is busy. - * - * @syscap SystemCapability.Account.AppAccount - * @since 8 - * @deprecated since 9 - */ + * Indicates the result of auth service is busy. + * + * @syscap SystemCapability.Account.AppAccount + * @since 8 + * @deprecated since 9 + */ ERROR_OAUTH_SERVICE_BUSY = 10010, /** - * Indicates the result of auth service exception. - * - * @syscap SystemCapability.Account.AppAccount - * @since 8 - * @deprecated since 9 - */ + * Indicates the result of auth service exception. + * + * @syscap SystemCapability.Account.AppAccount + * @since 8 + * @deprecated since 9 + */ ERROR_OAUTH_SERVICE_EXCEPTION = 10011, /** - * Indicates the result of auth session is not exist. - * - * @syscap SystemCapability.Account.AppAccount - * @since 8 - * @deprecated since 9 - */ + * Indicates the result of auth session is not exist. + * + * @syscap SystemCapability.Account.AppAccount + * @since 8 + * @deprecated since 9 + */ ERROR_OAUTH_SESSION_NOT_EXIST = 10012, /** - * Indicates the result of auth timeout. - * - * @syscap SystemCapability.Account.AppAccount - * @since 8 - * @deprecated since 9 - */ + * Indicates the result of auth timeout. + * + * @syscap SystemCapability.Account.AppAccount + * @since 8 + * @deprecated since 9 + */ ERROR_OAUTH_TIMEOUT = 10013, /** - * Indicates the result of token is not exist. - * - * @syscap SystemCapability.Account.AppAccount - * @since 8 - * @deprecated since 9 - */ + * Indicates the result of token is not exist. + * + * @syscap SystemCapability.Account.AppAccount + * @since 8 + * @deprecated since 9 + */ ERROR_OAUTH_TOKEN_NOT_EXIST = 10014, /** - * Indicates the result of token is too many. - * - * @syscap SystemCapability.Account.AppAccount - * @since 8 - * @deprecated since 9 - */ + * Indicates the result of token is too many. + * + * @syscap SystemCapability.Account.AppAccount + * @since 8 + * @deprecated since 9 + */ ERROR_OAUTH_TOKEN_TOO_MANY = 10015, /** - * Indicates the result of not supported action. - * - * @syscap SystemCapability.Account.AppAccount - * @since 8 - * @deprecated since 9 - */ + * Indicates the result of not supported action. + * + * @syscap SystemCapability.Account.AppAccount + * @since 8 + * @deprecated since 9 + */ ERROR_OAUTH_UNSUPPORT_ACTION = 10016, /** - * Indicates the result of not supported auth type. - * - * @syscap SystemCapability.Account.AppAccount - * @since 8 - * @deprecated since 9 - */ + * Indicates the result of not supported auth type. + * + * @syscap SystemCapability.Account.AppAccount + * @since 8 + * @deprecated since 9 + */ ERROR_OAUTH_UNSUPPORT_AUTH_TYPE = 10017, /** - * Indicates the result of permission denied. - * - * @syscap SystemCapability.Account.AppAccount - * @since 8 - * @deprecated since 9 - */ + * Indicates the result of permission denied. + * + * @syscap SystemCapability.Account.AppAccount + * @since 8 + * @deprecated since 9 + */ ERROR_PERMISSION_DENIED = 10018 } @@ -2798,6 +2880,7 @@ declare namespace appAccount { * @syscap SystemCapability.Account.AppAccount * @since 8 * @deprecated since 9 + * @useinstead AppAccount.AuthCallback.onResult */ onResult: (code: number, result: { [key: string]: any }) => void; @@ -2808,6 +2891,7 @@ declare namespace appAccount { * @syscap SystemCapability.Account.AppAccount * @since 8 * @deprecated since 9 + * @useinstead AppAccount.AuthCallback.onRequestRedirected */ onRequestRedirected: (request: Want) => void; } @@ -2825,9 +2909,10 @@ declare namespace appAccount { * * @type { function } * @syscap SystemCapability.Account.AppAccount - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - onResult: (code: number, result?: AuthResult) => void; + onResult: (code: int, result?: AuthResult) => void; /** * Notifies the client that the authentication request need to be redirected. @@ -2918,6 +3003,19 @@ declare namespace appAccount { */ auth(name: string, authType: string, options: Record, callback: AuthCallback): void; + /** + * Authenticates an application account to get an oauth token. + * + * @param { string } name - Indicates the account name. + * @param { string } authType - Indicates the authentication type. + * @param { RecordData } options - Indicates the authenticator-specific options for the request. + * @param { AuthCallback } callback - Indicates the authenticator callback. + * @syscap SystemCapability.Account.AppAccount + * @since 20 + * @arkts 1.2 + */ + auth(name: string, authType: string, options: RecordData, callback: AuthCallback): void; + /** * Verifies the credential to ensure the user is the owner of the specified application account. *

@@ -2974,4 +3072,4 @@ declare namespace appAccount { } } -export default appAccount; +export default appAccount; \ No newline at end of file diff --git a/api/@ohos.account.distributedAccount.d.ts b/api/@ohos.account.distributedAccount.d.ts index f114ba51a95de44cc302c8b59ba7ea1ad3073844..6cfa6b7be135de119249b839a2d1859bb719a9b8 100644 --- a/api/@ohos.account.distributedAccount.d.ts +++ b/api/@ohos.account.distributedAccount.d.ts @@ -19,6 +19,9 @@ */ import type { AsyncCallback } from './@ohos.base'; +/*** if arkts 1.2 */ +import type { RecordData } from './@ohos.base'; +/*** endif */ /** * This module provides the capability to manage distributed accounts. @@ -99,12 +102,12 @@ declare namespace distributedAccount { * Gets the distributed information of the specified OS account. * * @permission ohos.permission.MANAGE_DISTRIBUTED_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS - * @param { number } localId - Indicates the local ID of the specified OS account. + * @param { int } localId - Indicates the local ID of the specified OS account. * @param { AsyncCallback } callback - Asynchronous callback interface. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Not system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. - *
2. Incorrect parameter types. + *
2. Incorrect parameter types. * @throws { BusinessError } 12300001 - System service exception. * @throws { BusinessError } 12300003 - Account not found. * @syscap SystemCapability.Account.OsAccount @@ -115,8 +118,8 @@ declare namespace distributedAccount { * Gets the distributed information of the specified OS account. * * @permission ohos.permission.MANAGE_DISTRIBUTED_ACCOUNTS or (ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS and - * ohos.permission.GET_DISTRIBUTED_ACCOUNTS) - * @param { number } localId - Indicates the local ID of the specified OS account. + * ohos.permission.GET_DISTRIBUTED_ACCOUNTS) + * @param { int } localId - Indicates the local ID of the specified OS account. * @param { AsyncCallback } callback - Asynchronous callback interface. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Not system application. @@ -125,19 +128,20 @@ declare namespace distributedAccount { * @syscap SystemCapability.Account.OsAccount * @systemapi * @since 20 + * @arkts 1.1&1.2 */ - getOsAccountDistributedInfoByLocalId(localId: number, callback: AsyncCallback): void; + getOsAccountDistributedInfoByLocalId(localId: int, callback: AsyncCallback): void; /** * Gets the distributed information of the specified OS account. * * @permission ohos.permission.MANAGE_DISTRIBUTED_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS - * @param { number } localId - Indicates the local ID of the specified OS account. + * @param { int } localId - Indicates the local ID of the specified OS account. * @returns { Promise } The distributed information of the specified OS account. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Not system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. - *
2. Incorrect parameter types. + *
2. Incorrect parameter types. * @throws { BusinessError } 12300001 - System service exception. * @throws { BusinessError } 12300003 - Account not found. * @syscap SystemCapability.Account.OsAccount @@ -148,8 +152,8 @@ declare namespace distributedAccount { * Gets the distributed information of the specified OS account. * * @permission ohos.permission.MANAGE_DISTRIBUTED_ACCOUNTS or (ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS and - * ohos.permission.GET_DISTRIBUTED_ACCOUNTS) - * @param { number } localId - Indicates the local ID of the specified OS account. + * ohos.permission.GET_DISTRIBUTED_ACCOUNTS) + * @param { int } localId - Indicates the local ID of the specified OS account. * @returns { Promise } The distributed information of the specified OS account. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Not system application. @@ -158,8 +162,9 @@ declare namespace distributedAccount { * @syscap SystemCapability.Account.OsAccount * @systemapi * @since 20 + * @arkts 1.1&1.2 */ - getOsAccountDistributedInfoByLocalId(localId: number): Promise; + getOsAccountDistributedInfoByLocalId(localId: int): Promise; /** * Updates the distributed information of the OS account. @@ -194,7 +199,7 @@ declare namespace distributedAccount { * @param { DistributedInfo } accountInfo - Indicates the information of the OS account used for a distributed system. * @param { AsyncCallback } callback - Asynchronous callback interface. * @throws { BusinessError } 201 - Permission denied. - * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. * @throws { BusinessError } 12300001 - System service exception. * @throws { BusinessError } 12300002 - Invalid accountInfo. @@ -227,7 +232,7 @@ declare namespace distributedAccount { * Sets the distributed information of the specified OS account. * * @permission ohos.permission.MANAGE_DISTRIBUTED_ACCOUNTS - * @param { number } localId - Indicates the local ID of the OS account. + * @param { int } localId - Indicates the local ID of the OS account. * @param { DistributedInfo } distributedInfo - Indicates the distributed information. * @param { AsyncCallback } callback - Asynchronous callback interface. * @throws { BusinessError } 201 - Permission denied. @@ -240,19 +245,16 @@ declare namespace distributedAccount { * @throws { BusinessError } 12300008 - Restricted OS account. * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ - setOsAccountDistributedInfoByLocalId( - localId: number, - distributedInfo: DistributedInfo, - callback: AsyncCallback - ): void; + setOsAccountDistributedInfoByLocalId(localId: int, distributedInfo: DistributedInfo, callback: AsyncCallback): void; /** * Sets the distributed information of the specified OS account. * * @permission ohos.permission.MANAGE_DISTRIBUTED_ACCOUNTS - * @param { number } localId - Indicates the local ID of the OS account. + * @param { int } localId - Indicates the local ID of the OS account. * @param { DistributedInfo } distributedInfo - Indicates the distributed information. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 201 - Permission denied. @@ -265,17 +267,19 @@ declare namespace distributedAccount { * @throws { BusinessError } 12300008 - Restricted OS account. * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ - setOsAccountDistributedInfoByLocalId(localId: number, distributedInfo: DistributedInfo): Promise; + setOsAccountDistributedInfoByLocalId(localId: int, distributedInfo: DistributedInfo): Promise; } /** * Enum for distributed account status. * - * @enum { number } + * @enum { int } * @syscap SystemCapability.Account.OsAccount - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ enum DistributedAccountStatus { /** @@ -366,6 +370,16 @@ declare namespace distributedAccount { * @since 8 */ scalableData?: object; + + /** + * The scalable data in the distributed information of the OS account. + * + * @type { ?RecordData } + * @syscap SystemCapability.Account.OsAccount + * @since 20 + * @arkts 1.2 + */ + scalableData?: RecordData; } } diff --git a/api/@ohos.account.osAccount.d.ts b/api/@ohos.account.osAccount.d.ts index fb6e3a5dfdbd6c2e6aeb568adb202ca550bde140..60a8ccf1c69e3f0f5c897b10a2ee76029adf8e8d 100644 --- a/api/@ohos.account.osAccount.d.ts +++ b/api/@ohos.account.osAccount.d.ts @@ -20,6 +20,9 @@ import type distributedAccount from './@ohos.account.distributedAccount'; import type { AsyncCallback, Callback } from './@ohos.base'; +/*** if arkts 1.2 */ +import type { RecordData } from './@ohos.base'; +/*** endif */ /** * This module provides the capability to manage os accounts. @@ -55,7 +58,7 @@ declare namespace osAccount { *

* * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION - * @param { number } localId - Indicates the local ID of the OS account. + * @param { int } localId - Indicates the local ID of the OS account. * @param { AsyncCallback } callback - Asynchronous callback interface. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Not system application. @@ -79,7 +82,7 @@ declare namespace osAccount { *

* * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION - * @param { number } localId - Indicates the local ID of the OS account. + * @param { int } localId - Indicates the local ID of the OS account. * @param { AsyncCallback } callback - Asynchronous callback interface. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Not system application. @@ -93,9 +96,10 @@ declare namespace osAccount { * @throws { BusinessError } 12300016 - The number of logged in accounts reaches the upper limit. * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - activateOsAccount(localId: number, callback: AsyncCallback): void; + activateOsAccount(localId: int, callback: AsyncCallback): void; /** * Activates a specified OS account. @@ -106,7 +110,7 @@ declare namespace osAccount { *

* * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION - * @param { number } localId - Indicates the local ID of the OS account. + * @param { int } localId - Indicates the local ID of the OS account. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Not system application. @@ -130,7 +134,7 @@ declare namespace osAccount { *

* * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION - * @param { number } localId - Indicates the local ID of the OS account. + * @param { int } localId - Indicates the local ID of the OS account. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Not system application. @@ -144,15 +148,16 @@ declare namespace osAccount { * @throws { BusinessError } 12300016 - The number of logged in accounts reaches the upper limit. * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - activateOsAccount(localId: number): Promise; + activateOsAccount(localId: int): Promise; /** * Deactivates a specified OS account. * * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION - * @param { number } localId - Indicates the local ID of the OS account. + * @param { int } localId - Indicates the local ID of the OS account. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Not system application. @@ -164,9 +169,10 @@ declare namespace osAccount { * @throws { BusinessError } 12300010 - Service busy. Possible causes: The target account is being operated. * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - deactivateOsAccount(localId: number): Promise; + deactivateOsAccount(localId: int): Promise; /** * Checks whether the function of supporting multiple OS accounts is enabled. @@ -278,7 +284,7 @@ declare namespace osAccount { * Checks whether an OS account is activated based on its local ID. * * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS - * @param { number } localId - Indicates the local ID of the OS account. + * @param { int } localId - Indicates the local ID of the OS account. * @returns { Promise } - Returns {@code true} if the OS account is activated; returns {@code false} otherwise. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Not system application. @@ -288,9 +294,10 @@ declare namespace osAccount { * @throws { BusinessError } 12300003 - Account not found. * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 11 + * @since arkts {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - isOsAccountActivated(localId: number): Promise; + isOsAccountActivated(localId: int): Promise; /** * Checks whether a constraint has been enabled for an OS account based on its local ID. @@ -401,7 +408,7 @@ declare namespace osAccount { * Checks whether the given constraint is enabled for the specified OS account. * * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS - * @param { number } localId - Indicates the local ID of the OS account. + * @param { int } localId - Indicates the local ID of the OS account. * @param { string } constraint - Indicates the constraint to check. For example: the value can be: *
{@code constraint.wifi.set} - Indicates the constraint on configuring the Wi-Fi access point. *
{@code constraint.sms.use} - Indicates the constraint on sending and receiving short messages. @@ -417,9 +424,10 @@ declare namespace osAccount { * @throws { BusinessError } 12300003 - Account not found. * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 11 + * @since arkts {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - isOsAccountConstraintEnabled(localId: number, constraint: string): Promise; + isOsAccountConstraintEnabled(localId: int, constraint: string): Promise; /** * Checks whether this OS account is a test OS account. @@ -580,7 +588,7 @@ declare namespace osAccount { * Checks whether the specified OS account is unlocked. * * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS - * @param { number } localId - Indicates the local ID of the OS account. + * @param { int } localId - Indicates the local ID of the OS account. * @returns { Promise } Returns whether the specified OS account is unlocked. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Not system application. @@ -590,15 +598,16 @@ declare namespace osAccount { * @throws { BusinessError } 12300003 - Account not found. * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 11 + * @since arkts {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - isOsAccountUnlocked(localId: number): Promise; + isOsAccountUnlocked(localId: int): Promise; /** * Removes an OS account based on its local ID. * * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS - * @param { number } localId - Indicates the local ID of the OS account. + * @param { int } localId - Indicates the local ID of the OS account. * @param { AsyncCallback } callback - Indicates the callback for removing the specified OS account. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Not system application. @@ -611,15 +620,16 @@ declare namespace osAccount { * @throws { BusinessError } 12300010 - Service busy. Possible causes: The target account is being operated. * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 7 + * @since arkts {'1.1':'7', '1.2':'20'} + * @arkts 1.1&1.2 */ - removeOsAccount(localId: number, callback: AsyncCallback): void; + removeOsAccount(localId: int, callback: AsyncCallback): void; /** * Removes an OS account based on its local ID. * * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS - * @param { number } localId - Indicates the local ID of the OS account. + * @param { int } localId - Indicates the local ID of the OS account. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Not system application. @@ -632,15 +642,16 @@ declare namespace osAccount { * @throws { BusinessError } 12300010 - Service busy. Possible causes: The target account is being operated. * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 7 + * @since arkts {'1.1':'7', '1.2':'20'} + * @arkts 1.1&1.2 */ - removeOsAccount(localId: number): Promise; + removeOsAccount(localId: int): Promise; /** * Sets constraints for an OS account based on its local ID. * * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS - * @param { number } localId - Indicates the local ID of the OS account. + * @param { int } localId - Indicates the local ID of the OS account. * @param { Array } constraints - Indicates the constraints to set for the OS account. The value can be: *
{@code constraint.wifi.set} - Indicates the constraint on configuring the Wi-Fi access point. *
{@code constraint.sms.use} - Indicates the constraint on sending and receiving short messages. @@ -659,20 +670,17 @@ declare namespace osAccount { * @throws { BusinessError } 12300008 - Restricted Account. * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 7 + * @since arkts {'1.1':'7', '1.2':'20'} + * @arkts 1.1&1.2 */ - setOsAccountConstraints( - localId: number, - constraints: Array, - enable: boolean, - callback: AsyncCallback - ): void; + setOsAccountConstraints(localId: int, constraints: Array, enable: boolean, + callback: AsyncCallback): void; /** * Sets constraints for an OS account based on its local ID. * * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS - * @param { number } localId - Indicates the local ID of the OS account. + * @param { int } localId - Indicates the local ID of the OS account. * @param { Array } constraints - Indicates the constraints to set for the OS account. The value can be: *
{@code constraint.wifi.set} - Indicates the constraint on configuring the Wi-Fi access point. *
{@code constraint.sms.use} - Indicates the constraint on sending and receiving short messages. @@ -691,15 +699,16 @@ declare namespace osAccount { * @throws { BusinessError } 12300008 - Restricted Account. * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 7 + * @since arkts {'1.1':'7', '1.2':'20'} + * @arkts 1.1&1.2 */ - setOsAccountConstraints(localId: number, constraints: Array, enable: boolean): Promise; + setOsAccountConstraints(localId: int, constraints: Array, enable: boolean): Promise; /** * Sets the local name for an OS account based on its local ID. * * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS - * @param { number } localId - Indicates the local ID of the OS account. + * @param { int } localId - Indicates the local ID of the OS account. * @param { string } localName - Indicates the local name to set for the OS account. * @param { AsyncCallback } callback - Indicates the callback for setting the specified OS account name. * @throws { BusinessError } 201 - Permission denied. @@ -712,15 +721,16 @@ declare namespace osAccount { * @throws { BusinessError } 12300008 - Restricted Account. * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 7 + * @since arkts {'1.1':'7', '1.2':'20'} + * @arkts 1.1&1.2 */ - setOsAccountName(localId: number, localName: string, callback: AsyncCallback): void; + setOsAccountName(localId: int, localName: string, callback: AsyncCallback): void; /** * Sets the local name for an OS account based on its local ID. * * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS - * @param { number } localId - Indicates the local ID of the OS account. + * @param { int } localId - Indicates the local ID of the OS account. * @param { string } localName - Indicates the local name to set for the OS account. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 201 - Permission denied. @@ -733,9 +743,10 @@ declare namespace osAccount { * @throws { BusinessError } 12300008 - Restricted Account. * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 7 + * @since arkts {'1.1':'7', '1.2':'20'} + * @arkts 1.1&1.2 */ - setOsAccountName(localId: number, localName: string): Promise; + setOsAccountName(localId: int, localName: string): Promise; /** * Gets the name of the OS account to which the caller belongs. @@ -775,29 +786,31 @@ declare namespace osAccount { * Obtains the number of all OS accounts created on a device. * * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS - * @param { AsyncCallback } callback - Returns the number of created OS accounts. + * @param { AsyncCallback } callback - Returns the number of created OS accounts. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. * @throws { BusinessError } 12300001 - The system service works abnormally. * @syscap SystemCapability.Account.OsAccount * This API can be called only by system applications. - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - getOsAccountCount(callback: AsyncCallback): void; + getOsAccountCount(callback: AsyncCallback): void; /** * Obtains the number of all OS accounts created on a device. * * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS - * @returns { Promise } Returns the number of created OS accounts. + * @returns { Promise } Returns the number of created OS accounts. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 12300001 - The system service works abnormally. * @syscap SystemCapability.Account.OsAccount * This API can be called only by system applications. - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - getOsAccountCount(): Promise; + getOsAccountCount(): Promise; /** * Obtains the local ID of an OS account from the current process UID. @@ -824,24 +837,26 @@ declare namespace osAccount { /** * Gets the local ID of the current OS account. * - * @param { AsyncCallback } callback - Indicates the callback for getting the local ID of the current OS account. + * @param { AsyncCallback } callback - Indicates the callback for getting the local ID of the current OS account. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. * @throws { BusinessError } 12300001 - The system service works abnormally. * @syscap SystemCapability.Account.OsAccount - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - getOsAccountLocalId(callback: AsyncCallback): void; + getOsAccountLocalId(callback: AsyncCallback): void; /** * Get the local ID of the current OS account. * - * @returns { Promise } Returns the local ID of the current account. + * @returns { Promise } Returns the local ID of the current account. * @throws { BusinessError } 12300001 - The system service works abnormally. * @syscap SystemCapability.Account.OsAccount - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - getOsAccountLocalId(): Promise; + getOsAccountLocalId(): Promise; /** * Gets the local ID of an OS account from the process UID @@ -870,43 +885,46 @@ declare namespace osAccount { /** * Gets the local ID of the OS account associated with the specified UID. * - * @param { number } uid - Indicates the process UID. - * @param { AsyncCallback } callback - Indicates the callback for getting the local ID of the OS account associated with the specified UID. + * @param { int } uid - Indicates the process UID. + * @param { AsyncCallback } callback - Indicates the callback for getting the local ID of the OS account associated with the specified UID. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. * @throws { BusinessError } 12300001 - The system service works abnormally. * @throws { BusinessError } 12300002 - Invalid uid. * @syscap SystemCapability.Account.OsAccount - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - getOsAccountLocalIdForUid(uid: number, callback: AsyncCallback): void; + getOsAccountLocalIdForUid(uid: int, callback: AsyncCallback): void; /** * Get the local ID of the OS account associated with the specified UID. * - * @param { number } uid - Indicates the process UID. - * @returns { Promise } - Returns the local ID of the OS account associated with the specified UID. + * @param { int } uid - Indicates the process UID. + * @returns { Promise } - Returns the local ID of the OS account associated with the specified UID. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. * @throws { BusinessError } 12300001 - The system service works abnormally. * @throws { BusinessError } 12300002 - Invalid uid. * @syscap SystemCapability.Account.OsAccount - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - getOsAccountLocalIdForUid(uid: number): Promise; + getOsAccountLocalIdForUid(uid: int): Promise; /** * Gets the local ID of the OS account associated with the specified UID synchronously. * - * @param { number } uid - Indicates the process UID. - * @returns { number } Returns the local ID of the OS account associated with the specified UID. + * @param { int } uid - Indicates the process UID. + * @returns { int } Returns the local ID of the OS account associated with the specified UID. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. * @throws { BusinessError } 12300002 - Invalid uid. * @syscap SystemCapability.Account.OsAccount - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ - getOsAccountLocalIdForUidSync(uid: number): number; + getOsAccountLocalIdForUidSync(uid: int): int; /** * Queries the local ID of an OS account which is bound to the specified domain account. @@ -939,7 +957,7 @@ declare namespace osAccount { * * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS * @param { DomainAccountInfo } domainInfo - Indicates the domain account info. - * @param { AsyncCallback } callback - Indicates the callback for + * @param { AsyncCallback } callback - Indicates the callback for * getting the local ID of the OS account associated with the specified domain account. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. @@ -948,16 +966,17 @@ declare namespace osAccount { * @throws { BusinessError } 12300002 - Invalid domainInfo. * @syscap SystemCapability.Account.OsAccount * This API can be called only by system applications. - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - getOsAccountLocalIdForDomain(domainInfo: DomainAccountInfo, callback: AsyncCallback): void; + getOsAccountLocalIdForDomain(domainInfo: DomainAccountInfo, callback: AsyncCallback): void; /** * Gets the local ID of the OS account associated with the specified domain account. * * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS * @param { DomainAccountInfo } domainInfo - Indicates the domain account info. - * @returns { Promise } Returns the local ID of the OS account associated with the specified domain account. + * @returns { Promise } Returns the local ID of the OS account associated with the specified domain account. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. @@ -965,47 +984,51 @@ declare namespace osAccount { * @throws { BusinessError } 12300002 - Invalid domainInfo. * @syscap SystemCapability.Account.OsAccount * This API can be called only by system applications. - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - getOsAccountLocalIdForDomain(domainInfo: DomainAccountInfo): Promise; + getOsAccountLocalIdForDomain(domainInfo: DomainAccountInfo): Promise; /** * Queries the maximum number of OS accounts that can be created on a device. * - * @param { AsyncCallback } callback - Returns the maximum number of OS accounts that can be created. + * @param { AsyncCallback } callback - Returns the maximum number of OS accounts that can be created. * @throws { BusinessError } 202 - Not system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. * @throws { BusinessError } 12300001 - The system service works abnormally. * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 7 + * @since arkts {'1.1':'7', '1.2':'20'} + * @arkts 1.1&1.2 */ - queryMaxOsAccountNumber(callback: AsyncCallback): void; + queryMaxOsAccountNumber(callback: AsyncCallback): void; /** * Queries the maximum number of OS accounts that can be created on a device. * - * @returns { Promise } Returns the maximum number of OS accounts that can be created. + * @returns { Promise } Returns the maximum number of OS accounts that can be created. * @throws { BusinessError } 202 - Not system application. * @throws { BusinessError } 12300001 - The system service works abnormally. * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 7 + * @since arkts {'1.1':'7', '1.2':'20'} + * @arkts 1.1&1.2 */ - queryMaxOsAccountNumber(): Promise; + queryMaxOsAccountNumber(): Promise; /** * Queries the maximum number of OS accounts that can be logged in. * - * @returns { Promise } Returns the maximum number of OS accounts that can be logged in. + * @returns { Promise } Returns the maximum number of OS accounts that can be logged in. * @throws { BusinessError } 202 - Not system application. * @throws { BusinessError } 12300001 - The system service works abnormally. * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - queryMaxLoggedInOsAccountNumber(): Promise; + queryMaxLoggedInOsAccountNumber(): Promise; /** * Obtains all constraints of an OS account based on its local ID. @@ -1073,7 +1096,7 @@ declare namespace osAccount { * Gets all enabled constraints of the specified OS account by its local ID. * * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS - * @param { number } localId - Indicates the local ID of the OS account. + * @param { int } localId - Indicates the local ID of the OS account. * @returns { Promise> } Returns a list of constraints. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Not system application. @@ -1083,9 +1106,10 @@ declare namespace osAccount { * @throws { BusinessError } 12300003 - Account not found. * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 11 + * @since arkts {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - getEnabledOsAccountConstraints(localId: number): Promise>; + getEnabledOsAccountConstraints(localId: int): Promise>; /** * Queries the list of all the OS accounts that have been created in the system. @@ -1142,34 +1166,37 @@ declare namespace osAccount { /** * Gets the local IDs of all activated OS accounts. * - * @param { AsyncCallback> } callback - Indicates the callback for getting the local IDs of all activated OS accounts. + * @param { AsyncCallback> } callback - Indicates the callback for getting the local IDs of all activated OS accounts. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. * @throws { BusinessError } 12300001 - The system service works abnormally. * @syscap SystemCapability.Account.OsAccount - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - getActivatedOsAccountLocalIds(callback: AsyncCallback>): void; + getActivatedOsAccountLocalIds(callback: AsyncCallback>): void; /** * Gets the local IDs of all activated OS accounts. * - * @returns { Promise> } Returns all activated accounts. + * @returns { Promise> } Returns all activated accounts. * @throws { BusinessError } 12300001 - The system service works abnormally. * @syscap SystemCapability.Account.OsAccount - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - getActivatedOsAccountLocalIds(): Promise>; + getActivatedOsAccountLocalIds(): Promise>; /** * Gets the local ID of the foreground OS account. * - * @returns { Promise } Returns local ID of the foreground OS account. + * @returns { Promise } Returns local ID of the foreground OS account. * @throws { BusinessError } 12300001 - The system service works abnormally. * @syscap SystemCapability.Account.OsAccount - * @since 15 + * @since arkts {'1.1':'15', '1.2':'20'} + * @arkts 1.1&1.2 */ - getForegroundOsAccountLocalId(): Promise; + getForegroundOsAccountLocalId(): Promise; /** * Creates an OS account using the local name and account type. @@ -1457,7 +1484,7 @@ declare namespace osAccount { * Queries OS account information based on the local ID. * * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION - * @param { number } localId - Indicates the local ID of the OS account. + * @param { int } localId - Indicates the local ID of the OS account. * @param { AsyncCallback } callback - Returns the OS account information; returns {@code null} if the query fails. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Not system application. @@ -1468,15 +1495,16 @@ declare namespace osAccount { * @throws { BusinessError } 12300003 - Account not found. * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 7 + * @since arkts {'1.1':'7', '1.2':'20'} + * @arkts 1.1&1.2 */ - queryOsAccountById(localId: number, callback: AsyncCallback): void; + queryOsAccountById(localId: int, callback: AsyncCallback): void; /** * Queries OS account information based on the local ID. * * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION - * @param { number } localId - Indicates the local ID of the OS account. + * @param { int } localId - Indicates the local ID of the OS account. * @returns { Promise } Returns the OS account information; returns {@code null} if the query fails. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Not system application. @@ -1487,9 +1515,10 @@ declare namespace osAccount { * @throws { BusinessError } 12300003 - Account not found. * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 7 + * @since arkts {'1.1':'7', '1.2':'20'} + * @arkts 1.1&1.2 */ - queryOsAccountById(localId: number): Promise; + queryOsAccountById(localId: int): Promise; /** * Gets the domain account information associated with the specified OS account. @@ -1507,6 +1536,21 @@ declare namespace osAccount { */ getOsAccountDomainInfo(localId: number): Promise; + /** + * Gets the domain account information associated with the specified OS account. + * + * @permission ohos.permission.GET_DOMAIN_ACCOUNTS and ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS + * @param { int } localId - Indicates the local ID of the specified OS account. + * @returns { Promise } Returns the domain account information. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 12300001 - The system service works abnormally. + * @throws { BusinessError } 12300003 - OS account not found. + * @syscap SystemCapability.Account.OsAccount + * @since 20 + * @arkts 1.2 + */ + getOsAccountDomainInfo(localId: int): Promise; + /** * Obtains the type of this OS account from the current process. * @@ -1559,7 +1603,7 @@ declare namespace osAccount { * Gets the type of the specified OS account. * * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS - * @param { number } localId - Indicates the local ID of the OS account. + * @param { int } localId - Indicates the local ID of the OS account. * @returns { Promise } Returns the OS account type. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Not system application. @@ -1569,9 +1613,10 @@ declare namespace osAccount { * @throws { BusinessError } 12300003 - Account not found. * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - getOsAccountType(localId: number): Promise; + getOsAccountType(localId: int): Promise; /** * Obtains the distributed virtual device ID (DVID). @@ -1651,7 +1696,7 @@ declare namespace osAccount { * Obtains the profile photo of an OS account based on its local ID. * * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS - * @param { number } localId - Indicates the local ID of the OS account. + * @param { int } localId - Indicates the local ID of the OS account. * @param { AsyncCallback } callback - Returns the profile photo if obtained; * returns {@code null} if the profile photo fails to be obtained. * @throws { BusinessError } 201 - Permission denied. @@ -1663,15 +1708,16 @@ declare namespace osAccount { * @throws { BusinessError } 12300003 - Account not found. * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 7 + * @since arkts {'1.1':'7', '1.2':'20'} + * @arkts 1.1&1.2 */ - getOsAccountProfilePhoto(localId: number, callback: AsyncCallback): void; + getOsAccountProfilePhoto(localId: int, callback: AsyncCallback): void; /** * Obtains the profile photo of an OS account based on its local ID. * * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS - * @param { number } localId - Indicates the local ID of the OS account. + * @param { int } localId - Indicates the local ID of the OS account. * @returns { Promise } Returns the profile photo if obtained; * returns {@code null} if the profile photo fails to be obtained. * @throws { BusinessError } 201 - Permission denied. @@ -1683,15 +1729,16 @@ declare namespace osAccount { * @throws { BusinessError } 12300003 - Account not found. * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 7 + * @since arkts {'1.1':'7', '1.2':'20'} + * @arkts 1.1&1.2 */ - getOsAccountProfilePhoto(localId: number): Promise; + getOsAccountProfilePhoto(localId: int): Promise; /** * Sets the profile photo for an OS account based on its local ID. * * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS - * @param { number } localId - Indicates the local ID of the OS account. + * @param { int } localId - Indicates the local ID of the OS account. * @param { string } photo - Indicates the profile photo to set for the OS account. * @param { AsyncCallback } callback - Asynchronous callback interface. * @throws { BusinessError } 201 - Permission denied. @@ -1704,15 +1751,16 @@ declare namespace osAccount { * @throws { BusinessError } 12300008 - Restricted Account. * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 7 + * @since arkts {'1.1':'7', '1.2':'20'} + * @arkts 1.1&1.2 */ - setOsAccountProfilePhoto(localId: number, photo: string, callback: AsyncCallback): void; + setOsAccountProfilePhoto(localId: int, photo: string, callback: AsyncCallback): void; /** * Sets the profile photo for an OS account based on its local ID. * * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS - * @param { number } localId - Indicates the local ID of the OS account. + * @param { int } localId - Indicates the local ID of the OS account. * @param { string } photo - Indicates the profile photo to set for the OS account. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 201 - Permission denied. @@ -1725,9 +1773,10 @@ declare namespace osAccount { * @throws { BusinessError } 12300008 - Restricted Account. * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 7 + * @since arkts {'1.1':'7', '1.2':'20'} + * @arkts 1.1&1.2 */ - setOsAccountProfilePhoto(localId: number, photo: string): Promise; + setOsAccountProfilePhoto(localId: int, photo: string): Promise; /** * Obtain localId according to serial number @@ -1756,32 +1805,34 @@ declare namespace osAccount { /** * Gets the local ID of the OS account associated with the serial number. * - * @param { number } serialNumber - Indicates serial number. - * @param { AsyncCallback } callback - Indicates the callback for getting the local ID of the OS account associated with the serial number. + * @param { long } serialNumber - Indicates serial number. + * @param { AsyncCallback } callback - Indicates the callback for getting the local ID of the OS account associated with the serial number. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. * @throws { BusinessError } 12300001 - The system service works abnormally. * @throws { BusinessError } 12300002 - Invalid serialNumber. - * @throws { BusinessError } 12300003 - The account indicated by serialNumber does not exist. + * @throws { BusinessError } 12300003 - The account indicated by serialNumber dose not exist. * @syscap SystemCapability.Account.OsAccount - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - getOsAccountLocalIdForSerialNumber(serialNumber: number, callback: AsyncCallback): void; + getOsAccountLocalIdForSerialNumber(serialNumber: long, callback: AsyncCallback): void; /** * Gets the local ID of the OS account associated with the serial number. * - * @param { number } serialNumber - Indicates serial number. - * @returns { Promise } Returns the local ID of the OS account associated with the serial number. + * @param { long } serialNumber - Indicates serial number. + * @returns { Promise } Returns the local ID of the OS account associated with the serial number. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. * @throws { BusinessError } 12300001 - The system service works abnormally. * @throws { BusinessError } 12300002 - Invalid serialNumber. - * @throws { BusinessError } 12300003 - The account indicated by serialNumber does not exist. + * @throws { BusinessError } 12300003 - The account indicated by serialNumber dose not exist. * @syscap SystemCapability.Account.OsAccount - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - getOsAccountLocalIdForSerialNumber(serialNumber: number): Promise; + getOsAccountLocalIdForSerialNumber(serialNumber: long): Promise; /** * Obtain serial number according to localId. @@ -1810,32 +1861,34 @@ declare namespace osAccount { /** * Gets the serial number for the specified os account local id. * - * @param { number } localId - Indicates the local ID of the OS account. - * @param { AsyncCallback } callback - Indicates the callback for getting the serial number for the specified os account local id. + * @param { int } localId - Indicates the local ID of the OS account. + * @param { AsyncCallback } callback - Indicates the callback for getting the serial number for the specified os account local id. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. * @throws { BusinessError } 12300001 - The system service works abnormally. * @throws { BusinessError } 12300002 - Invalid localId. * @throws { BusinessError } 12300003 - Account not found. * @syscap SystemCapability.Account.OsAccount - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - getSerialNumberForOsAccountLocalId(localId: number, callback: AsyncCallback): void; + getSerialNumberForOsAccountLocalId(localId: int, callback: AsyncCallback): void; /** * Gets the serial number for the specified os account local id. * - * @param { number } localId - Indicates the local ID of the OS account. - * @returns { Promise } Returns the serial number according to local ID. + * @param { int } localId - Indicates the local ID of the OS account. + * @returns { Promise } Returns the serial number according to local ID. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. * @throws { BusinessError } 12300001 - The system service works abnormally. * @throws { BusinessError } 12300002 - Invalid localId. * @throws { BusinessError } 12300003 - Account not found. * @syscap SystemCapability.Account.OsAccount - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - getSerialNumberForOsAccountLocalId(localId: number): Promise; + getSerialNumberForOsAccountLocalId(localId: int): Promise; /** * Subscribes to the change events of accounts. @@ -1846,7 +1899,7 @@ declare namespace osAccount { * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION * @param { 'activate' | 'activating' } type - Event type. * @param { string } name - Indicates the name of subscriber. - * @param { Callback } callback - Asynchronous callback interface. + * @param { Callback } callback - Asynchronous callback interface. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Not system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. @@ -1855,9 +1908,10 @@ declare namespace osAccount { * @throws { BusinessError } 12300002 - Invalid type or name. * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 7 + * @since arkts {'1.1':'7', '1.2':'20'} + * @arkts 1.1&1.2 */ - on(type: 'activate' | 'activating', name: string, callback: Callback): void; + on(type: 'activate' | 'activating', name: string, callback: Callback): void; /** * Unsubscribes from account events. @@ -1865,7 +1919,7 @@ declare namespace osAccount { * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION * @param { 'activate' | 'activating' } type - Event type. * @param { string } name - Indicates the name of subscriber. - * @param { Callback } callback - Asynchronous callback interface. + * @param { Callback } callback - Asynchronous callback interface. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Not system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. @@ -1874,9 +1928,10 @@ declare namespace osAccount { * @throws { BusinessError } 12300002 - Invalid type or name. * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 7 + * @since arkts {'1.1':'7', '1.2':'20'} + * @arkts 1.1&1.2 */ - off(type: 'activate' | 'activating', name: string, callback?: Callback): void; + off(type: 'activate' | 'activating', name: string, callback?: Callback): void; /** * Subscribes to the OS account switching event. @@ -1894,6 +1949,21 @@ declare namespace osAccount { * @systemapi Hide this for inner system use. * @since 12 */ + /** + * Subscribes to the OS account switching event. + * + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS + * @param { 'switching' } type - Indicates the event type. + * @param { Callback } callback - Indicates the callback for getting the event data. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Not system application. + * @throws { BusinessError } 12300001 - The system service works abnormally. + * @throws { BusinessError } 12300002 - Invalid type. + * @syscap SystemCapability.Account.OsAccount + * @systemapi + * @since 20 + * @arkts 1.1&1.2 + */ on(type: 'switching', callback: Callback): void; /** @@ -1912,6 +1982,21 @@ declare namespace osAccount { * @systemapi Hide this for inner system use. * @since 12 */ + /** + * Unsubscribes from the OS account switching event. + * + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS + * @param { 'switching' } type - Indicates the event type. + * @param { Callback } [callback] - Indicates the callback for getting the event data. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Not system application. + * @throws { BusinessError } 12300001 - The system service works abnormally. + * @throws { BusinessError } 12300002 - Invalid type. + * @syscap SystemCapability.Account.OsAccount + * @systemapi + * @since 20 + * @arkts 1.1&1.2 + */ off(type: 'switching', callback?: Callback): void; /** @@ -1930,6 +2015,21 @@ declare namespace osAccount { * @systemapi Hide this for inner system use. * @since 12 */ + /** + * Subscribes to the OS account switched event. + * + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS + * @param { 'switched' } type - Indicates the event type. + * @param { Callback } callback - Indicates the callback for getting the event data. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Not system application. + * @throws { BusinessError } 12300001 - The system service works abnormally. + * @throws { BusinessError } 12300002 - Invalid type. + * @syscap SystemCapability.Account.OsAccount + * @systemapi + * @since 20 + * @arkts 1.1&1.2 + */ on(type: 'switched', callback: Callback): void; /** @@ -1948,13 +2048,96 @@ declare namespace osAccount { * @systemapi Hide this for inner system use. * @since 12 */ + /** + * Unsubscribes from the OS account switched event. + * + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS + * @param { 'switched' } type - Indicates the event type. + * @param { Callback } [callback] - Indicates the callback for getting the event data. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Not system application. + * @throws { BusinessError } 12300001 - The system service works abnormally. + * @throws { BusinessError } 12300002 - Invalid type. + * @syscap SystemCapability.Account.OsAccount + * @systemapi + * @since 20 + * @arkts 1.1&1.2 + */ off(type: 'switched', callback?: Callback): void; + /** + * Subscribes to the OS account created event. + * + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS + * @param { 'created' } type - Indicates the event type. + * @param { Callback } callback - Indicates the callback for getting the event data. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Not system application. + * @throws { BusinessError } 12300001 - The system service works abnormally. + * @throws { BusinessError } 12300002 - Invalid type. + * @syscap SystemCapability.Account.OsAccount + * @systemapi + * @since 20 + * @arkts 1.1&1.2 + */ + on(type: 'created', callback: Callback): void; + + /** + * Unsubscribes from the OS account created event. + * + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS + * @param { 'created' } type - Indicates the event type. + * @param { Callback } [callback] - Indicates the callback for getting the event data. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Not system application. + * @throws { BusinessError } 12300001 - The system service works abnormally. + * @throws { BusinessError } 12300002 - Invalid type. + * @syscap SystemCapability.Account.OsAccount + * @systemapi + * @since 20 + * @arkts 1.1&1.2 + */ + off(type: 'created', callback?: Callback): void; + + /** + * Subscribes to the OS account removed event. + * + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS + * @param { 'removed' } type - Indicates the event type. + * @param { Callback } callback - Indicates the callback for getting the event data. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Not system application. + * @throws { BusinessError } 12300001 - The system service works abnormally. + * @throws { BusinessError } 12300002 - Invalid type. + * @syscap SystemCapability.Account.OsAccount + * @systemapi + * @since 20 + * @arkts 1.1&1.2 + */ + on(type: 'removed', callback: Callback): void; + + /** + * Unsubscribes from the OS account removed event. + * + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS + * @param { 'removed' } type - Indicates the event type. + * @param { Callback } [callback] - Indicates the callback for getting the event data. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Not system application. + * @throws { BusinessError } 12300001 - The system service works abnormally. + * @throws { BusinessError } 12300002 - Invalid type. + * @syscap SystemCapability.Account.OsAccount + * @systemapi + * @since 20 + * @arkts 1.1&1.2 + */ + off(type: 'removed', callback?: Callback): void; + /** * Gets the bundle ID associated with the specified UID. * - * @param { number } uid - Indicates the target uid. - * @param { AsyncCallback } callback - Indicates the callback for getting the bundle ID associated with the specified UID. + * @param { int } uid - Indicates the target uid. + * @param { AsyncCallback } callback - Indicates the callback for getting the bundle ID associated with the specified UID. * @throws { BusinessError } 202 - Not system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. @@ -1962,15 +2145,16 @@ declare namespace osAccount { * @throws { BusinessError } 12300002 - Invalid uid. * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - getBundleIdForUid(uid: number, callback: AsyncCallback): void; + getBundleIdForUid(uid: int, callback: AsyncCallback): void; /** * Gets the bundle ID associated with the specified UID. * - * @param { number } uid - Indicates the target uid. - * @returns { Promise } Returns the bundle ID associated with the specified UID. + * @param { int } uid - Indicates the target uid. + * @returns { Promise } Returns the bundle ID associated with the specified UID. * @throws { BusinessError } 202 - Not system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. @@ -1978,24 +2162,26 @@ declare namespace osAccount { * @throws { BusinessError } 12300002 - Invalid uid. * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - getBundleIdForUid(uid: number): Promise; + getBundleIdForUid(uid: int): Promise; /** * Gets the bundle ID associated with the specified UID synchronously. * - * @param { number } uid - Indicates the target uid. - * @returns { number } Returns the bundle ID associated with the specified UID. + * @param { int } uid - Indicates the target uid. + * @returns { int } Returns the bundle ID associated with the specified UID. * @throws { BusinessError } 202 - Not system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. * @throws { BusinessError } 12300002 - Invalid uid. * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ - getBundleIdForUidSync(uid: number): number; + getBundleIdForUidSync(uid: int): int; /** * Check whether current process belongs to the main account. @@ -2033,7 +2219,7 @@ declare namespace osAccount { * Gets a list of constraint source types for the specified os account. * * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS - * @param { number } localId - Indicates the local ID of the OS account. + * @param { int } localId - Indicates the local ID of the OS account. * @param { string } constraint - Indicates the constraint to query the source type. * @param { AsyncCallback> } callback - Indicates the callback for * getting a list of constraint source types for the specified os account. @@ -2046,19 +2232,16 @@ declare namespace osAccount { * @throws { BusinessError } 12300003 - Account not found. * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - getOsAccountConstraintSourceTypes( - localId: number, - constraint: string, - callback: AsyncCallback> - ): void; + getOsAccountConstraintSourceTypes(localId: int, constraint: string, callback: AsyncCallback>): void; /** * Gets a list of constraint source types for the specified os account. * * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS - * @param { number } localId - Indicates the local ID of the OS account. + * @param { int } localId - Indicates the local ID of the OS account. * @param { string } constraint - Indicates the constraint to query the source type. * @returns { Promise> } Returns a list of constraint source types for the specified os account. * @throws { BusinessError } 201 - Permission denied. @@ -2070,32 +2253,10 @@ declare namespace osAccount { * @throws { BusinessError } 12300003 - Account not found. * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 9 - */ - getOsAccountConstraintSourceTypes(localId: number, constraint: string): Promise>; - - /** - * Binds the specified domain account to the target OS account. - * - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS - * @param { number } localId - Indicates the local Id of the OS account. - * @param { DomainAccountInfo } domainAccountInfo - Indicates the domain account information. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 201 - Permission denied. - * @throws { BusinessError } 202 - Not system application. - * @throws { BusinessError } 801 - Capability not supported. - * @throws { BusinessError } 12300001 - The system service works abnormally. - * @throws { BusinessError } 12300002 - Invalid domain account information. - * @throws { BusinessError } 12300003 - The OS account not found. - * @throws { BusinessError } 12300008 - Restricted OS account. Possible causes: The OS account cannot be bound. - * @throws { BusinessError } 12300010 - Service busy. Possible causes: The target OS account or domain account is being operated. - * @throws { BusinessError } 12300021 - The OS account is already bound. - * @throws { BusinessError } 12300022 - The domain account is already bound. - * @syscap SystemCapability.Account.OsAccount - * @systemapi - * @since 20 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - bindDomainAccount(localId: number, domainAccountInfo: DomainAccountInfo): Promise; + getOsAccountConstraintSourceTypes(localId: int, constraint: string): Promise>; } /** @@ -2109,11 +2270,12 @@ declare namespace osAccount { /** * The local ID of an OS account. * - * @type { number } + * @type { int } * @syscap SystemCapability.Account.OsAccount - * @since 7 + * @since arkts {'1.1':'7', '1.2':'20'} + * @arkts 1.1&1.2 */ - localId: number; + localId: int; /** * The local name of an OS account. @@ -2184,29 +2346,32 @@ declare namespace osAccount { /** * Os account create time. * - * @type { number } + * @type { long } * @syscap SystemCapability.Account.OsAccount - * @since 8 + * @since arkts {'1.1':'8', '1.2':'20'} + * @arkts 1.1&1.2 */ - createTime: number; + createTime: long; /** * The last time to log in. * - * @type { number } + * @type { long } * @syscap SystemCapability.Account.OsAccount - * @since 8 + * @since arkts {'1.1':'8', '1.2':'20'} + * @arkts 1.1&1.2 */ - lastLoginTime: number; + lastLoginTime: long; /** * Os account serial number. * - * @type { number } + * @type { long } * @syscap SystemCapability.Account.OsAccount - * @since 8 + * @since arkts {'1.1':'8', '1.2':'20'} + * @arkts 1.1&1.2 */ - serialNumber: number; + serialNumber: long; /** * Os account is activated or not. @@ -2278,22 +2443,35 @@ declare namespace osAccount { /** * Indicates which OS account to switch from. * - * @type { number } + * @type { int } * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - fromAccountId: number; + fromAccountId: int; /** * Indicates which OS account to switch to. * - * @type { number } + * @type { int } * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 + */ + toAccountId: int; + + /** + * Indicates which display the switch event occurred on. + * + * @type { ?long } + * @syscap SystemCapability.Account.OsAccount + * @systemapi + * @since 20 + * @arkts 1.1&1.2 */ - toAccountId: number; + displayId?: long; } /** @@ -2315,6 +2493,17 @@ declare namespace osAccount { */ shortName: string; + /** + * Indicates the short name of the OS account. + * + * @type { ?string } + * @syscap SystemCapability.Account.OsAccount + * @systemapi Hide this for inner system use. + * @since 20 + * @arkts 1.2 + */ + shortName?: string; + /** * Indicates the bundles are disallowed to be preinstalled on the OS account. * @@ -2406,9 +2595,10 @@ declare namespace osAccount { /** * Enumerates OS account types. * - * @enum { number } OsAccountType + * @enum { int } OsAccountType * @syscap SystemCapability.Account.OsAccount - * @since 7 + * @since arkts {'1.1':'7', '1.2':'20'} + * @arkts 1.1&1.2 */ enum OsAccountType { /** @@ -2467,13 +2657,14 @@ declare namespace osAccount { /** * Gets version information. * - * @returns { number } Returns the version information. + * @returns { int } Returns the version information. * @throws { BusinessError } 202 - Not system application. * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 8 + * @since arkts {'1.1':'8', '1.2':'20'} + * @arkts 1.1&1.2 */ - getVersion(): number; + getVersion(): int; /** * Checks whether the authentication capability is available. @@ -2481,18 +2672,20 @@ declare namespace osAccount { * @permission ohos.permission.ACCESS_USER_AUTH_INTERNAL * @param { AuthType } authType - Indicates the credential type for authentication. * @param { AuthTrustLevel } authTrustLevel - Indicates the trust level of authentication result. - * @returns { number } Returns a status result. + * @returns { int } Returns a status result. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Not system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. * @throws { BusinessError } 12300001 - The system service works abnormally. * @throws { BusinessError } 12300002 - Invalid authType or authTrustLevel. + * @throws { BusinessError } 12300117 - PIN is expired. * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 8 + * @since arkts {'1.1':'8', '1.2':'20'} + * @arkts 1.1&1.2 */ - getAvailableStatus(authType: AuthType, authTrustLevel: AuthTrustLevel): number; + getAvailableStatus(authType: AuthType, authTrustLevel: AuthTrustLevel): int; /** * Gets the property based on the specified request information. @@ -2527,6 +2720,23 @@ declare namespace osAccount { * @systemapi Hide this for inner system use. * @since 12 */ + /** + * Gets the property based on the specified request information. + * + * @permission ohos.permission.ACCESS_USER_AUTH_INTERNAL + * @param { GetPropertyRequest } request - Indicates the request information, including authentication type, and property type list. + * @param { AsyncCallback } callback - Returns an executor property. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Not system application. + * @throws { BusinessError } 12300001 - The system service works abnormally. + * @throws { BusinessError } 12300002 - Invalid request. + * @throws { BusinessError } 12300003 - Account not found. + * @throws { BusinessError } 12300020 - Device hardware abnormal. + * @syscap SystemCapability.Account.OsAccount + * @systemapi + * @since 20 + * @arkts 1.1&1.2 + */ getProperty(request: GetPropertyRequest, callback: AsyncCallback): void; /** @@ -2562,14 +2772,31 @@ declare namespace osAccount { * @systemapi Hide this for inner system use. * @since 12 */ - getProperty(request: GetPropertyRequest): Promise; - /** - * Gets the executor property associated with the specified credential. + * Gets the property based on the specified request information. * * @permission ohos.permission.ACCESS_USER_AUTH_INTERNAL - * @param { Uint8Array } credentialId - Indicates the id for getting the credential information. - * @param { Array } keys - Indicates the array of property types to get. + * @param { GetPropertyRequest } request - Indicates the request information, including authentication type, and property type list. + * @returns { Promise } Returns an executor property. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Not system application. + * @throws { BusinessError } 12300001 - The system service works abnormally. + * @throws { BusinessError } 12300002 - Invalid request. + * @throws { BusinessError } 12300003 - Account not found. + * @throws { BusinessError } 12300020 - Device hardware abnormal. + * @syscap SystemCapability.Account.OsAccount + * @systemapi + * @since 20 + * @arkts 1.1&1.2 + */ + getProperty(request: GetPropertyRequest): Promise; + + /** + * Gets the executor property associated with the specified credential. + * + * @permission ohos.permission.ACCESS_USER_AUTH_INTERNAL + * @param { Uint8Array } credentialId - Indicates the id for getting the credential information. + * @param { Array } keys - Indicates the array of property types to get. * @returns { Promise } Returns an executor property. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Not system application. @@ -2582,6 +2809,24 @@ declare namespace osAccount { * @systemapi Hide this for inner system use. * @since 14 */ + /** + * Gets the executor property associated with the specified credential. + * + * @permission ohos.permission.ACCESS_USER_AUTH_INTERNAL + * @param { Uint8Array } credentialId - Indicates the id for getting the credential information. + * @param { Array } keys - Indicates the array of property types to get. + * @returns { Promise } Returns an executor property. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Not system application. + * @throws { BusinessError } 12300001 - The system service works abnormally. + * @throws { BusinessError } 12300002 - Invalid keys. + * @throws { BusinessError } 12300020 - Device hardware abnormal. + * @throws { BusinessError } 12300102 - The credential does not exist. + * @syscap SystemCapability.Account.OsAccount + * @systemapi + * @since 20 + * @arkts 1.1&1.2 + */ getPropertyByCredentialId(credentialId: Uint8Array, keys: Array): Promise; /** @@ -2651,6 +2896,7 @@ declare namespace osAccount { * @syscap SystemCapability.Account.OsAccount * @systemapi * @since 20 + * @arkts 1.1&1.2 */ prepareRemoteAuth(remoteNetworkId: string): Promise; @@ -2746,6 +2992,7 @@ declare namespace osAccount { * @syscap SystemCapability.Account.OsAccount * @systemapi * @since 20 + * @arkts 1.1&1.2 */ auth( challenge: Uint8Array, @@ -2823,6 +3070,7 @@ declare namespace osAccount { * @syscap SystemCapability.Account.OsAccount * @systemapi * @since 20 + * @arkts 1.1&1.2 */ auth( challenge: Uint8Array, @@ -2832,112 +3080,6 @@ declare namespace osAccount { callback: IUserAuthCallback ): Uint8Array; - /** - * Executes user authentication. - * - * @permission ohos.permission.ACCESS_USER_AUTH_INTERNAL - * @param { number } userId - Indicates the user identification. - * @param { Uint8Array } challenge - Indicates the challenge value. - * @param { AuthType } authType - Indicates the authentication type. - * @param { AuthTrustLevel } authTrustLevel - Indicates the trust level of authentication result. - * @param { IUserAuthCallback } callback - Indicates the callback to get result and acquireInfo. - * @returns { Uint8Array } Returns a context ID for cancellation. - * @throws { BusinessError } 201 - Permission denied. - * @throws { BusinessError } 202 - Not system application. - * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. - *
2. Incorrect parameter types. - * @throws { BusinessError } 12300001 - The system service works abnormally. - * @throws { BusinessError } 12300002 - Invalid userId, challenge, authType or authTrustLevel. - * @throws { BusinessError } 12300101 - The credential is incorrect. - * @throws { BusinessError } 12300102 - The credential does not exist. - * @throws { BusinessError } 12300105 - The trust level is not supported. - * @throws { BusinessError } 12300106 - The authentication type is not supported. - * @throws { BusinessError } 12300109 - The authentication, enrollment, or update operation is canceled. - * @throws { BusinessError } 12300110 - The authentication is locked. - * @throws { BusinessError } 12300111 - The authentication time out. - * @throws { BusinessError } 12300112 - The authentication service is busy. - * @syscap SystemCapability.Account.OsAccount - * @systemapi Hide this for inner system use. - * @since 8 - */ - /** - * Executes user authentication. - * - * @permission ohos.permission.ACCESS_USER_AUTH_INTERNAL - * @param { number } userId - Indicates the user identification. - * @param { Uint8Array } challenge - Indicates the challenge value. - * @param { AuthType } authType - Indicates the authentication type. - * @param { AuthTrustLevel } authTrustLevel - Indicates the trust level of authentication result. - * @param { IUserAuthCallback } callback - Indicates the callback to get result and acquireInfo. - * @returns { Uint8Array } Returns a context ID for cancellation. - * @throws { BusinessError } 201 - Permission denied. - * @throws { BusinessError } 202 - Not system application. - * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. - *
2. Incorrect parameter types. - * @throws { BusinessError } 12300001 - The system service works abnormally. - * @throws { BusinessError } 12300002 - Invalid challenge, authType or authTrustLevel. - * @throws { BusinessError } 12300003 - Account not found. - * @throws { BusinessError } 12300013 - Network exception. - * @throws { BusinessError } 12300101 - The credential is incorrect. - * @throws { BusinessError } 12300102 - The credential does not exist. - * @throws { BusinessError } 12300105 - The trust level is not supported. - * @throws { BusinessError } 12300106 - The authentication type is not supported. - * @throws { BusinessError } 12300109 - The authentication, enrollment, or update operation is canceled. - * @throws { BusinessError } 12300110 - The authentication is locked. - * @throws { BusinessError } 12300111 - The authentication time out. - * @throws { BusinessError } 12300112 - The authentication service is busy. - * @throws { BusinessError } 12300113 - The authentication service does not exist. - * @throws { BusinessError } 12300114 - The authentication service works abnormally. - * @throws { BusinessError } 12300117 - PIN is expired. - * @throws { BusinessError } 12300211 - Server unreachable. - * @syscap SystemCapability.Account.OsAccount - * @systemapi Hide this for inner system use. - * @since 12 - */ - /** - * Executes user authentication. - * - * @permission ohos.permission.ACCESS_USER_AUTH_INTERNAL - * @param { number } userId - Indicates the user identification. - * @param { Uint8Array } challenge - Indicates the challenge value. - * @param { AuthType } authType - Indicates the authentication type. - * @param { AuthTrustLevel } authTrustLevel - Indicates the trust level of authentication result. - * @param { IUserAuthCallback } callback - Indicates the callback to get result and acquireInfo. - * @returns { Uint8Array } Returns a context ID for cancellation. - * @throws { BusinessError } 201 - Permission denied. - * @throws { BusinessError } 202 - Not system application. - * @throws { BusinessError } 12300001 - The system service works abnormally. - * @throws { BusinessError } 12300002 - Invalid challenge, authType or authTrustLevel. - * @throws { BusinessError } 12300003 - Account not found. - * @throws { BusinessError } 12300013 - Network exception. - * @throws { BusinessError } 12300020 - Device hardware abnormal. - * @throws { BusinessError } 12300090 - Cross-device capability not supported. - * @throws { BusinessError } 12300091 - Cross-device communication failed. - * @throws { BusinessError } 12300101 - The credential is incorrect. - * @throws { BusinessError } 12300102 - The credential does not exist. - * @throws { BusinessError } 12300105 - The trust level is not supported. - * @throws { BusinessError } 12300106 - The authentication type is not supported. - * @throws { BusinessError } 12300109 - The authentication, enrollment, or update operation is canceled. - * @throws { BusinessError } 12300110 - The authentication is locked. - * @throws { BusinessError } 12300111 - The authentication timeout. - * @throws { BusinessError } 12300112 - The authentication service is busy. - * @throws { BusinessError } 12300113 - The authentication service does not exist. - * @throws { BusinessError } 12300114 - The authentication service works abnormally. - * @throws { BusinessError } 12300117 - PIN is expired. - * @throws { BusinessError } 12300119 - Multi-factor authentication failed. - * @throws { BusinessError } 12300211 - Server unreachable. - * @syscap SystemCapability.Account.OsAccount - * @systemapi - * @since 20 - */ - authUser( - userId: number, - challenge: Uint8Array, - authType: AuthType, - authTrustLevel: AuthTrustLevel, - callback: IUserAuthCallback - ): Uint8Array; - /** * Cancels authentication with context ID. * @@ -3066,22 +3208,24 @@ declare namespace osAccount { /** * Indicates the remaining times that authentication can be performed. * - * @type { number } + * @type { int } * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ - remainTimes: number; + remainTimes: int; /** * Indicates the freezing time before performing the next authentication. * - * @type { number } + * @type { int } * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ - freezingTime: number; + freezingTime: int; } /** @@ -3123,15 +3267,27 @@ declare namespace osAccount { */ businessParams: Record; + /** + * Indicates the business parameters. + * + * @type { RecordData } + * @syscap SystemCapability.Account.OsAccount + * @systemapi Hide this for inner system use. + * @since 20 + * @arkts 1.2 + */ + businessParams: RecordData; + /** * Indicates caller UID. * - * @type { number } + * @type { int } * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ - callerUid: number; + callerUid: int; } /** @@ -3187,14 +3343,156 @@ declare namespace osAccount { /** * Indicates the caller UID. * - * @type { number } + * @type { int } * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ - callerUid: number; + callerUid: int; } + /** + * Authenticates the specified domain account. + * + * @typedef { function } DomainPluginAuthFunc + * @param { DomainAccountInfo } domainAccountInfo - + * Indicates the domain account information for authentication. + * @param { Uint8Array } credential - Indicates the credential for authentication. + * @param { IUserAuthCallback } callback - Indicates the authentication callback. + * @syscap SystemCapability.Account.OsAccount + * @systemapi + * @since 20 + * @arkts 1.1&1.2 + */ + declare type DomainPluginAuthFunc = (domainAccountInfo: DomainAccountInfo, + credential: Uint8Array, callback: IUserAuthCallback) => void, + + /** + * Authenticates the specified domain account with a popup. + * + * @typedef { function } DomainPluginAuthWithPopupFunc + * @param { DomainAccountInfo } domainAccountInfo - + * Indicates the domain account information for authentication. + * @param { IUserAuthCallback } callback - Indicates the callback for notifying the authentication result. + * @syscap SystemCapability.Account.OsAccount + * @systemapi + * @since 20 + * @arkts 1.1&1.2 + */ + declare type DomainPluginAuthWithPopupFunc = (domainAccountInfo: DomainAccountInfo, + callback: IUserAuthCallback) => void, + + /** + * Authenticates the specified domain account with an authorization token. + * + * @typedef { function } DomainPluginAuthWithTokenFunc + * @param { DomainAccountInfo } domainAccountInfo - + * Indicates the domain account information for authentication. + * @param { Uint8Array } token - + * Indicates the authorization token generated when PIN or biometric authentication is successful. + * @param { IUserAuthCallback } callback - Indicates the callback for notifying the authentication result. + * @syscap SystemCapability.Account.OsAccount + * @systemapi + * @since 20 + * @arkts 1.1&1.2 + */ + declare type DomainPluginAuthWithTokenFunc = (domainAccountInfo: DomainAccountInfo, + token: Uint8Array, callback: IUserAuthCallback) => void, + + /** + * Gets the domain account information with the specified options. + * + * @typedef { function } DomainPluginGetAccountInfoFunc + * @param { GetDomainAccountInfoPluginOptions } options - + * Indicates the options for getting domain account information. + * @param { AsyncCallback } callback - + * Indicates the callback for notifying the domain account information. + * @syscap SystemCapability.Account.OsAccount + * @systemapi + * @since 20 + * @arkts 1.1&1.2 + */ + declare type DomainPluginGetAccountInfoFunc = (options: GetDomainAccountInfoPluginOptions, + callback: AsyncCallback) => void, + + /** + * Gets the domain authentication property for the specified domain account. + * + * @typedef { function } DomainPluginGetAuthStatusInfoFunc + * @param { DomainAccountInfo } domainAccountInfo - + * Indicates the domain account information for authentication. + * @param { AsyncCallback } callback - + * Indicates the callback for notifying the domain authentication status information. + * @syscap SystemCapability.Account.OsAccount + * @systemapi + * @since 20 + * @arkts 1.1&1.2 + */ + declare type DomainPluginGetAuthStatusInfoFunc = (domainAccountInfo: DomainAccountInfo, + callback: AsyncCallback) => void, + + /** + * Binds the specified domain account with an OS account. + * + * @typedef { function } DomainPluginBindAccountFunc + * @param { DomainAccountInfo } domainAccountInfo - Indicates the domain account information. + * @param { int } localId - Indicates the local ID of the OS account. + * @param { AsyncCallback } callback - Indicates the callback for notifying the binding result. + * @syscap SystemCapability.Account.OsAccount + * @systemapi + * @since 20 + * @arkts 1.1&1.2 + */ + declare type DomainPluginBindAccountFunc = (domainAccountInfo: DomainAccountInfo, + localId: int, callback: AsyncCallback) => void, + + /** + * Unbind the specified domain account. + * + * @typedef { function } DomainPluginUnbindAccountFunc + * @param { DomainAccountInfo } domainAccountInfo - Indicates the domain account information. + * @param { AsyncCallback } callback - Indicates the callback for notifying the unbinding result. + * @syscap SystemCapability.Account.OsAccount + * @systemapi + * @since 20 + * @arkts 1.1&1.2 + */ + declare type DomainPluginUnbindAccountFunc = (domainAccountInfo: DomainAccountInfo, + callback: AsyncCallback) => void, + + /** + * Checks whether the token of specified domain account is valid. + * + * @typedef { function } DomainPluginIsAccountTokenValidFunc + * @param { DomainAccountInfo } domainAccountInfo - Indicates the domain account information. + * @param { Uint8Array } token - Indicates the account token. + * @param { AsyncCallback } callback - Indicates the callback for notifying the checking result. + * @syscap SystemCapability.Account.OsAccount + * @systemapi + * @since 20 + * @arkts 1.1&1.2 + */ + declare type DomainPluginIsAccountTokenValidFunc = ( + domainAccountInfo: DomainAccountInfo, + token: Uint8Array, + callback: AsyncCallback + ) => void; + + /** + * Gets the access token based on the specified options. + * + * @typedef { function } DomainPlugingetAccessTokenFunc + * @param { GetDomainAccessTokenOptions } options - Indicates the options for getting th access token. + * @param { AsyncCallback } callback - Indicates the callback for returning the access token. + * @syscap SystemCapability.Account.OsAccount + * @systemapi + * @since 20 + * @arkts 1.1&1.2 + */ + declare type DomainPluginGetAccessTokenFunc = (options: GetDomainAccessTokenOptions, + callback: AsyncCallback) => void, + /** * Provides the definition of domain plugin. * @@ -3214,7 +3512,16 @@ declare namespace osAccount { * @systemapi Hide this for inner system use. * @since 9 */ - auth(domainAccountInfo: DomainAccountInfo, credential: Uint8Array, callback: IUserAuthCallback): void; + /** + * Authenticates the specified domain account. + * + * @type { DomainPluginAuthFunc } + * @syscap SystemCapability.Account.OsAccount + * @systemapi + * @since 20 + * @arkts 1.1&1.2 + */ + auth: DomainPluginAuthFunc; /** * Authenticates the specified domain account with a popup. @@ -3225,41 +3532,81 @@ declare namespace osAccount { * @systemapi Hide this for inner system use. * @since 10 */ - authWithPopup(domainAccountInfo: DomainAccountInfo, callback: IUserAuthCallback): void; + /** + * Authenticates the specified domain account with a popup. + * + * @type { DomainPluginAuthWithPopupFunc } + * @syscap SystemCapability.Account.OsAccount + * @systemapi + * @since 20 + * @arkts 1.1&1.2 + */ + authWithPopup: DomainPluginAuthWithPopupFunc; /** * Authenticates the specified domain account with an authorization token. * * @param { DomainAccountInfo } domainAccountInfo - Indicates the domain account information for authentication. - * @param { Uint8Array } token - Indicates the authorization token generated when PIN or biometric authentication is successful. + * @param { Uint8Array } token - + * Indicates the authorization token generated when PIN or biometric authentication is successful. * @param { IUserAuthCallback } callback - Indicates the callback for notifying the authentication result. * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. * @since 10 */ - authWithToken(domainAccountInfo: DomainAccountInfo, token: Uint8Array, callback: IUserAuthCallback): void; + /** + * Authenticates the specified domain account with an authorization token. + * + * @type { DomainPluginAuthWithTokenFunc } + * @syscap SystemCapability.Account.OsAccount + * @systemapi + * @since 20 + * @arkts 1.1&1.2 + */ + authWithToken: DomainPluginAuthWithTokenFunc; /** * Gets the domain account information with the specified options. * - * @param { GetDomainAccountInfoPluginOptions } options - Indicates the options for getting domain account information. - * @param { AsyncCallback } callback - Indicates the callback for notifying the domain account information. + * @param { GetDomainAccountInfoPluginOptions } options - + * Indicates the options for getting domain account information. + * @param { AsyncCallback } callback - + * Indicates the callback for notifying the domain account information. * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. * @since 10 */ - getAccountInfo(options: GetDomainAccountInfoPluginOptions, callback: AsyncCallback): void; + /** + * Gets the domain account information with the specified options. + * + * @type { DomainPluginGetAccountInfoFunc } + * @syscap SystemCapability.Account.OsAccount + * @systemapi + * @since 20 + * @arkts 1.1&1.2 + */ + getAccountInfo: DomainPluginGetAccountInfoFunc; /** * Gets the domain authentication property for the specified domain account. * * @param { DomainAccountInfo } domainAccountInfo - Indicates the domain account information for authentication. - * @param { AsyncCallback } callback - Indicates the callback for notifying the domain authentication status information. + * @param { AsyncCallback } callback - + * Indicates the callback for notifying the domain authentication status information. * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. * @since 10 */ - getAuthStatusInfo(domainAccountInfo: DomainAccountInfo, callback: AsyncCallback): void; + /** + * Gets the domain authentication property for the specified domain account. + * + * @type { DomainPluginGetAuthStatusInfoFunc } + * @syscap SystemCapability.Account.OsAccount + * @systemapi + * @since 20 + * @arkts 1.1&1.2 + */ + getAuthStatusInfo: DomainPluginGetAuthStatusInfoFunc; /** * Binds the specified domain account with an OS account. @@ -3271,7 +3618,16 @@ declare namespace osAccount { * @systemapi Hide this for inner system use. * @since 10 */ - bindAccount(domainAccountInfo: DomainAccountInfo, localId: number, callback: AsyncCallback): void; + /** + * Binds the specified domain account with an OS account. + * + * @type { DomainPluginBindAccountFunc } + * @syscap SystemCapability.Account.OsAccount + * @systemapi + * @since 20 + * @arkts 1.1&1.2 + */ + bindAccount: DomainPluginBindAccountFunc; /** * Unbind the specified domain account. @@ -3282,7 +3638,16 @@ declare namespace osAccount { * @systemapi Hide this for inner system use. * @since 10 */ - unbindAccount(domainAccountInfo: DomainAccountInfo, callback: AsyncCallback): void; + /** + * Unbind the specified domain account. + * + * @type { DomainPluginUnbindAccountFunc } + * @syscap SystemCapability.Account.OsAccount + * @systemapi + * @since 20 + * @arkts 1.1&1.2 + */ + unbindAccount: DomainPluginUnbindAccountFunc; /** * Checks whether the token of specified domain account is valid. @@ -3294,11 +3659,16 @@ declare namespace osAccount { * @systemapi Hide this for inner system use. * @since 10 */ - isAccountTokenValid( - domainAccountInfo: DomainAccountInfo, - token: Uint8Array, - callback: AsyncCallback - ): void; + /** + * Checks whether the token of specified domain account is valid. + * + * @type { DomainPluginIsAccountTokenValidFunc } + * @syscap SystemCapability.Account.OsAccount + * @systemapi + * @since 20 + * @arkts 1.1&1.2 + */ + isAccountTokenValid: DomainPluginIsAccountTokenValidFunc; /** * Gets the access token based on the specified options. @@ -3309,7 +3679,16 @@ declare namespace osAccount { * @systemapi Hide this for inner system use. * @since 10 */ - getAccessToken(options: GetDomainAccessTokenOptions, callback: AsyncCallback): void; + /** + * Gets the access token based on the specified options. + * + * @type { DomainPluginGetAccessTokenFunc } + * @syscap SystemCapability.Account.OsAccount + * @systemapi + * @since 20 + * @arkts 1.1&1.2 + */ + getAccessToken: DomainPluginGetAccessTokenFunc; } /** @@ -3462,7 +3841,7 @@ declare namespace osAccount { * Authenticates the domain account bound to the specified OS account with a popup. * * @permission ohos.permission.ACCESS_USER_AUTH_INTERNAL - * @param { number } localId - Indicates the local ID of the specified OS account. + * @param { int } localId - Indicates the local ID of the specified OS account. * @param { IUserAuthCallback } callback - Indicates the callback for getting the authentication result. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Not system application. @@ -3488,7 +3867,7 @@ declare namespace osAccount { /** * Authenticates the domain account bound to the specified OS account with a popup. * - * @param { number } localId - Indicates the local ID of the specified OS account. + * @param { int } localId - Indicates the local ID of the specified OS account. * @param { IUserAuthCallback } callback - Indicates the callback for getting the authentication result. * @throws { BusinessError } 202 - Not system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. @@ -3509,9 +3888,10 @@ declare namespace osAccount { * @static * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 11 + * @since arkts {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - static authWithPopup(localId: number, callback: IUserAuthCallback): void; + static authWithPopup(localId: int, callback: IUserAuthCallback): void; /** * Checks whether the specified domain account exists. @@ -3689,7 +4069,7 @@ declare namespace osAccount { * @param { AsyncCallback } callback - Indicates the result callback. * @throws { BusinessError } 202 - Not system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. - *
2. Incorrect parameter types. + *
2. Incorrect parameter types. * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 12300001 - The system service works abnormally. * @throws { BusinessError } 12300002 - Invalid business parameters. @@ -3706,6 +4086,29 @@ declare namespace osAccount { */ static getAccessToken(businessParams: Record, callback: AsyncCallback): void; + /** + * Gets the business access token of the current domain account. + * + * @param { RecordData } businessParams - Indicates the business parameters. + * @param { AsyncCallback } callback - Indicates the result callback. + * @throws { BusinessError } 202 - Not system application. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 12300001 - The system service works abnormally. + * @throws { BusinessError } 12300002 - Invalid business parameters. + * @throws { BusinessError } 12300003 - Domain account not found. + * @throws { BusinessError } 12300013 - Network exception. + * @throws { BusinessError } 12300014 - The domain account is not authenticated. + * @throws { BusinessError } 12300111 - The operation time out. + * @throws { BusinessError } 12300114 - The authentication service works abnormally. + * @throws { BusinessError } 12300211 - Server unreachable. + * @static + * @syscap SystemCapability.Account.OsAccount + * @systemapi Hide this for inner system use. + * @since 20 + * @arkts 1.2 + */ + static getAccessToken(businessParams: RecordData, callback: AsyncCallback): void; + /** * Gets the business access token for the current domain account. * @@ -3730,6 +4133,31 @@ declare namespace osAccount { */ static getAccessToken(businessParams: Record): Promise; + /** + * Gets the business access token for the current domain account. + * + * @param { RecordData } businessParams - Indicates the business parameters. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 202 - Not system application. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 12300001 - The system service works abnormally. + * @throws { BusinessError } 12300002 - Invalid business parameters. + * @throws { BusinessError } 12300003 - Domain account not found. + * @throws { BusinessError } 12300013 - Network exception. + * @throws { BusinessError } 12300014 - The domain account is not authenticated. + * @throws { BusinessError } 12300111 - The operation time out. + * @throws { BusinessError } 12300114 - The authentication service works abnormally. + * @throws { BusinessError } 12300211 - Server unreachable. + * @static + * @syscap SystemCapability.Account.OsAccount + * @systemapi Hide this for inner system use. + * @since 20 + * @arkts 1.2 + */ + static getAccessToken(businessParams: RecordData): Promise; + /** * Checks whether the authentication of the target domain account is expired. * @@ -3768,6 +4196,16 @@ declare namespace osAccount { */ parameters: Record; + /** + * Indicates the detail config parameters. + * + * @type { RecordData } + * @syscap SystemCapability.Account.OsAccount + * @since 20 + * @arkts 1.2 + */ + parameters: RecordData; + /** * Indicates the config identifier. * @@ -3813,6 +4251,26 @@ declare namespace osAccount { */ static addServerConfig(parameters: Record): Promise; + /** + * Adds a domain server config. + * + * @permission ohos.permission.MANAGE_DOMAIN_ACCOUNT_SERVER_CONFIGS + * @param { RecordData } parameters - Indicates the server config parameters. + * @returns { Promise } Returns the added domain server config. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 12300001 - The system service works abnormally. + * @throws { BusinessError } 12300002 - Invalid server config parameters. + * @throws { BusinessError } 12300211 - Server unreachable. + * @throws { BusinessError } 12300213 - Server config already exists. + * @throws { BusinessError } 12300215 - The number of server config reaches the upper limit. + * @static + * @syscap SystemCapability.Account.OsAccount + * @since 20 + * @arkts 1.2 + */ + static addServerConfig(parameters: RecordData): Promise; + /** * Removes a domain server config. * @@ -3851,6 +4309,28 @@ declare namespace osAccount { */ static updateServerConfig(configId: string, parameters: Record): Promise; + /** + * Updates the target server config with the specified parameters. + * + * @permission ohos.permission.MANAGE_DOMAIN_ACCOUNT_SERVER_CONFIGS + * @param { string } configId - Indicates the server config identifier. + * @param { RecordData } parameters - Indicates the server config parameters. + * @returns { Promise } Returns the updated domain server config. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 12300001 - The system service works abnormally. + * @throws { BusinessError } 12300002 - Invalid server config parameters. + * @throws { BusinessError } 12300211 - Server unreachable. + * @throws { BusinessError } 12300212 - Server config not found. + * @throws { BusinessError } 12300213 - Server config already exists. + * @throws { BusinessError } 12300214 - Server config has been associated with an account. + * @static + * @syscap SystemCapability.Account.OsAccount + * @since 20 + * @arkts 1.2 + */ + static updateServerConfig(configId: string, parameters: RecordData): Promise; + /** * Gets the specified server config by identifier. * @@ -3958,7 +4438,7 @@ declare namespace osAccount { * Start an IDM operation to obtain challenge value. * * @permission ohos.permission.MANAGE_USER_IDM - * @param { number } [accountId] - Indicates the local ID of the OS account. + * @param { int } [accountId] - Indicates the local ID of the OS account. * @returns { Promise } Returns a challenge value. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Not system application. @@ -3968,9 +4448,10 @@ declare namespace osAccount { * @throws { BusinessError } 12300008 - Restricted account. * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - openSession(accountId?: number): Promise; + openSession(accountId?: int): Promise; /** * Adds credential. @@ -4025,6 +4506,36 @@ declare namespace osAccount { * @systemapi Hide this for inner system use. * @since 12 */ + /** + * Adds a credential. + *

+ * Add user credential information, pass in credential addition method and credential information + * (credential type, subclass, if adding user's non password credentials, pass in password authentication token), + * and get the result / acquireInfo callback. + * + * @permission ohos.permission.MANAGE_USER_IDM + * @param { CredentialInfo } credentialInfo - Indicates the credential information. + * @param { IIdmCallback } callback - Indicates the callback to get results and acquireInfo. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Not system application. + * @throws { BusinessError } 12300001 - The system service works abnormally. + * @throws { BusinessError } 12300002 - Invalid credentialInfo, i.e. authType or authSubType. + * @throws { BusinessError } 12300003 - Account not found. + * @throws { BusinessError } 12300008 - Restricted account. + * @throws { BusinessError } 12300020 - Device hardware abnormal. + * @throws { BusinessError } 12300090 - Cross-device capability not supported. + * @throws { BusinessError } 12300091 - Cross-device communication failed. + * @throws { BusinessError } 12300101 - The token is invalid. + * @throws { BusinessError } 12300106 - The authentication type is not supported. + * @throws { BusinessError } 12300109 - The authentication, enrollment, or update operation is canceled. + * @throws { BusinessError } 12300111 - The operation timeout. + * @throws { BusinessError } 12300115 - The number of credentials reaches the upper limit. + * @throws { BusinessError } 12300116 - Credential complexity verification failed. + * @syscap SystemCapability.Account.OsAccount + * @systemapi + * @since 20 + * @arkts 1.1&1.2 + */ addCredential(credentialInfo: CredentialInfo, callback: IIdmCallback): void; /** @@ -4091,7 +4602,7 @@ declare namespace osAccount { * End an IDM operation. * * @permission ohos.permission.MANAGE_USER_IDM - * @param { number } [accountId] - Indicates the local ID of the OS account. + * @param { int } [accountId] - Indicates the local ID of the OS account. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Not system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: Incorrect parameter types. @@ -4100,9 +4611,10 @@ declare namespace osAccount { * @throws { BusinessError } 12300008 - Restricted account. * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - closeSession(accountId?: number): void; + closeSession(accountId?: int): void; /** * Cancels entry with a challenge value. @@ -4175,6 +4687,21 @@ declare namespace osAccount { * @systemapi Hide this for inner system use. * @since 8 */ + /** + * Gets authentication information. + * + * @permission ohos.permission.USE_USER_IDM + * @param { AsyncCallback> } callback - Indicates the callback to get all registered credential information of + * the specified type for the current user. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Not system application. + * @throws { BusinessError } 12300001 - The system service works abnormally. + * @throws { BusinessError } 12300020 - Device hardware abnormal. + * @syscap SystemCapability.Account.OsAccount + * @systemapi + * @since 20 + * @arkts 1.1&1.2 + */ getAuthInfo(callback: AsyncCallback>): void; /** @@ -4194,6 +4721,23 @@ declare namespace osAccount { * @systemapi Hide this for inner system use. * @since 8 */ + /** + * Gets authentication information. + * + * @permission ohos.permission.USE_USER_IDM + * @param { AuthType } authType - Indicates the authentication type. + * @param { AsyncCallback> } callback - Indicates the callback to get all registered credential information of + * the specified type for the current user. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Not system application. + * @throws { BusinessError } 12300001 - The system service works abnormally. + * @throws { BusinessError } 12300002 - Invalid authType. + * @throws { BusinessError } 12300020 - Device hardware abnormal. + * @syscap SystemCapability.Account.OsAccount + * @systemapi + * @since 20 + * @arkts 1.1&1.2 + */ getAuthInfo(authType: AuthType, callback: AsyncCallback>): void; /** @@ -4212,7 +4756,24 @@ declare namespace osAccount { * @systemapi Hide this for inner system use. * @since 8 */ - getAuthInfo(authType?: AuthType): Promise>; + /** + * Gets authentication information. + * + * @permission ohos.permission.USE_USER_IDM + * @param { AuthType } authType - Indicates the authentication type. + * @returns { Promise> } Returns all registered credential information of + * the specified type for the current user. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Not system application. + * @throws { BusinessError } 12300001 - The system service works abnormally. + * @throws { BusinessError } 12300002 - Invalid authType. + * @throws { BusinessError } 12300020 - Device hardware abnormal. + * @syscap SystemCapability.Account.OsAccount + * @systemapi + * @since 20 + * @arkts 1.1&1.2 + */ + getAuthInfo(authType: AuthType): Promise>; /** * Gets authentication information. @@ -4231,29 +4792,25 @@ declare namespace osAccount { * @systemapi Hide this for inner system use. * @since 12 */ - getAuthInfo(options?: GetAuthInfoOptions): Promise>; - /** - * Gets the credential enrolled identifier of the specified authentication type. + * Gets authentication information. * * @permission ohos.permission.USE_USER_IDM - * @param { AuthType } authType - Indicates the authentication type. - * @param { number } [accountId] - Indicates the OS account identifier. - * @returns { Promise } Returns the enrolled identifier. + * @param { GetAuthInfoOptions } [options] - Indicates the options for getting the authentication information. + * @returns { Promise> } Returns all enrolled credential information + * according to the options. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Not system application. - * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. - *
2. Incorrect parameter types. * @throws { BusinessError } 12300001 - The system service works abnormally. - * @throws { BusinessError } 12300002 - Invalid authType. + * @throws { BusinessError } 12300002 - Invalid options. * @throws { BusinessError } 12300003 - Account not found. - * @throws { BusinessError } 12300102 - The credential does not exist. - * @throws { BusinessError } 12300106 - The authentication type is not supported. + * @throws { BusinessError } 12300020 - Device hardware abnormal. * @syscap SystemCapability.Account.OsAccount - * @systemapi Hide this for inner system use. - * @since 12 + * @systemapi + * @since 20 + * @arkts 1.1&1.2 */ - getEnrolledId(authType: AuthType, accountId?: number): Promise; + getAuthInfo(options?: GetAuthInfoOptions): Promise>; } /** @@ -4278,21 +4835,23 @@ declare namespace osAccount { /** * Indicates the OS account identifier. * - * @type { ?number } + * @type { ?int } * @syscap SystemCapability.Account.OsAccount * @systemapi - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - accountId?: number; + accountId?: int; } /** * Indicates the enumeration of the authentication intent. * - * @enum { number } AuthIntent + * @enum { int } AuthIntent * @syscap SystemCapability.Account.OsAccount * @systemapi - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ enum AuthIntent { /** @@ -4328,6 +4887,7 @@ declare namespace osAccount { * @syscap SystemCapability.Account.OsAccount * @systemapi * @since 20 + * @arkts 1.1&1.2 */ ABANDONED_PIN_AUTH = 4 } @@ -4364,12 +4924,13 @@ declare namespace osAccount { /** * Indicates the collector token identifier. * - * @type { ?number } + * @type { ?int } * @syscap SystemCapability.Account.OsAccount * @systemapi - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - collectorTokenId?: number; + collectorTokenId?: int; } /** @@ -4384,12 +4945,13 @@ declare namespace osAccount { /** * Indicates the local ID of the OS account to be authenticated. * - * @type { ?number } + * @type { ?int } * @syscap SystemCapability.Account.OsAccount * @systemapi - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - accountId?: number; + accountId?: int; /** * Indicates the authentication intent. @@ -4424,16 +4986,18 @@ declare namespace osAccount { /** * Notifies to set data. * - * @type { function } + * @param { AuthSubType } authSubType - Indicates the authentication credential subtype. + * @param { Uint8Array } data - Indicates the authentication credential data. * @throws { BusinessError } 202 - Not system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. * @throws { BusinessError } 12300002 - Invalid pinSubType. * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 8 + * @since arkts {'1.1':'8', '1.2':'20'} + * @arkts 1.1&1.2 */ - onSetData: (authSubType: AuthSubType, data: Uint8Array) => void; + onSetData(authSubType: AuthSubType, data: Uint8Array): void; } /** @@ -4494,9 +5058,10 @@ declare namespace osAccount { * @type { function } * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 8 + * @since arkts {'1.1':'8', '1.2':'20'} + * @arkts 1.1&1.2 */ - onResult: (result: number, extraInfo: AuthResult) => void; + onResult: (result: int, extraInfo: AuthResult) => void; /** * During an authentication, the TipsCode is returned through the callback. @@ -4504,9 +5069,10 @@ declare namespace osAccount { * @type { ?function } * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 8 + * @since arkts {'1.1':'8', '1.2':'20'} + * @arkts 1.1&1.2 */ - onAcquireInfo?: (module: number, acquire: number, extraInfo: Uint8Array) => void; + onAcquireInfo?: (module: int, acquire: int, extraInfo: Uint8Array) => void; } /** @@ -4524,9 +5090,10 @@ declare namespace osAccount { * @type { function } * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 8 + * @since arkts {'1.1':'8', '1.2':'20'} + * @arkts 1.1&1.2 */ - onResult: (result: number, extraInfo: RequestResult) => void; + onResult: (result: int, extraInfo: RequestResult) => void; /** * During an authentication, the TipsCode is returned through the callback. @@ -4534,9 +5101,10 @@ declare namespace osAccount { * @type { ?function } * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 8 + * @since arkts {'1.1':'8', '1.2':'20'} + * @arkts 1.1&1.2 */ - onAcquireInfo?: (module: number, acquire: number, extraInfo: Uint8Array) => void; + onAcquireInfo?: (module: int, acquire: int, extraInfo: Uint8Array) => void; } /** @@ -4571,12 +5139,13 @@ declare namespace osAccount { /** * Indicates the OS account identifier. * - * @type { ?number } + * @type { ?int } * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - accountId?: number; + accountId?: int; } /** @@ -4631,12 +5200,13 @@ declare namespace osAccount { /** * Indicates the result. * - * @type { number } + * @type { int } * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 8 + * @since arkts {'1.1':'8', '1.2':'20'} + * @arkts 1.1&1.2 */ - result: number; + result: int; /** * Indicates the authentication credential subtype. @@ -4651,32 +5221,35 @@ declare namespace osAccount { /** * Indicates the remaining times. * - * @type { ?number } + * @type { ?int } * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 8 + * @since arkts {'1.1':'8', '1.2':'20'} + * @arkts 1.1&1.2 */ - remainTimes?: number; + remainTimes?: int; /** * Indicates the freezing times. * - * @type { ?number } + * @type { ?int } * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 8 + * @since arkts {'1.1':'8', '1.2':'20'} + * @arkts 1.1&1.2 */ - freezingTime?: number; + freezingTime?: int; /** * Indicates next phase freezing time. * - * @type { ?number } + * @type { ?int } * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - nextPhaseFreezingTime?: number; + nextPhaseFreezingTime?: int; /** * Indicates the enrollment progress. @@ -4697,16 +5270,6 @@ declare namespace osAccount { * @since 10 */ sensorInfo?: string; - - /** - * Indicates the credential length. - * - * @type { ?number } - * @syscap SystemCapability.Account.OsAccount - * @systemapi - * @since 20 - */ - credentialLength?: number; } /** @@ -4731,32 +5294,35 @@ declare namespace osAccount { /** * Indicates the remaining times. * - * @type { ?number } + * @type { ?int } * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 8 + * @since arkts {'1.1':'8', '1.2':'20'} + * @arkts 1.1&1.2 */ - remainTimes?: number; + remainTimes?: int; /** * Indicates the freezing times. * - * @type { ?number } + * @type { ?int } * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 8 + * @since arkts {'1.1':'8', '1.2':'20'} + * @arkts 1.1&1.2 */ - freezingTime?: number; + freezingTime?: int; /** * Indicates next phase freezing time. * - * @type { ?number } + * @type { ?int } * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - nextPhaseFreezingTime?: number; + nextPhaseFreezingTime?: int; /** * Indicates the credential ID. @@ -4771,22 +5337,24 @@ declare namespace osAccount { /** * Indicates the local ID of the authenticated OS account. * - * @type { ?number } + * @type { ?int } * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - accountId?: number; + accountId?: int; /** * Indicates the validity period after which the PIN will expire. * - * @type { ?number } + * @type { ?long } * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - pinValidityPeriod?: number; + pinValidityPeriod?: long; } /** @@ -4831,12 +5399,13 @@ declare namespace osAccount { /** * Indicates the local ID of the OS account to which the credential belongs. * - * @type { ?number } + * @type { ?int } * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - accountId?: number; + accountId?: int; } /** @@ -4914,27 +5483,19 @@ declare namespace osAccount { * @syscap SystemCapability.Account.OsAccount * @systemapi * @since 20 + * @arkts 1.1&1.2 */ isAbandoned?: boolean; - - /** - * Indicates the validity period. - * - * @type { ?number } - * @syscap SystemCapability.Account.OsAccount - * @systemapi - * @since 20 - */ - validityPeriod?: number; } /** * Indicates the property type to get. * - * @enum { number } GetPropertyType + * @enum { int } GetPropertyType * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 8 + * @since arkts {'1.1':'8', '1.2':'20'} + * @arkts 1.1&1.2 */ enum GetPropertyType { /** @@ -4997,6 +5558,7 @@ declare namespace osAccount { * @syscap SystemCapability.Account.OsAccount * @systemapi * @since 20 + * @arkts 1.1&1.2 */ CREDENTIAL_LENGTH = 7 } @@ -5004,10 +5566,11 @@ declare namespace osAccount { /** * Indicates the property type to set. * - * @enum { number } SetPropertyType + * @enum { int } SetPropertyType * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 8 + * @since arkts {'1.1':'8', '1.2':'20'} + * @arkts 1.1&1.2 */ enum SetPropertyType { /** @@ -5023,10 +5586,11 @@ declare namespace osAccount { /** * Indicates the credential type for authentication. * - * @enum { number } AuthType + * @enum { int } AuthType * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 8 + * @since arkts {'1.1':'8', '1.2':'20'} + * @arkts 1.1&1.2 */ enum AuthType { /** @@ -5081,16 +5645,17 @@ declare namespace osAccount { * @systemapi Hide this for inner system use. * @since 9 */ - DOMAIN = 1024 + DOMAIN = 1024, } /** * Indicates the credential subtype for authentication. * - * @enum { number } AuthSubType + * @enum { int } AuthSubType * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 8 + * @since arkts {'1.1':'8', '1.2':'20'} + * @arkts 1.1&1.2 */ enum AuthSubType { /** @@ -5205,10 +5770,11 @@ declare namespace osAccount { /** * Indicates the trusted level of authentication results. * - * @enum { number } AuthTrustLevel + * @enum { int } AuthTrustLevel * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 8 + * @since arkts {'1.1':'8', '1.2':'20'} + * @arkts 1.1&1.2 */ enum AuthTrustLevel { /** @@ -5251,10 +5817,11 @@ declare namespace osAccount { /** * Indicates the module of acquired information. * - * @enum { number } Module + * @enum { int } Module * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 8 + * @since arkts {'1.1':'8', '1.2':'20'} + * @arkts 1.1&1.2 */ enum Module { /** @@ -5270,10 +5837,11 @@ declare namespace osAccount { /** * Indicates the enumeration of authentication result code. * - * @enum { number } ResultCode + * @enum { int } ResultCode * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 8 + * @since arkts {'1.1':'8', '1.2':'20'} + * @arkts 1.1&1.2 */ enum ResultCode { /** @@ -5379,10 +5947,11 @@ declare namespace osAccount { /** * Indicates the enumeration of prompt codes in the process of face authentication. * - * @enum { number } FaceTipsCode + * @enum { int } FaceTipsCode * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 8 + * @since arkts {'1.1':'8', '1.2':'20'} + * @arkts 1.1&1.2 */ enum FaceTipsCode { /** @@ -5488,10 +6057,11 @@ declare namespace osAccount { /** * Indicates the enumeration of prompt codes in the process of fingerprint authentication. * - * @enum { number } FingerprintTips + * @enum { int } FingerprintTips * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 8 + * @since arkts {'1.1':'8', '1.2':'20'} + * @arkts 1.1&1.2 */ enum FingerprintTips { /** @@ -5570,10 +6140,11 @@ declare namespace osAccount { /** * Enumerates for constraint source types. * - * @enum { number } ConstraintSourceType + * @enum { int } ConstraintSourceType * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ enum ConstraintSourceType { /** @@ -5626,12 +6197,13 @@ declare namespace osAccount { * Indicates the id of an os account who set the constraint. * When type is CONSTRAINT_NOT_EXIST or CONSTRAINT_TYPE_BASE, localId will be -1. * - * @type { number } + * @type { int } * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - localId: number; + localId: int; /** * Indicates the source type of the constraint. @@ -5643,6 +6215,29 @@ declare namespace osAccount { */ type: ConstraintSourceType; } + + /** + * Defines the created/removed event data structure for the OS account. + * + * @interface OsAccountEventData + * @syscap SystemCapability.Account.OsAccount + * @systemapi + * @since 20 + * @arkts 1.1&1.2 + */ + interface OsAccountEventData { + + /** + * Indicates the event type. + * + * @type { string } + * @syscap SystemCapability.Account.OsAccount + * @systemapi + * @since 20 + * @arkts 1.1&1.2 + */ + event: string; + } } export default osAccount; \ No newline at end of file