(impl: Omit<Terminal, typeof TypeId>): TerminalCreates a Terminal service implementation.
When to use
Use to construct a custom Terminal service implementation from concrete
terminal capabilities when writing a platform adapter, test implementation,
or custom runtime service.
Details
The implementation object supplies columns, rows, readInput,
readLine, and display; make attaches the Terminal service marker so
the result can be provided through the Terminal context service.
export const const make: (
impl: Omit<Terminal, typeof TypeId>
) => Terminal
Creates a Terminal service implementation.
When to use
Use to construct a custom Terminal service implementation from concrete
terminal capabilities when writing a platform adapter, test implementation,
or custom runtime service.
Details
The implementation object supplies columns, rows, readInput,
readLine, and display; make attaches the Terminal service marker so
the result can be provided through the Terminal context service.
make = (
impl: Omit<Terminal, typeof TypeId>impl: type Omit<T, K extends keyof any> = {
[P in Exclude<keyof T, K>]: T[P]
}
Construct a type with the properties of T except for those in type K.
Omit<Terminal, typeof const TypeId: "~effect/platform/Terminal"TypeId>
): Terminal => const Terminal: Context.Service<
Terminal,
Terminal
>
const Terminal: {
key: string;
Service: {
columns: Effect.Effect<number>;
rows: Effect.Effect<number>;
readInput: Effect.Effect<Queue.Dequeue<UserInput, Cause.Done>, never, Scope.Scope>;
readLine: Effect.Effect<string, QuitError>;
display: (text: string) => Effect.Effect<void, PlatformError>;
};
of: (this: void, self: Terminal) => Terminal;
context: (self: Terminal) => Context.Context<Terminal>;
use: (f: (service: Terminal) => Effect.Effect<A, E, R>) => Effect.Effect<A, E, Terminal | R>;
useSync: (f: (service: Terminal) => A) => Effect.Effect<A, never, Terminal>;
Identifier: Identifier;
stack: string | undefined;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
A Terminal represents a command-line interface which can read input from a
user and display messages to a user.
Service tag for command-line input and output services.
When to use
Use to access or provide platform terminal capabilities such as reading
input, writing output, and inspecting terminal dimensions.
Terminal.of({ ...impl: Omit<Terminal, typeof TypeId>impl, [const TypeId: "~effect/platform/Terminal"TypeId]: const TypeId: "~effect/platform/Terminal"TypeId })