@ledgerhq/live-common
Version:
Common ground for the Ledger Live apps
23 lines • 1.33 kB
TypeScript
import { Observable } from "rxjs";
import Transport from "@ledgerhq/hw-transport";
import { OpenOptions } from ".";
export declare const setErrorRemapping: (f: (arg0: Error) => Observable<never>) => void;
export declare const cancelDeviceAction: (transport: Transport) => void;
/**
* Provides a Transport instance to a given job
*
* @param deviceId
* @param options contains optional configuration
* - openTimeoutMs: optional timeout that limits in time the open attempt of the matching registered transport.
* - matchDeviceByName: optional name of the device to match.
*/
export declare const withDevice: (deviceId: string, options?: OpenOptions) => <T>(job: (t: Transport) => Observable<T>) => Observable<T>;
/**
* Provides a Transport instance to the given function fn
* @see withDevice
*/
export declare const withDevicePromise: <T>(deviceId: string, fn: (Transport: any) => Promise<T>) => Promise<T>;
export declare const genericCanRetryOnError: (err: unknown) => boolean;
export declare const retryWhileErrors: (acceptError: (arg0: Error) => boolean) => (attempts: Observable<any>) => Observable<any>;
export declare const withDevicePolling: (deviceId: string) => <T>(job: (arg0: Transport) => Observable<T>, acceptError?: (arg0: Error) => boolean) => Observable<T>;
//# sourceMappingURL=deviceAccess.d.ts.map