Skip to content

Commit 90af734

Browse files
authored
docs: more jsdocs (#214)
1 parent aef7a2b commit 90af734

File tree

3 files changed

+25
-4
lines changed

3 files changed

+25
-4
lines changed

mod.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ export type $Type<TExtras extends ExtrasObject = {}> =
104104
: Omit<$BuiltInProperties<TExtras>, keyof TExtras>)
105105
& TExtras;
106106

107+
/** String literal template. */
107108
export interface $Template {
108109
(strings: TemplateStringsArray, ...exprs: any[]): CommandBuilder;
109110
}
@@ -124,6 +125,7 @@ type Which = typeof import("./src/deps.ts").which;
124125
*/
125126
type WhichSync = typeof import("./src/deps.ts").whichSync;
126127

128+
/** Collection of built-in properties that come with a `$`. */
127129
export interface $BuiltInProperties<TExtras extends ExtrasObject = {}> {
128130
/**
129131
* Makes a request to the provided URL throwing by default if the
@@ -590,6 +592,7 @@ export interface Create$Options<TExtras extends ExtrasObject> {
590592
commandBuilder?: CommandBuilder;
591593
/** Uses the state of this request builder as a starting point. */
592594
requestBuilder?: RequestBuilder;
595+
/** Extra properties to put on the `$`. */
593596
extras?: TExtras;
594597
}
595598

src/pipes.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,25 @@ import type { RequestBuilder } from "./request.ts";
55

66
const encoder = new TextEncoder();
77

8+
/** `Deno.Reader` stream. */
89
export interface Reader {
910
read(p: Uint8Array): Promise<number | null>;
1011
}
1112

12-
export interface Writer {
13-
write(p: Uint8Array): Promise<number>;
14-
}
15-
13+
/** `Deno.WriterSync` stream. */
1614
export interface WriterSync {
1715
writeSync(p: Uint8Array): number;
1816
}
1917

18+
/** `Deno.Closer` */
2019
export interface Closer {
2120
close(): void;
2221
}
2322

23+
/** Behaviour to use for stdin.
24+
* @value "inherit" - Sends the stdin of the process to the shell (default).
25+
* @value "null" - Does not pipe or redirect the pipe.
26+
*/
2427
export type ShellPipeReaderKind =
2528
| "inherit"
2629
| "null"

src/result.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,19 @@ export function getAbortedResult(): ExecuteResult {
1717

1818
/** Tells the shell it should exit immediately with the provided exit code. */
1919
export interface ExitExecuteResult {
20+
/** Discriminator. */
2021
kind: "exit";
22+
/** Exit code to use and completely exit the shell with. */
2123
code: number;
2224
}
2325

2426
/** Tells the shell to continue executing. */
2527
export interface ContinueExecuteResult {
28+
/** Discriminator. */
2629
kind: "continue";
30+
/** Exit code to use. */
2731
code: number;
32+
/** Changes to the shell that should occur (ex. unsetting env vars). */
2833
changes?: EnvChange[];
2934
}
3035

@@ -39,8 +44,11 @@ export type EnvChange = SetEnvVarChange | SetShellVarChange | UnsetVarChange | C
3944
* Used for registering custom commands.
4045
*/
4146
export interface SetEnvVarChange {
47+
/** Discriminator. */
4248
kind: "envvar";
49+
/** Name of the env var to set. */
4350
name: string;
51+
/** Value to set the env var to. */
4452
value: string;
4553
}
4654

@@ -49,8 +57,11 @@ export interface SetEnvVarChange {
4957
* Used for registering custom commands.
5058
*/
5159
export interface SetShellVarChange {
60+
/** Discriminator. */
5261
kind: "shellvar";
62+
/** Name of the shell var to set. */
5363
name: string;
64+
/** Value to set the shell var to. */
5465
value: string;
5566
}
5667

@@ -59,7 +70,9 @@ export interface SetShellVarChange {
5970
* Used for registering custom commands.
6071
*/
6172
export interface UnsetVarChange {
73+
/** Discriminator. */
6274
kind: "unsetvar";
75+
/** Nave of the env var to unset. */
6376
name: string;
6477
}
6578

@@ -68,6 +81,8 @@ export interface UnsetVarChange {
6881
* Used for registering custom commands.
6982
*/
7083
export interface CdChange {
84+
/** Discriminator. */
7185
kind: "cd";
86+
/** Relative or absolute directory to change to. */
7287
dir: string;
7388
}

0 commit comments

Comments
 (0)