DefinitelyTyped/types/react-native-bluetooth-serial/index.d.ts
Ferdy Budhidharma bc0c933415 feat(react-dependents): update to TS 2.8 (part 2 of 2) (#27744)
* feat(react-dependents): update to ts 2.8

* fix version mismatches

* remove package.json

* post merge updates

* add package.json back again
2018-08-06 06:28:42 +01:00

21 lines
901 B
TypeScript

// Type definitions for react-native-bluetooth-serial 1.0
// Project: https://github.com/rusel1989/react-native-bluetooth-serial
// Definitions by: Rodrigo Weber <https://github.com/RodrigoAWeber>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
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>;
}