/* @flow */ // does not have session export type TrezorDeviceInfo = { path: string; } export type TrezorDeviceInfoWithSession = TrezorDeviceInfo & { session: ?string; } export type AcquireInput = { path: string; previous: ?string; checkPrevious: boolean; } export type MessageFromTrezor = {type: string, message: Object}; export type Transport = { enumerate(): Promise>; listen(old: ?Array): Promise>; acquire(input: AcquireInput): Promise; release(session: string, onclose: boolean): Promise; configure(signedData: string): Promise; call(session: string, name: string, data: Object): Promise; // resolves when the transport can be used; rejects when it cannot init(debug: ?boolean): Promise; stop(): void; configured: boolean; version: string; name: string; // webusb has a different model, where you have to // request device connection +requestDevice: () => Promise; requestNeeded: boolean; isOutdated: boolean; setBridgeLatestUrl(url: string): void; }