-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtypes.ts
More file actions
45 lines (39 loc) · 946 Bytes
/
types.ts
File metadata and controls
45 lines (39 loc) · 946 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/**
* Copyright (c) Crew Dev.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
export type Method = "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
export type Protocol = "HTTP" | "HTTPS";
interface RunCommand {
command: "run";
body: string;
}
export type Command = RunCommand;
export interface Flag {
flags: {
help?: true;
version?: true;
};
}
export interface OutputResponse {
ok: boolean;
protocol: Protocol;
status: number;
headers: Record<string, string>;
body?: Record<string, unknown> | string;
}
export interface RequestArgs {
method: Method;
url: string;
flags?: {
form: true;
};
body?: string | FormData | Record<string, unknown>;
headers?: Record<string, string>;
}
export type ArgsType =
| { data: Flag; type: "flag" }
| { data: Command; type: "command" }
| { data: RequestArgs; type: "request" };