@ledgerhq/device-transport-kit-web-hid 0.0.0-rn-hid-improvements-explorations-20250523153215 → 0.0.0-rn-ble-pairing-removed-while-reconnecting-20250731150808
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/esm/api/transport/WebHidApduSender.js +2 -0
- package/lib/esm/api/transport/WebHidApduSender.js.map +7 -0
- package/lib/esm/api/transport/WebHidApduSender.test.js +2 -0
- package/lib/esm/api/transport/WebHidApduSender.test.js.map +7 -0
- package/lib/esm/api/transport/WebHidTransport.js +1 -1
- package/lib/esm/api/transport/WebHidTransport.js.map +3 -3
- package/lib/esm/api/transport/WebHidTransport.test.js +1 -1
- package/lib/esm/api/transport/WebHidTransport.test.js.map +3 -3
- package/lib/types/api/transport/WebHidApduSender.d.ts +25 -0
- package/lib/types/api/transport/WebHidApduSender.d.ts.map +1 -0
- package/lib/types/api/transport/WebHidApduSender.test.d.ts +2 -0
- package/lib/types/api/transport/WebHidApduSender.test.d.ts.map +1 -0
- package/lib/types/api/transport/WebHidTransport.d.ts +7 -4
- package/lib/types/api/transport/WebHidTransport.d.ts.map +1 -1
- package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/lib/esm/api/transport/WebHidDeviceConnection.js +0 -2
- package/lib/esm/api/transport/WebHidDeviceConnection.js.map +0 -7
- package/lib/esm/api/transport/WebHidDeviceConnection.stub.js +0 -2
- package/lib/esm/api/transport/WebHidDeviceConnection.stub.js.map +0 -7
- package/lib/esm/api/transport/WebHidDeviceConnection.test.js +0 -2
- package/lib/esm/api/transport/WebHidDeviceConnection.test.js.map +0 -7
- package/lib/types/api/transport/WebHidDeviceConnection.d.ts +0 -49
- package/lib/types/api/transport/WebHidDeviceConnection.d.ts.map +0 -1
- package/lib/types/api/transport/WebHidDeviceConnection.stub.d.ts +0 -5
- package/lib/types/api/transport/WebHidDeviceConnection.stub.d.ts.map +0 -1
- package/lib/types/api/transport/WebHidDeviceConnection.test.d.ts +0 -2
- package/lib/types/api/transport/WebHidDeviceConnection.test.d.ts.map +0 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type ApduReceiverServiceFactory, type ApduResponse, type ApduSenderServiceFactory, type DeviceApduSender, type DmkError, type LoggerPublisherService } from "@ledgerhq/device-management-kit";
|
|
2
|
+
import { type Either } from "purify-ts";
|
|
3
|
+
export type WebHidApduSenderConstructorArgs = {
|
|
4
|
+
dependencies: WebHidApduSenderDependencies;
|
|
5
|
+
apduSenderFactory: ApduSenderServiceFactory;
|
|
6
|
+
apduReceiverFactory: ApduReceiverServiceFactory;
|
|
7
|
+
};
|
|
8
|
+
export type WebHidApduSenderDependencies = {
|
|
9
|
+
device: HIDDevice;
|
|
10
|
+
};
|
|
11
|
+
export declare class WebHidApduSender implements DeviceApduSender<WebHidApduSenderDependencies> {
|
|
12
|
+
private dependencies;
|
|
13
|
+
private readonly apduSender;
|
|
14
|
+
private readonly apduReceiver;
|
|
15
|
+
private sendApduPromiseResolver;
|
|
16
|
+
private readonly logger;
|
|
17
|
+
constructor({ dependencies, apduSenderFactory, apduReceiverFactory, }: WebHidApduSenderConstructorArgs, loggerServiceFactory: (tag: string) => LoggerPublisherService);
|
|
18
|
+
sendApdu(apdu: Uint8Array, _triggersDisconnection?: boolean, abortTimeout?: number): Promise<Either<DmkError, ApduResponse>>;
|
|
19
|
+
private receiveHidInputReport;
|
|
20
|
+
getDependencies(): WebHidApduSenderDependencies;
|
|
21
|
+
setDependencies(dependencies: WebHidApduSenderDependencies): void;
|
|
22
|
+
setupConnection(): Promise<void>;
|
|
23
|
+
closeConnection(): void;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=WebHidApduSender.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebHidApduSender.d.ts","sourceRoot":"","sources":["../../../../src/api/transport/WebHidApduSender.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,0BAA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@
|
|
|
1
|
-
import { type ApduReceiverServiceFactory, type ApduSenderServiceFactory, type ConnectError, type DeviceId, type DeviceModelDataSource, type DisconnectHandler, type DmkError, type LoggerPublisherService, type Transport, TransportConnectedDevice, type TransportDiscoveredDevice, type TransportFactory, type TransportIdentifier } from "@ledgerhq/device-management-kit";
|
|
1
|
+
import { type ApduReceiverServiceFactory, type ApduSenderServiceFactory, type ConnectError, DeviceConnectionStateMachine, type DeviceConnectionStateMachineParams, type DeviceId, type DeviceModelDataSource, type DisconnectHandler, type DmkError, type LoggerPublisherService, type Transport, TransportConnectedDevice, type TransportDiscoveredDevice, type TransportFactory, type TransportIdentifier } from "@ledgerhq/device-management-kit";
|
|
2
2
|
import { type Either } from "purify-ts";
|
|
3
3
|
import { type Observable } from "rxjs";
|
|
4
|
+
import { WebHidApduSender, type WebHidApduSenderConstructorArgs, type WebHidApduSenderDependencies } from "./WebHidApduSender";
|
|
4
5
|
export declare const webHidIdentifier: TransportIdentifier;
|
|
5
6
|
export declare class WebHidTransport implements Transport {
|
|
6
7
|
private readonly _deviceModelDataSource;
|
|
7
8
|
private readonly _loggerServiceFactory;
|
|
8
9
|
private readonly _apduSenderFactory;
|
|
9
10
|
private readonly _apduReceiverFactory;
|
|
11
|
+
private readonly _deviceConnectionStateMachineFactory;
|
|
12
|
+
private readonly _deviceApduSenderFactory;
|
|
10
13
|
/** List of HID devices that have been discovered */
|
|
11
14
|
private _transportDiscoveredDevices;
|
|
12
|
-
/** Map of *connected* HIDDevice to their
|
|
15
|
+
/** Map of *connected* HIDDevice to their device connection */
|
|
13
16
|
private _deviceConnectionsByHidDevice;
|
|
14
17
|
/**
|
|
15
|
-
* Set of
|
|
18
|
+
* Set of device connections for which the HIDDevice has been
|
|
16
19
|
* disconnected, so they are waiting for a reconnection
|
|
17
20
|
*/
|
|
18
21
|
private _deviceConnectionsPendingReconnection;
|
|
@@ -21,7 +24,7 @@ export declare class WebHidTransport implements Transport {
|
|
|
21
24
|
private _logger;
|
|
22
25
|
private readonly connectionType;
|
|
23
26
|
private readonly identifier;
|
|
24
|
-
constructor(_deviceModelDataSource: DeviceModelDataSource, _loggerServiceFactory: (tag: string) => LoggerPublisherService, _apduSenderFactory: ApduSenderServiceFactory, _apduReceiverFactory: ApduReceiverServiceFactory);
|
|
27
|
+
constructor(_deviceModelDataSource: DeviceModelDataSource, _loggerServiceFactory: (tag: string) => LoggerPublisherService, _apduSenderFactory: ApduSenderServiceFactory, _apduReceiverFactory: ApduReceiverServiceFactory, _deviceConnectionStateMachineFactory?: (args: DeviceConnectionStateMachineParams<WebHidApduSenderDependencies>) => DeviceConnectionStateMachine<WebHidApduSenderDependencies>, _deviceApduSenderFactory?: (args: WebHidApduSenderConstructorArgs, loggerFactory: (tag: string) => LoggerPublisherService) => WebHidApduSender);
|
|
25
28
|
/**
|
|
26
29
|
* Get the WebHID API if supported or error
|
|
27
30
|
* @returns `Either<WebHidTransportNotSupportedError, HID>`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebHidTransport.d.ts","sourceRoot":"","sources":["../../../../src/api/transport/WebHidTransport.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,EAC7B,KAAK,YAAY,EAEjB,KAAK,QAAQ,EACb,KAAK,qBAAqB,EAE1B,KAAK,iBAAiB,EACtB,KAAK,QAAQ,
|
|
1
|
+
{"version":3,"file":"WebHidTransport.d.ts","sourceRoot":"","sources":["../../../../src/api/transport/WebHidTransport.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,EAC7B,KAAK,YAAY,EAEjB,4BAA4B,EAC5B,KAAK,kCAAkC,EACvC,KAAK,QAAQ,EACb,KAAK,qBAAqB,EAE1B,KAAK,iBAAiB,EACtB,KAAK,QAAQ,EAEb,KAAK,sBAAsB,EAG3B,KAAK,SAAS,EACd,wBAAwB,EAExB,KAAK,yBAAyB,EAC9B,KAAK,gBA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