forked from Pilloxa/react-native-nordic-dfu
-
Notifications
You must be signed in to change notification settings - Fork 37
/
index.d.ts
39 lines (36 loc) · 948 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
34
35
36
37
38
39
declare module "react-native-nordic-dfu" {
export class NordicDFU {
static startDFU({
deviceAddress,
deviceName,
filePath,
alternativeAdvertisingNameEnabled,
packetReceiptNotificationParameter,
retries,
maxMtu,
}: {
deviceAddress: string;
deviceName?: string;
filePath: string | null;
alternativeAdvertisingNameEnabled?: boolean;
packetReceiptNotificationParameter?: number;
retries?: number;
maxMtu?: number;
}): 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;
}
}