espruino: added type for wifi module for access point (#27544)

* espruino added type for wifi module for access point

* espruino added myself to definitions

* changed tabsize to 4
This commit is contained in:
Jurand Niemczycki
2018-07-25 09:02:36 -07:00
committed by Andy
parent 7c8f1488d5
commit 0d17329314
2 changed files with 18 additions and 4 deletions
+12
View File
@@ -1,2 +1,14 @@
import * as wifi from 'Wifi';
wifi.connect('ssid', { password: 'pass', authMode: 'wpa_wpa2' }, err => {
if (err) throw err;
console.log('connected');
});
wifi.startAP('ssid', { password: 'pass', authMode: 'wpa_wpa2' }, err => {
if (err) throw err;
console.log("created");
});
I2C1.setup({ scl: D4, sda: D0 });
Serial2.setup(9600, { rx: D16, tx: D17 });
+6 -4
View File
@@ -1,6 +1,7 @@
// Type definitions for Espruino 1.94
// Project: http://www.espruino.com/
// Definitions by: Stanislav Berkov <https://github.com/stasberkov>
// Jurand Niemczycki <https://github.com/createdbyjurand>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare interface Object {
@@ -9,6 +10,7 @@ declare interface Object {
declare module "Wifi" {
function connect(ssid: string, options: any, callback: (err: any) => any): any;
function startAP(ssid: string, options: any, callback: (err: any) => any): any;
}
declare module "InfluxDB" {
@@ -391,10 +393,10 @@ declare interface Timer {
}
// write(data: any[]): any;
// on(event: string, handler: (data: any) => any): any;
// setup(boudrate: number, options: any): any;
// read(chars?: number): string;
// write(data: any[]): any;
// on(event: string, handler: (data: any) => any): any;
// setup(boudrate: number, options: any): any;
// read(chars?: number): string;
/**