import type { KeyEvent } from "@opentui/core"; import { Data, Effect, Option } from "effect"; import { DashboardAction, type DashboardState } from "./dashboard.ts"; /** * The result of handling a key event. Carries one of: a state-machine action * for the reducer to apply, or a side-effecting command (Run, RefreshSnapshot, * Quit) that the app loop must orchestrate. */ export type KeyAction = Data.TaggedEnum<{ Dispatch: { readonly action: DashboardAction; }; Run: {}; RefreshSnapshot: {}; Quit: {}; }>; export declare const KeyAction: { readonly Dispatch: Data.TaggedEnum.ConstructorFrom<{ readonly _tag: "Dispatch"; readonly action: DashboardAction; }, "_tag">; readonly Run: Data.TaggedEnum.ConstructorFrom<{ readonly _tag: "Run"; }, "_tag">; readonly RefreshSnapshot: Data.TaggedEnum.ConstructorFrom<{ readonly _tag: "RefreshSnapshot"; }, "_tag">; readonly Quit: Data.TaggedEnum.ConstructorFrom<{ readonly _tag: "Quit"; }, "_tag">; readonly $is: (tag: Tag) => (u: unknown) => u is Extract<{ readonly _tag: "Dispatch"; readonly action: DashboardAction; }, { readonly _tag: Tag; }> | Extract<{ readonly _tag: "Run"; }, { readonly _tag: Tag; }> | Extract<{ readonly _tag: "RefreshSnapshot"; }, { readonly _tag: Tag; }> | Extract<{ readonly _tag: "Quit"; }, { readonly _tag: Tag; }>; readonly $match: { any; readonly Run: (args: { readonly _tag: "Run"; }) => any; readonly RefreshSnapshot: (args: { readonly _tag: "RefreshSnapshot"; }) => any; readonly Quit: (args: { readonly _tag: "Quit"; }) => any; }>(cases: Cases): (value: { readonly _tag: "Dispatch"; readonly action: DashboardAction; } | { readonly _tag: "Run"; } | { readonly _tag: "RefreshSnapshot"; } | { readonly _tag: "Quit"; }) => import("effect/Unify").Unify>; any; readonly Run: (args: { readonly _tag: "Run"; }) => any; readonly RefreshSnapshot: (args: { readonly _tag: "RefreshSnapshot"; }) => any; readonly Quit: (args: { readonly _tag: "Quit"; }) => any; }>(value: { readonly _tag: "Dispatch"; readonly action: DashboardAction; } | { readonly _tag: "Run"; } | { readonly _tag: "RefreshSnapshot"; } | { readonly _tag: "Quit"; }, cases: Cases): import("effect/Unify").Unify>; }; }; export declare const handleDashboardKey: (key: KeyEvent, state: DashboardState) => Effect.Effect>; //# sourceMappingURL=keyboard.d.ts.map