Skip to content

Commit 6dbf881

Browse files
authored
Merge pull request #299 from bunsenstraat/bunsenstraat-patch-1
Bunsenstraat patch 1
2 parents ef6356e + 5d849e3 commit 6dbf881

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

packages/api/src/lib/compiler/api.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { CompilationResult, CompilationFileSources } from './type'
1+
import { CompilationResult, CompilationFileSources, lastCompilationResult } from './type'
22
import { StatusEvents, Api } from '@remixproject/plugin-utils'
33

44
export interface ICompiler extends Api {
@@ -11,7 +11,7 @@ export interface ICompiler extends Api {
1111
) => void
1212
} & StatusEvents
1313
methods: {
14-
getCompilationResult(): CompilationResult
14+
getCompilationResult(): lastCompilationResult
1515
compile(fileName: string): void
1616
}
1717
}

packages/api/src/lib/compiler/type/output.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,20 @@
22
// SOURCES //
33
/////////////
44
export interface CompilationFileSources {
5-
[fileName: string]: { content: string }
5+
[fileName: string]:
6+
{
7+
// Optional: keccak256 hash of the source file
8+
keccak256?: string,
9+
// Required (unless "urls" is used): literal contents of the source file
10+
content: string,
11+
urls?: string[]
12+
}
613
}
714

15+
export interface SourceWithTarget {
16+
sources?: CompilationFileSources,
17+
target?: string | null | undefined
18+
}
819

920
////////////
1021
// RESULT //
@@ -26,6 +37,11 @@ export interface CompilationResult {
2637
}
2738
}
2839

40+
export interface lastCompilationResult {
41+
data: CompilationResult | null
42+
source: SourceWithTarget | null | undefined
43+
}
44+
2945
///////////
3046
// ERROR //
3147
///////////

0 commit comments

Comments
 (0)