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

0.4.2 • Public • Published

Installation

npm install --save @types/node-dht-sensor

Summary

This package contains type definitions for node-dht-sensor (https://github.com/momenso/node-dht-sensor).

Details

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

index.d.ts

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

export type DHT11 = 11;
export type DHT22 = 22;
export type SensorType = DHT11 | DHT22;

export interface SensorData {
    temperature: number;
    humidity: number;
}

export function initialize(type: SensorType, pin: number): boolean;
// for faked test values only
export function initialize(testOptions: { test: { fake: SensorData } }): void;

export function read(
    type: SensorType,
    pin: number,
    callback: (err: NodeJS.ErrnoException | null, temperature: number, humidity: number) => void,
): void;
export function read(type?: SensorType, pin?: number): SensorData;

export function setMaxRetries(maxRetries: number): void;

export namespace promises {
    function initialize(type: SensorType, pin: number): boolean;
    function initialize(testOptions: { test: { fake: SensorData } }): void;
    function readSync(type?: SensorType, pin?: number): SensorData;
    function read(type?: SensorType, pin?: number): Promise<SensorData>;
    function setMaxRetries(maxRetries: number): void;
}

Additional Details

  • Last updated: Tue, 07 Nov 2023 09:09:39 GMT
  • Dependencies: @types/node

Credits

These definitions were written by Manuel Schächinger.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/node-dht-sensor

Weekly Downloads

30

Version

0.4.2

License

MIT

Unpacked Size

4.77 kB

Total Files

5

Last publish

Collaborators

  • types