-
Notifications
You must be signed in to change notification settings - Fork 2
/
createTransportRecorder.d.ts
30 lines (24 loc) · 1.15 KB
/
createTransportRecorder.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
declare module '@ledgerhq/hw-transport-mocker/createTransportRecorder' {
import Transport from '@ledgerhq/hw-transport';
import { RecordStore } from '@ledgerhq/hw-transport-mocker/RecordStore';
class TransportRecorder<Descriptor> extends Transport<Descriptor> {
static recordStore: RecordStore;
static isSupported: typeof Transport.isSupported;
static list: typeof Transport.list;
}
type TransportConstructor<Descriptor, Args extends []> = new (...args: Args) => Transport<Descriptor>;
type TransportRecorderConstructor<Descriptor> = typeof TransportRecorder &
(new (...args: unknown[]) => TransportRecorder<Descriptor>);
/**
* Create a decorated transport, which records any APDU exchanges.
*
* @param {TransportConstructor<Descriptor>} DecoratedTransport The transport class to decorate.
* @param {RecordStore} recordStore The RecordStore to record to.
* @return {TransportRecorder<Descriptor>} The decorated transport.
* @template Descriptor
*/
export default function <Descriptor>(
DecoratedTransport: TransportConstructor<Descriptor>,
recordStore: RecordStore
): TransportRecorderConstructor<Descriptor>;
}