import type { MessageFactoryFn } from './utils'; import type { HardwareUiInteractionMeta } from './ui-request'; import type { PROTO } from '../constants'; import type { KnownDevice as Device, DeviceStateEvent, Features, SupportFeatures } from '../types/device'; export declare const DEVICE_EVENT = "DEVICE_EVENT"; export declare const DEVICE: { readonly CONNECT: "device-connect"; readonly CONNECT_UNACQUIRED: "device-connect_unacquired"; readonly DISCONNECT: "device-disconnect"; readonly CHANGED: "device-changed"; readonly ACQUIRE: "device-acquire"; readonly RELEASE: "device-release"; readonly ACQUIRED: "device-acquired"; readonly RELEASED: "device-released"; readonly USED_ELSEWHERE: "device-used_elsewhere"; readonly UNREADABLE: "unreadable-device"; readonly LOADING: "device-loading"; readonly BUTTON: "button"; readonly PIN: "pin"; readonly PIN_ON_DEVICE: "pin_on_device"; readonly PIN_ON_DEVICE_COMPLETE: "pin_on_device_complete"; readonly PASSPHRASE: "passphrase"; readonly PASSPHRASE_ON_DEVICE: "passphrase_on_device"; readonly ATTACH_PIN_ON_DEVICE: "attach_pin_on_device"; readonly WORD: "word"; readonly SUPPORT_FEATURES: "support_features"; readonly SELECT_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE: "select_device_in_bootloader_for_web_device"; readonly SELECT_DEVICE_FOR_SWITCH_FIRMWARE_WEB_DEVICE: "select_device_for_switch_firmware_web_device"; readonly FEATURES: "features"; readonly STATE: "state"; }; export interface DeviceConnnectRequest { type: typeof DEVICE.CONNECT; payload: { device: Device; }; } export interface DeviceDisconnnectRequest { type: typeof DEVICE.DISCONNECT; payload: { device: Device; }; } export interface DeviceButtonRequestPayload extends Omit { code?: PROTO.ButtonRequest['code'] | 'ButtonRequest_FirmwareUpdate'; } export type PassphraseRequestPayload = { existsAttachPinUser?: boolean; deviceOnly?: boolean; source?: 'wallet-session-coordinator'; reason?: 'open-wallet' | 'session-recovery'; expectedPassphraseState?: string; interaction?: HardwareUiInteractionMeta; }; export interface DeviceButtonRequest { type: typeof DEVICE.BUTTON; payload: DeviceButtonRequestPayload & { device: Device | null; }; } export type DeviceFeaturesPayload = Features; export interface DeviceSendFeatures { type: typeof DEVICE.FEATURES; payload: DeviceFeaturesPayload; } export interface DeviceSendState { type: typeof DEVICE.STATE; payload: DeviceStateEvent; } export type DeviceSupportFeaturesPayload = SupportFeatures & { device: Device | null; }; export interface DeviceSendSupportFeatures { type: typeof DEVICE.SUPPORT_FEATURES; payload: DeviceSupportFeaturesPayload; } export type DeviceEvent = DeviceButtonRequest | DeviceSendState | DeviceSendFeatures | DeviceSendSupportFeatures | DeviceDisconnnectRequest | DeviceConnnectRequest; export type DeviceEventMessage = DeviceEvent & { event: typeof DEVICE_EVENT; }; export type DeviceEventListenerFn = (type: typeof DEVICE_EVENT, cb: (event: DeviceEventMessage) => void) => void; export declare const createDeviceMessage: MessageFactoryFn; //# sourceMappingURL=device.d.ts.map