From f830f17fb17210cc277717779920d963aa2176a0 Mon Sep 17 00:00:00 2001 From: clevercong Date: Fri, 14 Jan 2022 17:29:36 +0800 Subject: [PATCH] update telephony.observer api. Signed-off-by: clevercong --- api/@ohos.telephony.observer.d.ts | 32 +++++++++++-------------------- 1 file changed, 11 insertions(+), 21 deletions(-) mode change 100755 => 100644 api/@ohos.telephony.observer.d.ts diff --git a/api/@ohos.telephony.observer.d.ts b/api/@ohos.telephony.observer.d.ts old mode 100755 new mode 100644 index d1c0fe0b18..6e4fbce5de --- a/api/@ohos.telephony.observer.d.ts +++ b/api/@ohos.telephony.observer.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import {AsyncCallback} from "./basic"; +import {Callback} from "./basic"; import radio from "./@ohos.telephony.radio"; import call from "./@ohos.telephony.call"; @@ -38,14 +38,12 @@ declare namespace observer { * @param options including slotId Indicates the ID of the target card slot. * The value {@code 0} indicates card 1, and the value {@code 1} indicates card 2. * @param callback including an instance of the {@code NetworkState} class. + * @permission ohos.permission.GET_NETWORK_INFO */ - function on(type: 'networkStateChange', callback: AsyncCallback): void; - function on(type: 'networkStateChange', options: { slotId: number }, callback: AsyncCallback): void; + function on(type: 'networkStateChange', callback: Callback): void; + function on(type: 'networkStateChange', options: { slotId: number }, callback: Callback): void; - function once(type: 'networkStateChange', callback: AsyncCallback): void; - function once(type: 'networkStateChange', options: { slotId: number }, callback: AsyncCallback): void; - - function off(type: 'networkStateChange', callback?: AsyncCallback): void; + function off(type: 'networkStateChange', callback?: Callback): void; /** * Called when the signal strength corresponding to a monitored {@code slotId} updates. @@ -55,15 +53,11 @@ declare namespace observer { * The value {@code 0} indicates card 1, and the value {@code 1} indicates card 2. * @param callback including an array of instances of the classes derived from {@link SignalInformation}. */ - function on(type: 'signalInfoChange', callback: AsyncCallback>): void; + function on(type: 'signalInfoChange', callback: Callback>): void; function on(type: 'signalInfoChange', options: { slotId: number }, - callback: AsyncCallback>): void; - - function once(type: 'signalInfoChange', callback: AsyncCallback>): void; - function once(type: 'signalInfoChange', options: { slotId: number }, - callback: AsyncCallback>): void; + callback: Callback>): void; - function off(type: 'signalInfoChange', callback?: AsyncCallback>): void; + function off(type: 'signalInfoChange', callback?: Callback>): void; /** * Receives a call state change. This callback is invoked when the call state of a specified card updates @@ -76,15 +70,11 @@ declare namespace observer { * The value of number is an empty string if the application does not have * the {@code ohos.permission#READ_CALL_LOG READ_CALL_LOG} permission. */ - function on(type: 'callStateChange', callback: AsyncCallback<{ state: CallState, number: String }>): void; + function on(type: 'callStateChange', callback: Callback<{ state: CallState, number: string }>): void; function on(type: 'callStateChange', options: { slotId: number }, - callback: AsyncCallback<{ state: CallState, number: String }>): void; - - function once(type: 'callStateChange', callback: AsyncCallback<{ state: CallState, number: String }>): void; - function once(type: 'callStateChange', options: { slotId: number }, - callback: AsyncCallback<{ state: CallState, number: String }>): void; + callback: Callback<{ state: CallState, number: string }>): void; - function off(type: 'callStateChange', callback?: AsyncCallback<{ state: CallState, number: String }>): void; + function off(type: 'callStateChange', callback?: Callback<{ state: CallState, number: string }>): void; } export default observer; \ No newline at end of file -- Gitee