import { Observable } from "rxjs"; import type { AppAndVersion, ConnectAppEvent, Input as ConnectAppInput, DeviceDeprecationRules } from "../connectApp"; import type { Device, Action } from "./types"; import { AppOp, SkippedAppOp } from "../../apps/types"; import type { Account, DeviceInfo, FirmwareUpdateContext } from "@ledgerhq/types-live"; import { DeviceId } from "@ledgerhq/client-ids/ids"; import type { CryptoCurrency, TokenCurrency } from "@ledgerhq/types-cryptoassets"; import { ImplementationType } from "./implementations"; export type State = { isLoading: boolean; requestQuitApp: boolean; requestOpenApp: string | null | undefined; requiresAppInstallation: { appName: string; appNames: string[]; } | null | undefined; opened: boolean; appAndVersion: AppAndVersion | null | undefined; unresponsive: boolean; allowOpeningRequestedWording: string | null | undefined; allowOpeningGranted: boolean; allowManagerRequested: boolean; allowManagerGranted: boolean; device: Device | null | undefined; deviceInfo?: DeviceInfo | null | undefined; deviceId: DeviceId | null | undefined; latestFirmware?: FirmwareUpdateContext | null | undefined; error: Error | null | undefined; derivation: { address: string; } | null | undefined; displayUpgradeWarning: boolean; installingApp?: boolean; progress?: number; listingApps?: boolean; request: AppRequest | undefined; installQueue?: string[]; currentAppOp?: AppOp; itemProgress?: number; isLocked: boolean; skippedAppOps: SkippedAppOp[]; listedApps?: boolean; deviceDeprecationRules?: DeviceDeprecationRules; }; export type AppState = State & { onRetry: () => void; passWarning: () => void; inWrongDeviceForAccount: { accountName: string; } | null | undefined; }; export type AppRequest = { appName?: string; currency?: CryptoCurrency | null; account?: Account; tokenCurrency?: TokenCurrency; dependencies?: AppRequest[]; withInlineInstallProgress?: boolean; requireLatestFirmware?: boolean; allowPartialDependencies?: boolean; }; export type AppResult = { device: Device; appAndVersion: AppAndVersion | null | undefined; appName?: string; currency?: CryptoCurrency; account?: Account; tokenCurrency?: TokenCurrency; dependencies?: AppRequest[]; withInlineInstallProgress?: boolean; requireLatestFirmware?: boolean; }; type AppAction = Action; export type Event = { type: "error"; error: Error; device?: Device | null | undefined; } | { type: "deviceChange"; device: Device | null | undefined; } | ConnectAppEvent | { type: "display-upgrade-warning"; displayUpgradeWarning: boolean; }; export declare let currentMode: keyof typeof ImplementationType; export declare function setDeviceMode(mode: keyof typeof ImplementationType): void; export declare const createAction: (connectAppExec: (arg0: ConnectAppInput) => Observable) => AppAction; export declare function dependenciesToAppRequests(dependencies?: string[]): AppRequest[]; export {}; //# sourceMappingURL=app.d.ts.map