From b4fbfd5b05deea2b81acefc3d4c6c2f24813cde4 Mon Sep 17 00:00:00 2001 From: Phap Date: Thu, 25 Jul 2019 22:14:40 -0400 Subject: [PATCH 1/3] add definition file --- index.d.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 index.d.ts diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..94026e5 --- /dev/null +++ b/index.d.ts @@ -0,0 +1,19 @@ +export interface wifi { + isEnabled: () => void; + setEnabled: () => void; + findAndConnect: () => void; + disconnect: () => void; + getSSID: () => void; + getBSSID: () => void; + loadWifiList: () => void; + connectionStatus: () => void; + getCurrentSignalStrength: () => void; + getFrequency: () => void; + getIP: () => void; + getDhcpServerAddress: () => void; + isRemoveWifiNetwork: () => void; + reScanAndLoadWifiList: () => void; + forceWifiUsage: () => void; + connectionStatusOfBoundNetwork: () => void; + connectToHiddenNetwork: () => void; +} \ No newline at end of file From 7cb73714e819f6f6701616720340236dbdf7ce07 Mon Sep 17 00:00:00 2001 From: Phap Date: Thu, 25 Jul 2019 22:19:20 -0400 Subject: [PATCH 2/3] add declare statement --- index.d.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/index.d.ts b/index.d.ts index 94026e5..8dbeeaa 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,4 +1,4 @@ -export interface wifi { +declare const wifi: { isEnabled: () => void; setEnabled: () => void; findAndConnect: () => void; @@ -16,4 +16,6 @@ export interface wifi { forceWifiUsage: () => void; connectionStatusOfBoundNetwork: () => void; connectToHiddenNetwork: () => void; -} \ No newline at end of file +} + +export default wifi; From fc0f63ac0516d44582a58d593f1a2206d9d41cdd Mon Sep 17 00:00:00 2001 From: Phap Date: Thu, 19 Sep 2019 22:28:51 -0400 Subject: [PATCH 3/3] added parameter typings --- index.d.ts | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/index.d.ts b/index.d.ts index 8dbeeaa..1612a73 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,21 +1,21 @@ declare const wifi: { - isEnabled: () => void; - setEnabled: () => void; - findAndConnect: () => void; + isEnabled: (isEnabled: Function) => void; + setEnabled: (enabled: boolean) => void; + findAndConnect: (ssid: string, password: string, ssidFound: Function) => void; disconnect: () => void; - getSSID: () => void; - getBSSID: () => void; - loadWifiList: () => void; - connectionStatus: () => void; - getCurrentSignalStrength: () => void; - getFrequency: () => void; - getIP: () => void; - getDhcpServerAddress: () => void; - isRemoveWifiNetwork: () => void; - reScanAndLoadWifiList: () => void; - forceWifiUsage: () => void; - connectionStatusOfBoundNetwork: () => void; - connectToHiddenNetwork: () => void; + getSSID: (callback: Function) => void; + getBSSID: (callback: Function) => void; + loadWifiList: (successCallback: Function, errorCallback: Function) => void; + connectionStatus: (connectionStatusResult: Function) => void; + getCurrentSignalStrength: (callback: Function) => void; + getFrequency: (callback: Function) => void; + getIP: (callback: Function) => void; + getDhcpServerAddress: (callback: Function) => void; + isRemoveWifiNetwork: (ssid: string, callback: Function) => void; + reScanAndLoadWifiList: (successCallback: Function, errorCallback: Function) => void; + forceWifiUsage: (useWifi: boolean) => void; + connectionStatusOfBoundNetwork: (connectionStatusResult: Function) => void; + connectToHiddenNetwork: (ssid: string, password: string, networkAdded: Function) => void; } export default wifi;