-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.d.ts
More file actions
154 lines (152 loc) · 3.78 KB
/
index.d.ts
File metadata and controls
154 lines (152 loc) · 3.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
/* tslint:disable */
/* eslint-disable */
/* auto-generated by NAPI-RS */
export interface ExecuteParams {
instanceId: string
language: string
code: string
options?: ExecutionOptions
}
export interface ExecuteWithIoParams {
instanceId: string
language: string
code: string
stdin: string
options?: ExecutionOptions
}
export interface ExecutionOptions {
timeout?: number
memoryLimit?: number
enableTracing?: boolean
sandboxLevel?: string
env?: Record<string, string>
workingDirectory?: string
stdin?: string
}
export interface CompileParams {
code: string
instanceId: string
}
export interface TranspileParams {
code: string
instanceId: string
target: string
module: string
}
export interface CompileCParams {
code: string
instanceId: string
optimizationLevel: number
enableLto: boolean
target: string
}
export interface CompileJavaParams {
code: string
instanceId: string
mainClass: string
optimizationLevel: string
enableAssertions: boolean
target: string
}
export interface ExecuteWasmParams {
instanceId: string
wasmModule: Buffer
entryPoint: string
options?: ExecutionOptions
}
export interface ExecuteWasmWithArgsParams {
instanceId: string
wasmModule: Buffer
args: Array<string>
options?: ExecutionOptions
}
export interface ExecutionResult {
success: boolean
stdout?: string
stderr?: string
returnValue?: string
error?: ExecutionError
metrics?: ExecutionMetrics
trace?: ExecutionTrace
}
export interface ExecutionError {
type: string
message: string
stack?: string
line?: number
column?: number
}
export interface ExecutionMetrics {
coldStartTime: number
compilationTime: number
executionTime: number
totalTime: number
peakMemoryUsage: number
avgMemoryUsage: number
cpuUsage: number
allocations: number
gcCount?: number
gcTime?: number
}
export interface ExecutionTrace {
variables?: string
callStack?: Array<CallFrame>
memorySnapshots?: Array<MemorySnapshot>
}
export interface CallFrame {
functionName: string
fileName?: string
line: number
column: number
locals?: string
}
export interface MemorySnapshot {
timestamp: number
heapUsed: number
heapTotal: number
external?: number
}
export interface CompileResult {
success: boolean
error?: string
}
export interface TranspileResult {
success: boolean
code?: string
error?: string
}
export interface CompileWasmResult {
success: boolean
wasmModule?: Buffer
compilationTime?: number
error?: string
}
export interface MetricsResult {
totalExecutions: number
successfulExecutions: number
failedExecutions: number
avgExecutionTime: number
peakMemoryUsage: number
activeInstances: number
}
export declare function getVersion(): string
export declare class RuntimeController {
constructor()
initialize(): Promise<void>
execute(params: ExecuteParams): Promise<ExecutionResult>
executeWithIo(params: ExecuteWithIOParams): Promise<ExecutionResult>
compilePython(params: CompileParams): Promise<CompileResult>
compileJavascript(params: CompileParams): Promise<CompileResult>
transpileTypescript(params: TranspileParams): Promise<TranspileResult>
compileTypescript(params: CompileParams): Promise<CompileResult>
compileCToWasm(params: CompileCParams): Promise<CompileWasmResult>
compileJavaToWasm(params: CompileJavaParams): Promise<CompileWasmResult>
executeWasm(params: ExecuteWasmParams): Promise<ExecutionResult>
executeWasmWithArgs(params: ExecuteWasmWithArgsParams): Promise<ExecutionResult>
compileRuby(params: CompileParams): Promise<CompileResult>
compileGo(params: CompileParams): Promise<CompileResult>
compileGoToWasm(code: string, instanceId: string): Promise<CompileWasmResult>
destroyInstance(instanceId: string): Promise<void>
getMetrics(): Promise<MetricsResult>
shutdown(): Promise<void>
}