From 03aee6724a74a7ad722d23f75c828b52d8f8a548 Mon Sep 17 00:00:00 2001 From: zhewei Date: Fri, 25 Nov 2022 17:55:31 +0800 Subject: [PATCH 1/2] fix api Signed-off-by: zhewei --- api/@ohos.net.connection.d.ts | 6 +++--- api/@ohos.net.ethernet.d.ts | 2 +- api/@ohos.net.http.d.ts | 6 ++++-- api/@ohos.net.socket.d.ts | 13 ++++++------- api/@system.fetch.d.ts | 2 -- api/@system.network.d.ts | 2 -- 6 files changed, 14 insertions(+), 17 deletions(-) diff --git a/api/@ohos.net.connection.d.ts b/api/@ohos.net.connection.d.ts index 283d7bef59..08809bb2c4 100644 --- a/api/@ohos.net.connection.d.ts +++ b/api/@ohos.net.connection.d.ts @@ -29,7 +29,7 @@ declare namespace connection { type UDPSocket = socket.UDPSocket; /** - * Create a network connection with optional netSpefifier and timeout. + * Create a network connection with optional network specifier and timeout. * * @param netSpecifier Indicates the network specifier. See {@link NetSpecifier}. * @param timeout The time in milliseconds to attempt looking for a suitable network before @@ -52,7 +52,7 @@ declare namespace connection { * *

To call this method, you must have the {@code ohos.permission.GET_NETWORK_INFO} permission. * - * @return Returns the {@link NetHandle} object; + * @returns Returns the {@link NetHandle} object; * returns {@code null} if the default network is not activated. * @permission ohos.permission.GET_NETWORK_INFO * @since 9 @@ -212,7 +212,7 @@ declare namespace connection { * Resolves a host name to obtain the first IP address based on the specified NetHandle. * * @param host Indicates the host name or the domain. - * @return Returns the first NetAddress. + * @param callback Returns the first NetAddress. * @permission ohos.permission.GET_NETWORK_INFO */ getAddressByName(host: string, callback: AsyncCallback): void; diff --git a/api/@ohos.net.ethernet.d.ts b/api/@ohos.net.ethernet.d.ts index b1a3e6a33f..12ea7797b2 100644 --- a/api/@ohos.net.ethernet.d.ts +++ b/api/@ohos.net.ethernet.d.ts @@ -19,7 +19,7 @@ import {AsyncCallback, Callback} from "./basic"; * Provides interfaces to manage ethernet. * * @since 9 - * @syscap SystemCapability.Communication.NetManager.Ethernet + * @syscap SystemCapability.Communication.NetManager.Extension */ declare namespace ethernet { /** diff --git a/api/@ohos.net.http.d.ts b/api/@ohos.net.http.d.ts index ce56e55549..88537cab53 100644 --- a/api/@ohos.net.http.d.ts +++ b/api/@ohos.net.http.d.ts @@ -98,14 +98,16 @@ declare namespace http { /** * Registers an observer for HTTP Response Header events. * - * @deprecated use on_headersReceive instead since 8. + * @deprecated since 8 + * @useinstead on_headersReceive */ on(type: "headerReceive", callback: AsyncCallback): void; /** * Unregisters the observer for HTTP Response Header events. * - * @deprecated use off_headersReceive instead since 8. + * @deprecated since 8 + * @useinstead off_headersReceive */ off(type: "headerReceive", callback?: AsyncCallback): void; diff --git a/api/@ohos.net.socket.d.ts b/api/@ohos.net.socket.d.ts index 1f6d090abd..aceaa13962 100644 --- a/api/@ohos.net.socket.d.ts +++ b/api/@ohos.net.socket.d.ts @@ -442,8 +442,7 @@ declare namespace socket { /** * Returns an object representing the peer certificate. If the peer does not provide a certificate, * an empty object will be returned. If the socket is destroyed, null is returned. - * If needChain is true, it contains the complete certificate chain. Otherwise, - * it only contains the peer's certificate. + * It only contains the peer's certificate. * * @throws {BusinessError} 2303501 - SSL is null. * @throws {BusinessError} 2300002 - System internal error. @@ -464,8 +463,8 @@ declare namespace socket { getProtocol(): Promise; /** - * Returns an object containing the negotiated cipher suite information. - * For example:{"name": "AES128-SHA256", "standardName": "TLS_RSA_WITH_AES_128_CBC_SHA256", "version": "TLSv1.2"} + * Returns a list containing the negotiated cipher suite information. + * For example:{"TLS_RSA_WITH_AES_128_CBC_SHA256", "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256"} * * @throws {BusinessError} 2303501 - SSL is null. * @throws {BusinessError} 2303502 - Error in tls reading. @@ -545,12 +544,12 @@ declare namespace socket { /** * Certificate proving the identity of the client */ - cert: string; + cert?: string; /** * Private key of client certificate */ - key: string; + key?: string; /** * Password of the private key @@ -568,7 +567,7 @@ declare namespace socket { useRemoteCipherPrefer?: boolean; /** - * Supported signature algorithms. This list can contain summary algorithms(SHA256、MD5、etc)、 + * Supported signature algorithms. This string can contain summary algorithms(SHA256、MD5、etc)、 * Public key algorithm(RSA-PSS、ECDSA、etc)、Combination of the two(For example 'RSA+SHA384') * or TLS v1.3 Scheme name(For example rsa_pss_pss_sha512) */ diff --git a/api/@system.fetch.d.ts b/api/@system.fetch.d.ts index b36c780dbd..f728c65db9 100644 --- a/api/@system.fetch.d.ts +++ b/api/@system.fetch.d.ts @@ -14,7 +14,6 @@ */ /** - * @import import fetch from '@system.fetch'; * @since 3 * @syscap SystemCapability.Communication.NetStack */ @@ -39,7 +38,6 @@ export interface FetchResponse { } /** - * @import import fetch from '@system.fetch'; * @since 3 * @syscap SystemCapability.Communication.NetStack */ diff --git a/api/@system.network.d.ts b/api/@system.network.d.ts index 977bcd3414..c4ca822793 100644 --- a/api/@system.network.d.ts +++ b/api/@system.network.d.ts @@ -14,7 +14,6 @@ */ /** - * @import import network from '@system.network'; * @since 3 * @syscap SystemCapability.Communication.NetManager.Core */ @@ -33,7 +32,6 @@ export interface NetworkResponse { } /** - * @import import network from '@system.network'; * @since 3 * @syscap SystemCapability.Communication.NetManager.Core */ -- Gitee From aa94faa345c6a97f2ce35891e929874a00587d47 Mon Sep 17 00:00:00 2001 From: zhewei Date: Fri, 25 Nov 2022 18:27:08 +0800 Subject: [PATCH 2/2] fix problem Signed-off-by: zhewei --- api/@ohos.net.connection.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.net.connection.d.ts b/api/@ohos.net.connection.d.ts index 08809bb2c4..ea1121b4d8 100644 --- a/api/@ohos.net.connection.d.ts +++ b/api/@ohos.net.connection.d.ts @@ -29,7 +29,7 @@ declare namespace connection { type UDPSocket = socket.UDPSocket; /** - * Create a network connection with optional network specifier and timeout. + * Create a network connection with optional netSpecifier and timeout. * * @param netSpecifier Indicates the network specifier. See {@link NetSpecifier}. * @param timeout The time in milliseconds to attempt looking for a suitable network before -- Gitee