-
-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathRunner.ts
More file actions
24 lines (22 loc) · 818 Bytes
/
Runner.ts
File metadata and controls
24 lines (22 loc) · 818 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
export interface Runner {
init: (
stdout: (msg: string) => void,
onLoad: ({ version, banner }: { version: string; banner?: string }) => void,
packages?: string[][]
) => Promise<void>
// eslint-disable-next-line @typescript-eslint/no-explicit-any
getGlobal: (variable: string) => any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
setGlobal: (variable: string, value: any) => void
interruptExecution: () => void
readFile: (name: string) => void
writeFile: (name: string, data: string) => void
mkdir: (name: string) => void
rmdir: (name: string) => void
}
export interface PythonRunner extends Runner {
run: (code: string) => Promise<void>
}
export interface PythonConsoleRunner extends Runner {
run: (code: string) => Promise<{ state: string; error?: string }>
}