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