UNPKG

@ledgerhq/live-common

Version:
29 lines 1.02 kB
import { SharedTaskEvent } from "../tasks/core"; export type SharedActionState = { lockedDevice: boolean; error: { type: "SharedError"; message: string; name: string; /** * Informs if the action and its associated task in error is attempting to retry */ retrying: boolean; } | null; }; export type FullActionState<SpecificActionState extends { error: unknown; }> = Omit<SpecificActionState, "error"> & Omit<SharedActionState, "error"> & { error: SpecificActionState["error"] | SharedActionState["error"] | null; }; /** * Handles SharedTaskEvent that are not handled by specific action * * @param event The event not handled by the specific action * @returns An updated partial SharedActionState, the shared state of the state */ export declare function sharedReducer({ event }: { event: SharedTaskEvent; }): Partial<SharedActionState>; export declare const initialSharedActionState: SharedActionState; //# sourceMappingURL=core.d.ts.map