Skip to content

Commit 6c12c70

Browse files
committed
fix: update scan card api
1 parent f76d04e commit 6c12c70

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/index.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,11 @@ export async function getHardwares(sessionID: string): Promise<Hardware[]> {
211211
return data;
212212
}
213213

214+
export interface ScanCardCallback {
215+
onSuccess(card: Card): void;
216+
onError(e: AkilesError): void;
217+
}
218+
214219
/**
215220
* Scan a card using NFC.
216221
*
@@ -220,10 +225,7 @@ export async function getHardwares(sessionID: string): Promise<Hardware[]> {
220225
*
221226
* @returns A function that cancels the ongoing scanCard operation.
222227
*/
223-
export function scanCard(callback: {
224-
onSuccess(card: Card): void;
225-
onError(e: AkilesError): void;
226-
}) {
228+
export function scanCard(callback: ScanCardCallback) {
227229
const opId = Akiles.scanCard();
228230
const remove = listenEvents(opId, {
229231
scan_card_success: ({ card }) => {

0 commit comments

Comments
 (0)