@trezor/connect
Version:
High-level javascript interface for Trezor hardware wallet.
14 lines • 1 kB
TypeScript
import type { BlockchainEvent, BlockchainEventListenerFn } from '../../events/blockchain';
import type { DeviceEvent, DeviceEventListenerFn } from '../../events/device';
import type { TransportEvent, TransportEventListenerFn } from '../../events/transport';
import type { ProgressEventListenerFn, UiEvent, UiEventListenerFn } from '../../events/ui-request';
import type { UnionToIntersection } from '../utils';
type DetailedEvent<Event> = Event extends {
type: string;
} ? Event extends {
payload: any;
} ? (type: Event['type'], cb: (event: Event['payload']) => any) => void : (type: Event['type'], cb: () => any) => void : never;
type EventsUnion = BlockchainEventListenerFn | DetailedEvent<BlockchainEvent> | DeviceEventListenerFn | DetailedEvent<DeviceEvent> | TransportEventListenerFn | DetailedEvent<TransportEvent> | UiEventListenerFn | DetailedEvent<UiEvent> | ProgressEventListenerFn;
export declare const on: UnionToIntersection<EventsUnion>;
export {};
//# sourceMappingURL=on.d.ts.map