xlport 0.1.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.
@@ -0,0 +1,12 @@
1
+ /// <reference types="node" />
2
+ import { Stream } from 'stream';
3
+ import type { XlPortClientOptions, ExportBody, ImportRequest, ImportResponse } from './types';
4
+ export declare class XlPort {
5
+ private config;
6
+ constructor(config: XlPortClientOptions);
7
+ importFromFile(file: string | Buffer, request?: ImportRequest): Promise<ImportResponse>;
8
+ exportToFile(body: ExportBody): Stream;
9
+ private getExcelMimeType;
10
+ private loadFile;
11
+ }
12
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../lib/client.ts"],"names":[],"mappings":";AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,KAAK,EACV,mBAAmB,EAGnB,UAAU,EACV,aAAa,EACb,cAAc,EACf,MAAM,SAAS,CAAA;AAGhB,qBAAa,MAAM;IACjB,OAAO,CAAC,MAAM,CAA+B;gBACjC,MAAM,EAAE,mBAAmB;IAM1B,cAAc,CACzB,IAAI,EAAE,MAAM,GAAG,MAAM,EACrB,OAAO,GAAE,aAAoC,GAC5C,OAAO,CAAC,cAAc,CAAC;IA8BnB,YAAY,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM;IAgC7C,OAAO,CAAC,gBAAgB;YAIV,QAAQ;CASvB"}
package/dist/client.js ADDED
@@ -0,0 +1,155 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (_) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.XlPort = void 0;
40
+ var request_promise_1 = require("request-promise");
41
+ var request_1 = require("request");
42
+ var fs_1 = require("fs");
43
+ var path_1 = require("path");
44
+ var util_1 = require("util");
45
+ var types_1 = require("./types");
46
+ var XlPort = /** @class */ (function () {
47
+ function XlPort(config) {
48
+ this.config = {
49
+ url: config.url ? config.url.replace(/\/$/, '') : 'https://xlport.compute.molnify.com',
50
+ apiKey: config.apiKey,
51
+ };
52
+ }
53
+ XlPort.prototype.importFromFile = function (file, request) {
54
+ if (request === void 0) { request = types_1.defaultImportRequest; }
55
+ return __awaiter(this, void 0, void 0, function () {
56
+ var _a, _b;
57
+ var _c, _d;
58
+ return __generator(this, function (_e) {
59
+ switch (_e.label) {
60
+ case 0:
61
+ _a = request_promise_1.put;
62
+ _c = {
63
+ url: this.config.url + "/import",
64
+ headers: {
65
+ Authorization: 'xlport apikey ' + this.config.apiKey,
66
+ },
67
+ method: 'put'
68
+ };
69
+ _d = {};
70
+ if (!(typeof file === 'string')) return [3 /*break*/, 2];
71
+ return [4 /*yield*/, this.loadFile(file)];
72
+ case 1:
73
+ _b = _e.sent();
74
+ return [3 /*break*/, 3];
75
+ case 2:
76
+ _b = {
77
+ value: file,
78
+ options: { filename: 'file.xlsx', contentType: types_1.excelDefaultMimeType },
79
+ };
80
+ _e.label = 3;
81
+ case 3: return [2 /*return*/, _a.apply(void 0, [(_c.formData = (_d.file = _b,
82
+ _d.request = {
83
+ value: Buffer.from(JSON.stringify(request)),
84
+ options: {
85
+ filename: 'request.json',
86
+ contentType: 'application/json',
87
+ },
88
+ },
89
+ _d),
90
+ _c)])
91
+ .then(JSON.parse)
92
+ .then(function (response) {
93
+ if (!response)
94
+ throw Error('Response body is empty');
95
+ return response;
96
+ })];
97
+ }
98
+ });
99
+ });
100
+ };
101
+ XlPort.prototype.exportToFile = function (body) {
102
+ return request_1.put({
103
+ url: this.config.url + "/export",
104
+ headers: {
105
+ Authorization: 'xlport apikey ' + this.config.apiKey,
106
+ },
107
+ body: 'templateId' in body ? JSON.stringify(body) : 'templateUrl' in body ? JSON.stringify(body) : null,
108
+ formData: 'template' in body
109
+ ? {
110
+ template: {
111
+ template: {
112
+ value: body.template,
113
+ options: {
114
+ filename: 'template.xlsx',
115
+ contentType: 'application/vnd.ms-excel',
116
+ },
117
+ },
118
+ },
119
+ data: {
120
+ value: Buffer.from(JSON.stringify(body.data)),
121
+ options: {
122
+ filename: 'data.json',
123
+ contentType: 'application/json',
124
+ },
125
+ },
126
+ }
127
+ : undefined,
128
+ encoding: null,
129
+ });
130
+ };
131
+ XlPort.prototype.getExcelMimeType = function (path) {
132
+ return types_1.mimeTypes[path_1.extname(path)] || types_1.excelDefaultMimeType;
133
+ };
134
+ XlPort.prototype.loadFile = function (path) {
135
+ return __awaiter(this, void 0, void 0, function () {
136
+ var _a;
137
+ return __generator(this, function (_b) {
138
+ switch (_b.label) {
139
+ case 0:
140
+ _a = {};
141
+ return [4 /*yield*/, util_1.promisify(fs_1.readFile)(path)];
142
+ case 1: return [2 /*return*/, (_a.value = _b.sent(),
143
+ _a.options = {
144
+ filename: 'file.xlsx',
145
+ contentType: this.getExcelMimeType(path),
146
+ },
147
+ _a)];
148
+ }
149
+ });
150
+ });
151
+ };
152
+ return XlPort;
153
+ }());
154
+ exports.XlPort = XlPort;
155
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../lib/client.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAmD;AACnD,mCAA2C;AAC3C,yBAA6B;AAC7B,6BAA8B;AAC9B,6BAAgC;AAUhC,iCAA+E;AAE/E;IAEE,gBAAY,MAA2B;QACrC,IAAI,CAAC,MAAM,GAAG;YACZ,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,oCAAoC;YACtF,MAAM,EAAE,MAAM,CAAC,MAAM;SACtB,CAAA;IACH,CAAC;IACY,+BAAc,GAA3B,UACE,IAAqB,EACrB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AI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,aAAa,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI;YACvG,QAAQ,EACN,UAAU,IAAI,IAAI;gBAChB,CAAC,CAAC;oBACE,QAAQ,EAAE;wBACR,QAAQ,EAAE;4BACR,KAAK,EAAE,IAAI,CAAC,QAAQ;4BACpB,OAAO,EAAE;gCACP,QAAQ,EAAE,eAAe;gCACzB,WAAW,EAAE,0BAA0B;6BACxC;yBACF;qBACF;oBACD,IAAI,EAAE;wBACJ,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;wBAC7C,OAAO,EAAE;4BACP,QAAQ,EAAE,WAAW;4BACrB,WAAW,EAAE,kBAAkB;yBAChC;qBACF;iBACF;gBACH,CAAC,CAAC,SAAS;YACf,QAAQ,EAAE,IAAI;SACf,CAAC,CAAA;IACJ,CAAC;IAEO,iCAAgB,GAAxB,UAAyB,IAAY;QACnC,OAAO,iBAAS,CAAqB,cAAO,CAAC,IAAI,CAAC,CAAC,IAAI,4BAAoB,CAAA;IAC7E,CAAC;IAEa,yBAAQ,GAAtB,UAAuB,IAAY;;;;;;;wBAExB,qBAAM,gBAAS,CAAC,aAAQ,CAAC,CAAC,IAAI,CAAC,EAAA;4BADxC,uBACE,QAAK,GAAE,SAA+B;4BACtC,UAAO,GAAE;gCACP,QAAQ,EAAE,WAAW;gCACrB,WAAW,EAAE,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC;6BACzC;iCACF;;;;KACF;IACH,aAAC;AAAD,CAAC,AAtFD,IAsFC;AAtFY,wBAAM"}
@@ -0,0 +1,3 @@
1
+ export * from './client';
2
+ export * from './types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./client"), exports);
14
+ __exportStar(require("./types"), exports);
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAwB;AACxB,0CAAuB"}
@@ -0,0 +1,53 @@
1
+ /// <reference types="node" />
2
+ import { ReadStream } from 'fs';
3
+ export declare type XlPortClientOptions = {
4
+ url?: string;
5
+ apiKey: string;
6
+ };
7
+ export declare type ExcelFileExtension = 'xls' | 'xlsx' | 'xlsm' | 'xlsb';
8
+ export declare type ExcelDefaultMimeType = 'application/vnd.ms-excel';
9
+ export declare type ExcelMimeType = ExcelDefaultMimeType | 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' | 'application/vnd.ms-excel.sheet.macroEnabled.12' | 'application/vnd.ms-excel.sheet.binary.macroEnabled.12';
10
+ export declare const excelDefaultMimeType = "application/vnd.ms-excel";
11
+ declare type Dictionary<K extends string, T> = {
12
+ [P in K]?: T;
13
+ };
14
+ export declare type MimeTypes = Dictionary<ExcelFileExtension, ExcelMimeType>;
15
+ export declare type ImportRequest = {
16
+ properties: string[];
17
+ tables?: Record<string, string[]>[] | ['*'];
18
+ };
19
+ export declare type ExportRawType = Boolean | string | number;
20
+ export declare type ExportDetails = ExportRawType | Record<string, ExportRawType>[];
21
+ export declare type ExportData = {
22
+ [key in string]?: ExportDetails;
23
+ };
24
+ interface TemplateIdBody {
25
+ templateId: string;
26
+ data: ExportData;
27
+ }
28
+ interface UrlBody {
29
+ templateUrl: string;
30
+ data: ExportData;
31
+ }
32
+ interface FileBody {
33
+ template: Buffer | ReadStream;
34
+ data: ExportData;
35
+ }
36
+ export declare type ExportBody = FileBody | UrlBody | TemplateIdBody;
37
+ export declare type ImportResponse = ImportSuccess | ImportError;
38
+ export interface ImportError {
39
+ status: 'error';
40
+ message: string;
41
+ }
42
+ export interface ImportSuccess {
43
+ status: 'success';
44
+ data: {
45
+ properties?: Record<string, ImportValue>;
46
+ tables?: Record<string, ImportValue>[];
47
+ };
48
+ }
49
+ export declare type ImportValue = boolean | string | number;
50
+ export declare const defaultImportRequest: ImportRequest;
51
+ export declare const mimeTypes: MimeTypes;
52
+ export {};
53
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../lib/types.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAA;AAE/B,oBAAY,mBAAmB,GAAG;IAChC,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAED,oBAAY,kBAAkB,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAA;AACjE,oBAAY,oBAAoB,GAAG,0BAA0B,CAAA;AAC7D,oBAAY,aAAa,GACrB,oBAAoB,GACpB,mEAAmE,GACnE,gDAAgD,GAChD,uDAAuD,CAAA;AAE3D,eAAO,MAAM,oBAAoB,6BAA6B,CAAA;AAC9D,aAAK,UAAU,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,IAAI;KAAG,CAAC,IAAI,CAAC,CA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,OAAO,GAAG,MAAM,GAAG,MAAM,CAAA;AAEnD,eAAO,MAAM,oBAAoB,EAAE,aAGlC,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,SAKvB,CAAA"}
package/dist/types.js ADDED
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.mimeTypes = exports.defaultImportRequest = exports.excelDefaultMimeType = void 0;
4
+ exports.excelDefaultMimeType = 'application/vnd.ms-excel';
5
+ exports.defaultImportRequest = {
6
+ properties: ['*'],
7
+ tables: ['*'],
8
+ };
9
+ exports.mimeTypes = {
10
+ xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
11
+ xlsm: 'application/vnd.ms-excel.sheet.macroEnabled.12',
12
+ xlsb: 'application/vnd.ms-excel.sheet.binary.macroEnabled.12',
13
+ xls: 'application/vnd.ms-excel',
14
+ };
15
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../lib/types.ts"],"names":[],"mappings":";;;AAea,QAAA,oBAAoB,GAAG,0BAA0B,CAAA;AA+CjD,QAAA,oBAAoB,GAAkB;IACjD,UAAU,EAAE,CAAC,GAAG,CAAC;IACjB,MAAM,EAAE,CAAC,GAAG,CAAC;CACd,CAAA;AAEY,QAAA,SAAS,GAAc;IAClC,IAAI,EAAE,mEAAmE;IACzE,IAAI,EAAE,gDAAgD;IACtD,IAAI,EAAE,uDAAuD;IAC7D,GAAG,EAAE,0BAA0B;CAChC,CAAA"}
package/package.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "xlport",
3
+ "version": "0.1.0",
4
+ "description": "",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "scripts": {
8
+ "run": "tsc",
9
+ "test": "echo \"Error: no test specified\" && exit 1",
10
+ "prepublish": "tsc"
11
+ },
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "git+https://github.com/xlport/xlportjs.git"
15
+ },
16
+ "keywords": [
17
+ "xlPort",
18
+ "Excel import",
19
+ "Excel export"
20
+ ],
21
+ "author": "xlPort, Peter Albert",
22
+ "license": "MIT",
23
+ "bugs": {
24
+ "url": "https://github.com/xlport/xlportjs/issues"
25
+ },
26
+ "homepage": "https://xlport.io",
27
+ "devDependencies": {
28
+ "typescript": "^4.9.3",
29
+ "@types/node": "^10.0.0",
30
+ "@types/request": "2.48.8",
31
+ "@types/request-promise": "4.1.48"
32
+ },
33
+ "dependencies": {
34
+ "request": "2.88.0",
35
+ "request-promise": "^4.2.4"
36
+ },
37
+ "prettier": {
38
+ "trailingComma": "all",
39
+ "printWidth": 120,
40
+ "semi": false,
41
+ "singleQuote": true,
42
+ "arrowParens": "always",
43
+ "endOfLine": "lf"
44
+ }
45
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,62 @@
1
+ {
2
+ "compilerOptions": {
3
+ /* Basic Options */
4
+ "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
5
+ "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
6
+ "lib": ["es2015"], /* Specify library files to be included in the compilation. */
7
+ // "allowJs": true, /* Allow javascript files to be compiled. */
8
+ // "checkJs": true, /* Report errors in .js files. */
9
+ // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
10
+ "declaration": true, /* Generates corresponding '.d.ts' file. */
11
+ "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
12
+ "sourceMap": true, /* Generates corresponding '.map' file. */
13
+ // "outFile": "./", /* Concatenate and emit output to single file. */
14
+ "outDir": "./dist", /* Redirect output structure to the directory. */
15
+ // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
16
+ // "composite": true, /* Enable project compilation */
17
+ // "incremental": true, /* Enable incremental compilation */
18
+ // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
19
+ // "removeComments": true, /* Do not emit comments to output. */
20
+ // "noEmit": true, /* Do not emit outputs. */
21
+ // "importHelpers": true, /* Import emit helpers from 'tslib'. */
22
+ // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
23
+ // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
24
+
25
+ /* Strict Type-Checking Options */
26
+ "strict": true, /* Enable all strict type-checking options. */
27
+ // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
28
+ // "strictNullChecks": true, /* Enable strict null checks. */
29
+ // "strictFunctionTypes": true, /* Enable strict checking of function types. */
30
+ // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
31
+ // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
32
+ // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
33
+ // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
34
+
35
+ /* Additional Checks */
36
+ "noUnusedLocals": true, /* Report errors on unused locals. */
37
+ "noUnusedParameters": true, /* Report errors on unused parameters. */
38
+ "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
39
+ "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
40
+
41
+ /* Module Resolution Options */
42
+ // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
43
+ // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
44
+ // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
45
+ // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
46
+ // "typeRoots": [], /* List of folders to include type definitions from. */
47
+ // "types": [], /* Type declaration files to be included in compilation. */
48
+ // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
49
+ "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
50
+ // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
51
+
52
+ /* Source Map Options */
53
+ // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
54
+ // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
55
+ // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
56
+ // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
57
+
58
+ /* Experimental Options */
59
+ // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
60
+ // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
61
+ }
62
+ }