forked from AssemblyScript/assemblyscript
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathasc.d.ts
More file actions
Latest commit
118 lines (96 loc) · 3.68 KB
/
Copy pathasc.d.ts
File metadata and controls
118 lines (96 loc) · 3.68 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
/** Whether this is a webpack bundle or not. */
exportconstisBundle: boolean;
/** Whether asc runs the sources directly or not. */
exportconstisDev: boolean;
/** AssemblyScript version. */
exportconstversion: string;
/** Command line option description. */
exportinterfaceOptionDescription{
/** Textual description. */
description: string|string[];
/** Option type, e.g. `string`. */
type: string;
/** Option aliases, if any. */
aliases?: string[];
}
/** Available CLI options. */
exportconstoptions: {[key: string]: OptionDescription};
/** Common root used in source maps. */
exportvarsourceMapRoot: string;
/** Prefix used for library files. */
exportvarlibraryPrefix: string;
/** Default Binaryen optimization level. */
exportvardefaultOptimizeLevel: number;
/** Default Binaryen shrink level. */
exportvardefaultShrinkLevel: number;
/** Bundled library files. */
exportconstlibraryFiles: {[key: string]: string};
/** Bundled definition files. */
exportconstdefinitionFiles: {assembly: string,portable: string};
/** A compatible output stream. */
exportinterfaceOutputStream{
/** Writes another chunk of data to the stream. */
write(chunk: Uint8Array|string): void;
/** Converts the output to a buffer. */
toBuffer(): Uint8Array;
/** Converts the output to a string. */
toString(): string;
}
/** Compiler API options. */
interfaceCompilerOptions{
/** Standard output stream to use. */
stdout?: OutputStream;
/** Standard error stream to use. */
stderr?: OutputStream;
/** Reads a file from disk (or memory). */
readFile?: (name: string)=>string|null;
/** Writes a file to disk (or memory). */
writeFile?: (name: string,contents: Uint8Array)=>void;
/** Lists all files within a directory. */
listFiles?: (dir: string)=>string[]|null;
}
/** Convenience function that parses and compiles source strings directly. */
exportfunctioncompileString(sources: {[key: string]: string}|string,options?: CompilerOptions): {
/** Standard output. */
stdout: OutputStream,
/** Standard error. */
stderr: OutputStream,
/** Emitted binary. */
binary: Uint8Array|null,
/** Emitted text format. */
text: string|null
}
/** Runs the command line utility using the specified arguments array. */
exportfunctionmain(argv: string[],options: CompilerOptions,callback?: (err: Error|null)=>number): number;
exportfunctionmain(argv: string[],callback?: (err: Error|null)=>number): number;
/** Checks diagnostics emitted so far for errors. */
exportfunctioncheckDiagnostics(emitter: any,stderr?: OutputStream): boolean;
/** An object of stats for the current task. */
exportinterfaceStats{
readTime: number,
readCount: number,
writeTime: number,
writeCount: number,
parseTime: number,
parseCount: number,
compileTime: number,
compileCount: number,
emitTime: number,
emitCount: number,
validateTime: number,
validateCount: number,
optimizeTime: number,
optimizeCount: number
}
/** Creates an empty set of stats. */
exportfunctioncreateStats(): Stats;
/** Measures the execution time of the specified function. */
exportfunctionmeasure(fn: Function): number;
/** Formats a high resolution time to a human readable string. */
exportfunctionformatTime(time: number): string;
/** Formats and prints out the contents of a set of stats. */
exportfunctionprintStats(stats: Stats,output: OutputStream): void;
/** Creates a memory stream that can be used in place of stdout/stderr. */
exportfunctioncreateMemoryStream(fn?: (chunk: Uint8Array|string)=>void): OutputStream;
/** Compatible TypeScript compiler options for syntax highlighting etc. */
exportconsttscOptions: {[key: string]: any};