forked from Pilloxa/react-native-nordic-dfu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
33 lines (30 loc) · 778 Bytes
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
declare module 'react-native-nordic-dfu' {
export class NordicDFU {
static startDFU({
deviceAddress,
deviceName,
filePath,
alternativeAdvertisingNameEnabled
}: {
deviceAddress: string;
deviceName?: string;
filePath: string | null;
alternativeAdvertisingNameEnabled?: boolean;
}): Promise<string>;
}
export interface IDfuUpdate {
percent?: number;
currentPart?: number;
partsTotal?: number;
avgSpeed?: number;
speed?: number;
state?: string;
}
export class DFUEmitter {
static addListener(
name: 'DFUProgress' | 'DFUStateChanged',
handler: (update: IDfuUpdate) => void
): void;
static removeAllListeners(name: 'DFUProgress' | 'DFUStateChanged'): void;
}
}