Adding types

This commit is contained in:
adambrangenberg 2023-05-09 22:22:18 +02:00
parent c2796388a8
commit f897b32b7b
7 changed files with 94 additions and 1 deletions

View File

@ -1,4 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<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>

10
.idea/modules.xml Normal file
View 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 Normal file
View 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 Normal file
View 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
View 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";

View 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>

View 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>