import type { QrKeyringBridge, QrScanRequest, SerializedUR } from "./qr-keyring.mjs"; export type QrKeyringDeferredPromiseBridgeOptions = { /** * Callback invoked when a scan request is made. * This can be used to trigger the actual scanning process. */ onScanRequested?: (request: QrScanRequest) => void; /** * Callback invoked when a scan is successfully resolved. * This can be used to handle the result of the scan. */ onScanResolved?: (result: SerializedUR) => void; /** * Callback invoked when a scan is rejected with an error. * This can be used to handle errors that occur during the scan. */ onScanRejected?: (error: Error) => void; }; /** * A bridge that turns the scan request into a deferred promise, allowing * the consumer to control the resolution and rejection of the scan. */ export declare class QrKeyringDeferredPromiseBridge implements QrKeyringBridge { #private; constructor({ onScanRequested, onScanResolved, onScanRejected, }?: QrKeyringDeferredPromiseBridgeOptions); /** * Request a QR code scan, obtaining a CBOR and a type as response. * * @param request - The type of QR scan request. * @returns A promise that resolves with the scanned data as a serialized UR. */ requestScan(request: QrScanRequest): Promise; /** * Resolve the pending scan with the given result. * * @param result - The scanned data as a serialized UR. */ resolvePendingScan(result: SerializedUR): void; /** * Reject the pending scan with the given error. * * @param error - The error to reject the scan with. */ rejectPendingScan(error: Error): void; } //# sourceMappingURL=qr-keyring-deferred-promise-bridge.d.mts.map