@@ -9,7 +9,8 @@ import { messageSystemActions } from '@suite-common/message-system';
9
9
import type { Route } from '@suite-common/suite-types' ;
10
10
import { notificationsActions } from '@suite-common/toast-notifications' ;
11
11
import { deviceActions , discoveryActions , transactionsActions } from '@suite-common/wallet-core' ;
12
- import type { BlockchainEvent , TransportEvent , UiEvent } from '@trezor/connect' ;
12
+ import { BlockchainEvent , DEVICE , DeviceEvent , TransportEvent , UiEvent } from '@trezor/connect' ;
13
+ import { FilterOutFromUnionByTypeProperty } from '@trezor/type-utils' ;
13
14
14
15
import type { BackupAction } from 'src/actions/backup/backupActions' ;
15
16
import type { OnboardingAction } from 'src/actions/onboarding/onboardingActions' ;
@@ -41,7 +42,14 @@ export type {
41
42
TrezorDevice ,
42
43
} from '@suite-common/suite-types' ;
43
44
44
- type TrezorConnectEvents = TransportEvent | UiEvent | BlockchainEvent ;
45
+ type FilteredDeviceEvents = FilterOutFromUnionByTypeProperty <
46
+ DeviceEvent ,
47
+ // Those types are remapped onto different actions in the connectInitThunks.ts and not used directly
48
+ // as the rest of the DeviceEvents.
49
+ typeof DEVICE . CONNECT | typeof DEVICE . CONNECT_UNACQUIRED
50
+ > ;
51
+
52
+ type TrezorConnectEvents = TransportEvent | UiEvent | FilteredDeviceEvents | BlockchainEvent ;
45
53
46
54
export type TransactionAction = ReturnType <
47
55
( typeof transactionsActions ) [ keyof typeof transactionsActions ]
@@ -62,7 +70,7 @@ type DeviceAuthenticityAction = ReturnType<
62
70
63
71
// all actions from all apps used to properly type Dispatch.
64
72
export type Action =
65
- | TrezorConnectEvents // Todo: This should not be here, actions shall be defined independently from Connect Events (and they shall be mapped onto them)
73
+ | TrezorConnectEvents
66
74
| RouterAction
67
75
| WindowAction
68
76
| StorageAction
@@ -113,6 +121,7 @@ export type ForegroundAppProps = {
113
121
export type ToastNotificationVariant = 'success' | 'info' | 'warning' | 'error' | 'transparent' ;
114
122
115
123
export { TorStatus } from '@trezor/suite-desktop-api/src/enums' ;
124
+
116
125
export interface TorBootstrap {
117
126
current : number ;
118
127
total : number ;
0 commit comments