mirror of
https://github.com/denoland/deno.git
synced 2025-08-02 18:12:39 +00:00
Fix compile and bundle api types (#3703)
This commit is contained in:
parent
aedf8721cf
commit
35eb79610f
3 changed files with 7 additions and 6 deletions
|
@ -240,9 +240,10 @@ self.compilerMain = function compilerMain(): void {
|
||||||
emitResult.emitSkipped === false,
|
emitResult.emitSkipped === false,
|
||||||
"Unexpected skip of the emit."
|
"Unexpected skip of the emit."
|
||||||
);
|
);
|
||||||
const { items } = fromTypeScriptDiagnostic(diagnostics);
|
|
||||||
const result = [
|
const result = [
|
||||||
items && items.length ? items : undefined,
|
diagnostics.length
|
||||||
|
? fromTypeScriptDiagnostic(diagnostics)
|
||||||
|
: undefined,
|
||||||
bundle ? state.emitBundle : state.emitMap
|
bundle ? state.emitBundle : state.emitMap
|
||||||
];
|
];
|
||||||
postMessage(result);
|
postMessage(result);
|
||||||
|
|
|
@ -328,7 +328,7 @@ export function compile(
|
||||||
rootName: string,
|
rootName: string,
|
||||||
sources?: Record<string, string>,
|
sources?: Record<string, string>,
|
||||||
options?: CompilerOptions
|
options?: CompilerOptions
|
||||||
): Promise<[Diagnostic[] | undefined, Record<string, string>]> {
|
): Promise<[Diagnostic | undefined, Record<string, string>]> {
|
||||||
const payload = {
|
const payload = {
|
||||||
rootName: sources ? rootName : checkRelative(rootName),
|
rootName: sources ? rootName : checkRelative(rootName),
|
||||||
sources,
|
sources,
|
||||||
|
@ -377,7 +377,7 @@ export function bundle(
|
||||||
rootName: string,
|
rootName: string,
|
||||||
sources?: Record<string, string>,
|
sources?: Record<string, string>,
|
||||||
options?: CompilerOptions
|
options?: CompilerOptions
|
||||||
): Promise<[Diagnostic[] | undefined, string]> {
|
): Promise<[Diagnostic | undefined, string]> {
|
||||||
const payload = {
|
const payload = {
|
||||||
rootName: sources ? rootName : checkRelative(rootName),
|
rootName: sources ? rootName : checkRelative(rootName),
|
||||||
sources,
|
sources,
|
||||||
|
|
4
cli/js/lib.deno_runtime.d.ts
vendored
4
cli/js/lib.deno_runtime.d.ts
vendored
|
@ -1904,7 +1904,7 @@ declare namespace Deno {
|
||||||
rootName: string,
|
rootName: string,
|
||||||
sources?: Record<string, string>,
|
sources?: Record<string, string>,
|
||||||
options?: CompilerOptions
|
options?: CompilerOptions
|
||||||
): Promise<[Diagnostic[] | undefined, Record<string, string>]>;
|
): Promise<[Diagnostic | undefined, Record<string, string>]>;
|
||||||
|
|
||||||
/** Takes a root module name, and optionally a record set of sources. Resolves
|
/** Takes a root module name, and optionally a record set of sources. Resolves
|
||||||
* with a single JavaScript string that is like the output of a `deno bundle`
|
* with a single JavaScript string that is like the output of a `deno bundle`
|
||||||
|
@ -1938,7 +1938,7 @@ declare namespace Deno {
|
||||||
rootName: string,
|
rootName: string,
|
||||||
sources?: Record<string, string>,
|
sources?: Record<string, string>,
|
||||||
options?: CompilerOptions
|
options?: CompilerOptions
|
||||||
): Promise<[Diagnostic[] | undefined, string]>;
|
): Promise<[Diagnostic | undefined, string]>;
|
||||||
|
|
||||||
// @url js/deno.d.ts
|
// @url js/deno.d.ts
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue