修改param,callback格式

Signed-off-by: xujie <xujie223@huawei.com>
This commit is contained in:
xujie 2023-06-09 14:08:43 +08:00
parent 7aba78c16e
commit 975893d2ed
7 changed files with 368 additions and 369 deletions

View File

@ -37,8 +37,8 @@ declare namespace connection {
/**
* Create a network connection with optional netSpecifier and timeout.
* @param { NetSpecifier } netSpecifier Indicates the network specifier. See {@link NetSpecifier}.
* @param { number } timeout The time in milliseconds to attempt looking for a suitable network before
* @param { NetSpecifier } netSpecifier - Indicates the network specifier. See {@link NetSpecifier}.
* @param { number } timeout - The time in milliseconds to attempt looking for a suitable network before
* {@link NetConnection#netUnavailable} is called.
* @returns { NetConnection } the NetConnection of the NetSpecifier.
* @syscap SystemCapability.Communication.NetManager.Core
@ -46,8 +46,8 @@ declare namespace connection {
*/
/**
* Create a network connection with optional netSpecifier and timeout.
* @param { NetSpecifier } netSpecifier Indicates the network specifier. See {@link NetSpecifier}.
* @param { number } timeout The time in milliseconds to attempt looking for a suitable network before
* @param { NetSpecifier } netSpecifier - Indicates the network specifier. See {@link NetSpecifier}.
* @param { number } timeout - The time in milliseconds to attempt looking for a suitable network before
* {@link NetConnection#netUnavailable} is called.
* @returns { NetConnection } the NetConnection of the NetSpecifier.
* @syscap SystemCapability.Communication.NetManager.Core
@ -60,8 +60,7 @@ declare namespace connection {
* Obtains the data network that is activated by default.
* To call this method, you must have the {@code ohos.permission.GET_NETWORK_INFO} permission.
* @permission ohos.permission.GET_NETWORK_INFO
* @param { AsyncCallback<NetHandle> } callback Returns the {@link NetHandle} object;
* returns {@code null} if the default network is not activated.
* @param { AsyncCallback<NetHandle> } callback - the callback of getDefaultNet.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 2100002 - Operation failed. Cannot connect to service.
@ -103,7 +102,7 @@ declare namespace connection {
* Obtains the list of data networks that are activated.
* To invoke this method, you must have the {@code ohos.permission.GET_NETWORK_INFO} permission.
* @permission ohos.permission.GET_NETWORK_INFO
* @param { AsyncCallback<Array<NetHandle>> } callback Returns the {@link NetHandle} object; returns {@code null} if no network is activated.
* @param { AsyncCallback<Array<NetHandle>> } callback - the callback of getAllNets.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 2100002 - Operation failed. Cannot connect to service.
@ -131,8 +130,8 @@ declare namespace connection {
* Queries the connection properties of a network.
* This method requires the {@code ohos.permission.GET_NETWORK_INFO} permission.
* @permission ohos.permission.GET_NETWORK_INFO
* @param { NetHandle } netHandle Indicates the network to be queried.
* @param { AsyncCallback<ConnectionProperties> } callback Returns the {@link ConnectionProperties} object.
* @param { NetHandle } netHandle - Indicates the network to be queried.
* @param { AsyncCallback<ConnectionProperties> } callback - the callback of getConnectionProperties.{@link ConnectionProperties}.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 2100001 - Invalid parameter value.
@ -147,7 +146,7 @@ declare namespace connection {
* Queries the connection properties of a network.
* This method requires the {@code ohos.permission.GET_NETWORK_INFO} permission.
* @permission ohos.permission.GET_NETWORK_INFO
* @param { NetHandle } netHandle Indicates the network to be queried.
* @param { NetHandle } netHandle - Indicates the network to be queried.
* @returns { Promise<ConnectionProperties> } The promise returned by the function.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Parameter error.
@ -163,8 +162,8 @@ declare namespace connection {
* Obtains {@link NetCapabilities} of a {@link NetHandle} object.
* To invoke this method, you must have the {@code ohos.permission.GET_NETWORK_INFO} permission.
* @permission ohos.permission.GET_NETWORK_INFO
* @param { NetHandle } netHandle Indicates the handle. See {@link NetHandle}.
* @param { AsyncCallback<NetCapabilities> } callback Returns {@link NetCapabilities}; returns {@code null} if {@code handle} is invalid.
* @param { NetHandle } netHandle - Indicates the handle. See {@link NetHandle}.
* @param { AsyncCallback<NetCapabilities> } callback - the callback of getNetCapabilities.{@link NetCapabilities}.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 2100001 - Invalid parameter value.
@ -179,7 +178,7 @@ declare namespace connection {
* Obtains {@link NetCapabilities} of a {@link NetHandle} object.
* To invoke this method, you must have the {@code ohos.permission.GET_NETWORK_INFO} permission.
* @permission ohos.permission.GET_NETWORK_INFO
* @param { NetHandle } netHandle Indicates the handle. See {@link NetHandle}.
* @param { NetHandle } netHandle - Indicates the handle. See {@link NetHandle}.
* @returns { Promise<NetCapabilities> } The promise returned by the function.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Parameter error.
@ -194,7 +193,7 @@ declare namespace connection {
/**
* Checks whether data traffic usage on the current network is metered.
* @permission ohos.permission.GET_NETWORK_INFO
* @param { AsyncCallback<boolean> } callback Returns {@code true} if data traffic usage on the current network is metered;
* @param { AsyncCallback<boolean> } callback - Returns {@code true} if data traffic usage on the current network is metered;
* returns {@code false} otherwise.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Parameter error.
@ -221,7 +220,7 @@ declare namespace connection {
/**
* Checks whether the default data network is activated.
* @permission ohos.permission.GET_NETWORK_INFO
* @param { AsyncCallback<boolean> } callback Returns {@code true} if the default data network is activated;
* @param { AsyncCallback<boolean> } callback - Returns {@code true} if the default data network is activated;
* returns {@code false} otherwise.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Parameter error.
@ -233,7 +232,7 @@ declare namespace connection {
/**
* Checks whether the default data network is activated.
* @permission ohos.permission.GET_NETWORK_INFO
* @param { AsyncCallback<boolean> } callback Returns {@code true} if the default data network is activated;
* @param { AsyncCallback<boolean> } callback - Returns {@code true} if the default data network is activated;
* returns {@code false} otherwise.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Parameter error.
@ -337,7 +336,7 @@ declare namespace connection {
/**
* Reports the network state is connected.
* @permission ohos.permission.GET_NETWORK_INFO and ohos.permission.INTERNET
* @param { NetHandle } netHandle Indicates the network whose state is to be reported.
* @param { NetHandle } netHandle - Indicates the network whose state is to be reported.
* @param { AsyncCallback<void> } callback - the callback of reportNetConnected.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Parameter error.
@ -352,7 +351,7 @@ declare namespace connection {
/**
* Reports the network state is connected.
* @permission ohos.permission.GET_NETWORK_INFO and ohos.permission.INTERNET
* @param { NetHandle } netHandle Indicates the network whose state is to be reported.
* @param { NetHandle } netHandle - Indicates the network whose state is to be reported.
* @returns { Promise<void> } The promise returned by the function.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Parameter error.
@ -367,7 +366,7 @@ declare namespace connection {
/**
* Reports the network state is disconnected.
* @permission ohos.permission.GET_NETWORK_INFO and ohos.permission.INTERNET
* @param { NetHandle } netHandle Indicates the network whose state is to be reported.
* @param { NetHandle } netHandle - Indicates the network whose state is to be reported.
* @param { AsyncCallback<void> } callback - the callback of reportNetDisconnected.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Parameter error.
@ -382,7 +381,7 @@ declare namespace connection {
/**
* Reports the network state is disconnected.
* @permission ohos.permission.GET_NETWORK_INFO and ohos.permission.INTERNET
* @param { NetHandle } netHandle Indicates the network whose state is to be reported.
* @param { NetHandle } netHandle - Indicates the network whose state is to be reported.
* @returns { Promise<void> } The promise returned by the function.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Parameter error.
@ -397,8 +396,8 @@ declare namespace connection {
/**
* Resolves the host name to obtain all IP addresses based on the default data network.
* @permission ohos.permission.INTERNET
* @param { string } host Indicates the host name or the domain.
* @param { AsyncCallback<Array<NetAddress>> } callback Returns the NetAddress list.
* @param { string } host - Indicates the host name or the domain.
* @param { AsyncCallback<Array<NetAddress>> } callback - Returns the NetAddress list.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 2100001 - Invalid parameter value.
@ -412,7 +411,7 @@ declare namespace connection {
/**
* Resolves the host name to obtain all IP addresses based on the default data network.
* @permission ohos.permission.INTERNET
* @param { string } host Indicates the host name or the domain.
* @param { string } host - Indicates the host name or the domain.
* @returns { Promise<Array<NetAddress>> } The promise returned by the function.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Parameter error.
@ -426,7 +425,7 @@ declare namespace connection {
/**
* Obtains the {@link NetHandle} bound to a process using {@link setAppNet}.
* @param { AsyncCallback<NetHandle> } callback Returns the {@link NetHandle} bound to the process;
* @param { AsyncCallback<NetHandle> } callback - Returns the {@link NetHandle} bound to the process;
* returns {@code null} if no {@link NetHandle} is bound to the process.For details, see {@link NetHandle}.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 2100002 - Operation failed. Cannot connect to service.
@ -452,8 +451,8 @@ declare namespace connection {
* <p>All the sockets created from the process will be bound to the {@code NetHandle},
* and the resolution of all host names will be managed by the {@code NetHandle}.</p>
* @permission ohos.permission.INTERNET
* @param { NetHandle } netHandle Indicates the handle. For details, see {@link NetHandle}.
* @param { AsyncCallback<void> } callback Returns the callback of setAppNet.
* @param { NetHandle } netHandle - Indicates the handle. For details, see {@link NetHandle}.
* @param { AsyncCallback<void> } callback - the callback of setAppNet.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 2100001 - Invalid parameter value.
@ -469,7 +468,7 @@ declare namespace connection {
* <p>All the sockets created from the process will be bound to the {@code NetHandle},
* and the resolution of all host names will be managed by the {@code NetHandle}.</p>
* @permission ohos.permission.INTERNET
* @param { NetHandle } netHandle Indicates the handle. For details, see {@link NetHandle}.
* @param { NetHandle } netHandle - Indicates the handle. For details, see {@link NetHandle}.
* @returns { Promise<void> } the promise returned by the function.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Parameter error.
@ -483,7 +482,7 @@ declare namespace connection {
/**
* Obtains the network independent global {@link HttpProxy} proxy settings.
* @param { AsyncCallback<HttpProxy> } callback Returns the proxy settings. For details, see {@link HttpProxy}.
* @param { AsyncCallback<HttpProxy> } callback - Returns the proxy settings. For details, see {@link HttpProxy}.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 202 - Non-system applications use system APIs.
* @throws { BusinessError } 2100002 - Operation failed. Cannot connect to service.
@ -510,8 +509,8 @@ declare namespace connection {
/**
* Set a network independent global {@link HttpProxy} proxy settings.
* @permission ohos.permission.CONNECTIVITY_INTERNAL
* @param { HttpProxy } httpProxy Indicates the global proxy settings. For details, see {@link HttpProxy}.
* @param { AsyncCallback<void> } callback Returns the callback of setGlobalHttpProxy.
* @param { HttpProxy } httpProxy - Indicates the global proxy settings. For details, see {@link HttpProxy}.
* @param { AsyncCallback<void> } callback - the callback of setGlobalHttpProxy.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 202 - Non-system applications use system APIs.
@ -527,7 +526,7 @@ declare namespace connection {
/**
* Set a network independent global {@link HttpProxy} proxy settings.
* @permission ohos.permission.CONNECTIVITY_INTERNAL
* @param { HttpProxy } httpProxy Indicates the global proxy settings. For details, see {@link HttpProxy}.
* @param { HttpProxy } httpProxy - Indicates the global proxy settings. For details, see {@link HttpProxy}.
* @returns { Promise<void> } the promise returned by the function.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Parameter error.
@ -557,15 +556,15 @@ declare namespace connection {
export interface NetConnection {
/**
* Registers a listener for netAvailable events.
* @param { 'netAvailable' } type Indicates Event name.
* @param { Callback<NetHandle> } callback - the callback of on.
* @param { 'netAvailable' } type - Indicates Event name.
* @param { Callback<NetHandle> } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetManager.Core
* @since 8
*/
/**
* Registers a listener for netAvailable events.
* @param { 'netAvailable' } type Indicates Event name.
* @param { Callback<NetHandle> } callback - the callback of on.
* @param { 'netAvailable' } type - Indicates Event name.
* @param { Callback<NetHandle> } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetManager.Core
* @crossplatform
* @since 10
@ -574,8 +573,8 @@ declare namespace connection {
/**
* Registers a listener for netBlockStatusChange events.
* @param { 'netBlockStatusChange' } type Indicates Event name.
* @param { Callback<{ netHandle: NetHandle, blocked: boolean }> } callback - the callback of on.
* @param { 'netBlockStatusChange' } type - Indicates Event name.
* @param { Callback<{ netHandle: NetHandle, blocked: boolean }> } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetManager.Core
* @since 8
*/
@ -583,15 +582,15 @@ declare namespace connection {
/**
* Registers a listener for **netCapabilitiesChange** events.
* @param { 'netCapabilitiesChange' } type Indicates Event name.
* @param { Callback<{ netHandle: NetHandle, netCap: NetCapabilities }> } callback - the callback of on.
* @param { 'netCapabilitiesChange' } type - Indicates Event name.
* @param { Callback<{ netHandle: NetHandle, netCap: NetCapabilities }> } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetManager.Core
* @since 8
*/
/**
* Registers a listener for **netCapabilitiesChange** events.
* @param { 'netCapabilitiesChange' } type Indicates Event name.
* @param { Callback<{ netHandle: NetHandle, netCap: NetCapabilities }> } callback - the callback of on.
* @param { 'netCapabilitiesChange' } type - Indicates Event name.
* @param { Callback<{ netHandle: NetHandle, netCap: NetCapabilities }> } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetManager.Core
* @crossplatform
* @since 10
@ -600,8 +599,8 @@ declare namespace connection {
/**
* Registers a listener for netConnectionPropertiesChange events.
* @param { 'netConnectionPropertiesChange' } type Indicates Event name.
* @param { Callback<{ netHandle: NetHandle, connectionProperties: ConnectionProperties }> } callback - the callback of on.
* @param { 'netConnectionPropertiesChange' } type - Indicates Event name.
* @param { Callback<{ netHandle: NetHandle, connectionProperties: ConnectionProperties }> } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetManager.Core
* @since 8
*/
@ -609,15 +608,15 @@ declare namespace connection {
/**
* Registers a listener for **netLost** events.
* @param { 'netLost' } type Indicates Event name.
* @param { Callback<NetHandle> } callback - the callback of on.
* @param { 'netLost' } type - Indicates Event name.
* @param { Callback<NetHandle> } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetManager.Core
* @since 8
*/
/**
* Registers a listener for **netLost** events.
* @param { 'netLost' } type Indicates Event name.
* @param { Callback<NetHandle> } callback - the callback of on.
* @param { 'netLost' } type - Indicates Event name.
* @param { Callback<NetHandle> } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetManager.Core
* @crossplatform
* @since 10
@ -626,15 +625,15 @@ declare namespace connection {
/**
* Registers a listener for netUnavailable events.
* @param { 'netUnavailable' } type Indicates Event name.
* @param { Callback<void> } callback - the callback of on.
* @param { 'netUnavailable' } type - Indicates Event name.
* @param { Callback<void> } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetManager.Core
* @since 8
*/
/**
* Registers a listener for netUnavailable events.
* @param { 'netUnavailable' } type Indicates Event name.
* @param { Callback<void> } callback - the callback of on.
* @param { 'netUnavailable' } type - Indicates Event name.
* @param { Callback<void> } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetManager.Core
* @crossplatform
* @since 10
@ -753,7 +752,7 @@ declare namespace connection {
* <p>Binds a TCPSocket or UDPSocket to the current network. All data flows from
* the socket will use this network, without being subject to {@link setAppNet}.</p>
* Before using this method, ensure that the socket is disconnected.
* @param { TCPSocket | UDPSocket } socketParam Indicates the TCPSocket or UDPSocket object.
* @param { TCPSocket | UDPSocket } socketParam - Indicates the TCPSocket or UDPSocket object.
* @param { AsyncCallback<void> } callback - the callback of bindSocket.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 2100001 - Invalid parameter value.
@ -768,7 +767,7 @@ declare namespace connection {
* <p>Binds a TCPSocket or UDPSocket to the current network. All data flows from
* the socket will use this network, without being subject to {@link setAppNet}.</p>
* Before using this method, ensure that the socket is disconnected.
* @param { TCPSocket | UDPSocket } socketParam Indicates the TCPSocket or UDPSocket object.
* @param { TCPSocket | UDPSocket } socketParam - Indicates the TCPSocket or UDPSocket object.
* @returns { Promise<void> } the promise returned by the function.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 2100001 - Invalid parameter value.
@ -782,8 +781,8 @@ declare namespace connection {
/**
* Resolves a host name to obtain all IP addresses based on the specified NetHandle.
* @permission ohos.permission.INTERNET
* @param { string } host Indicates the host name or the domain.
* @param { AsyncCallback<Array<NetAddress>> } callback Returns the NetAddress list.
* @param { string } host - Indicates the host name or the domain.
* @param { AsyncCallback<Array<NetAddress>> } callback - the callback of getAddressesByName.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 2100001 - Invalid parameter value.
@ -797,7 +796,7 @@ declare namespace connection {
/**
* Resolves a host name to obtain all IP addresses based on the specified NetHandle.
* @permission ohos.permission.INTERNET
* @param { string } host Indicates the host name or the domain.
* @param { string } host - Indicates the host name or the domain.
* @returns { Promise<Array<NetAddress>> } The promise returned by the function.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Parameter error.
@ -812,8 +811,8 @@ declare namespace connection {
/**
* Resolves a host name to obtain the first IP address based on the specified NetHandle.
* @permission ohos.permission.INTERNET
* @param { string } host Indicates the host name or the domain.
* @param { AsyncCallback<NetAddress> } callback Returns the first NetAddress.
* @param { string } host - Indicates the host name or the domain.
* @param { AsyncCallback<NetAddress> } callback - the callback of getAddressByName.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 2100001 - Invalid parameter value.
@ -827,7 +826,7 @@ declare namespace connection {
/**
* Resolves a host name to obtain the first IP address based on the specified NetHandle.
* @permission ohos.permission.INTERNET
* @param { string } host Indicates the host name or the domain.
* @param { string } host - Indicates the host name or the domain.
* @returns { Promise<NetAddress> } The promise returned by the function.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Parameter error.

View File

@ -25,7 +25,7 @@ declare namespace ethernet {
/**
* Get the specified network interface information.
* @permission ohos.permission.GET_NETWORK_INFO
* @param { string } iface Indicates the network interface name.
* @param { string } iface - Indicates the network interface name.
* @param { AsyncCallback<InterfaceConfiguration> } callback - the callback of getIfaceConfig.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Non-system applications use system APIs.
@ -43,7 +43,7 @@ declare namespace ethernet {
/**
* Get the specified network interface information.
* @permission ohos.permission.GET_NETWORK_INFO
* @param { string } iface Indicates the network interface name.
* @param { string } iface - Indicates the network interface name.
* @returns { Promise<InterfaceConfiguration> } the promise returned by the function.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Non-system applications use system APIs.
@ -61,8 +61,8 @@ declare namespace ethernet {
/**
* Set the specified network interface parameters.
* @permission ohos.permission.CONNECTIVITY_INTERNAL
* @param { string } iface Indicates the network interface name of the network parameter.
* @param { InterfaceConfiguration } ic Indicates the ic. See {@link InterfaceConfiguration}.
* @param { string } iface - Indicates the network interface name of the network parameter.
* @param { InterfaceConfiguration } ic - Indicates the ic. See {@link InterfaceConfiguration}.
* @param { AsyncCallback<void> } callback - the callback of setIfaceConfig.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Non-system applications use system APIs.
@ -83,8 +83,8 @@ declare namespace ethernet {
/**
* Set the specified network interface parameters.
* @permission ohos.permission.CONNECTIVITY_INTERNAL
* @param { string } iface Indicates the network interface name of the network parameter.
* @param { InterfaceConfiguration } ic Indicates the ic. See {@link InterfaceConfiguration}.
* @param { string } iface - Indicates the network interface name of the network parameter.
* @param { InterfaceConfiguration } ic - Indicates the ic. See {@link InterfaceConfiguration}.
* @returns { Promise<void> } the promise returned by the function.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Non-system applications use system APIs.
@ -105,7 +105,7 @@ declare namespace ethernet {
/**
* Check whether the specified network is active.
* @permission ohos.permission.GET_NETWORK_INFO
* @param { string } iface Indicates the network interface name.
* @param { string } iface - Indicates the network interface name.
* @param { AsyncCallback<number> } callback - the callback of isIfaceActive.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Non-system applications use system APIs.
@ -123,7 +123,7 @@ declare namespace ethernet {
/**
* Check whether the specified network is active.
* @permission ohos.permission.GET_NETWORK_INFO
* @param { string } iface Indicates the network interface name.
* @param { string } iface - Indicates the network interface name.
* @returns { Promise<number> } the promise returned by the function.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Non-system applications use system APIs.
@ -169,8 +169,8 @@ declare namespace ethernet {
/**
* Register a callback for the ethernet interface active state change.
* @permission ohos.permission.GET_NETWORK_INFO
* @param { 'interfaceStateChange' } type Indicates Event name.
* @param { Callback<{ iface: string, active: boolean }> } callback including iface Indicates the ethernet interface,
* @param { 'interfaceStateChange' } type - Indicates Event name.
* @param { Callback<{ iface: string, active: boolean }> } callback - Including iface Indicates the ethernet interface,
* and active Indicates whether the interface is active.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Non-system applications use system APIs.
@ -184,8 +184,8 @@ declare namespace ethernet {
/**
* Unregister a callback from the ethernet interface active state change.
* @permission ohos.permission.GET_NETWORK_INFO
* @param { 'interfaceStateChange' } type Indicates Event name.
* @param { Callback<{ iface: string, active: boolean }> } callback including iface Indicates the ethernet interface,
* @param { 'interfaceStateChange' } type - Indicates Event name.
* @param { Callback<{ iface: string, active: boolean }> } callback - Including iface Indicates the ethernet interface,
* and active Indicates whether the interface is active.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Non-system applications use system APIs.

View File

@ -238,7 +238,7 @@ declare namespace http {
/**
* Initiates an HTTP request to a given URL.
* @permission ohos.permission.INTERNET
* @param { string } url URL for initiating an HTTP request.
* @param { string } url - URL for initiating an HTTP request.
* @param { AsyncCallback<HttpResponse> } callback - the callback of request.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
@ -277,7 +277,7 @@ declare namespace http {
/**
* Initiates an HTTP request to a given URL.
* @permission ohos.permission.INTERNET
* @param { string } url URL for initiating an HTTP request.
* @param { string } url - URL for initiating an HTTP request.
* @param { AsyncCallback<HttpResponse> } callback - the callback of request.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
@ -319,9 +319,9 @@ declare namespace http {
/**
* Initiates an HTTP request to a given URL.
* @permission ohos.permission.INTERNET
* @param { string } url URL for initiating an HTTP request.
* @param { HttpRequestOptions } options Optional parameters {@link HttpRequestOptions}.
* @param { AsyncCallback<HttpResponse> } callback callback - the callback of request..
* @param { string } url - URL for initiating an HTTP request.
* @param { HttpRequestOptions } options - Optional parameters {@link HttpRequestOptions}.
* @param { AsyncCallback<HttpResponse> } callback - the callback of request..
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 2300001 - Unsupported protocol.
@ -359,9 +359,9 @@ declare namespace http {
/**
* Initiates an HTTP request to a given URL.
* @permission ohos.permission.INTERNET
* @param { string } url URL for initiating an HTTP request.
* @param { HttpRequestOptions } options Optional parameters {@link HttpRequestOptions}.
* @param { AsyncCallback<HttpResponse> } callback callback - the callback of request..
* @param { string } url - URL for initiating an HTTP request.
* @param { HttpRequestOptions } options - Optional parameters {@link HttpRequestOptions}.
* @param { AsyncCallback<HttpResponse> } callback - the callback of request.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 2300001 - Unsupported protocol.
@ -402,8 +402,8 @@ declare namespace http {
/**
* Initiates an HTTP request to a given URL.
* @permission ohos.permission.INTERNET
* @param { string } url URL for initiating an HTTP request.
* @param { HttpRequestOptions } options Optional parameters {@link HttpRequestOptions}.
* @param { string } url - URL for initiating an HTTP request.
* @param { HttpRequestOptions } options - Optional parameters {@link HttpRequestOptions}.
* @returns { Promise<HttpResponse> } The promise returned by the function.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
@ -442,8 +442,8 @@ declare namespace http {
/**
* Initiates an HTTP request to a given URL.
* @permission ohos.permission.INTERNET
* @param { string } url URL for initiating an HTTP request.
* @param { HttpRequestOptions } options Optional parameters {@link HttpRequestOptions}.
* @param { string } url - URL for initiating an HTTP request.
* @param { HttpRequestOptions } options - Optional parameters {@link HttpRequestOptions}.
* @returns { Promise<HttpResponse> } The promise returned by the function.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
@ -485,8 +485,8 @@ declare namespace http {
/**
* Initiates an HTTP request to a given URL, applicable to scenarios where http response supports streaming.
* @permission ohos.permission.INTERNET
* @param { string } url URL for initiating an HTTP request.
* @param { AsyncCallback<number> } callback Returns the callback of request2 {@link ResponseCode},
* @param { string } url - URL for initiating an HTTP request.
* @param { AsyncCallback<number> } callback - Returns the callback of request2 {@link ResponseCode},
* should use on_headersReceive and on_dataReceive to get http response.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
@ -527,8 +527,8 @@ declare namespace http {
/**
* Initiates an HTTP request to a given URL, applicable to scenarios where http response supports streaming.
* @permission ohos.permission.INTERNET
* @param { string } url URL for initiating an HTTP request.
* @param { HttpRequestOptions } options Optional parameters {@link HttpRequestOptions}.
* @param { string } url - URL for initiating an HTTP request.
* @param { HttpRequestOptions } options - Optional parameters {@link HttpRequestOptions}.
* @param { AsyncCallback<number> } callback - the callback of request2.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
@ -569,8 +569,8 @@ declare namespace http {
/**
* Initiates an HTTP request to a given URL, applicable to scenarios where http response supports streaming.
* @permission ohos.permission.INTERNET
* @param { string } url URL for initiating an HTTP request.
* @param { HttpRequestOptions } options Optional parameters {@link HttpRequestOptions}.
* @param { string } url - URL for initiating an HTTP request.
* @param { HttpRequestOptions } options - Optional parameters {@link HttpRequestOptions}.
* @returns { Promise<number> } the promise returned by the function.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
@ -623,8 +623,8 @@ declare namespace http {
/**
* Registers an observer for HTTP Response Header events.
* @param { "headerReceive" } type Indicates Event name.
* @param { AsyncCallback<Object> } callback - the callback of on.
* @param { "headerReceive" } type - Indicates Event name.
* @param { AsyncCallback<Object> } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetStack
* @since 6
* @deprecated since 8
@ -634,8 +634,8 @@ declare namespace http {
/**
* Unregisters the observer for HTTP Response Header events.
* @param { "headerReceive" } type Indicates Event name.
* @param { AsyncCallback<Object> } callback - the callback of off.
* @param { "headerReceive" } type - Indicates Event name.
* @param { AsyncCallback<Object> } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetStack
* @since 6
* @deprecated since 8
@ -645,15 +645,15 @@ declare namespace http {
/**
* Registers an observer for HTTP Response Header events.
* @param { "headersReceive" } type Indicates Event name.
* @param { Callback<Object> } callback - the callback of on.
* @param { "headersReceive" } type - Indicates Event name.
* @param { Callback<Object> } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetStack
* @since 8
*/
/**
* Registers an observer for HTTP Response Header events.
* @param { "headersReceive" } type Indicates Event name.
* @param { Callback<Object> } callback - the callback of on.
* @param { "headersReceive" } type - Indicates Event name.
* @param { Callback<Object> } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetStack
* @crossplatform
* @since 10
@ -662,15 +662,15 @@ declare namespace http {
/**
* Unregisters the observer for HTTP Response Header events.
* @param { "headersReceive" } type Indicates Event name.
* @param { Callback<Object> } callback - the callback of off.
* @param { "headersReceive" } type - Indicates Event name.
* @param { Callback<Object> } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetStack
* @since 8
*/
/**
* Unregisters the observer for HTTP Response Header events.
* @param { "headersReceive" } type Indicates Event name.
* @param { Callback<Object> } callback - the callback of off.
* @param { "headersReceive" } type - Indicates Event name.
* @param { Callback<Object> } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetStack
* @crossplatform
* @since 10
@ -679,15 +679,15 @@ declare namespace http {
/**
* Registers a one-time observer for HTTP Response Header events.
* @param { "headersReceive" } type Indicates Event name.
* @param { Callback<Object> } callback - the callback of once.
* @param { "headersReceive" } type - Indicates Event name.
* @param { Callback<Object> } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetStack
* @since 8
*/
/**
* Registers a one-time observer for HTTP Response Header events.
* @param { "headersReceive" } type Indicates Event name.
* @param { Callback<Object> } callback - the callback of once.
* @param { "headersReceive" } type - Indicates Event name.
* @param { Callback<Object> } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetStack
* @crossplatform
* @since 10
@ -696,8 +696,8 @@ declare namespace http {
/**
* Registers an observer for receiving HTTP Response data events continuously.
* @param { "dataReceive" } type Indicates Event name.
* @param { Callback<ArrayBuffer> } callback - the callback of on.
* @param { "dataReceive" } type - Indicates Event name.
* @param { Callback<ArrayBuffer> } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetStack
* @since 10
*/
@ -705,8 +705,8 @@ declare namespace http {
/**
* Unregisters an observer for receiving HTTP Response data events continuously.
* @param { "dataReceive" } type Indicates Event name.
* @param { Callback<ArrayBuffer> } callback - the callback of off.
* @param { "dataReceive" } type - Indicates Event name.
* @param { Callback<ArrayBuffer> } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetStack
* @since 10
*/
@ -714,8 +714,8 @@ declare namespace http {
/**
* Registers an observer for receiving HTTP Response data ends events.
* @param { "dataEnd" } type Indicates Event name.
* @param { Callback<void> } callback - the callback of on.
* @param { "dataEnd" } type - Indicates Event name.
* @param { Callback<void> } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetStack
* @since 10
*/
@ -723,8 +723,8 @@ declare namespace http {
/**
* Unregisters an observer for receiving HTTP Response data ends events.
* @param { "dataEnd" } type Indicates Event name.
* @param { Callback<void> } callback - the callback of off.
* @param { "dataEnd" } type - Indicates Event name.
* @param { Callback<void> } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetStack
* @since 10
*/
@ -732,8 +732,8 @@ declare namespace http {
/**
* Registers an observer for progress of receiving HTTP Response data events.
* @param { "dataProgress" } type Indicates Event name.
* @param { Callback<{ receiveSize: number, totalSize: number }> } callback - the callback of on.
* @param { "dataProgress" } type - Indicates Event name.
* @param { Callback<{ receiveSize: number, totalSize: number }> } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetStack
* @since 10
*/
@ -741,8 +741,8 @@ declare namespace http {
/**
* Unregisters an observer for progress of receiving HTTP Response data events.
* @param { "dataProgress" } type Indicates Event name.
* @param { Callback<{ receiveSize: number, totalSize: number }> } callback - the callback of off.
* @param { "dataProgress" } type - Indicates Event name.
* @param { Callback<{ receiveSize: number, totalSize: number }> } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetStack
* @since 10
*/
@ -1535,14 +1535,14 @@ declare namespace http {
/**
* Creates a default {@code HttpResponseCache} object to store the responses of HTTP access requests.
* @param { number } cacheSize the size of cache(max value is 10MB), default is 10*1024*1024(10MB).
* @param { number } cacheSize - the size of cache(max value is 10MB), default is 10*1024*1024(10MB).
* @returns { HttpResponseCache } the HttpResponseCache of the createHttpResponseCache.
* @syscap SystemCapability.Communication.NetStack
* @since 9
*/
/**
* Creates a default {@code HttpResponseCache} object to store the responses of HTTP access requests.
* @param { number } cacheSize the size of cache(max value is 10MB), default is 10*1024*1024(10MB).
* @param { number } cacheSize - the size of cache(max value is 10MB), default is 10*1024*1024(10MB).
* @returns { HttpResponseCache } the HttpResponseCache of the createHttpResponseCache.
* @syscap SystemCapability.Communication.NetStack
* @crossplatform
@ -1566,13 +1566,13 @@ declare namespace http {
export interface HttpResponseCache {
/**
* Writes data in the cache to the file system so that all the cached data can be accessed in the next HTTP request.
* @param { AsyncCallback<void> } callback Returns the callback of flush.
* @param { AsyncCallback<void> } callback - the callback of flush.
* @syscap SystemCapability.Communication.NetStack
* @since 9
*/
/**
* Writes data in the cache to the file system so that all the cached data can be accessed in the next HTTP request.
* @param { AsyncCallback<void> } callback Returns the callback of flush.
* @param { AsyncCallback<void> } callback - the callback of flush.
* @syscap SystemCapability.Communication.NetStack
* @crossplatform
* @since 10
@ -1596,13 +1596,13 @@ declare namespace http {
/**
* Disables a cache and deletes the data in it.
* @param { AsyncCallback<void> } callback Returns the callback of delete.
* @param { AsyncCallback<void> } callback - the callback of delete.
* @syscap SystemCapability.Communication.NetStack
* @since 9
*/
/**
* Disables a cache and deletes the data in it.
* @param { AsyncCallback<void> } callback Returns the callback of delete.
* @param { AsyncCallback<void> } callback - the callback of delete.
* @syscap SystemCapability.Communication.NetStack
* @crossplatform
* @since 10

View File

@ -28,9 +28,9 @@ declare namespace mdns {
/**
* Adds an mDNS service.
* @param { Context } context Indicates the context of application or capability.
* @param { LocalServiceInfo } serviceInfo Information about the mDNS service. {@link LocalServiceInfo}
* @param { AsyncCallback<LocalServiceInfo> } callback Returns the callback of addLocalService.
* @param { Context } context - Indicates the context of application or capability.
* @param { LocalServiceInfo } serviceInfo - Information about the mDNS service. {@link LocalServiceInfo}
* @param { AsyncCallback<LocalServiceInfo> } callback - the callback of addLocalService.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 2100002 - Operation failed. Cannot connect to service.
* @throws { BusinessError } 2100003 - System internal error.
@ -45,8 +45,8 @@ declare namespace mdns {
/**
* Adds an mDNS service.
* @param { Context } context Indicates the context of application or capability.
* @param { LocalServiceInfo } serviceInfo Information about the mDNS service. {@link LocalServiceInfo}
* @param { Context } context - Indicates the context of application or capability.
* @param { LocalServiceInfo } serviceInfo - Information about the mDNS service. {@link LocalServiceInfo}
* @returns { Promise<LocalServiceInfo> } The promise returned by the function.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 2100002 - Operation failed. Cannot connect to service.
@ -61,9 +61,9 @@ declare namespace mdns {
/**
* Removes an mDNS service.
* @param { Context } context Indicates the context of application or capability.
* @param { LocalServiceInfo } serviceInfo Information about the mDNS service. {@link LocalServiceInfo}
* @param { AsyncCallback<LocalServiceInfo> } callback Returns the callback of removeLocalService.
* @param { Context } context - Indicates the context of application or capability.
* @param { LocalServiceInfo } serviceInfo - Information about the mDNS service. {@link LocalServiceInfo}
* @param { AsyncCallback<LocalServiceInfo> } callback - the callback of removeLocalService.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 2100002 - Operation failed. Cannot connect to service.
* @throws { BusinessError } 2100003 - System internal error.
@ -78,8 +78,8 @@ declare namespace mdns {
/**
* Removes an mDNS service.
* @param { Context } context Indicates the context of application or capability.
* @param { LocalServiceInfo } serviceInfo Information about the mDNS service. {@link LocalServiceInfo}
* @param { Context } context - Indicates the context of application or capability.
* @param { LocalServiceInfo } serviceInfo - Information about the mDNS service. {@link LocalServiceInfo}
* @returns { Promise<LocalServiceInfo> } The promise returned by the function.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 2100002 - Operation failed. Cannot connect to service.
@ -94,8 +94,8 @@ declare namespace mdns {
/**
* Create an mDNS based discovery service with context and serviceType.
* @param { Context } context Indicates the context of application or capability.
* @param { string } serviceType The service type being discovered.
* @param { Context } context - Indicates the context of application or capability.
* @param { string } serviceType - The service type being discovered.
* @returns { DiscoveryService } the DiscoveryService of the createDiscoveryService.
* @throws { BusinessError } 401 - Parameter error.
* @syscap SystemCapability.Communication.NetManager.MDNS
@ -105,9 +105,9 @@ declare namespace mdns {
/**
* Resolves an mDNS service.
* @param { Context } context Indicates the context of application or capability.
* @param { LocalServiceInfo } serviceInfo Information about the mDNS service. {@link LocalServiceInfo}
* @param { AsyncCallback<LocalServiceInfo> } callback Returns the callback of resolveLocalService.
* @param { Context } context - Indicates the context of application or capability.
* @param { LocalServiceInfo } serviceInfo - Information about the mDNS service. {@link LocalServiceInfo}
* @param { AsyncCallback<LocalServiceInfo> } callback - the callback of resolveLocalService.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 2100002 - Operation failed. Cannot connect to service.
* @throws { BusinessError } 2100003 - System internal error.
@ -122,8 +122,8 @@ declare namespace mdns {
/**
* Resolves an mDNS service.
* @param { Context } context Indicates the context of application or capability.
* @param { LocalServiceInfo } serviceInfo Information about the mDNS service. {@link LocalServiceInfo}
* @param { Context } context - Indicates the context of application or capability.
* @param { LocalServiceInfo } serviceInfo - Information about the mDNS service. {@link LocalServiceInfo}
* @returns { Promise<LocalServiceInfo> } The promise returned by the function.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 2100002 - Operation failed. Cannot connect to service.
@ -145,7 +145,7 @@ declare namespace mdns {
export interface DiscoveryService {
/**
* Enables listening for discoveryStart events of mDNS services.
* @param { 'discoveryStart' } type Indicates Event name.
* @param { 'discoveryStart' } type - Indicates Event name.
* @param { Callback<{ serviceInfo: LocalServiceInfo, errorCode?: MdnsError }> } callback - the callback of on.
* @syscap SystemCapability.Communication.NetManager.MDNS
* @since 10
@ -155,8 +155,8 @@ declare namespace mdns {
/**
* Enables listening for discoveryStop events of mDNS services.
* @param { 'discoveryStop' } type Indicates Event name.
* @param { Callback<{ serviceInfo: LocalServiceInfo, errorCode?: MdnsError }> } callback - the callback of on.
* @param { 'discoveryStop' } type - Indicates Event name.
* @param { Callback<{ serviceInfo: LocalServiceInfo, errorCode?: MdnsError }> } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetManager.MDNS
* @since 10
*/
@ -165,8 +165,8 @@ declare namespace mdns {
/**
* Enables listening for serviceFound events of mDNS services.
* @param { 'serviceFound' } type Indicates Event name.
* @param { Callback<LocalServiceInfo> } callback - the callback of on.
* @param { 'serviceFound' } type - Indicates Event name.
* @param { Callback<LocalServiceInfo> } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetManager.MDNS
* @since 10
*/
@ -174,8 +174,8 @@ declare namespace mdns {
/**
* Enables listening for serviceLost events of mDNS services.
* @param { 'serviceLost' } type Indicates Event name.
* @param { Callback<LocalServiceInfo> } callback - the callback of on.
* @param { 'serviceLost' } type - Indicates Event name.
* @param { Callback<LocalServiceInfo> } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetManager.MDNS
* @since 10
*/

View File

@ -27,7 +27,7 @@ declare namespace sharing {
/**
* Checks whether this device allows for network sharing.
* @permission ohos.permission.CONNECTIVITY_INTERNAL
* @param { AsyncCallback<boolean> } callback Returns {@code true} indicating network sharing is supported;
* @param { AsyncCallback<boolean> } callback - Returns {@code true} indicating network sharing is supported;
* returns {@code false} otherwise.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Non-system applications use system APIs.
@ -58,7 +58,7 @@ declare namespace sharing {
/**
* Return the global network sharing state.
* @permission ohos.permission.CONNECTIVITY_INTERNAL
* @param { AsyncCallback<boolean> } callback Returns {@code true} indicating network sharing is running;
* @param { AsyncCallback<boolean> } callback - Returns {@code true} indicating network sharing is running;
* returns {@code false} otherwise.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Non-system applications use system APIs.
@ -89,8 +89,8 @@ declare namespace sharing {
/**
* Start network sharing for given type.
* @permission ohos.permission.CONNECTIVITY_INTERNAL
* @param { SharingIfaceType } type Enumeration of shareable interface types.
* @param { AsyncCallback<void> } callback Returns the result.
* @param { SharingIfaceType } type - Enumeration of shareable interface types.
* @param { AsyncCallback<void> } callback - the callback of startSharing.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Non-system applications use system APIs.
* @throws { BusinessError } 401 - Parameter error.
@ -111,7 +111,7 @@ declare namespace sharing {
/**
* Start network sharing for given type.
* @permission ohos.permission.CONNECTIVITY_INTERNAL
* @param { SharingIfaceType } type Enumeration of shareable interface types.
* @param { SharingIfaceType } type - Enumeration of shareable interface types.
* @returns { Promise<void> } The promise returned by the function.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Non-system applications use system APIs.
@ -133,8 +133,8 @@ declare namespace sharing {
/**
* Stop network sharing for given type.
* @permission ohos.permission.CONNECTIVITY_INTERNAL
* @param { SharingIfaceType } type Enumeration of shareable interface types.
* @param { AsyncCallback<void> } callback Returns the result.
* @param { SharingIfaceType } type - Enumeration of shareable interface types.
* @param { AsyncCallback<void> } callback - the callback of startSharing.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Non-system applications use system APIs.
* @throws { BusinessError } 401 - Parameter error.
@ -154,7 +154,7 @@ declare namespace sharing {
/**
* Stop network sharing for given type.
* @permission ohos.permission.CONNECTIVITY_INTERNAL
* @param { SharingIfaceType } type Enumeration of shareable interface types.
* @param { SharingIfaceType } type - Enumeration of shareable interface types.
* @returns { Promise<void> } The promise returned by the function.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Non-system applications use system APIs.
@ -175,7 +175,7 @@ declare namespace sharing {
/**
* Obtains the number of downlink data bytes of the sharing network interfaces.
* @permission ohos.permission.CONNECTIVITY_INTERNAL
* @param { AsyncCallback<number> } callback Returns the number of downlink data bytes of the sharing network interfaces.
* @param { AsyncCallback<number> } callback - Returns the number of downlink data bytes of the sharing network interfaces.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Non-system applications use system APIs.
* @throws { BusinessError } 401 - Parameter error.
@ -205,7 +205,7 @@ declare namespace sharing {
/**
* Obtains the number of uplink data bytes of the sharing network interfaces.
* @permission ohos.permission.CONNECTIVITY_INTERNAL
* @param { AsyncCallback<number> } callback Returns the number of uplink data bytes of the sharing network interfaces.
* @param { AsyncCallback<number> } callback - Returns the number of uplink data bytes of the sharing network interfaces.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Non-system applications use system APIs.
* @throws { BusinessError } 401 - Parameter error.
@ -235,7 +235,7 @@ declare namespace sharing {
/**
* Obtains the number of total data bytes of the sharing network interfaces.
* @permission ohos.permission.CONNECTIVITY_INTERNAL
* @param { AsyncCallback<number> } callback Returns the number of total data bytes of the sharing network interfaces.
* @param { AsyncCallback<number> } callback - Returns the number of total data bytes of the sharing network interfaces.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Non-system applications use system APIs.
* @throws { BusinessError } 401 - Parameter error.
@ -265,8 +265,8 @@ declare namespace sharing {
/**
* Obtains the names of interfaces in each sharing state.
* @permission ohos.permission.CONNECTIVITY_INTERNAL
* @param { SharingIfaceState } state Is the network sharing state.
* @param { AsyncCallback<Array<string>> } callback Returns an array of interface names that meet this status.
* @param { SharingIfaceState } state - Is the network sharing state.
* @param { AsyncCallback<Array<string>> } callback - Returns an array of interface names that meet this status.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Non-system applications use system APIs.
* @throws { BusinessError } 401 - Parameter error.
@ -282,7 +282,7 @@ declare namespace sharing {
/**
* Obtains the names of interfaces in each sharing state.
* @permission ohos.permission.CONNECTIVITY_INTERNAL
* @param { SharingIfaceState } state Is the network sharing state.
* @param { SharingIfaceState } state - Is the network sharing state.
* @returns { Promise<Array<string>> } The promise returned by the function.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Non-system applications use system APIs.
@ -299,8 +299,8 @@ declare namespace sharing {
/**
* Obtains the network sharing state for given type.
* @permission ohos.permission.CONNECTIVITY_INTERNAL
* @param { SharingIfaceType } type Is the enumeration of shareable interface types.
* @param { AsyncCallback<SharingIfaceState> } callback Returns {@code SharingIfaceState}.
* @param { SharingIfaceType } type - Is the enumeration of shareable interface types.
* @param { AsyncCallback<SharingIfaceState> } callback - the callback of getSharingState. {@code SharingIfaceState}.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Non-system applications use system APIs.
* @throws { BusinessError } 401 - Parameter error.
@ -316,7 +316,7 @@ declare namespace sharing {
/**
* Obtains the network sharing state for given type.
* @permission ohos.permission.CONNECTIVITY_INTERNAL
* @param { SharingIfaceType } type Is the enumeration of shareable interface types.
* @param { SharingIfaceType } type - Is the enumeration of shareable interface types.
* @returns { Promise<SharingIfaceState> } The promise returned by the function.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Non-system applications use system APIs.
@ -333,7 +333,7 @@ declare namespace sharing {
/**
* Get a list regular expression that defines any interface that can support network sharing.
* @permission ohos.permission.CONNECTIVITY_INTERNAL
* @param { SharingIfaceType } type Is the enumeration of shareable interface types.
* @param { SharingIfaceType } type - Is the enumeration of shareable interface types.
* @param { AsyncCallback<Array<string>> } callback - the callback of getSharableRegexes.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Non-system applications use system APIs.
@ -350,7 +350,7 @@ declare namespace sharing {
/**
* Get a list regular expression that defines any interface that can support network sharing.
* @permission ohos.permission.CONNECTIVITY_INTERNAL
* @param { SharingIfaceType } type Is the enumeration of shareable interface types.
* @param { SharingIfaceType } type - Is the enumeration of shareable interface types.
* @returns { Promise<Array<string>> } The promise returned by the function.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Non-system applications use system APIs.
@ -367,8 +367,8 @@ declare namespace sharing {
/**
* Register a callback for the global network sharing state change.
* @permission ohos.permission.CONNECTIVITY_INTERNAL
* @param { 'sharingStateChange' } type Indicates Event name.
* @param { Callback<boolean> } callback callback function that returns the status
* @param { 'sharingStateChange' } type - Indicates Event name.
* @param { Callback<boolean> } callback - the callback function that returns the status.
* @throws { BusinessError } 201 Permission denied.
* @throws { BusinessError } 202 - Non-system applications use system APIs.
* @throws { BusinessError } 401 Parameter error.
@ -382,7 +382,7 @@ declare namespace sharing {
* Unregister a callback for the global network sharing state change.
* @permission ohos.permission.CONNECTIVITY_INTERNAL
* @param { 'sharingStateChange' } type Indicates Event name.
* @param { Callback<boolean> } callback callback function that returns the status
* @param { Callback<boolean> } callback - the callback function that returns the status.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Non-system applications use system APIs.
* @throws { BusinessError } 401 - Parameter error.
@ -395,8 +395,8 @@ declare namespace sharing {
/**
* Register a callback for the interface network sharing state change.
* @permission ohos.permission.CONNECTIVITY_INTERNAL
* @param { 'interfaceSharingStateChange' } type Indicates Event name.
* @param { Callback<{ type: SharingIfaceType, iface: string, state: SharingIfaceState }> } callback callback function that returns the message.
* @param { 'interfaceSharingStateChange' } type - Indicates Event name.
* @param { Callback<{ type: SharingIfaceType, iface: string, state: SharingIfaceState }> } callback- the callback function that returns the message.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Non-system applications use system APIs.
* @throws { BusinessError } 401 - Parameter error.
@ -409,8 +409,8 @@ declare namespace sharing {
/**
* Unregister a callback for the interface network sharing state change.
* @permission ohos.permission.CONNECTIVITY_INTERNAL
* @param { 'interfaceSharingStateChange' } type Indicates Event name.
* @param { Callback<{ type: SharingIfaceType, iface: string, state: SharingIfaceState }> } callback callback function that returns the message.
* @param { 'interfaceSharingStateChange' } type - Indicates Event name.
* @param { Callback<{ type: SharingIfaceType, iface: string, state: SharingIfaceState }> } callback - the callback function that returns the message.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Non-system applications use system APIs.
* @throws { BusinessError } 401 - Parameter error.
@ -423,8 +423,8 @@ declare namespace sharing {
/**
* Register a callback for the sharing upstream network change.
* @permission ohos.permission.CONNECTIVITY_INTERNAL
* @param { 'sharingUpstreamChange' } type Indicates Event name.
* @param { Callback<NetHandle> } callback callback function that returns the network handle.
* @param { 'sharingUpstreamChange' } type - Indicates Event name.
* @param { Callback<NetHandle> } callback - the callback function that returns the network handle.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Non-system applications use system APIs.
* @throws { BusinessError } 401 - Parameter error.
@ -437,8 +437,8 @@ declare namespace sharing {
/**
* Unregister a callback for the sharing upstream network change.
* @permission ohos.permission.CONNECTIVITY_INTERNAL
* @param { 'sharingUpstreamChange' } type Indicates Event name.
* @param { Callback<NetHandle> } callback callback function that returns the network handle.
* @param { 'sharingUpstreamChange' } type - Indicates Event name.
* @param { Callback<NetHandle> } callback - the callback function that returns the network handle.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Non-system applications use system APIs.
* @throws { BusinessError } 401 - Parameter error.

View File

@ -390,8 +390,8 @@ declare namespace socket {
/**
* Binds the IP address and port number. The port number can be specified or randomly allocated by the system.
* @permission ohos.permission.INTERNET
* @param { NetAddress } address Destination address. {@link NetAddress}
* @param { AsyncCallback<void> } callback Returns the callback of bind.
* @param { NetAddress } address - Destination address. {@link NetAddress}
* @param { AsyncCallback<void> } callback - the callback of bind.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
* @syscap SystemCapability.Communication.NetStack
@ -400,8 +400,8 @@ declare namespace socket {
/**
* Binds the IP address and port number. The port number can be specified or randomly allocated by the system.
* @permission ohos.permission.INTERNET
* @param { NetAddress } address Destination address. {@link NetAddress}
* @param { AsyncCallback<void> } callback Returns the callback of bind.
* @param { NetAddress } address - Destination address. {@link NetAddress}
* @param { AsyncCallback<void> } callback - the callback of bind.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
* @syscap SystemCapability.Communication.NetStack
@ -413,7 +413,7 @@ declare namespace socket {
/**
* Binds the IP address and port number. The port number can be specified or randomly allocated by the system.
* @permission ohos.permission.INTERNET
* @param { NetAddress } address Destination address. {@link NetAddress}
* @param { NetAddress } address - Destination address. {@link NetAddress}
* @returns { Promise<void> } The promise returned by the function.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
@ -423,7 +423,7 @@ declare namespace socket {
/**
* Binds the IP address and port number. The port number can be specified or randomly allocated by the system.
* @permission ohos.permission.INTERNET
* @param { NetAddress } address Destination address. {@link NetAddress}
* @param { NetAddress } address - Destination address. {@link NetAddress}
* @returns { Promise<void> } The promise returned by the function.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
@ -436,8 +436,8 @@ declare namespace socket {
/**
* Sends data over a UDPSocket connection.
* @permission ohos.permission.INTERNET
* @param { UDPSendOptions } options Optional parameters {@link UDPSendOptions}.
* @param { AsyncCallback<void> } callback Returns the callback of send.
* @param { UDPSendOptions } options - Optional parameters {@link UDPSendOptions}.
* @param { AsyncCallback<void> } callback - the callback of send.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
* @syscap SystemCapability.Communication.NetStack
@ -446,8 +446,8 @@ declare namespace socket {
/**
* Sends data over a UDPSocket connection.
* @permission ohos.permission.INTERNET
* @param { UDPSendOptions } options Optional parameters {@link UDPSendOptions}.
* @param { AsyncCallback<void> } callback Returns the callback of send.
* @param { UDPSendOptions } options - Optional parameters {@link UDPSendOptions}.
* @param { AsyncCallback<void> } callback - the callback of send.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
* @syscap SystemCapability.Communication.NetStack
@ -459,7 +459,7 @@ declare namespace socket {
/**
* Sends data over a UDPSocket connection.
* @permission ohos.permission.INTERNET
* @param { UDPSendOptions } options Optional parameters {@link UDPSendOptions}.
* @param { UDPSendOptions } options - Optional parameters {@link UDPSendOptions}.
* @returns { Promise<void> } The promise returned by the function.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
@ -469,7 +469,7 @@ declare namespace socket {
/**
* Sends data over a UDPSocket connection.
* @permission ohos.permission.INTERNET
* @param { UDPSendOptions } options Optional parameters {@link UDPSendOptions}.
* @param { UDPSendOptions } options - Optional parameters {@link UDPSendOptions}.
* @returns { Promise<void> } The promise returned by the function.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
@ -482,7 +482,7 @@ declare namespace socket {
/**
* Closes a UDPSocket connection.
* @permission ohos.permission.INTERNET
* @param { AsyncCallback<void> } callback Returns the callback of close.
* @param { AsyncCallback<void> } callback - the callback of close.
* @throws { BusinessError } 201 - Permission denied.
* @syscap SystemCapability.Communication.NetStack
* @since 7
@ -490,7 +490,7 @@ declare namespace socket {
/**
* Closes a UDPSocket connection.
* @permission ohos.permission.INTERNET
* @param { AsyncCallback<void> } callback Returns the callback of close.
* @param { AsyncCallback<void> } callback - the callback of close.
* @throws { BusinessError } 201 - Permission denied.
* @syscap SystemCapability.Communication.NetStack
* @crossplatform
@ -520,7 +520,7 @@ declare namespace socket {
/**
* Obtains the status of the UDPSocket connection.
* @permission ohos.permission.INTERNET
* @param { AsyncCallback<SocketStateBase> } callback Callback used to return the result. {@link SocketStateBase}.
* @param { AsyncCallback<SocketStateBase> } callback - the callback of getState. {@link SocketStateBase}.
* @throws { BusinessError } 201 - Permission denied.
* @syscap SystemCapability.Communication.NetStack
* @since 7
@ -528,7 +528,7 @@ declare namespace socket {
/**
* Obtains the status of the UDPSocket connection.
* @permission ohos.permission.INTERNET
* @param { AsyncCallback<SocketStateBase> } callback Callback used to return the result. {@link SocketStateBase}.
* @param { AsyncCallback<SocketStateBase> } callback - the callback of getState. {@link SocketStateBase}.
* @throws { BusinessError } 201 - Permission denied.
* @syscap SystemCapability.Communication.NetStack
* @crossplatform
@ -558,8 +558,8 @@ declare namespace socket {
/**
* Sets other attributes of the UDPSocket connection.
* @permission ohos.permission.INTERNET
* @param { UDPExtraOptions } options Optional parameters {@link UDPExtraOptions}.
* @param { AsyncCallback<void> }callback Returns the callback of setExtraOptions.
* @param { UDPExtraOptions } options - Optional parameters {@link UDPExtraOptions}.
* @param { AsyncCallback<void> }callback - the callback of setExtraOptions.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
* @syscap SystemCapability.Communication.NetStack
@ -568,8 +568,8 @@ declare namespace socket {
/**
* Sets other attributes of the UDPSocket connection.
* @permission ohos.permission.INTERNET
* @param { UDPExtraOptions } options Optional parameters {@link UDPExtraOptions}.
* @param { AsyncCallback<void> }callback Returns the callback of setExtraOptions.
* @param { UDPExtraOptions } options - Optional parameters {@link UDPExtraOptions}.
* @param { AsyncCallback<void> }callback - the callback of setExtraOptions.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
* @syscap SystemCapability.Communication.NetStack
@ -581,7 +581,7 @@ declare namespace socket {
/**
* Sets other attributes of the UDPSocket connection.
* @permission ohos.permission.INTERNET
* @param { UDPExtraOptions } options Optional parameters {@link UDPExtraOptions}.
* @param { UDPExtraOptions } options - Optional parameters {@link UDPExtraOptions}.
* @returns { Promise<void> } The promise returned by the function.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
@ -591,7 +591,7 @@ declare namespace socket {
/**
* Sets other attributes of the UDPSocket connection.
* @permission ohos.permission.INTERNET
* @param { UDPExtraOptions } options Optional parameters {@link UDPExtraOptions}.
* @param { UDPExtraOptions } options - Optional parameters {@link UDPExtraOptions}.
* @returns { Promise<void> } The promise returned by the function.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
@ -603,15 +603,15 @@ declare namespace socket {
/**
* Listens for message receiving events of the UDPSocket connection.
* @param { 'message' } type Indicates Event name.
* @param { Callback<{ message: ArrayBuffer, remoteInfo: SocketRemoteInfo }> } callback callback function that returns the message
* @param { 'message' } type - Indicates Event name.
* @param { Callback<{ message: ArrayBuffer, remoteInfo: SocketRemoteInfo }> } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetStack
* @since 7
*/
/**
* Listens for message receiving events of the UDPSocket connection.
* @param { 'message' } type Indicates Event name.
* @param { Callback<{ message: ArrayBuffer, remoteInfo: SocketRemoteInfo }> } callback callback function that returns the message
* @param { 'message' } type - Indicates Event name.
* @param { Callback<{ message: ArrayBuffer, remoteInfo: SocketRemoteInfo }> } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetStack
* @crossplatform
* @since 10
@ -620,15 +620,15 @@ declare namespace socket {
/**
* Cancels listening for message receiving events of the UDPSocket connection.
* @param { 'message' } type Indicates Event name.
* @param { Callback<{ message: ArrayBuffer, remoteInfo: SocketRemoteInfo }> } callback callback function that returns the message
* @param { 'message' } type - Indicates Event name.
* @param { Callback<{ message: ArrayBuffer, remoteInfo: SocketRemoteInfo }> } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetStack
* @since 7
*/
/**
* Cancels listening for message receiving events of the UDPSocket connection.
* @param { 'message' } type Indicates Event name.
* @param { Callback<{ message: ArrayBuffer, remoteInfo: SocketRemoteInfo }> } callback callback function that returns the message
* @param { 'message' } type - Indicates Event name.
* @param { Callback<{ message: ArrayBuffer, remoteInfo: SocketRemoteInfo }> } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetStack
* @crossplatform
* @since 10
@ -637,15 +637,15 @@ declare namespace socket {
/**
* Listens for data packet message events or close events of the UDPSocket connection.
* @param { 'listening' | 'close' } type Indicates Event name.
* @param { Callback<void> } callback Returns the callback of on.
* @param { 'listening' | 'close' } type - Indicates Event name.
* @param { Callback<void> } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetStack
* @since 7
*/
/**
* Listens for data packet message events or close events of the UDPSocket connection.
* @param { 'listening' | 'close' } type Indicates Event name.
* @param { Callback<void> } callback Returns the callback of on.
* @param { 'listening' | 'close' } type - Indicates Event name.
* @param { Callback<void> } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetStack
* @crossplatform
* @since 10
@ -654,15 +654,15 @@ declare namespace socket {
/**
* Cancels listening for data packet message events or close events of the UDPSocket connection.
* @param { 'listening' | 'close' } type Indicates Event name.
* @param { Callback<void> } callback Returns the callback of off.
* @param { 'listening' | 'close' } type - Indicates Event name.
* @param { Callback<void> } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetStack
* @since 7
*/
/**
* Cancels listening for data packet message events or close events of the UDPSocket connection.
* @param { 'listening' | 'close' } type Indicates Event name.
* @param { Callback<void> } callback Returns the callback of off.
* @param { 'listening' | 'close' } type - Indicates Event name.
* @param { Callback<void> } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetStack
* @crossplatform
* @since 10
@ -671,15 +671,15 @@ declare namespace socket {
/**
* Listens for error events of the UDPSocket connection.
* @param { 'error' } type Indicates Event name.
* @param { ErrorCallback } callback Returns the callback of on.
* @param { 'error' } type - Indicates Event name.
* @param { ErrorCallback } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetStack
* @since 7
*/
/**
* Listens for error events of the UDPSocket connection.
* @param { 'error' } type Indicates Event name.
* @param { ErrorCallback } callback Returns the callback of on.
* @param { 'error' } type - Indicates Event name.
* @param { ErrorCallback } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetStack
* @crossplatform
* @since 10
@ -688,15 +688,15 @@ declare namespace socket {
/**
* Cancels listening for error events of the UDPSocket connection.
* @param { 'error' } type Indicates Event name.
* @param { ErrorCallback } callback Returns the callback of off.
* @param { 'error' } type - Indicates Event name.
* @param { ErrorCallback } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetStack
* @since 7
*/
/**
* Cancels listening for error events of the UDPSocket connection.
* @param { 'error' } type Indicates Event name.
* @param { ErrorCallback } callback Returns the callback of off.
* @param { 'error' } type - Indicates Event name.
* @param { ErrorCallback } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetStack
* @crossplatform
* @since 10
@ -887,8 +887,8 @@ declare namespace socket {
/**
* Binds the IP address and port number. The port number can be specified or randomly allocated by the system.
* @permission ohos.permission.INTERNET
* @param { NetAddress } address Destination address. {@link NetAddress}
* @param { AsyncCallback<void> } callback Returns the callback of bind.
* @param { NetAddress } address - Destination address. {@link NetAddress}
* @param { AsyncCallback<void> } callback - Return the callback of bind.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
* @syscap SystemCapability.Communication.NetStack
@ -897,8 +897,8 @@ declare namespace socket {
/**
* Binds the IP address and port number. The port number can be specified or randomly allocated by the system.
* @permission ohos.permission.INTERNET
* @param { NetAddress } address Destination address. {@link NetAddress}
* @param { AsyncCallback<void> } callback Returns the callback of bind.
* @param { NetAddress } address - Destination address. {@link NetAddress}
* @param { AsyncCallback<void> } callback - the callback of bind.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
* @syscap SystemCapability.Communication.NetStack
@ -910,7 +910,7 @@ declare namespace socket {
/**
* Binds the IP address and port number. The port number can be specified or randomly allocated by the system.
* @permission ohos.permission.INTERNET
* @param { NetAddress } address Destination address. {@link NetAddress}
* @param { NetAddress } address - Destination address. {@link NetAddress}
* @returns { Promise<void> } The promise returned by the function.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
@ -920,7 +920,7 @@ declare namespace socket {
/**
* Binds the IP address and port number. The port number can be specified or randomly allocated by the system.
* @permission ohos.permission.INTERNET
* @param { NetAddress } address Destination address. {@link NetAddress}
* @param { NetAddress } address - Destination address. {@link NetAddress}
* @returns { Promise<void> } The promise returned by the function.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
@ -933,8 +933,8 @@ declare namespace socket {
/**
* Sets up a connection to the specified IP address and port number.
* @permission ohos.permission.INTERNET
* @param { TCPConnectOptions } options Optional parameters {@link TCPConnectOptions}.
* @param { AsyncCallback<void> } callback Returns the callback of connect.
* @param { TCPConnectOptions } options - Optional parameters {@link TCPConnectOptions}.
* @param { AsyncCallback<void> } callback - the callback of connect.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
* @syscap SystemCapability.Communication.NetStack
@ -943,8 +943,8 @@ declare namespace socket {
/**
* Sets up a connection to the specified IP address and port number.
* @permission ohos.permission.INTERNET
* @param { TCPConnectOptions } options Optional parameters {@link TCPConnectOptions}.
* @param { AsyncCallback<void> } callback Returns the callback of connect.
* @param { TCPConnectOptions } options - Optional parameters {@link TCPConnectOptions}.
* @param { AsyncCallback<void> } callback - the callback of connect.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
* @syscap SystemCapability.Communication.NetStack
@ -956,7 +956,7 @@ declare namespace socket {
/**
* Sets up a connection to the specified IP address and port number.
* @permission ohos.permission.INTERNET
* @param { TCPConnectOptions } options Optional parameters {@link TCPConnectOptions}.
* @param { TCPConnectOptions } options - Optional parameters {@link TCPConnectOptions}.
* @returns { Promise<void> } The promise returned by the function.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
@ -966,7 +966,7 @@ declare namespace socket {
/**
* Sets up a connection to the specified IP address and port number.
* @permission ohos.permission.INTERNET
* @param { TCPConnectOptions } options Optional parameters {@link TCPConnectOptions}.
* @param { TCPConnectOptions } options - Optional parameters {@link TCPConnectOptions}.
* @returns { Promise<void> } The promise returned by the function.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
@ -979,8 +979,8 @@ declare namespace socket {
/**
* Sends data over a TCPSocket connection.
* @permission ohos.permission.INTERNET
* @param { TCPSendOptions } options Optional parameters {@link TCPSendOptions}.
* @param { AsyncCallback<void> } callback Returns the callback of send.
* @param { TCPSendOptions } options - Optional parameters {@link TCPSendOptions}.
* @param { AsyncCallback<void> } callback - the callback of send.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
* @syscap SystemCapability.Communication.NetStack
@ -989,8 +989,8 @@ declare namespace socket {
/**
* Sends data over a TCPSocket connection.
* @permission ohos.permission.INTERNET
* @param { TCPSendOptions } options Optional parameters {@link TCPSendOptions}.
* @param { AsyncCallback<void> } callback Returns the callback of send.
* @param { TCPSendOptions } options - Optional parameters {@link TCPSendOptions}.
* @param { AsyncCallback<void> } callback - the callback of send.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
* @syscap SystemCapability.Communication.NetStack
@ -1002,7 +1002,7 @@ declare namespace socket {
/**
* Sends data over a TCPSocket connection.
* @permission ohos.permission.INTERNET
* @param { TCPSendOptions } options Optional parameters {@link TCPSendOptions}.
* @param { TCPSendOptions } options - Optional parameters {@link TCPSendOptions}.
* @returns { Promise<void> } The promise returned by the function.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
@ -1012,7 +1012,7 @@ declare namespace socket {
/**
* Sends data over a TCPSocket connection.
* @permission ohos.permission.INTERNET
* @param { TCPSendOptions } options Optional parameters {@link TCPSendOptions}.
* @param { TCPSendOptions } options - Optional parameters {@link TCPSendOptions}.
* @returns { Promise<void> } The promise returned by the function.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
@ -1025,7 +1025,7 @@ declare namespace socket {
/**
* Closes a TCPSocket connection.
* @permission ohos.permission.INTERNET
* @param { AsyncCallback<void> } callback Returns the callback of close.
* @param { AsyncCallback<void> } callback - the callback of close.
* @throws { BusinessError } 201 - Permission denied.
* @syscap SystemCapability.Communication.NetStack
* @since 7
@ -1033,7 +1033,7 @@ declare namespace socket {
/**
* Closes a TCPSocket connection.
* @permission ohos.permission.INTERNET
* @param { AsyncCallback<void> } callback Returns the callback of close.
* @param { AsyncCallback<void> } callback - the callback of close.
* @throws { BusinessError } 201 - Permission denied.
* @syscap SystemCapability.Communication.NetStack
* @crossplatform
@ -1063,7 +1063,7 @@ declare namespace socket {
/**
* Obtains the peer address of a TCPSocket connection.
* @permission ohos.permission.INTERNET
* @param { AsyncCallback<NetAddress> } callback Callback used to return the result. {@link NetAddress}
* @param { AsyncCallback<NetAddress> } callback - the callback of getRemoteAddress. {@link NetAddress}
* @throws { BusinessError } 201 - Permission denied.
* @syscap SystemCapability.Communication.NetStack
* @since 7
@ -1071,7 +1071,7 @@ declare namespace socket {
/**
* Obtains the peer address of a TCPSocket connection.
* @permission ohos.permission.INTERNET
* @param { AsyncCallback<NetAddress> } callback Callback used to return the result. {@link NetAddress}
* @param { AsyncCallback<NetAddress> } callback - the callback of getRemoteAddress. {@link NetAddress}
* @throws { BusinessError } 201 - Permission denied.
* @syscap SystemCapability.Communication.NetStack
* @crossplatform
@ -1101,7 +1101,7 @@ declare namespace socket {
/**
* Obtains the status of the TCPSocket connection.
* @permission ohos.permission.INTERNET
* @param { AsyncCallback<SocketStateBase> } callback Callback used to return the result. {@link SocketStateBase}
* @param { AsyncCallback<SocketStateBase> } callback - the callback of getState. {@link SocketStateBase}
* @throws { BusinessError } 201 - Permission denied.
* @syscap SystemCapability.Communication.NetStack
* @since 7
@ -1109,7 +1109,7 @@ declare namespace socket {
/**
* Obtains the status of the TCPSocket connection.
* @permission ohos.permission.INTERNET
* @param { AsyncCallback<SocketStateBase> } callback Callback used to return the result. {@link SocketStateBase}
* @param { AsyncCallback<SocketStateBase> } callback - the callback of getState. {@link SocketStateBase}
* @throws { BusinessError } 201 - Permission denied.
* @syscap SystemCapability.Communication.NetStack
* @crossplatform
@ -1139,8 +1139,8 @@ declare namespace socket {
/**
* Sets other attributes of the TCPSocket connection.
* @permission ohos.permission.INTERNET
* @param { TCPExtraOptions } options Optional parameters {@link TCPExtraOptions}.
* @param { AsyncCallback<void> } callback Callback used to return the result.
* @param { TCPExtraOptions } options - Optional parameters {@link TCPExtraOptions}.
* @param { AsyncCallback<void> } callback - the callback of setExtraOptions.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
* @syscap SystemCapability.Communication.NetStack
@ -1149,8 +1149,8 @@ declare namespace socket {
/**
* Sets other attributes of the TCPSocket connection.
* @permission ohos.permission.INTERNET
* @param { TCPExtraOptions } options Optional parameters {@link TCPExtraOptions}.
* @param { AsyncCallback<void> } callback Callback used to return the result.
* @param { TCPExtraOptions } options - Optional parameters {@link TCPExtraOptions}.
* @param { AsyncCallback<void> } callback - the callback of setExtraOptions.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
* @syscap SystemCapability.Communication.NetStack
@ -1162,7 +1162,7 @@ declare namespace socket {
/**
* Sets other attributes of the TCPSocket connection.
* @permission ohos.permission.INTERNET
* @param { TCPExtraOptions } options Optional parameters {@link TCPExtraOptions}.
* @param { TCPExtraOptions } options - Optional parameters {@link TCPExtraOptions}.
* @returns { Promise<void> } The promise returned by the function.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
@ -1172,7 +1172,7 @@ declare namespace socket {
/**
* Sets other attributes of the TCPSocket connection.
* @permission ohos.permission.INTERNET
* @param { TCPExtraOptions } options Optional parameters {@link TCPExtraOptions}.
* @param { TCPExtraOptions } options - Optional parameters {@link TCPExtraOptions}.
* @returns { Promise<void> } The promise returned by the function.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
@ -1184,15 +1184,15 @@ declare namespace socket {
/**
* Listens for message receiving events of the TCPSocket connection.
* @param { 'message' } type Indicates Event name.
* @param { Callback<{ message: ArrayBuffer, remoteInfo: SocketRemoteInfo }> } callback Returns the callback of on.
* @param { 'message' } type - Indicates Event name.
* @param { Callback<{ message: ArrayBuffer, remoteInfo: SocketRemoteInfo }> } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetStack
* @since 7
*/
/**
* Listens for message receiving events of the TCPSocket connection.
* @param { 'message' } type Indicates Event name.
* @param { Callback<{ message: ArrayBuffer, remoteInfo: SocketRemoteInfo }> } callback Returns the callback of on.
* @param { Callback<{ message: ArrayBuffer, remoteInfo: SocketRemoteInfo }> } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetStack
* @crossplatform
* @since 10
@ -1202,14 +1202,14 @@ declare namespace socket {
/**
* Cancels listening for message receiving events of the TCPSocket connection.
* @param { 'message' } type Indicates Event name.
* @param { Callback<{ message: ArrayBuffer, remoteInfo: SocketRemoteInfo }> } callback callback function that returns the message
* @param { Callback<{ message: ArrayBuffer, remoteInfo: SocketRemoteInfo }> } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetStack
* @since 7
*/
/**
* Cancels listening for message receiving events of the TCPSocket connection.
* @param { 'message' } type Indicates Event name.
* @param { Callback<{ message: ArrayBuffer, remoteInfo: SocketRemoteInfo }> } callback callback function that returns the message
* @param { Callback<{ message: ArrayBuffer, remoteInfo: SocketRemoteInfo }> } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetStack
* @crossplatform
* @since 10
@ -1219,15 +1219,15 @@ declare namespace socket {
/**
* Listens for connection or close events of the TCPSocket connection.
* @param { 'connect' | 'close' } type Indicates Event name.
* @param { Callback<void> } callback Returns the callback of on.
* @param { 'connect' | 'close' } type - Indicates Event name.
* @param { Callback<void> } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetStack
* @since 7
*/
/**
* Listens for connection or close events of the TCPSocket connection.
* @param { 'connect' | 'close' } type Indicates Event name.
* @param { Callback<void> } callback Returns the callback of on.
* @param { 'connect' | 'close' } type - Indicates Event name.
* @param { Callback<void> } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetStack
* @crossplatform
* @since 10
@ -1236,15 +1236,15 @@ declare namespace socket {
/**
* Cancels listening for connection or close events of the TCPSocket connection.
* @param { 'connect' | 'close' } type Indicates Event name.
* @param { Callback<void> } callback callback function that returns the message
* @param { 'connect' | 'close' } type - Indicates Event name.
* @param { Callback<void> } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetStack
* @since 7
*/
/**
* Cancels listening for connection or close events of the TCPSocket connection.
* @param { 'connect' | 'close' } type Indicates Event name.
* @param { Callback<void> } callback callback function that returns the message
* @param { 'connect' | 'close' } type - Indicates Event name.
* @param { Callback<void> } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetStack
* @crossplatform
* @since 10
@ -1253,15 +1253,15 @@ declare namespace socket {
/**
* Listens for error events of the TCPSocket connection.
* @param { 'error' } type Indicates Event name.
* @param { ErrorCallback } callback Returns the callback of on.
* @param { 'error' } type - Indicates Event name.
* @param { ErrorCallback } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetStack
* @since 7
*/
/**
* Listens for error events of the TCPSocket connection.
* @param { 'error' } type Indicates Event name.
* @param { ErrorCallback } callback Returns the callback of on.
* @param { 'error' } type - Indicates Event name.
* @param { ErrorCallback } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetStack
* @crossplatform
* @since 10
@ -1270,15 +1270,15 @@ declare namespace socket {
/**
* Cancels listening for error events of the TCPSocket connection.
* @param { 'error' } type Indicates Event name.
* @param { ErrorCallback } callback callback function that returns the message
* @param { 'error' } type - Indicates Event name.
* @param { ErrorCallback } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetStack
* @since 7
*/
/**
* Cancels listening for error events of the TCPSocket connection.
* @param { 'error' } type Indicates Event name.
* @param { ErrorCallback } callback callback function that returns the message
* @param { 'error' } type - Indicates Event name.
* @param { ErrorCallback } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetStack
* @crossplatform
* @since 10
@ -1303,7 +1303,7 @@ declare namespace socket {
/**
* Binds the IP address and port number. The port number can be specified or randomly allocated by the system.
* @permission ohos.permission.INTERNET
* @param { NetAddress } address Destination address. {@link NetAddress}
* @param { NetAddress } address - Destination address. {@link NetAddress}
* @param { AsyncCallback<void> } callback - the callback of bind.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
@ -1315,7 +1315,7 @@ declare namespace socket {
/**
* Binds the IP address and port number. The port number can be specified or randomly allocated by the system.
* @permission ohos.permission.INTERNET
* @param { NetAddress } address Destination address. {@link NetAddress}
* @param { NetAddress } address - Destination address. {@link NetAddress}
* @param { AsyncCallback<void> } callback - the callback of bind.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
@ -1330,7 +1330,7 @@ declare namespace socket {
/**
* Binds the IP address and port number. The port number can be specified or randomly allocated by the system.
* @permission ohos.permission.INTERNET
* @param { NetAddress } address Destination address. {@link NetAddress}
* @param { NetAddress } address - Destination address. {@link NetAddress}
* @returns { Promise<void> } The promise returned by the function.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
@ -1342,7 +1342,7 @@ declare namespace socket {
/**
* Binds the IP address and port number. The port number can be specified or randomly allocated by the system.
* @permission ohos.permission.INTERNET
* @param { NetAddress } address Destination address. {@link NetAddress}
* @param { NetAddress } address - Destination address. {@link NetAddress}
* @returns { Promise<void> } The promise returned by the function.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
@ -1356,7 +1356,7 @@ declare namespace socket {
/**
* Obtains the peer address of a TLSSocket connection.
* @param { AsyncCallback<NetAddress> } callback the callback of getRemoteAddress.
* @param { AsyncCallback<NetAddress> } callback - the callback of getRemoteAddress.
* @throws { BusinessError } 2303188 - Socket operation on non-socket.
* @throws { BusinessError } 2300002 - System internal error.
* @syscap SystemCapability.Communication.NetStack
@ -1364,7 +1364,7 @@ declare namespace socket {
*/
/**
* Obtains the peer address of a TLSSocket connection.
* @param { AsyncCallback<NetAddress> } callback the callback of getRemoteAddress.
* @param { AsyncCallback<NetAddress> } callback - the callback of getRemoteAddress.
* @throws { BusinessError } 2303188 - Socket operation on non-socket.
* @throws { BusinessError } 2300002 - System internal error.
* @syscap SystemCapability.Communication.NetStack
@ -1432,7 +1432,7 @@ declare namespace socket {
/**
* Sets other attributes of the TLSSocket connection.
* @param { TCPExtraOptions } options Optional parameters {@link TCPExtraOptions}.
* @param { TCPExtraOptions } options - Optional parameters {@link TCPExtraOptions}.
* @param { AsyncCallback<void> } callback - the callback of setExtraOptions.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 2303188 - Socket operation on non-socket.
@ -1442,7 +1442,7 @@ declare namespace socket {
*/
/**
* Sets other attributes of the TLSSocket connection.
* @param { TCPExtraOptions } options Optional parameters {@link TCPExtraOptions}.
* @param { TCPExtraOptions } options - Optional parameters {@link TCPExtraOptions}.
* @param { AsyncCallback<void> } callback - the callback of setExtraOptions.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 2303188 - Socket operation on non-socket.
@ -1455,7 +1455,7 @@ declare namespace socket {
/**
* Sets other attributes of the TLSSocket connection.
* @param { TCPExtraOptions } options Optional parameters {@link TCPExtraOptions}.
* @param { TCPExtraOptions } options - Optional parameters {@link TCPExtraOptions}.
* @returns { Promise<void> } The promise returned by the function.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 2303188 - Socket operation on non-socket.
@ -1465,7 +1465,7 @@ declare namespace socket {
*/
/**
* Sets other attributes of the TLSSocket connection.
* @param { TCPExtraOptions } options Optional parameters {@link TCPExtraOptions}.
* @param { TCPExtraOptions } options - Optional parameters {@link TCPExtraOptions}.
* @returns { Promise<void> } The promise returned by the function.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 2303188 - Socket operation on non-socket.
@ -1478,8 +1478,8 @@ declare namespace socket {
/**
* Listens for message receiving events of the TLSSocket connection.
* @param { 'message' } type Indicates Event name.
* @param { Callback<{ message: ArrayBuffer, remoteInfo: SocketRemoteInfo }> } callback Returns the callback of on.
* @param { 'message' } type - Indicates Event name.
* @param { Callback<{ message: ArrayBuffer, remoteInfo: SocketRemoteInfo }> } callback - the callback used to return the result.
* @throws { BusinessError } 401 - Parameter error.
* @syscap SystemCapability.Communication.NetStack
* @since 9
@ -1487,7 +1487,7 @@ declare namespace socket {
/**
* Listens for message receiving events of the TLSSocket connection.
* @param { 'message' } type Indicates Event name.
* @param { Callback<{ message: ArrayBuffer, remoteInfo: SocketRemoteInfo }> } callback Returns the callback of on.
* @param { Callback<{ message: ArrayBuffer, remoteInfo: SocketRemoteInfo }> } callback - the callback used to return the result.
* @throws { BusinessError } 401 - Parameter error.
* @syscap SystemCapability.Communication.NetStack
* @crossplatform
@ -1497,8 +1497,8 @@ declare namespace socket {
/**
* Cancels listening for message receiving events of the TLSSocket connection.
* @param { 'message' } type Indicates Event name.
* @param { Callback<{ message: ArrayBuffer, remoteInfo: SocketRemoteInfo }> } callback callback function that returns the message
* @param { 'message' } type - Indicates Event name.
* @param { Callback<{ message: ArrayBuffer, remoteInfo: SocketRemoteInfo }> } callback - the callback used to return the result.
* @throws { BusinessError } 401 - Parameter error.
* @syscap SystemCapability.Communication.NetStack
* @since 9
@ -1506,7 +1506,7 @@ declare namespace socket {
/**
* Cancels listening for message receiving events of the TLSSocket connection.
* @param { 'message' } type Indicates Event name.
* @param { Callback<{ message: ArrayBuffer, remoteInfo: SocketRemoteInfo }> } callback callback function that returns the message
* @param { Callback<{ message: ArrayBuffer, remoteInfo: SocketRemoteInfo }> } callback - the callback used to return the result.
* @throws { BusinessError } 401 - Parameter error.
* @syscap SystemCapability.Communication.NetStack
* @crossplatform
@ -1516,16 +1516,16 @@ declare namespace socket {
/**
* Listens for connection or close events of the TLSSocket connection.
* @param { 'connect' | 'close' } type Indicates Event name.
* @param {Callback<void> } callback Returns the callback of on.
* @param { 'connect' | 'close' } type - Indicates Event name.
* @param {Callback<void> } callback - the callback used to return the result.
* @throws { BusinessError } 401 - Parameter error.
* @syscap SystemCapability.Communication.NetStack
* @since 9
*/
/**
* Listens for connection or close events of the TLSSocket connection.
* @param { 'connect' | 'close' } type Indicates Event name.
* @param {Callback<void> } callback Returns the callback of on.
* @param { 'connect' | 'close' } type - Indicates Event name.
* @param {Callback<void> } callback - the callback used to return the result.
* @throws { BusinessError } 401 - Parameter error.
* @syscap SystemCapability.Communication.NetStack
* @crossplatform
@ -1535,16 +1535,16 @@ declare namespace socket {
/**
* Cancels listening for connection or close events of the TLSSocket connection.
* @param { 'connect' | 'close' } type Indicates Event name.
* @param {Callback<void> } callback callback function that returns the message
* @param { 'connect' | 'close' } type - Indicates Event name.
* @param {Callback<void> } callback - the callback used to return the result.
* @throws { BusinessError } 401 - Parameter error.
* @syscap SystemCapability.Communication.NetStack
* @since 9
*/
/**
* Cancels listening for connection or close events of the TLSSocket connection.
* @param { 'connect' | 'close' } type Indicates Event name.
* @param {Callback<void> } callback callback function that returns the message
* @param { 'connect' | 'close' } type - Indicates Event name.
* @param {Callback<void> } callback - the callback used to return the result.
* @throws { BusinessError } 401 - Parameter error.
* @syscap SystemCapability.Communication.NetStack
* @crossplatform
@ -1554,16 +1554,16 @@ declare namespace socket {
/**
* Listens for error events of the TLSSocket connection.
* @param { 'error' } type Indicates Event name.
* @param { ErrorCallback } callback Returns the callback of on.
* @param { 'error' } type - Indicates Event name.
* @param { ErrorCallback } callback - the callback used to return the result.
* @throws { BusinessError } 401 - Parameter error.
* @syscap SystemCapability.Communication.NetStack
* @since 9
*/
/**
* Listens for error events of the TLSSocket connection.
* @param { 'error' } type Indicates Event name.
* @param { ErrorCallback } callback Returns the callback of on.
* @param { 'error' } type - Indicates Event name.
* @param { ErrorCallback } callback - the callback used to return the result.
* @throws { BusinessError } 401 - Parameter error.
* @syscap SystemCapability.Communication.NetStack
* @crossplatform
@ -1573,16 +1573,16 @@ declare namespace socket {
/**
* Cancels listening for error events of the TLSSocket connection.
* @param { 'error' } type Indicates Event name.
* @param { ErrorCallback } callback callback function that returns the message
* @param { 'error' } type - Indicates Event name.
* @param { ErrorCallback } callback - the callback used to return the result.
* @throws { BusinessError } 401 - Parameter error.
* @syscap SystemCapability.Communication.NetStack
* @since 9
*/
/**
* Cancels listening for error events of the TLSSocket connection.
* @param { 'error' } type Indicates Event name.
* @param { ErrorCallback } callback callback function that returns the message
* @param { 'error' } type - Indicates Event name.
* @param { ErrorCallback } callback - the callback used to return the result.
* @throws { BusinessError } 401 - Parameter error.
* @syscap SystemCapability.Communication.NetStack
* @crossplatform
@ -1823,7 +1823,7 @@ declare namespace socket {
/**
* Sets up a connection to the specified IP address and port number.
* Only TCP is supported.
* @param { TLSConnectOptions } options Optional parameters {@link TLSConnectOptions}.
* @param { TLSConnectOptions } options - Optional parameters {@link TLSConnectOptions}.
* @param { AsyncCallback<void> } callback - the callback of connect.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 2303104 - Interrupted system call.
@ -1846,7 +1846,7 @@ declare namespace socket {
/**
* Sets up a connection to the specified IP address and port number.
* Only TCP is supported.
* @param { TLSConnectOptions } options Optional parameters {@link TLSConnectOptions}.
* @param { TLSConnectOptions } options - Optional parameters {@link TLSConnectOptions}.
* @param { AsyncCallback<void> } callback - the callback of connect.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 2303104 - Interrupted system call.
@ -1872,7 +1872,7 @@ declare namespace socket {
/**
* Sets up a connection to the specified IP address and port number.
* Only TCP is supported.
* @param { TLSConnectOptions } options Optional parameters {@link TLSConnectOptions}.
* @param { TLSConnectOptions } options - Optional parameters {@link TLSConnectOptions}.
* @returns { Promise<void> } The promise returned by the function.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 2303104 - Interrupted system call.
@ -1895,7 +1895,7 @@ declare namespace socket {
/**
* Sets up a connection to the specified IP address and port number.
* Only TCP is supported.
* @param { TLSConnectOptions } options Optional parameters {@link TLSConnectOptions}.
* @param { TLSConnectOptions } options - Optional parameters {@link TLSConnectOptions}.
* @returns { Promise<void> } The promise returned by the function.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 2303104 - Interrupted system call.
@ -1920,7 +1920,7 @@ declare namespace socket {
/**
* Sends data over a TLSSocket connection.
* @param { string } data Optional parameters {@link string}.
* @param { string } data - Optional parameters {@link string}.
* @param { AsyncCallback<void> } callback - the callback of send.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 2303501 - SSL is null.
@ -1933,7 +1933,7 @@ declare namespace socket {
*/
/**
* Sends data over a TLSSocket connection.
* @param { string } data Optional parameters {@link string}.
* @param { string } data - Optional parameters {@link string}.
* @param { AsyncCallback<void> } callback - the callback of send.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 2303501 - SSL is null.
@ -1949,7 +1949,7 @@ declare namespace socket {
/**
* Sends data over a TLSSocket connection.
* @param { string } data Optional parameters {@link string}.
* @param { string } data - Optional parameters {@link string}.
* @returns { Promise<void> } The promise returned by the function.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 2303501 - SSL is null.
@ -1962,7 +1962,7 @@ declare namespace socket {
*/
/**
* Sends data over a TLSSocket connection.
* @param { string } data Optional parameters {@link string}.
* @param { string } data - Optional parameters {@link string}.
* @returns { Promise<void> } The promise returned by the function.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 2303501 - SSL is null.

View File

@ -137,8 +137,8 @@ declare namespace webSocket {
/**
* Initiates a WebSocket request to establish a WebSocket connection to a given URL.
* @permission ohos.permission.INTERNET
* @param { string } url URL for establishing a WebSocket connection.
* @param { AsyncCallback<boolean> } callback Returns callback used to return the execution result.
* @param { string } url - URL for establishing a WebSocket connection.
* @param { AsyncCallback<boolean> } callback - the callback of connect.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
* @syscap SystemCapability.Communication.NetStack
@ -148,7 +148,7 @@ declare namespace webSocket {
* Initiates a WebSocket request to establish a WebSocket connection to a given URL.
* @permission ohos.permission.INTERNET
* @param { string } url URL for establishing a WebSocket connection.
* @param { AsyncCallback<boolean> } callback Returns callback used to return the execution result.
* @param { AsyncCallback<boolean> } callback - the callback of connect.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
* @syscap SystemCapability.Communication.NetStack
@ -161,8 +161,8 @@ declare namespace webSocket {
* Initiates a WebSocket request to establish a WebSocket connection to a given URL.
* @permission ohos.permission.INTERNET
* @param { string } url URL for establishing a WebSocket connection.
* @param { WebSocketRequestOptions } options Optional parameters {@link WebSocketRequestOptions}.
* @param { AsyncCallback<boolean> } callback Returns callback used to return the execution result.
* @param { WebSocketRequestOptions } options - Optional parameters {@link WebSocketRequestOptions}.
* @param { AsyncCallback<boolean> } callback - the callback of connect.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
* @syscap SystemCapability.Communication.NetStack
@ -172,8 +172,8 @@ declare namespace webSocket {
* Initiates a WebSocket request to establish a WebSocket connection to a given URL.
* @permission ohos.permission.INTERNET
* @param { string } url URL for establishing a WebSocket connection.
* @param { WebSocketRequestOptions } options Optional parameters {@link WebSocketRequestOptions}.
* @param { AsyncCallback<boolean> } callback Returns callback used to return the execution result.
* @param { WebSocketRequestOptions } options - Optional parameters {@link WebSocketRequestOptions}.
* @param { AsyncCallback<boolean> } callback - the callback of connect.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
* @syscap SystemCapability.Communication.NetStack
@ -186,7 +186,7 @@ declare namespace webSocket {
* Initiates a WebSocket request to establish a WebSocket connection to a given URL.
* @permission ohos.permission.INTERNET
* @param { string } url URL for establishing a WebSocket connection.
* @param { WebSocketRequestOptions } options Optional parameters {@link WebSocketRequestOptions}.
* @param { WebSocketRequestOptions } options - Optional parameters {@link WebSocketRequestOptions}.
* @returns { Promise<boolean> } The promise returned by the function.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
@ -197,7 +197,7 @@ declare namespace webSocket {
* Initiates a WebSocket request to establish a WebSocket connection to a given URL.
* @permission ohos.permission.INTERNET
* @param { string } url URL for establishing a WebSocket connection.
* @param { WebSocketRequestOptions } options Optional parameters {@link WebSocketRequestOptions}.
* @param { WebSocketRequestOptions } options - Optional parameters {@link WebSocketRequestOptions}.
* @returns { Promise<boolean> } The promise returned by the function.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
@ -210,8 +210,8 @@ declare namespace webSocket {
/**
* Sends data through a WebSocket connection.
* @permission ohos.permission.INTERNET
* @param { string | ArrayBuffer } data Data to send. It can be a string(API 6) or an ArrayBuffer(API 8).
* @param { AsyncCallback<boolean> } callback Returns callback used to return the execution result.
* @param { string | ArrayBuffer } data - Data to send. It can be a string(API 6) or an ArrayBuffer(API 8).
* @param { AsyncCallback<boolean> } callback - the callback of send.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
* @syscap SystemCapability.Communication.NetStack
@ -220,8 +220,8 @@ declare namespace webSocket {
/**
* Sends data through a WebSocket connection.
* @permission ohos.permission.INTERNET
* @param { string | ArrayBuffer } data Data to send. It can be a string(API 6) or an ArrayBuffer(API 8).
* @param { AsyncCallback<boolean> } callback Returns callback used to return the execution result.
* @param { string | ArrayBuffer } data - Data to send. It can be a string(API 6) or an ArrayBuffer(API 8).
* @param { AsyncCallback<boolean> } callback - the callback of send.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
* @syscap SystemCapability.Communication.NetStack
@ -233,7 +233,7 @@ declare namespace webSocket {
/**
* Sends data through a WebSocket connection.
* @permission ohos.permission.INTERNET
* @param { string | ArrayBuffer } data Data to send. It can be a string(API 6) or an ArrayBuffer(API 8).
* @param { string | ArrayBuffer } data - Data to send. It can be a string(API 6) or an ArrayBuffer(API 8).
* @returns { Promise<boolean> } The promise returned by the function.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
@ -243,7 +243,7 @@ declare namespace webSocket {
/**
* Sends data through a WebSocket connection.
* @permission ohos.permission.INTERNET
* @param { string | ArrayBuffer } data Data to send. It can be a string(API 6) or an ArrayBuffer(API 8).
* @param { string | ArrayBuffer } data - Data to send. It can be a string(API 6) or an ArrayBuffer(API 8).
* @returns { Promise<boolean> } The promise returned by the function.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
@ -256,7 +256,7 @@ declare namespace webSocket {
/**
* Closes a WebSocket connection.
* @permission ohos.permission.INTERNET
* @param { AsyncCallback<boolean> } callback Returns callback used to return the execution result.
* @param { AsyncCallback<boolean> } callback - the callback of close.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
* @syscap SystemCapability.Communication.NetStack
@ -265,7 +265,7 @@ declare namespace webSocket {
/**
* Closes a WebSocket connection.
* @permission ohos.permission.INTERNET
* @param { AsyncCallback<boolean> } callback Returns callback used to return the execution result.
* @param { AsyncCallback<boolean> } callback - the callback of close.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
* @syscap SystemCapability.Communication.NetStack
@ -277,8 +277,8 @@ declare namespace webSocket {
/**
* Closes a WebSocket connection.
* @permission ohos.permission.INTERNET
* @param { WebSocketCloseOptions } options Optional parameters {@link WebSocketCloseOptions}.
* @param { AsyncCallback<boolean> } callback Returns callback used to return the execution result.
* @param { WebSocketCloseOptions } options - Optional parameters {@link WebSocketCloseOptions}.
* @param { AsyncCallback<boolean> } callback - the callback of close.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
* @syscap SystemCapability.Communication.NetStack
@ -287,8 +287,8 @@ declare namespace webSocket {
/**
* Closes a WebSocket connection.
* @permission ohos.permission.INTERNET
* @param { WebSocketCloseOptions } options Optional parameters {@link WebSocketCloseOptions}.
* @param { AsyncCallback<boolean> } callback Returns callback used to return the execution result.
* @param { WebSocketCloseOptions } options - Optional parameters {@link WebSocketCloseOptions}.
* @param { AsyncCallback<boolean> } callback - the callback of close.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
* @syscap SystemCapability.Communication.NetStack
@ -300,7 +300,7 @@ declare namespace webSocket {
/**
* Closes a WebSocket connection.
* @permission ohos.permission.INTERNET
* @param { WebSocketCloseOptions } options Optional parameters {@link WebSocketCloseOptions}.
* @param { WebSocketCloseOptions } options - Optional parameters {@link WebSocketCloseOptions}.
* @returns { Promise<boolean> } The promise returned by the function.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
@ -310,7 +310,7 @@ declare namespace webSocket {
/**
* Closes a WebSocket connection.
* @permission ohos.permission.INTERNET
* @param { WebSocketCloseOptions } options Optional parameters {@link WebSocketCloseOptions}.
* @param { WebSocketCloseOptions } options - Optional parameters {@link WebSocketCloseOptions}.
* @returns { Promise<boolean> } The promise returned by the function.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
@ -322,15 +322,15 @@ declare namespace webSocket {
/**
* Enables listening for the open events of a WebSocket connection.
* @param { 'open' } type event indicating that a WebSocket connection has been opened.
* @param { AsyncCallback<Object> } callback Returns callback used to return the result.
* @param { 'open' } type - event indicating that a WebSocket connection has been opened.
* @param { AsyncCallback<Object> } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetStack
* @since 6
*/
/**
* Enables listening for the open events of a WebSocket connection.
* @param { 'open' } type event indicating that a WebSocket connection has been opened.
* @param { AsyncCallback<Object> } callback Returns callback used to return the result.
* @param { 'open' } type - event indicating that a WebSocket connection has been opened.
* @param { AsyncCallback<Object> } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetStack
* @crossplatform
* @since 10
@ -339,15 +339,15 @@ declare namespace webSocket {
/**
* Cancels listening for the open events of a WebSocket connection.
* @param { 'open' } type event indicating that a WebSocket connection has been opened.
* @param { AsyncCallback<Object> } callback Returns callback used to return the result.
* @param { 'open' } type - event indicating that a WebSocket connection has been opened.
* @param { AsyncCallback<Object> } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetStack
* @since 6
*/
/**
* Cancels listening for the open events of a WebSocket connection.
* @param { 'open' } type event indicating that a WebSocket connection has been opened.
* @param { AsyncCallback<Object> } callback Returns callback used to return the result.
* @param { 'open' } type - event indicating that a WebSocket connection has been opened.
* @param { AsyncCallback<Object> } callback the callback used to return the result.
* @syscap SystemCapability.Communication.NetStack
* @crossplatform
* @since 10
@ -357,16 +357,16 @@ declare namespace webSocket {
/**
* Enables listening for the message events of a WebSocket connection.
* data in AsyncCallback can be a string(API 6) or an ArrayBuffer(API 8).
* @param { 'message' } type event indicating that a message has been received from the server.
* @param { AsyncCallback<string | ArrayBuffer> } callback Returns callback used to return the result.
* @param { 'message' } type - event indicating that a message has been received from the server.
* @param { AsyncCallback<string | ArrayBuffer> } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetStack
* @since 6
*/
/**
* Enables listening for the message events of a WebSocket connection.
* data in AsyncCallback can be a string(API 6) or an ArrayBuffer(API 8).
* @param { 'message' } type event indicating that a message has been received from the server.
* @param { AsyncCallback<string | ArrayBuffer> } callback Returns callback used to return the result.
* @param { 'message' } type - event indicating that a message has been received from the server.
* @param { AsyncCallback<string | ArrayBuffer> } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetStack
* @crossplatform
* @since 10
@ -376,16 +376,16 @@ declare namespace webSocket {
/**
* Cancels listening for the message events of a WebSocket connection.
* data in AsyncCallback can be a string(API 6) or an ArrayBuffer(API 8).
* @param { 'message' } type event indicating that a message has been received from the server.
* @param { AsyncCallback<string | ArrayBuffer> } callback Returns callback used to return the result.
* @param { 'message' } type - event indicating that a message has been received from the server.
* @param { AsyncCallback<string | ArrayBuffer> } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetStack
* @since 6
*/
/**
* Cancels listening for the message events of a WebSocket connection.
* data in AsyncCallback can be a string(API 6) or an ArrayBuffer(API 8).
* @param { 'message' } type event indicating that a message has been received from the server.
* @param { AsyncCallback<string | ArrayBuffer> } callback Returns callback used to return the result.
* @param { 'message' } type - event indicating that a message has been received from the server.
* @param { AsyncCallback<string | ArrayBuffer> } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetStack
* @crossplatform
* @since 10
@ -394,16 +394,16 @@ declare namespace webSocket {
/**
* Enables listening for the close events of a WebSocket connection.
* @param { 'close' } type event indicating that a WebSocket connection has been closed.
* @param { AsyncCallback<{ code: number, reason: string }> } callback Callback used to return the result.
* @param { 'close' } type - event indicating that a WebSocket connection has been closed.
* @param { AsyncCallback<{ code: number, reason: string }> } callback - the callback used to return the result.
* <br>close indicates the close error code and reason indicates the error code description.
* @syscap SystemCapability.Communication.NetStack
* @since 6
*/
/**
* Enables listening for the close events of a WebSocket connection.
* @param { 'close' } type event indicating that a WebSocket connection has been closed.
* @param { AsyncCallback<{ code: number, reason: string }> } callback Callback used to return the result.
* @param { 'close' } type - event indicating that a WebSocket connection has been closed.
* @param { AsyncCallback<{ code: number, reason: string }> } callback - the callback used to return the result.
* <br>close indicates the close error code and reason indicates the error code description.
* @syscap SystemCapability.Communication.NetStack
* @crossplatform
@ -413,16 +413,16 @@ declare namespace webSocket {
/**
* Cancels listening for the close events of a WebSocket connection.
* @param { 'close' } type event indicating that a WebSocket connection has been closed.
* @param { AsyncCallback<{ code: number, reason: string }> } callback Callback used to return the result.
* @param { 'close' } type - event indicating that a WebSocket connection has been closed.
* @param { AsyncCallback<{ code: number, reason: string }> } callback - the callback used to return the result.
* <br>close indicates the close error code and reason indicates the error code description.
* @syscap SystemCapability.Communication.NetStack
* @since 6
*/
/**
* Cancels listening for the close events of a WebSocket connection.
* @param { 'close' } type event indicating that a WebSocket connection has been closed.
* @param { AsyncCallback<{ code: number, reason: string }> } callback Callback used to return the result.
* @param { 'close' } type - event indicating that a WebSocket connection has been closed.
* @param { AsyncCallback<{ code: number, reason: string }> } callback - the callback used to return the result.
* <br>close indicates the close error code and reason indicates the error code description.
* @syscap SystemCapability.Communication.NetStack
* @crossplatform
@ -432,15 +432,15 @@ declare namespace webSocket {
/**
* Enables listening for the error events of a WebSocket connection.
* @param { 'error' } type event indicating the WebSocket connection has encountered an error.
* @param { ErrorCallback } callback return callback used to return the result.
* @param { 'error' } type - event indicating the WebSocket connection has encountered an error.
* @param { ErrorCallback } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetStack
* @since 6
*/
/**
* Enables listening for the error events of a WebSocket connection.
* @param { 'error' } type event indicating the WebSocket connection has encountered an error.
* @param { ErrorCallback } callback return callback used to return the result.
* @param { 'error' } type - event indicating the WebSocket connection has encountered an error.
* @param { ErrorCallback } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetStack
* @crossplatform
* @since 10
@ -449,15 +449,15 @@ declare namespace webSocket {
/**
* Cancels listening for the error events of a WebSocket connection.
* @param { 'error' } type event indicating the WebSocket connection has encountered an error.
* @param { ErrorCallback } callback return callback used to return the result.
* @param { 'error' } type - event indicating the WebSocket connection has encountered an error.
* @param { ErrorCallback } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetStack
* @since 6
*/
/**
* Cancels listening for the error events of a WebSocket connection.
* @param { 'error' } type event indicating the WebSocket connection has encountered an error.
* @param { ErrorCallback } callback return callback used to return the result.
* @param { 'error' } type - event indicating the WebSocket connection has encountered an error.
* @param { ErrorCallback } callback - the callback used to return the result.
* @syscap SystemCapability.Communication.NetStack
* @crossplatform
* @since 10