mirror of
https://github.com/engineer-man/piston.git
synced 2025-04-24 05:56:26 +02:00
Adding types
This commit is contained in:
parent
c2796388a8
commit
f897b32b7b
7 changed files with 94 additions and 1 deletions
4
.idea/misc.xml
generated
4
.idea/misc.xml
generated
|
@ -1,4 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" project-jdk-name="corretto-17" project-jdk-type="JavaSDK" />
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" project-jdk-name="corretto-17" project-jdk-type="JavaSDK">
|
||||||
|
<output url="file://$PROJECT_DIR$/out" />
|
||||||
|
</component>
|
||||||
</project>
|
</project>
|
10
.idea/modules.xml
generated
Normal file
10
.idea/modules.xml
generated
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectModuleManager">
|
||||||
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/packages/groovy/groovy.iml" filepath="$PROJECT_DIR$/packages/groovy/groovy.iml" />
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/packages/java/packages.iml" filepath="$PROJECT_DIR$/packages/java/packages.iml" />
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/.idea/piston.iml" filepath="$PROJECT_DIR$/.idea/piston.iml" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
9
.idea/piston.iml
generated
Normal file
9
.idea/piston.iml
generated
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="JAVA_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||||
|
<exclude-output />
|
||||||
|
<content url="file://$MODULE_DIR$" />
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
</component>
|
||||||
|
</module>
|
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
44
index.d.ts
vendored
Normal file
44
index.d.ts
vendored
Normal file
|
@ -0,0 +1,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";
|
11
packages/groovy/groovy.iml
Normal file
11
packages/groovy/groovy.iml
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="JAVA_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||||
|
<exclude-output />
|
||||||
|
<content url="file://$MODULE_DIR$">
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/3.0.7" isTestSource="false" />
|
||||||
|
</content>
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
</component>
|
||||||
|
</module>
|
11
packages/java/packages.iml
Normal file
11
packages/java/packages.iml
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="JAVA_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||||
|
<exclude-output />
|
||||||
|
<content url="file://$MODULE_DIR$">
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/15.0.2" isTestSource="false" />
|
||||||
|
</content>
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
</component>
|
||||||
|
</module>
|
Loading…
Add table
Add a link
Reference in a new issue