-
Notifications
You must be signed in to change notification settings - Fork 14
/
index.d.ts
80 lines (61 loc) · 2.1 KB
/
index.d.ts
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
import * as WebSocket from 'ws';
import * as http from 'http';
export type HTML = string;
export type JavaScript = string;
export type AssemblyScript = string;
export type TypeScript = string;
export type CommandLineOptions = {
readonly buildStatic: boolean;
readonly watchFiles: boolean;
readonly httpPort: number;
readonly wsPort: number;
readonly exclude: string | undefined;
readonly include: string | undefined;
readonly disableSpa: boolean;
readonly customHTTPHeadersFilePath: string | undefined;
readonly ascOptionsFilePath: string | undefined;
readonly tscOptionsFilePath: string | undefined;
readonly spaRoot: string | undefined;
};
export type Clients = {
[remoteAddress: string]: Readonly<WebSocket>;
};
export type CompiledFiles = {
[filePath: string]: Readonly<Buffer> | null;
};
export type FileContentsResult = {
readonly fileContents: Readonly<Buffer>;
} | 'FILE_NOT_FOUND';
export type Transformer = (transformerParams: {
sourceString: string;
sourceBuffer: Readonly<Buffer>;
}) => Promise<string> | string;
export type TransformerCreator = (transformerCreatorParams: {
url: string;
compilerOptions: any; // TODO I would really like to get rid of this any
wsPort: number;
}) => Transformer;
export type CustomHTTPHeaders = {
readonly [regexp: string]: Readonly<HTTPHeaders>;
};
export type HTTPHeaders = {
readonly [key: string]: string;
};
// TODO waiting on better options for the asc programmatic API: https://github.com/AssemblyScript/assemblyscript/issues/1019
// TODO we might just import the correct type from assemblyscript here
export type ASCOptions = [];
// TODO import the types directly from TypeScript if possible
export type TSCOptions = {
};
export type RustCOptions = {
};
export type WabtOptions = {};
export type COptions = {};
export type CPPOptions = {};
export type JSONOptions = {};
export type Plugin = {
readonly fileExtensions: ReadonlyArray<string>;
readonly httpHeaders: Readonly<HTTPHeaders>;
readonly createTransformer: TransformerCreator;
readonly defaultCompilerOptions: any;
};