@types/wake_on_lan
TypeScript icon, indicating that this package has built-in type declarations

0.0.33 • Public • Published

Installation

npm install --save @types/wake_on_lan

Summary

This package contains type definitions for wake_on_lan (https://github.com/agnat/node_wake_on_lan).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/wake_on_lan.

index.d.ts

/// <reference types="node"/>

declare var wol: wol.Wol;
export = wol;

declare namespace wol {
    export interface WakeOptions {
        /**
         * The ip address to which the packet is send  (default: 255.255.255.255)
         */
        address?: string | undefined;

        /**
         * Number of packets to send (default: 3)
         */
        num_packets?: number | undefined;

        /**
         * The interval between packets (default: 100ms)
         */
        interval?: number | undefined;

        /**
         * The port to send to (default: 9)
         */
        port?: number | undefined;
    }

    type ErrorCallback = (Error: any) => void;

    export interface Wol {
        /**
         * Send a sequence of Wake-on-LAN magic packets to the given MAC address.
         *
         * @param {string} macAddress the mac address of the target device
         */
        wake(macAddress: string): void;

        /**
         * Send a sequence of Wake-on-LAN magic packets to the given MAC address.
         *
         * @param {string} macAddress the mac address of the target device
         * @param {ErrorCallback} callback is called when all packets have been sent or an error occurs.
         */
        wake(macAddress: string, callback: ErrorCallback): void;

        /**
         * Send a sequence of Wake-on-LAN magic packets to the given MAC address.
         *
         * @param {string} macAddress the mac address of the target device
         * @param {WakeOptions} opts additional options to send the packet
         * @param {ErrorCallback} callback is called when all packets have been sent or an error occurs.
         */
        wake(macAddress: string, opts: WakeOptions, callback?: Function): void;

        /**
         * Creates a buffer with a magic packet for the given MAC address.
         *
         * @param {string} macAddress mac address of the target device
         * @return {Buffer} the magic packet
         */
        createMagicPacket(macAddress: string): Buffer;
    }
}

Additional Details

  • Last updated: Tue, 07 Nov 2023 15:11:36 GMT
  • Dependencies: @types/node

Credits

These definitions were written by Tobias Kahlert.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/wake_on_lan

Weekly Downloads

179

Version

0.0.33

License

MIT

Unpacked Size

6.71 kB

Total Files

5

Last publish

Collaborators

  • types