File tree Expand file tree Collapse file tree 3 files changed +10
-10
lines changed Expand file tree Collapse file tree 3 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -5,11 +5,11 @@ import * as path from 'path'
55
66import RunScenario from './run'
77import SubmissionScenario from './submission'
8- import { RunJob , SubmitJob } from "./job" ;
8+ import { RunJob , SubmitJob , Job } from "./job" ;
99
1010export function execute ( job : RunJob ) : Promise < RunResult >
1111export function execute ( job : SubmitJob ) : Promise < SubmissionResult >
12- export async function execute ( job ) {
12+ export async function execute ( job : Job ) {
1313 // Create RUNBOX
1414 rm ( '-rf' , config . RUNBOX . DIR )
1515 mkdir ( '-p' , config . RUNBOX . DIR )
Original file line number Diff line number Diff line change 1- type JobConstructorOpts = {
1+ interface JobConstructorOpts {
22 id : number
33 source : string
44 lang : string
55 timelimit ?: number
66}
7- type RunJobConstructorOpts = JobConstructorOpts & {
7+ interface RunJobConstructorOpts extends JobConstructorOpts {
88 stdin : string
99}
10- type TestcaseOpts = {
10+ interface TestcaseOpts {
1111 id : number ,
1212 input : string ,
1313 output : string
1414}
15- type SubmitJobConstructorOpts = JobConstructorOpts & {
15+ interface SubmitJobConstructorOpts extends JobConstructorOpts {
1616 testcases : Array < TestcaseOpts >
1717}
1818
Original file line number Diff line number Diff line change 1- export type Result = {
1+ export interface Result {
22 id : number ,
33 stderr : string
44}
55
6- export type TestcaseResult = {
6+ export interface TestcaseResult {
77 id : number ,
88 score : number ,
99 time : string ,
1010 result : string
1111}
1212
13- export type RunResult = Result & {
13+ export interface RunResult extends Result {
1414 stdout : string ,
1515 time : number ,
1616 code : number
1717}
1818
19- export type SubmissionResult = Result & {
19+ export interface SubmissionResult extends Result {
2020 testcases : Array < TestcaseResult >
2121}
You can’t perform that action at this time.
0 commit comments