Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@types/node-wifi

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/node-wifi

TypeScript definitions for node-wifi

  • 2.0.2
  • ts4.5
  • ts4.6
  • ts4.7
  • ts4.8
  • ts4.9
  • ts5.0
  • ts5.1
  • ts5.2
  • ts5.3
  • ts5.4
  • ts5.5
  • ts5.6
  • ts5.7
  • ts5.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Installation

npm install --save @types/node-wifi

Summary

This package contains type definitions for node-wifi (https://github.com/friedrith/node-wifi).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node-wifi.

index.d.ts

export interface WiFiNetwork {
    ssid: string;
    bssid?: string;
    mac?: string; // equals to bssid (for retrocompatibility)
    channel: number;
    frequency: number; // in MHz
    signal_level: number; // in dB
    quality: number; // same as signal level but in %
    security: string; // format depending on locale for open networks in Windows
    security_flags: string[]; // encryption protocols (format currently depending of the OS)
    mode?: string; // network mode like Infra (format currently depending of the OS)
}

export interface InitConfig {
    debug?: boolean;
    iface?: string | null; // network interface, choose a random wifi interface if set to null
}

export interface ConnectionOpts {
    ssid: string;
    password: string;
}

export interface DeletionOpts {
    ssid: string;
}

/**
 * Initialize wifi module
 * Absolutely necessary even to set interface to null
 */
export function init(options: InitConfig): void;

/**
 * Scan networks
 */
export function scan(): Promise<WiFiNetwork[]>;
export function scan(cb: (error: Error | null, networks: WiFiNetwork[]) => void): void;

/**
 * Connect to a network
 * on windows, the callback is called even if the connection failed due to netsh limitations
 * if your software may work on windows, you should use `wifi.getCurrentConnections` to check if the connection succeeded
 */
export function connect(opts: ConnectionOpts): Promise<void>;
export function connect(opts: ConnectionOpts, cb: () => void): void;

/**
 * Disconnect from a network
 * not available on all os for now
 */
export function disconnect(): Promise<void>;
export function disconnect(cb: (error: Error | null) => void): void;

/**
 * List the current wifi connections
 */
export function getCurrentConnections(): Promise<WiFiNetwork[]>;
export function getCurrentConnections(cb: (error: Error | null, currentConnections: WiFiNetwork[]) => void): void;

/**
 * Delete a saved network
 * not available on all os for now
 */
export function deleteConnection(opts: DeletionOpts, cb: (error: Error | null) => void): void;
export function deleteConnection(opts: DeletionOpts): Promise<void>;

Additional Details

  • Last updated: Tue, 07 Nov 2023 09:09:39 GMT
  • Dependencies: none

Credits

These definitions were written by hieyou1.

FAQs

Package last updated on 07 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc