/** * @since 1.0.0 */ import type { Tag } from "effect/Context"; import type { Effect } from "effect/Effect"; import type { ReadonlyMailbox } from "effect/Mailbox"; import type { Option } from "effect/Option"; import type * as Scope from "effect/Scope"; import type { PlatformError } from "./Error.js"; /** * A `Terminal` represents a command-line interface which can read input from a * user and display messages to a user. * * @since 1.0.0 * @category models */ export interface Terminal { /** * The number of columns available on the platform's terminal interface. */ readonly columns: Effect; /** * The number of rows available on the platform's terminal interface. */ readonly rows: Effect; /** * Determines if the current terminal interface is interactive. */ readonly isTTY: Effect; /** * Reads input events from the default standard input. */ readonly readInput: Effect, never, Scope.Scope>; /** * Reads a single line from the default standard input. */ readonly readLine: Effect; /** * Displays text to the the default standard output. */ readonly display: (text: string) => Effect; } /** * @since 1.0.0 * @category model */ export interface Key { /** * The name of the key being pressed. */ readonly name: string; /** * If set to `true`, then the user is also holding down the `Ctrl` key. */ readonly ctrl: boolean; /** * If set to `true`, then the user is also holding down the `Meta` key. */ readonly meta: boolean; /** * If set to `true`, then the user is also holding down the `Shift` key. */ readonly shift: boolean; } /** * @since 1.0.0 * @category model */ export interface UserInput { /** * The character read from the user (if any). */ readonly input: Option; /** * The key that the user pressed. */ readonly key: Key; } declare const QuitException_base: new = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & { readonly _tag: "QuitException"; } & Readonly; /** * A `QuitException` represents an exception that occurs when a user attempts to * quit out of a `Terminal` prompt for input (usually by entering `ctrl`+`c`). * * @since 1.0.0 * @category model */ export declare class QuitException extends QuitException_base<{}> { } /** * @since 1.0.0 * @category refinements */ export declare const isQuitException: (u: unknown) => u is QuitException; /** * @since 1.0.0 * @category tag */ export declare const Terminal: Tag; export {}; //# sourceMappingURL=Terminal.d.ts.map