Correct asc output stream typings, fixes #485

This commit is contained in:
dcode 2019-02-21 06:16:29 +01:00
parent 34d86a0d6a
commit c0738ed6b6
2 changed files with 7 additions and 19 deletions

8
cli/asc.d.ts vendored
View File

@ -42,6 +42,12 @@ export const definitionFiles: { assembly: string, portable: string };
export interface OutputStream {
/** Writes another chunk of data to the stream. */
write(chunk: Uint8Array | string): void;
}
/** An in-memory output stream. */
export interface MemoryStream extends OutputStream {
/** Resets the stream to offset zero. */
reset(): void;
/** Converts the output to a buffer. */
toBuffer(): Uint8Array;
/** Converts the output to a string. */
@ -112,7 +118,7 @@ export function formatTime(time: number): string;
export function printStats(stats: Stats, output: OutputStream): void;
/** Creates a memory stream that can be used in place of stdout/stderr. */
export function createMemoryStream(fn?: (chunk: Uint8Array | string) => void): OutputStream;
export function createMemoryStream(fn?: (chunk: Uint8Array | string) => void): MemoryStream;
/** Compatible TypeScript compiler options for syntax highlighting etc. */
export const tscOptions: { [key: string]: any };

View File

@ -756,24 +756,6 @@ exports.main = function main(argv, options, callback) {
}
}
var argumentSubstitutions = {
"-O" : [ "--optimize" ],
"-Os" : [ "--optimize", "--shrinkLevel", "1" ],
"-Oz" : [ "--optimize", "--shrinkLevel", "2" ],
"-O0" : [ "--optimizeLevel", "0", "--shrinkLevel", "0" ],
"-O0s": [ "--optimizeLevel", "0", "--shrinkLevel", "1" ],
"-O0z": [ "--optimizeLevel", "0", "--shrinkLevel", "2" ],
"-O1" : [ "--optimizeLevel", "1", "--shrinkLevel", "0" ],
"-O1s": [ "--optimizeLevel", "1", "--shrinkLevel", "1" ],
"-O1z": [ "--optimizeLevel", "1", "--shrinkLevel", "2" ],
"-O2" : [ "--optimizeLevel", "2", "--shrinkLevel", "0" ],
"-O2s": [ "--optimizeLevel", "2", "--shrinkLevel", "1" ],
"-O2z": [ "--optimizeLevel", "2", "--shrinkLevel", "2" ],
"-O3" : [ "--optimizeLevel", "3", "--shrinkLevel", "0" ],
"-O3s": [ "--optimizeLevel", "3", "--shrinkLevel", "1" ],
"-O3z": [ "--optimizeLevel", "3", "--shrinkLevel", "2" ],
};
/** Checks diagnostics emitted so far for errors. */
function checkDiagnostics(emitter, stderr) {
var diagnostic;