declare module 'trezor-connect' { type Path = number[] | string; interface ErrorResponse { success: false; payload: { error: string; }; } type SuccessResponse = { success: true; payload: T; }; type Response = ErrorResponse | SuccessResponse; interface OptionalCommonParams { device?: { path: string; state?: string; instance?: number; }; useEmptyPassphrase?: boolean; keepSession?: boolean; } namespace TrezorConnect { // ethereumGetAddress (single & bundle overloads) interface EthereumGetAddressParams { path: Path; showOnTrezor: boolean; } interface EthereumGetAddressPayload { address: string; path: number[]; serializedPath: string; } type EthereumGetAddressResponse = Response; export function ethereumGetAddress( params: EthereumGetAddressParams, ): Promise; interface EthereumGetAddressBundleParams { bundle: EthereumGetAddressParams[]; } type EthereumGetAddressBundleResponse = Response; export function ethereumGetAddress( params: EthereumGetAddressBundleParams, ): Promise; // getPublicKey (single & bundle overloads) interface GetPublicKeyParams { path: string; coin?: string; } interface GetPublicKeyPayload { path: Array; serializedPath: string; xpub: string; xpubSegwit?: string; chainCode: string; childNum: number; publicKey: string; fingerprint: number; depth: number; } type GetPublicKeyResponse = Response; export function getPublicKey( params: GetPublicKeyParams, ): Promise; interface GetPublicKeyBundleParams { bundle: GetPublicKeyParams[]; } type GetPublicKeyBundleResponse = Response; export function getPublicKey( params: GetPublicKeyBundleParams, ): Promise; } export default TrezorConnect; }