fix: added incremental typing to piston

This commit is contained in:
Endercheif 2023-02-27 18:08:05 -08:00
parent 593f59a184
commit 2962e0cf99
No known key found for this signature in database
GPG key ID: 7767459A0C8BEE00
14 changed files with 1039 additions and 1318 deletions

21
api/src/types.ts Normal file
View file

@ -0,0 +1,21 @@
export type File = {
content: string;
name?: string;
encoding?: 'base64' | 'hex' | 'utf8';
};
export interface Body {
language: string;
version: string;
files: Array<File>;
stdin?: string;
args?: Array<string>;
run_timeout?: number;
compile_timeout?: number;
compile_memory_limit?: number;
run_memory_limit?: number;
}
export type ObjectType<TObject extends Record<any, Record<Key, any>>, Key extends string> = {
[K in keyof TObject]: TObject[K][Key];
};