共用方式為


NetworkDiagnostics interface

網路診斷

方法

getLatest()

取得最新的已知網路診斷

off("diagnosticChanged", (args: NetworkDiagnosticChangedEventArgs) => void)

diagnosticChanged 事件的取消訂閱函式

on("diagnosticChanged", (args: NetworkDiagnosticChangedEventArgs) => void)

diagnosticChanged 事件的訂閱函式

方法詳細資料

getLatest()

取得最新的已知網路診斷

function getLatest(): LatestNetworkDiagnostics

傳回

off("diagnosticChanged", (args: NetworkDiagnosticChangedEventArgs) => void)

diagnosticChanged 事件的取消訂閱函式

function off(event: "diagnosticChanged", listener: (args: NetworkDiagnosticChangedEventArgs) => void)

參數

event

"diagnosticChanged"

事件名稱

listener

(args: NetworkDiagnosticChangedEventArgs) => void

回呼 fn,用來取消訂閱此事件

on("diagnosticChanged", (args: NetworkDiagnosticChangedEventArgs) => void)

diagnosticChanged 事件的訂閱函式

function on(event: "diagnosticChanged", listener: (args: NetworkDiagnosticChangedEventArgs) => void)

參數

event

"diagnosticChanged"

事件名稱

listener

(args: NetworkDiagnosticChangedEventArgs) => void

在診斷變更時所呼叫的回調 fn