Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/api/src/lib/compiler/api.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CompilationResult, CompilationFileSources } from './type'
import { CompilationResult, CompilationFileSources, lastCompilationResult } from './type'
import { StatusEvents, Api } from '@remixproject/plugin-utils'

export interface ICompiler extends Api {
Expand All @@ -11,7 +11,7 @@ export interface ICompiler extends Api {
) => void
} & StatusEvents
methods: {
getCompilationResult(): CompilationResult
getCompilationResult(): lastCompilationResult
compile(fileName: string): void
}
}
18 changes: 17 additions & 1 deletion packages/api/src/lib/compiler/type/output.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,20 @@
// SOURCES //
/////////////
export interface CompilationFileSources {
[fileName: string]: { content: string }
[fileName: string]:
{
// Optional: keccak256 hash of the source file
keccak256?: string,
// Required (unless "urls" is used): literal contents of the source file
content: string,
urls?: string[]
}
}

export interface SourceWithTarget {
sources?: CompilationFileSources,
target?: string | null | undefined
}

////////////
// RESULT //
Expand All @@ -26,6 +37,11 @@ export interface CompilationResult {
}
}

export interface lastCompilationResult {
data: CompilationResult | null
source: SourceWithTarget | null | undefined
}

///////////
// ERROR //
///////////
Expand Down