diff --git a/api/@ohos.net.http.d.ts b/api/@ohos.net.http.d.ts index 9d555afdde77c8873a33342ed88cf9752506fed7..de5a6c3ec88ee314dd5eaf02a7bdd5cbf29fc9dc 100644 --- a/api/@ohos.net.http.d.ts +++ b/api/@ohos.net.http.d.ts @@ -71,13 +71,38 @@ declare namespace http { /** * Registers an observer for HTTP Response Header events. + * + * @deprecated use on_headersReceive instead since 8. */ on(type: "headerReceive", callback: AsyncCallback): void; /** * Unregisters the observer for HTTP Response Header events. + * + * @deprecated use off_headersReceive instead since 8. */ off(type: "headerReceive", callback?: AsyncCallback): void; + + /** + * Registers an observer for HTTP Response Header events. + * + * @since 8 + */ + on(type: "headersReceive", callback: Callback): void; + + /** + * Unregisters the observer for HTTP Response Header events. + * + * @since 8 + */ + off(type: "headersReceive", callback?: Callback): void; + + /** + * Registers a one-time observer for HTTP Response Header events. + * + * @since 8 + */ + once(type: "headersReceive", callback: Callback): void; } export enum RequestMethod { @@ -131,7 +156,7 @@ declare namespace http { export interface HttpResponse { /** - * result can be a string or an Object (API 6) or an ArrayBuffer(API 8). + * result can be a string (API 6) or an ArrayBuffer(API 8). Object is deprecated from API 8. */ result: string | Object | ArrayBuffer; /** diff --git a/api/@ohos.net.statistics.d.ts b/api/@ohos.net.statistics.d.ts deleted file mode 100644 index 9f1446839dabd36a14b78a7e5fd01baea7dbc620..0000000000000000000000000000000000000000 --- a/api/@ohos.net.statistics.d.ts +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import {AsyncCallback, Callback} from "./basic"; - -/** - * Obtains traffic statistics. - * - * @since 8 - * @syscap SystemCapability.Communication.NetManager.Core - */ -declare namespace statistics { - /** - * Queries the data traffic (including all TCP and UDP data packets) received through a specified NIC. - * - * @param nic Indicates the NIC name. - * @param callback Returns the data traffic received through the specified NIC. - */ - function getIfaceRxBytes(nic: string, callback: AsyncCallback): void; - function getIfaceRxBytes(nic: string): Promise; - - /** - * Queries the data traffic (including all TCP and UDP data packets) sent through a specified NIC. - * - * @param nic Indicates the NIC name. - * @param callback Returns the data traffic sent through the specified NIC. - */ - function getIfaceTxBytes(nic: string, callback: AsyncCallback): void; - function getIfaceTxBytes(nic: string): Promise; - - /** - * Queries the data traffic (including all TCP and UDP data packets) received through the cellular network. - * - * @param callback Returns the data traffic received through the cellular network. - */ - function getCellularRxBytes(callback: AsyncCallback): void; - function getCellularRxBytes(): Promise; - - /** - * Queries the data traffic (including all TCP and UDP data packets) sent through the cellular network. - * - * @param callback Returns the data traffic sent through the cellular network. - */ - function getCellularTxBytes(callback: AsyncCallback): void; - function getCellularTxBytes(): Promise; - - /** - * Queries the data traffic (including all TCP and UDP data packets) sent through all NICs. - * - * @param callback Returns the data traffic sent through all NICs. - */ - function getAllTxBytes(callback: AsyncCallback): void; - function getAllTxBytes(): Promise; - - /** - * Queries the data traffic (including all TCP and UDP data packets) received through all NICs. - * - * @param callback Returns the data traffic received through all NICs. - */ - function getAllRxBytes(callback: AsyncCallback): void; - function getAllRxBytes(): Promise; - - /** - * Queries the data traffic (including all TCP and UDP data packets) received by a specified application. - * This method applies only to system applications and your own applications. - * - * @param uid Indicates the process ID of the application. - * @param callback Returns the data traffic received by the specified application. - */ - function getUidRxBytes(uid: number, callback: AsyncCallback): void; - function getUidRxBytes(uid: number): Promise; - - /** - * Queries the data traffic (including all TCP and UDP data packets) sent by a specified application. - * This method applies only to system applications and your own applications. - * - * @param uid Indicates the process ID of the application. - * @param callback Returns the data traffic sent by the specified application. - */ - function getUidTxBytes(uid: number, callback: AsyncCallback): void; - function getUidTxBytes(uid: number): Promise; - - /** - * Register notifications of network traffic updates, restrictions, and warnings. - * - * @permission ohos.permission.GET_NETSTATS_SUMMARY - * @systemapi Hide this for inner system use. - */ - function on(type: 'netStatsChange', callback: Callback<{ iface: string, uid?: number }>): void; - - /** - * @systemapi Hide this for inner system use. - */ - function off(type: 'netStatsChange', callback?: Callback<{ iface: string, uid?: number }>): void; - - /** - * Get the traffic usage details of the network interface in the specified time period. - * - * @param IfaceInfo Indicates the handle. See {@link IfaceInfo}. - * @permission ohos.permission.GET_NETSTATS_SUMMARY - * @systemapi Hide this for inner system use. - */ - function getIfaceStats(ifaceInfo: IfaceInfo, callback: AsyncCallback): void; - function getIfaceStats(ifaceInfo: IfaceInfo): Promise; - - /** - * Get the traffic usage details of the specified time period of the application. - * - * @param UidStatsInfo Indicates the handle. See {@link UidStatsInfo}. - * @permission ohos.permission.GET_NETSTATS_SUMMARY - * @systemapi Hide this for inner system use. - */ - function getIfaceUidStats(uidStatsInfo: UidStatsInfo, callback: AsyncCallback): void; - function getIfaceUidStats(uidStatsInfo: UidStatsInfo): Promise; - - /** - * @systemapi Hide this for inner system use. - */ - export interface IfaceInfo { - iface: string; - startTime: number; - endTime: number; - } - - /** - * @systemapi Hide this for inner system use. - */ - export interface UidStatsInfo { - /*See {@link IfaceInfo}*/ - ifaceInfo: IfaceInfo; - uid: number; - } - - /** - * @systemapi Hide this for inner system use. - */ - export interface NetStatsInfo { - rxBytes: number; - txBytes: number; - rxPackets: number; - txPackets: number; - } -} - -export default statistics; \ No newline at end of file diff --git a/api/@ohos.telephony.radio.d.ts b/api/@ohos.telephony.radio.d.ts index cae3d90ff79ea82b000e84a7e08579f3114e1bde..38b942aba015ebb43b7278c0c619ad77fec02cf3 100644 --- a/api/@ohos.telephony.radio.d.ts +++ b/api/@ohos.telephony.radio.d.ts @@ -143,6 +143,7 @@ declare namespace radio { * supported by the device. * @param callback Returns the IMEI; returns an empty string if the IMEI does not exist. * @permission ohos.permission.GET_TELEPHONY_STATE + * @systemapi Hide this for inner system use. * @since 8 */ function getIMEI(callback: AsyncCallback): void; @@ -158,6 +159,7 @@ declare namespace radio { * supported by the device. * @param callback Returns the MEID; returns an empty string if the MEID does not exist. * @permission ohos.permission.GET_TELEPHONY_STATE + * @systemapi Hide this for inner system use. * @since 8 */ function getMEID(callback: AsyncCallback): void; @@ -177,6 +179,7 @@ declare namespace radio { * supported by the device. * @param callback Returns the unique device ID; returns an empty string if the unique device ID does not exist. * @permission ohos.permission.GET_TELEPHONY_STATE + * @systemapi Hide this for inner system use. * @since 8 */ function getUniqueDeviceId(callback: AsyncCallback): void; @@ -233,27 +236,42 @@ declare namespace radio { function isNrSupported(slotId: number): boolean; /** + * Checks whether the radio service is enabled. + * + * @param slotId Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. * @permission ohos.permission.GET_NETWORK_INFO * @since 7 */ function isRadioOn(callback: AsyncCallback): void; - function isRadioOn(): Promise; + function isRadioOn(slotId: number, callback: AsyncCallback): void + function isRadioOn(slotId?: number): Promise; /** + * Turn on the radio service. + * + * @param slotId Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. * @permission ohos.permission.SET_TELEPHONY_STATE * @systemapi Hide this for inner system use. * @since 7 */ function turnOnRadio(callback: AsyncCallback): void; - function turnOnRadio(): Promise; + function turnOnRadio(slotId: number, callback: AsyncCallback): void; + function turnOnRadio(slotId?: number): Promise; /** + * Turn off the radio service. + * + * @param slotId Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. * @permission ohos.permission.SET_TELEPHONY_STATE * @systemapi Hide this for inner system use. * @since 7 */ function turnOffRadio(callback: AsyncCallback): void; - function turnOffRadio(): Promise; + function turnOffRadio(slotId: number, callback: AsyncCallback): void; + function turnOffRadio(slotId?: number): Promise; /** * @since 7 diff --git a/api/@ohos.telephony.sim.d.ts b/api/@ohos.telephony.sim.d.ts index 35b4253181c565e3546fcf2cd6f3f4399d635701..83d8ed9902ed9fa4e22f96b95265c4957b222c3a 100644 --- a/api/@ohos.telephony.sim.d.ts +++ b/api/@ohos.telephony.sim.d.ts @@ -133,6 +133,8 @@ declare namespace sim { * ranging from 0 to the maximum card slot index number supported by the device. * @param callback Returns the ICCID; returns an empty string if no SIM card is inserted. * @permission ohos.permission.GET_TELEPHONY_STATE + * @systemapi Hide this for inner system use. + * @since 7 */ function getSimIccId(slotId: number, callback: AsyncCallback): void; function getSimIccId(slotId: number): Promise; @@ -147,6 +149,7 @@ declare namespace sim { * @param callback Returns the voice mailbox alpha identifier; * returns an empty string if no voice mailbox alpha identifier is written into the SIM card. * @permission ohos.permission.GET_TELEPHONY_STATE + * @systemapi Hide this for inner system use. * @since 8 */ function getVoiceMailIdentifier(slotId: number, callback: AsyncCallback): void; @@ -162,6 +165,7 @@ declare namespace sim { * @param callback Returns the voice mailbox number; * returns an empty string if no voice mailbox number is written into the SIM card. * @permission ohos.permission.GET_TELEPHONY_STATE + * @systemapi Hide this for inner system use. * @since 8 */ function getVoiceMailNumber(slotId: number, callback: AsyncCallback): void; @@ -186,6 +190,7 @@ declare namespace sim { * @param callback Returns the MSISDN; returns an empty string if no SIM card is inserted or * no MSISDN is recorded in the EFMSISDN file. * @permission ohos.permission.GET_TELEPHONY_STATE + * @systemapi Hide this for inner system use. * @since 8 */ function getSimTelephoneNumber(slotId: number, callback: AsyncCallback): void; @@ -202,7 +207,8 @@ declare namespace sim { * @param callback Returns the GID1; returns an empty string if no SIM card is inserted or * no GID1 in the SIM card. * @permission ohos.permission.GET_TELEPHONY_STATE - * @since 8 + * @systemapi Hide this for inner system use. + * @since 7 */ function getSimGid1(slotId: number, callback: AsyncCallback): void; function getSimGid1(slotId: number): Promise; diff --git a/api/@ohos.telephony.sms.d.ts b/api/@ohos.telephony.sms.d.ts index 2a18155c134cf483126082fc6bef0aae38ca780b..5b8e4b45e20692db675bcbaee663fbc0bfa7c089 100644 --- a/api/@ohos.telephony.sms.d.ts +++ b/api/@ohos.telephony.sms.d.ts @@ -98,6 +98,7 @@ declare namespace sms { * @param slotId Indicates the ID of the slot holding the SIM card for sending SMS messages. * @param smscAddr Indicates the SMSC address. * @permission ohos.permission.SET_TELEPHONY_STATE + * @systemapi Hide this for inner system use. * @since 7 */ function setSmscAddr(slotId: number, smscAddr: string, callback: AsyncCallback): void; @@ -111,6 +112,7 @@ declare namespace sms { * @param slotId Indicates the ID of the slot holding the SIM card for sending SMS messages. * @param callback Returns the SMSC address. * @permission ohos.permission.GET_TELEPHONY_STATE + * @systemapi Hide this for inner system use. * @since 7 */ function getSmscAddr(slotId: number, callback: AsyncCallback): void;