UNPKG

10.2 kBJavaScriptView Raw
1"use strict";
2var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3 var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5 else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6 return c > 3 && r && Object.defineProperty(target, key, r), r;
7};
8var plugin_1 = require('./plugin');
9/**
10 * @beta
11 * @name Hotspot
12 * @description
13 * @usage
14 * ```typescript
15 * import { Hotspot, Network } from 'ionic-native';
16 *
17 *
18 * Hotspot.scanWifi().then((networks: Array<Network>) => {
19 * console.log(networks);
20 * });
21 *
22 * ```
23 * @interfaces
24 * HotspotConnectionInfo
25 * HotspotNetwork
26 * HotspotNetworkConfig
27 * HotspotDevice
28 */
29var Hotspot = (function () {
30 function Hotspot() {
31 }
32 /**
33 * @returns {Promise<boolean>}
34 */
35 Hotspot.isAvailable = function () { return; };
36 /**
37 * @returns {Promise<boolean>}
38 */
39 Hotspot.toggleWifi = function () { return; };
40 /**
41 * Configures and starts hotspot with SSID and Password
42 *
43 * @param {string} SSID - SSID of your new Access Point
44 * @param {string} mode - encryption mode (Open, WEP, WPA, WPA_PSK)
45 * @param {string} password - password for your new Access Point
46 *
47 * @returns {Promise<void>} - Promise to call once hotspot is started, or reject upon failure
48 */
49 Hotspot.createHotspot = function (ssid, mode, password) { return; };
50 /**
51 * Turns on Access Point
52 *
53 * @returns {Promise<boolean>} - true if AP is started
54 */
55 Hotspot.startHotspot = function () { return; };
56 /**
57 * Configures hotspot with SSID and Password
58 *
59 * @param {string} SSID - SSID of your new Access Point
60 * @param {string} mode - encryption mode (Open, WEP, WPA, WPA_PSK)
61 * @param {string} password - password for your new Access Point
62 *
63 * @returns {Promise<void>} - Promise to call when hotspot is configured, or reject upon failure
64 */
65 Hotspot.configureHotspot = function (ssid, mode, password) { return; };
66 /**
67 * Turns off Access Point
68 *
69 * @returns {Promise<boolean>} - Promise to turn off the hotspot, true on success, false on failure
70 */
71 Hotspot.stopHotspot = function () { return; };
72 /**
73 * Checks if hotspot is enabled
74 *
75 * @returns {Promise<void>} - Promise that hotspot is enabled, rejected if it is not enabled
76 */
77 Hotspot.isHotspotEnabled = function () { return; };
78 /**
79 * @returns {Promise<Array<HotspotDevice>>}
80 */
81 Hotspot.getAllHotspotDevices = function () { return; };
82 /**
83 * Connect to a WiFi network
84 *
85 * @param {string} ssid
86 * SSID to connect
87 * @param {string} password
88 * password to use
89 *
90 * @returns {Promise<void>}
91 * Promise that connection to the WiFi network was successfull, rejected if unsuccessful
92 */
93 Hotspot.connectToWifi = function (ssid, password) { return; };
94 /**
95 * Connect to a WiFi network
96 *
97 * @param {string} ssid
98 * SSID to connect
99 * @param {string} password
100 * Password to use
101 * @param {string} authentication
102 * Authentication modes to use (LEAP, SHARED, OPEN)
103 * @param {string[]} encryption
104 * Encryption modes to use (CCMP, TKIP, WEP104, WEP40)
105 *
106 * @returns {Promise<void>}
107 * Promise that connection to the WiFi network was successfull, rejected if unsuccessful
108 */
109 Hotspot.connectToWifiAuthEncrypt = function (ssid, password, authentication, encryption) { return; };
110 /**
111 * Add a WiFi network
112 *
113 * @param {string} ssid
114 * SSID of network
115 * @param {string} mode
116 * Authentication mode of (Open, WEP, WPA, WPA_PSK)
117 * @param {string} password
118 * Password for network
119 *
120 * @returns {Promise<void>}
121 * Promise that adding the WiFi network was successfull, rejected if unsuccessful
122 */
123 Hotspot.addWifiNetwork = function (ssid, mode, password) { return; };
124 /**
125 * Remove a WiFi network
126 *
127 * @param {string} ssid
128 * SSID of network
129 *
130 * @returns {Promise<void>}
131 * Promise that removing the WiFi network was successfull, rejected if unsuccessful
132 */
133 Hotspot.removeWifiNetwork = function (ssid) { return; };
134 /**
135 * @returns {Promise<boolean>}
136 */
137 Hotspot.isConnectedToInternet = function () { return; };
138 /**
139 * @returns {Promise<boolean>}
140 */
141 Hotspot.isConnectedToInternetViaWifi = function () { return; };
142 /**
143 * @returns {Promise<boolean>}
144 */
145 Hotspot.isWifiOn = function () { return; };
146 /**
147 * @returns {Promise<boolean>}
148 */
149 Hotspot.isWifiSupported = function () { return; };
150 /**
151 * @returns {Promise<boolean>}
152 */
153 Hotspot.isWifiDirectSupported = function () { return; };
154 /**
155 * @returns {Promise<Array<HotspotNetwork>>}
156 */
157 Hotspot.scanWifi = function () { return; };
158 /**
159 * @returns {Promise<Array<HotspotNetwork>>}
160 */
161 Hotspot.scanWifiByLevel = function () { return; };
162 /**
163 * @returns {Promise<any>}
164 */
165 Hotspot.startWifiPeriodicallyScan = function (interval, duration) { return; };
166 /**
167 * @returns {Promise<any>}
168 */
169 Hotspot.stopWifiPeriodicallyScan = function () { return; };
170 /**
171 * @returns {Promise<HotspotNetworkConfig>}
172 */
173 Hotspot.getNetConfig = function () { return; };
174 /**
175 * @returns {Promise<HotspotConnectionInfo>}
176 */
177 Hotspot.getConnectionInfo = function () { return; };
178 /**
179 * @returns {Promise<string>}
180 */
181 Hotspot.pingHost = function (ip) { return; };
182 /**
183 * Gets MAC Address associated with IP Address from ARP File
184 *
185 * @param {string} ip - IP Address that you want the MAC Address of
186 *
187 * @returns {Promise<string>} - A Promise for the MAC Address
188 */
189 Hotspot.getMacAddressOfHost = function (ip) { return; };
190 /**
191 * Checks if IP is live using DNS
192 *
193 * @param {string} ip - IP Address you want to test
194 *
195 * @returns {Promise<boolean>} - A Promise for whether the IP Address is reachable
196 */
197 Hotspot.isDnsLive = function (ip) { return; };
198 /**
199 * Checks if IP is live using socket And PORT
200 *
201 * @param {string} ip - IP Address you want to test
202 *
203 * @returns {Promise<boolean>} - A Promise for whether the IP Address is reachable
204 */
205 Hotspot.isPortLive = function (ip) { return; };
206 /**
207 * Checks if device is rooted
208 *
209 * @returns {Promise<boolean>} - A Promise for whether the device is rooted
210 */
211 Hotspot.isRooted = function () { return; };
212 __decorate([
213 plugin_1.Cordova()
214 ], Hotspot, "isAvailable", null);
215 __decorate([
216 plugin_1.Cordova()
217 ], Hotspot, "toggleWifi", null);
218 __decorate([
219 plugin_1.Cordova()
220 ], Hotspot, "createHotspot", null);
221 __decorate([
222 plugin_1.Cordova()
223 ], Hotspot, "startHotspot", null);
224 __decorate([
225 plugin_1.Cordova()
226 ], Hotspot, "configureHotspot", null);
227 __decorate([
228 plugin_1.Cordova()
229 ], Hotspot, "stopHotspot", null);
230 __decorate([
231 plugin_1.Cordova()
232 ], Hotspot, "isHotspotEnabled", null);
233 __decorate([
234 plugin_1.Cordova()
235 ], Hotspot, "getAllHotspotDevices", null);
236 __decorate([
237 plugin_1.Cordova()
238 ], Hotspot, "connectToWifi", null);
239 __decorate([
240 plugin_1.Cordova()
241 ], Hotspot, "connectToWifiAuthEncrypt", null);
242 __decorate([
243 plugin_1.Cordova()
244 ], Hotspot, "addWifiNetwork", null);
245 __decorate([
246 plugin_1.Cordova()
247 ], Hotspot, "removeWifiNetwork", null);
248 __decorate([
249 plugin_1.Cordova()
250 ], Hotspot, "isConnectedToInternet", null);
251 __decorate([
252 plugin_1.Cordova()
253 ], Hotspot, "isConnectedToInternetViaWifi", null);
254 __decorate([
255 plugin_1.Cordova()
256 ], Hotspot, "isWifiOn", null);
257 __decorate([
258 plugin_1.Cordova()
259 ], Hotspot, "isWifiSupported", null);
260 __decorate([
261 plugin_1.Cordova()
262 ], Hotspot, "isWifiDirectSupported", null);
263 __decorate([
264 plugin_1.Cordova()
265 ], Hotspot, "scanWifi", null);
266 __decorate([
267 plugin_1.Cordova()
268 ], Hotspot, "scanWifiByLevel", null);
269 __decorate([
270 plugin_1.Cordova()
271 ], Hotspot, "startWifiPeriodicallyScan", null);
272 __decorate([
273 plugin_1.Cordova()
274 ], Hotspot, "stopWifiPeriodicallyScan", null);
275 __decorate([
276 plugin_1.Cordova()
277 ], Hotspot, "getNetConfig", null);
278 __decorate([
279 plugin_1.Cordova()
280 ], Hotspot, "getConnectionInfo", null);
281 __decorate([
282 plugin_1.Cordova()
283 ], Hotspot, "pingHost", null);
284 __decorate([
285 plugin_1.Cordova()
286 ], Hotspot, "getMacAddressOfHost", null);
287 __decorate([
288 plugin_1.Cordova()
289 ], Hotspot, "isDnsLive", null);
290 __decorate([
291 plugin_1.Cordova()
292 ], Hotspot, "isPortLive", null);
293 __decorate([
294 plugin_1.Cordova()
295 ], Hotspot, "isRooted", null);
296 Hotspot = __decorate([
297 plugin_1.Plugin({
298 pluginName: 'Hotspot',
299 plugin: 'cordova-plugin-hotspot',
300 pluginRef: 'cordova.plugins.hotspot',
301 repo: 'https://github.com/hypery2k/cordova-hotspot-plugin',
302 platforms: ['Android']
303 })
304 ], Hotspot);
305 return Hotspot;
306}());
307exports.Hotspot = Hotspot;
308//# sourceMappingURL=hotspot.js.map
\No newline at end of file