npm.io
1.0.5 • Published 2 years ago

@types/react-native-bluetooth-serial

Licence
MIT
Version
1.0.5
Deps
2
Size
4 kB
Vulns
0
Weekly
0
Stars
51.4K

Installation

npm install --save @types/react-native-bluetooth-serial

Summary

This package contains type definitions for react-native-bluetooth-serial (https://github.com/rusel1989/react-native-bluetooth-serial).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-native-bluetooth-serial.

index.d.ts

import * as React from "react";
import * as ReactNative from "react-native";

export type Buffer = (data: number[]) => void;

export namespace BluetoothSerial {
    function on(eventName: string, handler: () => void): void;
    function removeListener(eventName: string, handler: () => void): void;
    function write(data: Buffer | string): Promise<boolean>;
    function list(): Promise<Array<{ id: string; name: string }>>;
    function isEnabled(): Promise<boolean>;
    function connect(id: string): Promise<void>;
    function disconnect(): Promise<void>;
    function isConnected(): Promise<boolean>;
}

Additional Details

Credits

These definitions were written by Rodrigo Weber.