|
1 | 1 | namespace ts {
|
2 | 2 | /* @internal */
|
3 | 3 | export const compileOnSaveCommandLineOption: CommandLineOption = { name: "compileOnSave", type: "boolean" };
|
| 4 | + |
| 5 | + const commandLineLibMap = createMapFromTemplate({ |
| 6 | + // JavaScript only |
| 7 | + "es5": "lib.es5.d.ts", |
| 8 | + "es6": "lib.es2015.d.ts", |
| 9 | + "es2015": "lib.es2015.d.ts", |
| 10 | + "es7": "lib.es2016.d.ts", |
| 11 | + "es2016": "lib.es2016.d.ts", |
| 12 | + "es2017": "lib.es2017.d.ts", |
| 13 | + "es2018": "lib.es2018.d.ts", |
| 14 | + "esnext": "lib.esnext.d.ts", |
| 15 | + // Host only |
| 16 | + "dom": "lib.dom.d.ts", |
| 17 | + "dom.iterable": "lib.dom.iterable.d.ts", |
| 18 | + "webworker": "lib.webworker.d.ts", |
| 19 | + "scripthost": "lib.scripthost.d.ts", |
| 20 | + // ES2015 Or ESNext By-feature options |
| 21 | + "es2015.core": "lib.es2015.core.d.ts", |
| 22 | + "es2015.collection": "lib.es2015.collection.d.ts", |
| 23 | + "es2015.generator": "lib.es2015.generator.d.ts", |
| 24 | + "es2015.iterable": "lib.es2015.iterable.d.ts", |
| 25 | + "es2015.promise": "lib.es2015.promise.d.ts", |
| 26 | + "es2015.proxy": "lib.es2015.proxy.d.ts", |
| 27 | + "es2015.reflect": "lib.es2015.reflect.d.ts", |
| 28 | + "es2015.symbol": "lib.es2015.symbol.d.ts", |
| 29 | + "es2015.symbol.wellknown": "lib.es2015.symbol.wellknown.d.ts", |
| 30 | + "es2016.array.include": "lib.es2016.array.include.d.ts", |
| 31 | + "es2017.object": "lib.es2017.object.d.ts", |
| 32 | + "es2017.sharedmemory": "lib.es2017.sharedmemory.d.ts", |
| 33 | + "es2017.string": "lib.es2017.string.d.ts", |
| 34 | + "es2017.intl": "lib.es2017.intl.d.ts", |
| 35 | + "es2017.typedarrays": "lib.es2017.typedarrays.d.ts", |
| 36 | + "es2018.intl": "lib.es2018.intl.d.ts", |
| 37 | + "es2018.promise": "lib.es2018.promise.d.ts", |
| 38 | + "es2018.regexp": "lib.es2018.regexp.d.ts", |
| 39 | + "esnext.array": "lib.esnext.array.d.ts", |
| 40 | + "esnext.asynciterable": "lib.esnext.asynciterable.d.ts", |
| 41 | + }); |
| 42 | + |
| 43 | + // Internally we add some additional lib references that we only support when used as part of a |
| 44 | + // "lib" reference directive. They are not available on the command line or in tsconfig.json. |
| 45 | + /* @internal */ |
| 46 | + export const libMap = cloneMap(commandLineLibMap) |
| 47 | + .set("webworker.importscripts", "lib.webworker.importscripts.d.ts"); |
| 48 | + |
| 49 | + /* @internal */ |
| 50 | + export const libs = arrayFrom(commandLineLibMap.keys()); |
| 51 | + |
4 | 52 | /* @internal */
|
5 | 53 | export const optionDeclarations: CommandLineOption[] = [
|
6 | 54 | // CommandLine only options
|
@@ -114,43 +162,7 @@ namespace ts {
|
114 | 162 | type: "list",
|
115 | 163 | element: {
|
116 | 164 | name: "lib",
|
117 |
| - type: createMapFromTemplate({ |
118 |
| - // JavaScript only |
119 |
| - "es5": "lib.es5.d.ts", |
120 |
| - "es6": "lib.es2015.d.ts", |
121 |
| - "es2015": "lib.es2015.d.ts", |
122 |
| - "es7": "lib.es2016.d.ts", |
123 |
| - "es2016": "lib.es2016.d.ts", |
124 |
| - "es2017": "lib.es2017.d.ts", |
125 |
| - "es2018": "lib.es2018.d.ts", |
126 |
| - "esnext": "lib.esnext.d.ts", |
127 |
| - // Host only |
128 |
| - "dom": "lib.dom.d.ts", |
129 |
| - "dom.iterable": "lib.dom.iterable.d.ts", |
130 |
| - "webworker": "lib.webworker.d.ts", |
131 |
| - "scripthost": "lib.scripthost.d.ts", |
132 |
| - // ES2015 Or ESNext By-feature options |
133 |
| - "es2015.core": "lib.es2015.core.d.ts", |
134 |
| - "es2015.collection": "lib.es2015.collection.d.ts", |
135 |
| - "es2015.generator": "lib.es2015.generator.d.ts", |
136 |
| - "es2015.iterable": "lib.es2015.iterable.d.ts", |
137 |
| - "es2015.promise": "lib.es2015.promise.d.ts", |
138 |
| - "es2015.proxy": "lib.es2015.proxy.d.ts", |
139 |
| - "es2015.reflect": "lib.es2015.reflect.d.ts", |
140 |
| - "es2015.symbol": "lib.es2015.symbol.d.ts", |
141 |
| - "es2015.symbol.wellknown": "lib.es2015.symbol.wellknown.d.ts", |
142 |
| - "es2016.array.include": "lib.es2016.array.include.d.ts", |
143 |
| - "es2017.object": "lib.es2017.object.d.ts", |
144 |
| - "es2017.sharedmemory": "lib.es2017.sharedmemory.d.ts", |
145 |
| - "es2017.string": "lib.es2017.string.d.ts", |
146 |
| - "es2017.intl": "lib.es2017.intl.d.ts", |
147 |
| - "es2017.typedarrays": "lib.es2017.typedarrays.d.ts", |
148 |
| - "es2018.intl": "lib.es2018.intl.d.ts", |
149 |
| - "es2018.promise": "lib.es2018.promise.d.ts", |
150 |
| - "es2018.regexp": "lib.es2018.regexp.d.ts", |
151 |
| - "esnext.array": "lib.esnext.array.d.ts", |
152 |
| - "esnext.asynciterable": "lib.esnext.asynciterable.d.ts", |
153 |
| - }), |
| 165 | + type: commandLineLibMap |
154 | 166 | },
|
155 | 167 | showInSimplifiedHelpView: true,
|
156 | 168 | category: Diagnostics.Basic_Options,
|
|
0 commit comments