This repository has been archived by the owner on Jul 16, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
62cbddb
commit 5c4165c
Showing
13 changed files
with
327 additions
and
17 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
--- | ||
title: Terminal.ts | ||
nav_order: 18 | ||
parent: "@effect/platform-bun" | ||
--- | ||
|
||
## Terminal overview | ||
|
||
Added in v1.0.0 | ||
|
||
--- | ||
|
||
<h2 class="text-delta">Table of contents</h2> | ||
|
||
- [constructors](#constructors) | ||
- [make](#make) | ||
- [layer](#layer) | ||
- [layer](#layer-1) | ||
- [model](#model) | ||
- [Key](#key) | ||
- [UserInput](#userinput) | ||
- [tag](#tag) | ||
- [Terminal](#terminal) | ||
|
||
--- | ||
|
||
# constructors | ||
|
||
## make | ||
|
||
**Signature** | ||
|
||
```ts | ||
export declare const make: (shouldQuit?: ((input: UserInput) => boolean) | undefined) => Effect<Scope, never, Terminal> | ||
``` | ||
Added in v1.0.0 | ||
# layer | ||
## layer | ||
**Signature** | ||
```ts | ||
export declare const layer: Layer<never, never, Terminal> | ||
``` | ||
Added in v1.0.0 | ||
# model | ||
## Key | ||
**Signature** | ||
```ts | ||
export declare const Key: Key | ||
``` | ||
Added in v1.0.0 | ||
## UserInput | ||
**Signature** | ||
```ts | ||
export declare const UserInput: UserInput | ||
``` | ||
Added in v1.0.0 | ||
# tag | ||
## Terminal | ||
**Signature** | ||
```ts | ||
export declare const Terminal: Tag<Terminal, Terminal> | ||
``` | ||
Added in v1.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
--- | ||
title: Terminal.ts | ||
nav_order: 21 | ||
parent: "@effect/platform-node" | ||
--- | ||
|
||
## Terminal overview | ||
|
||
Added in v1.0.0 | ||
|
||
--- | ||
|
||
<h2 class="text-delta">Table of contents</h2> | ||
|
||
- [constructors](#constructors) | ||
- [make](#make) | ||
- [layer](#layer) | ||
- [layer](#layer-1) | ||
- [model](#model) | ||
- [Key](#key) | ||
- [UserInput](#userinput) | ||
- [tag](#tag) | ||
- [Terminal](#terminal) | ||
|
||
--- | ||
|
||
# constructors | ||
|
||
## make | ||
|
||
**Signature** | ||
|
||
```ts | ||
export declare const make: (shouldQuit?: ((input: UserInput) => boolean) | undefined) => Effect<Scope, never, Terminal> | ||
``` | ||
Added in v1.0.0 | ||
# layer | ||
## layer | ||
**Signature** | ||
```ts | ||
export declare const layer: Layer<never, never, Terminal> | ||
``` | ||
Added in v1.0.0 | ||
# model | ||
## Key | ||
**Signature** | ||
```ts | ||
export declare const Key: Key | ||
``` | ||
Added in v1.0.0 | ||
## UserInput | ||
**Signature** | ||
```ts | ||
export declare const UserInput: UserInput | ||
``` | ||
Added in v1.0.0 | ||
# tag | ||
## Terminal | ||
**Signature** | ||
```ts | ||
export declare const Terminal: Tag<Terminal, Terminal> | ||
``` | ||
Added in v1.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
--- | ||
title: Terminal.ts | ||
nav_order: 31 | ||
parent: "@effect/platform" | ||
--- | ||
|
||
## Terminal overview | ||
|
||
Added in v1.0.0 | ||
|
||
--- | ||
|
||
<h2 class="text-delta">Table of contents</h2> | ||
|
||
- [model](#model) | ||
- [Key (interface)](#key-interface) | ||
- [QuitException (class)](#quitexception-class) | ||
- [UserInput (interface)](#userinput-interface) | ||
- [models](#models) | ||
- [Terminal (interface)](#terminal-interface) | ||
- [tag](#tag) | ||
- [Terminal](#terminal) | ||
|
||
--- | ||
|
||
# model | ||
|
||
## Key (interface) | ||
|
||
**Signature** | ||
|
||
```ts | ||
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 | ||
} | ||
``` | ||
|
||
Added in v1.0.0 | ||
|
||
## QuitException (class) | ||
|
||
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`). | ||
|
||
**Signature** | ||
|
||
```ts | ||
export declare class QuitException | ||
``` | ||
|
||
Added in v1.0.0 | ||
|
||
## UserInput (interface) | ||
|
||
**Signature** | ||
|
||
```ts | ||
export interface UserInput { | ||
/** | ||
* The character read from the user (if any). | ||
*/ | ||
readonly input: Option<string> | ||
/** | ||
* The key that the user pressed. | ||
*/ | ||
readonly key: Key | ||
} | ||
``` | ||
|
||
Added in v1.0.0 | ||
|
||
# models | ||
|
||
## Terminal (interface) | ||
|
||
A `Terminal` represents a command-line interface which can read input from a | ||
user and display messages to a user. | ||
|
||
**Signature** | ||
|
||
```ts | ||
export interface Terminal { | ||
/** | ||
* Reads a single input event from the default standard input. | ||
*/ | ||
readonly readInput: Effect<never, QuitException, UserInput> | ||
/** | ||
* Displays text to the the default standard output. | ||
*/ | ||
readonly display: (text: string) => Effect<never, PlatformError, void> | ||
} | ||
``` | ||
|
||
Added in v1.0.0 | ||
|
||
# tag | ||
|
||
## Terminal | ||
|
||
**Signature** | ||
|
||
```ts | ||
export declare const Terminal: Tag<Terminal, Terminal> | ||
``` | ||
Added in v1.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.