Skip to content

Commit

Permalink
fix(#23): move copy of types to turbomodule (#24)
Browse files Browse the repository at this point in the history
* fix(#23): move copy of types to turbomodule

* chore(package.json): remove packageManager field

* fix(ios): podfile fix
  • Loading branch information
mateogianolio authored Nov 23, 2023
1 parent 3bb75be commit 237c2d6
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 11 deletions.
6 changes: 3 additions & 3 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ PODS:
- React-jsinspector (0.72.4)
- React-logger (0.72.4):
- glog
- react-native-esp-idf-provisioning (0.2.8):
- react-native-esp-idf-provisioning (0.2.9):
- ESPProvision (~> 2.1)
- RCT-Folly (= 2021.07.22.00)
- React-Core
Expand Down Expand Up @@ -724,7 +724,7 @@ SPEC CHECKSUMS:
React-jsiexecutor: c7f826e40fa9cab5d37cab6130b1af237332b594
React-jsinspector: aaed4cf551c4a1c98092436518c2d267b13a673f
React-logger: da1ebe05ae06eb6db4b162202faeafac4b435e77
react-native-esp-idf-provisioning: 763a1894e71a0781ada5f7473dccc464496626ea
react-native-esp-idf-provisioning: e8c9c57bcd53b053e75914fc92ab6db5e3534992
react-native-safe-area-context: 2cd91d532de12acdb0a9cbc8d43ac72a8e4c897c
React-NativeModulesApple: edb5ace14f73f4969df6e7b1f3e41bef0012740f
React-perflogger: 496a1a3dc6737f964107cb3ddae7f9e265ddda58
Expand Down Expand Up @@ -753,4 +753,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 3527a5429736b6af9fc29f486fd0c0114b5cc5de

COCOAPODS: 1.13.0
COCOAPODS: 1.14.2
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@
"engines": {
"node": ">= 18.0.0"
},
"packageManager": "^[email protected]",
"jest": {
"preset": "react-native",
"modulePathIgnorePatterns": [
Expand Down
50 changes: 43 additions & 7 deletions src/NativeEspIdfProvisioning.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,48 @@
import type { TurboModule } from 'react-native';
import { TurboModuleRegistry } from 'react-native';
import type {
ESPDeviceInterface,
ESPSecurity,
ESPStatusResponse,
ESPTransport,
ESPWifiList,
} from './types';

export enum ESPTransport {
ble = 'ble',
softap = 'softap',
}

export enum ESPSecurity {
unsecure = 0,
secure = 1,
secure2 = 2,
}

export enum ESPWifiAuthMode {
open = 0,
wep = 1,
wpa2Enterprise = 2,
wpa2Psk = 3,
wpaPsk = 4,
wpaWpa2Psk = 5,
}

export interface ESPDeviceInterface {
name: string;
security: ESPSecurity;
transport: ESPTransport;
connected?: boolean;
username?: string;
versionInfo?: { [key: string]: any }[];
capabilities?: string[];
advertisementData?: { [key: string]: any }[];
}

export interface ESPWifiList {
ssid: string;
rssi: number;
auth: ESPWifiAuthMode;
bssid?: string;
channel?: number;
}

export interface ESPStatusResponse {
status: string;
}

export interface Spec extends TurboModule {
searchESPDevices(
Expand Down

0 comments on commit 237c2d6

Please sign in to comment.