-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathindex.d.ts
44 lines (37 loc) · 1.75 KB
/
index.d.ts
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
export default function piston(): PistonClient
export interface PistonClient {
runtimes(): Promise<Result | Runtime[]>;
execute(language: language, code: string, options?: ExecutionOptions): Promise<Result | ExecutionResult>;
}
export interface ExecutionResult {
language: language;
version: string;
run: {
stdout: string;
stderr: string;
code: number;
signal: any;
output: string
}
}
export interface ExecutionOptions {
language: language;
version: string;
files: {
name: string;
content: string;
}[]
stdin: string;
args: string[];
compile_timeout: number;
run_timeout: number;
compile_memory_limit: number;
run_memory_limit: number;
}
export interface Runtime {
language: language;
version: string;
aliases: string[]
}
export type Result = any | { error: any, success: boolean } | undefined;
export type language = "awk" | "bash" | "befunge93" | "brachylog" | "brainfuck" | "bqn" | "c" | "c++" | "cjam" | "clojure" | "cobol" | "coffeescript" | "cow" | "crystal" | "csharp" | "csharp.net" | "d" | "dart" | "dash" | "dragon" | "elixir" | "emacs" | "emojicode" | "erlang" | "file" | "forte" | "forth" | "fortran" | "freebasic" | "fsharp.net" | "fsi" | "go" | "golfscript" | "groovy" | "haskell" | "husk" | "iverilog" | "japt" | "java" | "javascript" | "jelly" | "julia" | "kotlin" | "lisp" | "llvm_ir" | "lolcode" | "lua" | "matl" | "nasm" | "nasm64" | "nim" | "ocaml" | "octave" | "osabie" | "paradoc" | "pascal" | "perl" | "php" | "ponylang" | "powershell" | "prolog" | "pure" | "pyth" | "python" | "python2" | "racket" | "raku" | "retina" | "rockstar" | "rscript" | "ruby" | "rust" | "samarium" | "scala" | "smalltalk" | "sqlite3" | "swift" | "typescript" | "basic" | "basic.net" | "vlang" | "vyxal" | "yeethon" | "zig";