lavva.webbluetooth
Version:
Library implementing WebBluetooth custom functionality if underlying platform does support it
66 lines (65 loc) • 1.75 kB
TypeScript
export * from './DeviceStore';
export * from './LavvaBluetooth';
export interface IDevicesSearchScreenView {
OnSelectionCancelled: INativeEvent;
onDeviceSelected: INativeTypedEvent<NativeBluetoothDeviceInfo>;
AddFoundDevice(device: NativeBluetoothDeviceInfo): void;
UpdateFoundDevice(device: NativeBluetoothDeviceInfo): void;
StartedScanning(scanTime: number): void;
StoppedScanning(): void;
SelectionCancelled(): void;
}
export declare class NativeBluetoothDeviceInfo {
rssi: number;
uuids: string[] | null;
deviceName: string;
deviceAddress: string;
}
export interface INativeEvent {
Invoke(): void;
Subscribe(handler: {
(): void;
}): void;
Unsubscribe(handler: {
(): void;
}): void;
}
export interface INativeTypedEvent<T> {
Subscribe(handler: {
(data: T): void;
}): void;
Unsubscribe(handler: {
(data: T): void;
}): void;
}
export declare class NativeEvent implements INativeEvent {
private handlers;
GetHandlers(): {
(): void;
}[];
RemoveAllSubscriptions(): void;
Subscribe(handler: {
(): void;
}): void;
Unsubscribe(handler: {
(): void;
}): void;
Invoke(): void;
}
export declare class NativeTypedEvent<T> implements INativeTypedEvent<T> {
private handlers;
private name;
constructor(name: string);
Subscribe(handler: {
(data: T): void;
}): void;
Unsubscribe(handler: {
(data: T): void;
}): void;
RemoveAllSubscriptions(): void;
Invoke(data: T): void;
}
export declare class ExtendedWebBluetooth {
static IsCustomSearchScreenSupported(): boolean;
static SetSearchScreen(screen: IDevicesSearchScreenView): void;
}