export-table-pulgin-csharp 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +169 -0
- package/package.json +14 -0
- package/src/index.ts +184 -0
- package/tsconfig.json +101 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import DataTable, { Field } from "windy-quicktable/dist/table/DataTable";
|
|
2
|
+
export declare function cmm(a?: string): string;
|
|
3
|
+
export declare function st(f: (a?: any) => string): string;
|
|
4
|
+
export declare function foreach<T>(ls: T[], f: (e: T) => string): string;
|
|
5
|
+
export declare type ExportParams = {
|
|
6
|
+
name: string;
|
|
7
|
+
tables: DataTable[];
|
|
8
|
+
fields: Field[];
|
|
9
|
+
datas: any[][];
|
|
10
|
+
objects: any[];
|
|
11
|
+
xxtea: (str: string, key: string, deflate: boolean) => string;
|
|
12
|
+
inject: {
|
|
13
|
+
[key: string]: boolean;
|
|
14
|
+
};
|
|
15
|
+
packagename: string | undefined;
|
|
16
|
+
};
|
|
17
|
+
export declare function export_stuff(paras: ExportParams): string | null;
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,SAAS,EAAE,EAAE,KAAK,EAAE,MAAM,uCAAuC,CAAA;AAExE,wBAAgB,GAAG,CAAC,CAAC,CAAC,EAAE,MAAM,UAAe;AAC7C,wBAAgB,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,MAAM,UAExC;AACD,wBAAgB,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,MAAM,UAEtD;AAED,oBAAY,YAAY,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,SAAS,EAAE,CAAA;IACnB,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,KAAK,EAAE,GAAG,EAAE,EAAE,CAAA;IACd,OAAO,EAAE,GAAG,EAAE,CAAA;IACd,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,KAAK,MAAM,CAAA;IAC7D,MAAM,EAAE;QACP,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACvB,CAAA;IACD,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;CAC/B,CAAA;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,GAAG,IAAI,CA+J/D"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.export_stuff = exports.foreach = exports.st = exports.cmm = void 0;
|
|
4
|
+
function cmm(a) { return ""; }
|
|
5
|
+
exports.cmm = cmm;
|
|
6
|
+
function st(f) {
|
|
7
|
+
return f();
|
|
8
|
+
}
|
|
9
|
+
exports.st = st;
|
|
10
|
+
function foreach(ls, f) {
|
|
11
|
+
return ls.map(e => f(e)).join("\n");
|
|
12
|
+
}
|
|
13
|
+
exports.foreach = foreach;
|
|
14
|
+
function export_stuff(paras) {
|
|
15
|
+
let { datas, fields, inject, name, objects, packagename, tables, xxtea, } = paras;
|
|
16
|
+
let firstLetterUpper = function (str) {
|
|
17
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
18
|
+
};
|
|
19
|
+
let firstLetterLower = function (str) {
|
|
20
|
+
return str.charAt(0).toLowerCase() + str.slice(1);
|
|
21
|
+
};
|
|
22
|
+
let convMemberName = firstLetterUpper;
|
|
23
|
+
let convVarName = firstLetterLower;
|
|
24
|
+
let RowClass = firstLetterUpper(name);
|
|
25
|
+
let initFunc = name + "Init";
|
|
26
|
+
let mapfield = fields.find(a => a.type == "key"); //如果是map,则生成对应的map
|
|
27
|
+
let mapName = name + "Map";
|
|
28
|
+
let getFieldType = function (t) {
|
|
29
|
+
if (t == "object") {
|
|
30
|
+
throw new Error("invalid type <object>");
|
|
31
|
+
}
|
|
32
|
+
else if (t == "object[]") {
|
|
33
|
+
throw new Error("invalid type <object[]>");
|
|
34
|
+
}
|
|
35
|
+
else if (t == "number") {
|
|
36
|
+
return "double";
|
|
37
|
+
}
|
|
38
|
+
else if (t == "number[]") {
|
|
39
|
+
return "double[]";
|
|
40
|
+
}
|
|
41
|
+
else if (t == "uid") {
|
|
42
|
+
return "int";
|
|
43
|
+
}
|
|
44
|
+
else if (t == "bool") {
|
|
45
|
+
return "bool";
|
|
46
|
+
}
|
|
47
|
+
else if (t == "bool[]") {
|
|
48
|
+
return "bool[]";
|
|
49
|
+
}
|
|
50
|
+
else if (t == "string") {
|
|
51
|
+
return "string";
|
|
52
|
+
}
|
|
53
|
+
else if (t == "string[]") {
|
|
54
|
+
return "string[]";
|
|
55
|
+
}
|
|
56
|
+
else if (t == "fk") {
|
|
57
|
+
return "int";
|
|
58
|
+
}
|
|
59
|
+
else if (t == "fk[]") {
|
|
60
|
+
return "int[]";
|
|
61
|
+
}
|
|
62
|
+
else if (t == "any") {
|
|
63
|
+
throw new Error("invalid type <any>");
|
|
64
|
+
}
|
|
65
|
+
else if (t == "key") {
|
|
66
|
+
return "string";
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
throw new Error("invalid type <unkown>");
|
|
70
|
+
}
|
|
71
|
+
return t;
|
|
72
|
+
};
|
|
73
|
+
const genValue = (value, t) => {
|
|
74
|
+
if (t == "object") {
|
|
75
|
+
throw new Error("invalid type <object>");
|
|
76
|
+
}
|
|
77
|
+
else if (t == "object[]") {
|
|
78
|
+
throw new Error("invalid type <object[]>");
|
|
79
|
+
}
|
|
80
|
+
else if (t == "number") {
|
|
81
|
+
return `${value}`;
|
|
82
|
+
}
|
|
83
|
+
else if (t == "number[]") {
|
|
84
|
+
let values = value;
|
|
85
|
+
return `new double[]{${values.join(", ")}}`;
|
|
86
|
+
}
|
|
87
|
+
else if (t == "uid") {
|
|
88
|
+
return `${value}`;
|
|
89
|
+
}
|
|
90
|
+
else if (t == "bool") {
|
|
91
|
+
return `${value}`;
|
|
92
|
+
}
|
|
93
|
+
else if (t == "bool[]") {
|
|
94
|
+
let values = value;
|
|
95
|
+
return `new bool[]{${values.join(", ")}}`;
|
|
96
|
+
}
|
|
97
|
+
else if (t == "string") {
|
|
98
|
+
return `"${value}"`;
|
|
99
|
+
}
|
|
100
|
+
else if (t == "string[]") {
|
|
101
|
+
let values = value;
|
|
102
|
+
return `new string[]{${values.map(v => `"${v}"`).join(", ")}}`;
|
|
103
|
+
}
|
|
104
|
+
else if (t == "fk") {
|
|
105
|
+
return `${value}`;
|
|
106
|
+
}
|
|
107
|
+
else if (t == "fk[]") {
|
|
108
|
+
let values = value;
|
|
109
|
+
return `new int[]{${values.join(", ")}}`;
|
|
110
|
+
}
|
|
111
|
+
else if (t == "any") {
|
|
112
|
+
throw new Error("invalid type <any>");
|
|
113
|
+
}
|
|
114
|
+
else if (t == "key") {
|
|
115
|
+
return `${value}`;
|
|
116
|
+
}
|
|
117
|
+
throw new Error("invalid type <unkown>");
|
|
118
|
+
};
|
|
119
|
+
const getTitle = (v) => {
|
|
120
|
+
return v.describe.split("\n")[0];
|
|
121
|
+
};
|
|
122
|
+
const getDescripts = (v) => {
|
|
123
|
+
return v.describe.split("\n");
|
|
124
|
+
};
|
|
125
|
+
let temp = `
|
|
126
|
+
using System.Collections.Generic;
|
|
127
|
+
|
|
128
|
+
public class ${RowClass} {
|
|
129
|
+
|
|
130
|
+
public static List<${RowClass}> Configs = new List<${RowClass}>()
|
|
131
|
+
{
|
|
132
|
+
${foreach(datas, data => ` new ${RowClass}(${st(() => fields.map((f, index) => genValue(data[index], f.type)).join(", "))}),`)}
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
public ${RowClass}() { }
|
|
136
|
+
public ${RowClass}(${st(() => fields.map(f => `${getFieldType(f.type)} ${convVarName(f.name)}`).join(", "))})
|
|
137
|
+
{
|
|
138
|
+
${foreach(fields, f => ` this.${convMemberName(f.name)} = ${convVarName(f.name)};`)}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
public virtual ${RowClass} MergeFrom(${RowClass} source)
|
|
142
|
+
{
|
|
143
|
+
${foreach(fields, f => ` this.${convMemberName(f.name)} = source.${convMemberName(f.name)};`)}
|
|
144
|
+
return this;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
public virtual ${RowClass} Clone()
|
|
148
|
+
{
|
|
149
|
+
var config = new ${RowClass}();
|
|
150
|
+
config.MergeFrom(this);
|
|
151
|
+
return config;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
${cmm( /**生成字段 */)}
|
|
155
|
+
${foreach(fields, f => `
|
|
156
|
+
/// <summary>
|
|
157
|
+
${foreach(getDescripts(f), line => ` /// ${line}`)}
|
|
158
|
+
/// </summary>
|
|
159
|
+
public ${getFieldType(f.type)} ${convMemberName(f.name)};`)}
|
|
160
|
+
|
|
161
|
+
${cmm( /**生成get字段 */)}
|
|
162
|
+
#region get字段
|
|
163
|
+
${foreach(fields, f => ` public ${getFieldType(f.type)} ${getTitle(f).replace(" ", "_")} => ${convMemberName(f.name)};`)}
|
|
164
|
+
#endregion
|
|
165
|
+
}
|
|
166
|
+
`;
|
|
167
|
+
return temp;
|
|
168
|
+
}
|
|
169
|
+
exports.export_stuff = export_stuff;
|
package/package.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "export-table-pulgin-csharp",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
|
+
},
|
|
9
|
+
"author": "windyuuy",
|
|
10
|
+
"license": "ISC",
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"windy-quicktable": "^1.3.27"
|
|
13
|
+
}
|
|
14
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
|
|
2
|
+
import DataTable, { Field } from "windy-quicktable/dist/table/DataTable"
|
|
3
|
+
|
|
4
|
+
export function cmm(a?: string) { return "" }
|
|
5
|
+
export function st(f: (a?: any) => string) {
|
|
6
|
+
return f()
|
|
7
|
+
}
|
|
8
|
+
export function foreach<T>(ls: T[], f: (e: T) => string) {
|
|
9
|
+
return ls.map(e => f(e)).join("\n")
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type ExportParams = {
|
|
13
|
+
name: string
|
|
14
|
+
tables: DataTable[]
|
|
15
|
+
fields: Field[]
|
|
16
|
+
datas: any[][]
|
|
17
|
+
objects: any[]
|
|
18
|
+
xxtea: (str: string, key: string, deflate: boolean) => string
|
|
19
|
+
inject: {
|
|
20
|
+
[key: string]: boolean;
|
|
21
|
+
}
|
|
22
|
+
packagename: string | undefined
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function export_stuff(paras: ExportParams): string | null {
|
|
26
|
+
let {
|
|
27
|
+
datas,
|
|
28
|
+
fields,
|
|
29
|
+
inject,
|
|
30
|
+
name,
|
|
31
|
+
objects,
|
|
32
|
+
packagename,
|
|
33
|
+
tables,
|
|
34
|
+
xxtea,
|
|
35
|
+
} = paras;
|
|
36
|
+
|
|
37
|
+
let firstLetterUpper = function (str: string) {
|
|
38
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
39
|
+
};
|
|
40
|
+
let firstLetterLower = function (str: string) {
|
|
41
|
+
return str.charAt(0).toLowerCase() + str.slice(1);
|
|
42
|
+
};
|
|
43
|
+
let convMemberName = firstLetterUpper
|
|
44
|
+
let convVarName = firstLetterLower
|
|
45
|
+
|
|
46
|
+
let RowClass = firstLetterUpper(name)
|
|
47
|
+
let initFunc = name + "Init"
|
|
48
|
+
let mapfield = fields.find(a => a.type == "key")//如果是map,则生成对应的map
|
|
49
|
+
let mapName = name + "Map"
|
|
50
|
+
|
|
51
|
+
let getFieldType = function (t: string) {
|
|
52
|
+
if (t == "object") {
|
|
53
|
+
throw new Error("invalid type <object>")
|
|
54
|
+
} else if (t == "object[]") {
|
|
55
|
+
throw new Error("invalid type <object[]>")
|
|
56
|
+
} else if (t == "number") {
|
|
57
|
+
return "double";
|
|
58
|
+
} else if (t == "number[]") {
|
|
59
|
+
return "double[]";
|
|
60
|
+
} else if (t == "uid") {
|
|
61
|
+
return "int";
|
|
62
|
+
} else if (t == "bool") {
|
|
63
|
+
return "bool";
|
|
64
|
+
} else if (t == "bool[]") {
|
|
65
|
+
return "bool[]";
|
|
66
|
+
} else if (t == "string") {
|
|
67
|
+
return "string";
|
|
68
|
+
} else if (t == "string[]") {
|
|
69
|
+
return "string[]";
|
|
70
|
+
} else if (t == "fk") {
|
|
71
|
+
return "int";
|
|
72
|
+
} else if (t == "fk[]") {
|
|
73
|
+
return "int[]";
|
|
74
|
+
} else if (t == "any") {
|
|
75
|
+
throw new Error("invalid type <any>")
|
|
76
|
+
} else if (t == "key") {
|
|
77
|
+
return "string";
|
|
78
|
+
} else {
|
|
79
|
+
throw new Error("invalid type <unkown>")
|
|
80
|
+
}
|
|
81
|
+
return t;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const genValue = (value: any, t: string): string => {
|
|
85
|
+
if (t == "object") {
|
|
86
|
+
throw new Error("invalid type <object>")
|
|
87
|
+
} else if (t == "object[]") {
|
|
88
|
+
throw new Error("invalid type <object[]>")
|
|
89
|
+
} else if (t == "number") {
|
|
90
|
+
return `${value}`
|
|
91
|
+
} else if (t == "number[]") {
|
|
92
|
+
let values = value as number[]
|
|
93
|
+
return `new double[]{${values.join(", ")}}`
|
|
94
|
+
} else if (t == "uid") {
|
|
95
|
+
return `${value}`
|
|
96
|
+
} else if (t == "bool") {
|
|
97
|
+
return `${value}`
|
|
98
|
+
} else if (t == "bool[]") {
|
|
99
|
+
let values = value as boolean[]
|
|
100
|
+
return `new bool[]{${values.join(", ")}}`
|
|
101
|
+
} else if (t == "string") {
|
|
102
|
+
return `"${value}"`
|
|
103
|
+
} else if (t == "string[]") {
|
|
104
|
+
let values = value as string[]
|
|
105
|
+
return `new string[]{${values.map(v => `"${v}"`).join(", ")}}`
|
|
106
|
+
} else if (t == "fk") {
|
|
107
|
+
return `${value}`
|
|
108
|
+
} else if (t == "fk[]") {
|
|
109
|
+
let values = value as number[]
|
|
110
|
+
return `new int[]{${values.join(", ")}}`
|
|
111
|
+
} else if (t == "any") {
|
|
112
|
+
throw new Error("invalid type <any>")
|
|
113
|
+
} else if (t == "key") {
|
|
114
|
+
return `${value}`
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
throw new Error("invalid type <unkown>")
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const getTitle = (v: Field) => {
|
|
121
|
+
return v.describe.split("\n")[0]
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const getDescripts = (v: Field) => {
|
|
125
|
+
return v.describe.split("\n")
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
let temp = `
|
|
129
|
+
using System.Collections.Generic;
|
|
130
|
+
|
|
131
|
+
public class ${RowClass} {
|
|
132
|
+
|
|
133
|
+
public static List<${RowClass}> Configs = new List<${RowClass}>()
|
|
134
|
+
{
|
|
135
|
+
${foreach(datas, data =>
|
|
136
|
+
` new ${RowClass}(${st(() => fields.map((f, index) => genValue(data[index], f.type)).join(", "))}),`
|
|
137
|
+
)}
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
public ${RowClass}() { }
|
|
141
|
+
public ${RowClass}(${st(() => fields.map(f => `${getFieldType(f.type)} ${convVarName(f.name)}`).join(", "))})
|
|
142
|
+
{
|
|
143
|
+
${foreach(fields, f =>
|
|
144
|
+
` this.${convMemberName(f.name)} = ${convVarName(f.name)};`
|
|
145
|
+
)}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
public virtual ${RowClass} MergeFrom(${RowClass} source)
|
|
149
|
+
{
|
|
150
|
+
${foreach(fields, f =>
|
|
151
|
+
` this.${convMemberName(f.name)} = source.${convMemberName(f.name)};`
|
|
152
|
+
)}
|
|
153
|
+
return this;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
public virtual ${RowClass} Clone()
|
|
157
|
+
{
|
|
158
|
+
var config = new ${RowClass}();
|
|
159
|
+
config.MergeFrom(this);
|
|
160
|
+
return config;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
${cmm(/**生成字段 */)}
|
|
164
|
+
${foreach(fields, f => `
|
|
165
|
+
/// <summary>
|
|
166
|
+
${foreach(getDescripts(f), line =>
|
|
167
|
+
` /// ${line}`
|
|
168
|
+
)}
|
|
169
|
+
/// </summary>
|
|
170
|
+
public ${getFieldType(f.type)} ${convMemberName(f.name)};`
|
|
171
|
+
)}
|
|
172
|
+
|
|
173
|
+
${cmm(/**生成get字段 */)}
|
|
174
|
+
#region get字段
|
|
175
|
+
${foreach(fields, f =>
|
|
176
|
+
` public ${getFieldType(f.type)} ${getTitle(f).replace(" ", "_")} => ${convMemberName(f.name)};`
|
|
177
|
+
)}
|
|
178
|
+
#endregion
|
|
179
|
+
}
|
|
180
|
+
`
|
|
181
|
+
|
|
182
|
+
return temp
|
|
183
|
+
|
|
184
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
/* Visit https://aka.ms/tsconfig.json to read more about this file */
|
|
4
|
+
|
|
5
|
+
/* Projects */
|
|
6
|
+
// "incremental": true, /* Enable incremental compilation */
|
|
7
|
+
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
|
|
8
|
+
// "tsBuildInfoFile": "./", /* Specify the folder for .tsbuildinfo incremental compilation files. */
|
|
9
|
+
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects */
|
|
10
|
+
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
|
|
11
|
+
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
|
|
12
|
+
|
|
13
|
+
/* Language and Environment */
|
|
14
|
+
"target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
|
|
15
|
+
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
|
16
|
+
// "jsx": "preserve", /* Specify what JSX code is generated. */
|
|
17
|
+
// "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
|
|
18
|
+
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
|
|
19
|
+
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h' */
|
|
20
|
+
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
|
|
21
|
+
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.` */
|
|
22
|
+
// "reactNamespace": "", /* Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit. */
|
|
23
|
+
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
|
|
24
|
+
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
|
|
25
|
+
|
|
26
|
+
/* Modules */
|
|
27
|
+
"module": "commonjs", /* Specify what module code is generated. */
|
|
28
|
+
// "rootDir": "./", /* Specify the root folder within your source files. */
|
|
29
|
+
// "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
|
|
30
|
+
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|
|
31
|
+
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
|
32
|
+
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
|
33
|
+
// "typeRoots": [], /* Specify multiple folders that act like `./node_modules/@types`. */
|
|
34
|
+
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
|
|
35
|
+
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
|
36
|
+
// "resolveJsonModule": true, /* Enable importing .json files */
|
|
37
|
+
// "noResolve": true, /* Disallow `import`s, `require`s or `<reference>`s from expanding the number of files TypeScript should add to a project. */
|
|
38
|
+
|
|
39
|
+
/* JavaScript Support */
|
|
40
|
+
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. */
|
|
41
|
+
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
|
|
42
|
+
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`. */
|
|
43
|
+
|
|
44
|
+
/* Emit */
|
|
45
|
+
"declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
|
|
46
|
+
"declarationMap": true, /* Create sourcemaps for d.ts files. */
|
|
47
|
+
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
|
|
48
|
+
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
|
|
49
|
+
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */
|
|
50
|
+
"outDir": "./dist/", /* Specify an output folder for all emitted files. */
|
|
51
|
+
// "removeComments": true, /* Disable emitting comments. */
|
|
52
|
+
// "noEmit": true, /* Disable emitting files from a compilation. */
|
|
53
|
+
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
|
|
54
|
+
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types */
|
|
55
|
+
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
|
|
56
|
+
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
|
|
57
|
+
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
|
58
|
+
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
|
|
59
|
+
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
|
|
60
|
+
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
|
|
61
|
+
// "newLine": "crlf", /* Set the newline character for emitting files. */
|
|
62
|
+
// "stripInternal": true, /* Disable emitting declarations that have `@internal` in their JSDoc comments. */
|
|
63
|
+
// "noEmitHelpers": true, /* Disable generating custom helper functions like `__extends` in compiled output. */
|
|
64
|
+
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
|
|
65
|
+
// "preserveConstEnums": true, /* Disable erasing `const enum` declarations in generated code. */
|
|
66
|
+
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
|
|
67
|
+
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
|
|
68
|
+
|
|
69
|
+
/* Interop Constraints */
|
|
70
|
+
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
|
|
71
|
+
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
|
|
72
|
+
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */
|
|
73
|
+
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
|
|
74
|
+
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
|
|
75
|
+
|
|
76
|
+
/* Type Checking */
|
|
77
|
+
"strict": true, /* Enable all strict type-checking options. */
|
|
78
|
+
// "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied `any` type.. */
|
|
79
|
+
// "strictNullChecks": true, /* When type checking, take into account `null` and `undefined`. */
|
|
80
|
+
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
|
|
81
|
+
// "strictBindCallApply": true, /* Check that the arguments for `bind`, `call`, and `apply` methods match the original function. */
|
|
82
|
+
// "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
|
|
83
|
+
// "noImplicitThis": true, /* Enable error reporting when `this` is given the type `any`. */
|
|
84
|
+
// "useUnknownInCatchVariables": true, /* Type catch clause variables as 'unknown' instead of 'any'. */
|
|
85
|
+
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
|
|
86
|
+
// "noUnusedLocals": true, /* Enable error reporting when a local variables aren't read. */
|
|
87
|
+
// "noUnusedParameters": true, /* Raise an error when a function parameter isn't read */
|
|
88
|
+
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
|
|
89
|
+
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
|
|
90
|
+
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
|
|
91
|
+
// "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */
|
|
92
|
+
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
|
|
93
|
+
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type */
|
|
94
|
+
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
|
|
95
|
+
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
|
|
96
|
+
|
|
97
|
+
/* Completeness */
|
|
98
|
+
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
|
|
99
|
+
"skipLibCheck": true /* Skip type checking all .d.ts files. */
|
|
100
|
+
}
|
|
101
|
+
}
|