ihsm 0.0.13 → 0.0.19
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/README.md +190 -6
- package/lib/cjs/index.d.ts +282 -0
- package/lib/cjs/index.js +331 -0
- package/lib/cjs/index.js.map +1 -0
- package/lib/cjs/internal/defs.private.d.ts +31 -0
- package/lib/cjs/internal/defs.private.js +3 -0
- package/lib/cjs/internal/defs.private.js.map +1 -0
- package/lib/cjs/internal/dispatch.debug.d.ts +4 -0
- package/lib/cjs/internal/dispatch.debug.js +330 -0
- package/lib/cjs/internal/dispatch.debug.js.map +1 -0
- package/lib/cjs/internal/dispatch.production.d.ts +6 -0
- package/lib/cjs/internal/dispatch.production.js +239 -0
- package/lib/cjs/internal/dispatch.production.js.map +1 -0
- package/lib/cjs/internal/dispatch.trace.d.ts +4 -0
- package/lib/cjs/internal/dispatch.trace.js +410 -0
- package/lib/cjs/internal/dispatch.trace.js.map +1 -0
- package/lib/cjs/internal/hsm.d.ts +54 -0
- package/lib/cjs/internal/hsm.js +182 -0
- package/lib/cjs/internal/hsm.js.map +1 -0
- package/lib/cjs/internal/utils.d.ts +18 -0
- package/lib/cjs/internal/utils.js +51 -0
- package/lib/cjs/internal/utils.js.map +1 -0
- package/lib/cjs/package.json +3 -0
- package/lib/esm/index.d.ts +282 -0
- package/lib/esm/index.js +314 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/internal/defs.private.d.ts +31 -0
- package/lib/esm/internal/defs.private.js +2 -0
- package/lib/esm/internal/defs.private.js.map +1 -0
- package/lib/esm/internal/dispatch.debug.d.ts +4 -0
- package/lib/esm/internal/dispatch.debug.js +326 -0
- package/lib/esm/internal/dispatch.debug.js.map +1 -0
- package/lib/esm/internal/dispatch.production.d.ts +6 -0
- package/lib/esm/internal/dispatch.production.js +235 -0
- package/lib/esm/internal/dispatch.production.js.map +1 -0
- package/lib/esm/internal/dispatch.trace.d.ts +4 -0
- package/lib/esm/internal/dispatch.trace.js +406 -0
- package/lib/esm/internal/dispatch.trace.js.map +1 -0
- package/lib/esm/internal/hsm.d.ts +54 -0
- package/lib/esm/internal/hsm.js +178 -0
- package/lib/esm/internal/hsm.js.map +1 -0
- package/lib/esm/internal/utils.d.ts +18 -0
- package/lib/esm/internal/utils.js +41 -0
- package/lib/esm/internal/utils.js.map +1 -0
- package/lib/esm/package.json +3 -0
- package/package.json +114 -66
- package/lib/index.browser.js +0 -523
- package/lib/index.d.ts +0 -105
- package/lib/index.js +0 -374
- package/tsconfig.json +0 -72
package/lib/index.js
DELETED
|
@@ -1,374 +0,0 @@
|
|
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
var LogLevel;
|
|
13
|
-
(function (LogLevel) {
|
|
14
|
-
LogLevel[LogLevel["ALL"] = 0] = "ALL";
|
|
15
|
-
LogLevel[LogLevel["TRACE"] = 20] = "TRACE";
|
|
16
|
-
LogLevel[LogLevel["DEBUG"] = 30] = "DEBUG";
|
|
17
|
-
LogLevel[LogLevel["INFO"] = 30] = "INFO";
|
|
18
|
-
LogLevel[LogLevel["WARN"] = 40] = "WARN";
|
|
19
|
-
LogLevel[LogLevel["ERROR"] = 50] = "ERROR";
|
|
20
|
-
LogLevel[LogLevel["FATAL"] = 60] = "FATAL";
|
|
21
|
-
LogLevel[LogLevel["OFF"] = 70] = "OFF";
|
|
22
|
-
})(LogLevel = exports.LogLevel || (exports.LogLevel = {}));
|
|
23
|
-
class State {
|
|
24
|
-
_init(..._) { }
|
|
25
|
-
_exit() { }
|
|
26
|
-
_entry() { }
|
|
27
|
-
}
|
|
28
|
-
exports.State = State;
|
|
29
|
-
function createObject(topState, logLevel = LogLevel.INFO) {
|
|
30
|
-
return create(topState, {}, logLevel);
|
|
31
|
-
}
|
|
32
|
-
exports.createObject = createObject;
|
|
33
|
-
function create(topState, userData, logLevel = LogLevel.INFO) {
|
|
34
|
-
let hsm = new Hsm(topState, userData, logLevel);
|
|
35
|
-
let currState = topState;
|
|
36
|
-
hsm.logTrace(`[${currState.name}] #_init`);
|
|
37
|
-
while (true) {
|
|
38
|
-
if (Object.prototype.hasOwnProperty.call(currState.prototype, '_init')) {
|
|
39
|
-
currState.prototype['_init'].call(hsm, userData);
|
|
40
|
-
hsm.logTrace(` [${currState.name}] init`);
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
hsm.logTrace(` [${currState.name}] init?`);
|
|
44
|
-
}
|
|
45
|
-
if (Object.prototype.hasOwnProperty.call(currState, 'initialState') && currState.initialState) {
|
|
46
|
-
hsm.logTrace(` [${currState.name}] initialState found in '${currState.name}'`);
|
|
47
|
-
currState = currState.initialState;
|
|
48
|
-
hsm.currentState = currState;
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
break;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
return hsm;
|
|
55
|
-
}
|
|
56
|
-
exports.create = create;
|
|
57
|
-
function init(topState, logLevel = LogLevel.INFO, fieldName = 'hsm') {
|
|
58
|
-
return function (constructor) {
|
|
59
|
-
return class extends constructor {
|
|
60
|
-
constructor(...args) {
|
|
61
|
-
super(...args);
|
|
62
|
-
let self = this;
|
|
63
|
-
let hsm = new Hsm(topState, this, logLevel);
|
|
64
|
-
Object.defineProperty(self, fieldName, {
|
|
65
|
-
get() { return hsm; }, set(_) { throw new Error(`Field ${fieldName} is constant`); }
|
|
66
|
-
});
|
|
67
|
-
let currState = topState;
|
|
68
|
-
hsm.logTrace(`[${currState.name}] #_init`);
|
|
69
|
-
++hsm.indent;
|
|
70
|
-
while (true) {
|
|
71
|
-
if (Object.prototype.hasOwnProperty.call(currState.prototype, '_init')) {
|
|
72
|
-
currState.prototype['_init'].call(hsm, ...args);
|
|
73
|
-
hsm.logTrace(`[${currState.name}] init`);
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
hsm.logTrace(`[${currState.name}] init?`);
|
|
77
|
-
}
|
|
78
|
-
if (Object.prototype.hasOwnProperty.call(currState, 'initialState') && currState.initialState) {
|
|
79
|
-
hsm.logTrace(`[${currState.name}] initial state is [${currState.initialState.name}]`);
|
|
80
|
-
currState = currState.initialState;
|
|
81
|
-
hsm.currentState = currState;
|
|
82
|
-
}
|
|
83
|
-
else {
|
|
84
|
-
break;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
hsm.logTrace(`current state: [${currState.name}]`);
|
|
88
|
-
--hsm.indent;
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
exports.init = init;
|
|
94
|
-
function initialState() {
|
|
95
|
-
return function (TargetState) {
|
|
96
|
-
let ParentOfTargetState = Object.getPrototypeOf(TargetState.prototype).constructor;
|
|
97
|
-
if (ParentOfTargetState.initialState) {
|
|
98
|
-
throw new Error(`@ihsm.initialState has been set twice for parent class "${ParentOfTargetState.name}"; check all classes that extend "${ParentOfTargetState.name}"`);
|
|
99
|
-
}
|
|
100
|
-
TargetState.isInitialState = true;
|
|
101
|
-
ParentOfTargetState.initialState = TargetState;
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
exports.initialState = initialState;
|
|
105
|
-
class DebugTransition {
|
|
106
|
-
constructor(exitList, entryList) {
|
|
107
|
-
this.exitList = exitList;
|
|
108
|
-
this.entryList = entryList;
|
|
109
|
-
}
|
|
110
|
-
execute(hsm) {
|
|
111
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
112
|
-
++hsm.indent;
|
|
113
|
-
const exitLen = this.exitList.length;
|
|
114
|
-
for (let i = 0; i < exitLen; ++i) {
|
|
115
|
-
let lastState = this.exitList[i].prototype;
|
|
116
|
-
if (Object.prototype.hasOwnProperty.call(lastState, '_exit')) {
|
|
117
|
-
let res = lastState._exit.call(hsm);
|
|
118
|
-
if (Object.isPrototypeOf.call(hsm, Promise)) {
|
|
119
|
-
res = yield res;
|
|
120
|
-
}
|
|
121
|
-
hsm.logTrace(`[${this.exitList[i].name}] exit`);
|
|
122
|
-
}
|
|
123
|
-
else {
|
|
124
|
-
hsm.logTrace(`[${this.exitList[i].name}] exit?`);
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
const entryLen = this.entryList.length;
|
|
128
|
-
let lastState = hsm.currentState;
|
|
129
|
-
for (let i = 0; i < entryLen; ++i) {
|
|
130
|
-
lastState = this.entryList[i];
|
|
131
|
-
let stateProto = lastState.prototype;
|
|
132
|
-
if (Object.prototype.hasOwnProperty.call(stateProto, '_entry')) {
|
|
133
|
-
let res = stateProto._entry.call(hsm);
|
|
134
|
-
if (Object.isPrototypeOf.call(hsm, Promise)) {
|
|
135
|
-
res = yield res;
|
|
136
|
-
}
|
|
137
|
-
hsm.logTrace(`[${this.entryList[i].name}] enter`);
|
|
138
|
-
}
|
|
139
|
-
else {
|
|
140
|
-
hsm.logTrace(`[${this.entryList[i].name}] enter?`);
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
hsm.currentState = lastState;
|
|
144
|
-
--hsm.indent;
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
class Hsm {
|
|
149
|
-
constructor(UserTopState, userData, logLevel) {
|
|
150
|
-
this.jobs = [];
|
|
151
|
-
this.hsm = this;
|
|
152
|
-
this.ctx = userData;
|
|
153
|
-
this.topState = UserTopState;
|
|
154
|
-
this.currentState = UserTopState;
|
|
155
|
-
this.typeName = Object.getPrototypeOf(userData).constructor.name;
|
|
156
|
-
this.name = this.typeName;
|
|
157
|
-
this.logLevel = logLevel;
|
|
158
|
-
this.log = console.log;
|
|
159
|
-
this.transitionCache = new Map();
|
|
160
|
-
this.jobs = [];
|
|
161
|
-
this.isRunning = false;
|
|
162
|
-
this.indent = 0;
|
|
163
|
-
}
|
|
164
|
-
post(signal, ...payload) {
|
|
165
|
-
this.pushTask(createSyncTask(this, signal, ...payload));
|
|
166
|
-
}
|
|
167
|
-
send(signal, ...payload) {
|
|
168
|
-
let self = this;
|
|
169
|
-
return new Promise(function (resolve, reject) {
|
|
170
|
-
self.pushTask(createAsyncTask(self, resolve, reject, signal, ...payload));
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
transition(nextState) {
|
|
174
|
-
if (nextState === undefined) {
|
|
175
|
-
throw new Error("Cannot transition to undefined");
|
|
176
|
-
}
|
|
177
|
-
this.nextState = nextState;
|
|
178
|
-
}
|
|
179
|
-
unhandled() {
|
|
180
|
-
throw new Error("Unhandled method");
|
|
181
|
-
}
|
|
182
|
-
prepLine(msg, ...optionalParameters) {
|
|
183
|
-
return `${this.typeName} | ${' '.repeat(this.indent * 4)}${msg}`;
|
|
184
|
-
}
|
|
185
|
-
logTrace(msg, ...optionalParameters) {
|
|
186
|
-
if (this.logLevel <= LogLevel.TRACE) {
|
|
187
|
-
if (typeof msg === "string") {
|
|
188
|
-
this.log(this.prepLine(msg, optionalParameters));
|
|
189
|
-
}
|
|
190
|
-
else {
|
|
191
|
-
this.log(msg);
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
logDebug(msg, ...optionalParameters) {
|
|
196
|
-
if (this.logLevel <= LogLevel.DEBUG) {
|
|
197
|
-
if (typeof msg === "string") {
|
|
198
|
-
this.log(this.prepLine(msg, optionalParameters));
|
|
199
|
-
}
|
|
200
|
-
else {
|
|
201
|
-
this.log(msg);
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
logWarn(msg, ...optionalParameters) {
|
|
206
|
-
if (this.logLevel <= LogLevel.WARN) {
|
|
207
|
-
if (typeof msg === "string") {
|
|
208
|
-
this.log(this.prepLine(msg, optionalParameters));
|
|
209
|
-
}
|
|
210
|
-
else {
|
|
211
|
-
this.log(msg);
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
logInfo(msg, ...optionalParameters) {
|
|
216
|
-
if (this.logLevel <= LogLevel.INFO) {
|
|
217
|
-
if (typeof msg === "string") {
|
|
218
|
-
this.log(this.prepLine(msg, optionalParameters));
|
|
219
|
-
}
|
|
220
|
-
else {
|
|
221
|
-
this.log(msg);
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
logError(msg, ...optionalParameters) {
|
|
226
|
-
if (this.logLevel <= LogLevel.ERROR) {
|
|
227
|
-
if (typeof msg === "string") {
|
|
228
|
-
this.log(this.prepLine(msg, optionalParameters));
|
|
229
|
-
}
|
|
230
|
-
else {
|
|
231
|
-
this.log(msg);
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
logFatal(msg, ...optionalParameters) {
|
|
236
|
-
if (typeof msg === "string") {
|
|
237
|
-
this.log(this.prepLine(msg, optionalParameters));
|
|
238
|
-
}
|
|
239
|
-
else {
|
|
240
|
-
this.log(msg);
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
wait(millis) {
|
|
244
|
-
return new Promise(function (resolve) {
|
|
245
|
-
setTimeout(function () { resolve(); }, millis);
|
|
246
|
-
});
|
|
247
|
-
}
|
|
248
|
-
pushTask(t) {
|
|
249
|
-
this.jobs.push(t);
|
|
250
|
-
if (this.isRunning) {
|
|
251
|
-
return;
|
|
252
|
-
}
|
|
253
|
-
this.isRunning = true;
|
|
254
|
-
this.dequeue();
|
|
255
|
-
}
|
|
256
|
-
dequeue() {
|
|
257
|
-
if (this.jobs.length == 0) {
|
|
258
|
-
this.isRunning = false;
|
|
259
|
-
return;
|
|
260
|
-
}
|
|
261
|
-
let task = this.jobs.shift();
|
|
262
|
-
this.exec(task);
|
|
263
|
-
}
|
|
264
|
-
exec(task) {
|
|
265
|
-
let self = this;
|
|
266
|
-
setTimeout(function () {
|
|
267
|
-
Promise
|
|
268
|
-
.resolve()
|
|
269
|
-
.then(function () {
|
|
270
|
-
return new Promise(function (resolve) { task(resolve); });
|
|
271
|
-
})
|
|
272
|
-
.then(function () {
|
|
273
|
-
self.dequeue();
|
|
274
|
-
});
|
|
275
|
-
}, 0);
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
function getDebugTransition(srcState, destState, topState) {
|
|
279
|
-
let src = srcState;
|
|
280
|
-
let dst = destState;
|
|
281
|
-
let srcPath = [];
|
|
282
|
-
const end = topState;
|
|
283
|
-
let srcIndex = new Map();
|
|
284
|
-
let dstPath = [];
|
|
285
|
-
let cur = src;
|
|
286
|
-
let i = 0;
|
|
287
|
-
while (cur !== end) {
|
|
288
|
-
srcPath.push(cur);
|
|
289
|
-
srcIndex.set(cur, i);
|
|
290
|
-
cur = Object.getPrototypeOf(cur);
|
|
291
|
-
++i;
|
|
292
|
-
}
|
|
293
|
-
cur = dst;
|
|
294
|
-
while (cur !== end) {
|
|
295
|
-
let i = srcIndex.get(cur);
|
|
296
|
-
if (i !== undefined) {
|
|
297
|
-
srcPath = srcPath.slice(0, i);
|
|
298
|
-
break;
|
|
299
|
-
}
|
|
300
|
-
dstPath.unshift(cur);
|
|
301
|
-
cur = Object.getPrototypeOf(cur);
|
|
302
|
-
}
|
|
303
|
-
while (dst.hasOwnProperty('initialState')) {
|
|
304
|
-
dst = dst.initialState;
|
|
305
|
-
dstPath.push(dst);
|
|
306
|
-
}
|
|
307
|
-
return new DebugTransition(srcPath, dstPath);
|
|
308
|
-
}
|
|
309
|
-
function debugDispatch(hsm, signal, ...payload) {
|
|
310
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
311
|
-
hsm.logTrace(`[${hsm.currentState.name}] #${signal}`);
|
|
312
|
-
++hsm.indent;
|
|
313
|
-
try {
|
|
314
|
-
let messageHandler = hsm.currentState.prototype[signal];
|
|
315
|
-
if (!messageHandler) {
|
|
316
|
-
throw {
|
|
317
|
-
errorType: 'UnknownMessage',
|
|
318
|
-
errorLevel: 'Application Error',
|
|
319
|
-
errorMessage: `Cannot handle the #${signal} message`,
|
|
320
|
-
actorType: `${hsm.name}`,
|
|
321
|
-
currentState: `${hsm.currentState.name}`
|
|
322
|
-
};
|
|
323
|
-
}
|
|
324
|
-
let result = messageHandler.call(hsm, ...payload);
|
|
325
|
-
let output = undefined;
|
|
326
|
-
if (result instanceof Promise) {
|
|
327
|
-
output = yield result;
|
|
328
|
-
}
|
|
329
|
-
if (hsm.nextState != null) {
|
|
330
|
-
const destState = hsm.nextState;
|
|
331
|
-
hsm.logTrace(`transition [${hsm.currentState.name}] => [${destState.name}]`);
|
|
332
|
-
let tr = hsm.transitionCache.get([hsm.currentState, destState]);
|
|
333
|
-
if (!tr) {
|
|
334
|
-
tr = getDebugTransition(hsm.currentState, destState, hsm.topState);
|
|
335
|
-
hsm.transitionCache.set([hsm.currentState, destState], tr);
|
|
336
|
-
}
|
|
337
|
-
yield tr.execute(hsm);
|
|
338
|
-
hsm.nextState = undefined;
|
|
339
|
-
hsm.logTrace(`current state: [${hsm.currentState.name}]`);
|
|
340
|
-
}
|
|
341
|
-
if (output !== undefined) {
|
|
342
|
-
return output;
|
|
343
|
-
}
|
|
344
|
-
else {
|
|
345
|
-
return undefined;
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
finally {
|
|
349
|
-
--hsm.indent;
|
|
350
|
-
}
|
|
351
|
-
});
|
|
352
|
-
}
|
|
353
|
-
function createAsyncTask(hsm, resolve, reject, signal, ...payload) {
|
|
354
|
-
return function (doneCallback) {
|
|
355
|
-
debugDispatch(hsm, signal, ...payload)
|
|
356
|
-
.then(function (result) { resolve(result); })
|
|
357
|
-
.catch(function (err) { reject(err); })
|
|
358
|
-
.finally(function () {
|
|
359
|
-
doneCallback();
|
|
360
|
-
});
|
|
361
|
-
};
|
|
362
|
-
}
|
|
363
|
-
function createSyncTask(hsm, signal, ...payload) {
|
|
364
|
-
return function (doneCallback) {
|
|
365
|
-
debugDispatch(hsm, signal, ...payload)
|
|
366
|
-
.catch(function (err) {
|
|
367
|
-
hsm.logError(err);
|
|
368
|
-
})
|
|
369
|
-
.finally(function () {
|
|
370
|
-
doneCallback();
|
|
371
|
-
});
|
|
372
|
-
};
|
|
373
|
-
}
|
|
374
|
-
//# sourceMappingURL=index.js.map
|
package/tsconfig.json
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"incremental": true,
|
|
4
|
-
"moduleResolution": "node",
|
|
5
|
-
"target": "es6",
|
|
6
|
-
"module": "commonjs",
|
|
7
|
-
"allowJs": false,
|
|
8
|
-
"checkJs": false,
|
|
9
|
-
// "jsx": "preserve", // Specify JSX code generation: 'preserve', 'react-native', or 'react'.
|
|
10
|
-
"declaration": true,
|
|
11
|
-
"declarationMap": false,
|
|
12
|
-
"sourceMap": true,
|
|
13
|
-
// "outFile": ".", // Concatenate and emit output to single file.
|
|
14
|
-
// "outDir": "./build",
|
|
15
|
-
"rootDir": "./src/",
|
|
16
|
-
"composite": false,
|
|
17
|
-
"tsBuildInfoFile": "./.tsc",
|
|
18
|
-
"removeComments": true,
|
|
19
|
-
"noEmit": false,
|
|
20
|
-
// "importHelpers": true,
|
|
21
|
-
// "downlevelIteration": true,
|
|
22
|
-
// "isolatedModules": true,
|
|
23
|
-
"strict": true,
|
|
24
|
-
"noImplicitAny": true,
|
|
25
|
-
"strictNullChecks": true,
|
|
26
|
-
"strictFunctionTypes": true,
|
|
27
|
-
"strictBindCallApply": true,
|
|
28
|
-
"strictPropertyInitialization": true,
|
|
29
|
-
"noImplicitThis": true,
|
|
30
|
-
"alwaysStrict": true,
|
|
31
|
-
"noUnusedLocals": false,
|
|
32
|
-
"noUnusedParameters": false,
|
|
33
|
-
"noImplicitReturns": true,
|
|
34
|
-
"noFallthroughCasesInSwitch": true,
|
|
35
|
-
"importHelpers": false,
|
|
36
|
-
"baseUrl": ".",
|
|
37
|
-
"paths": {
|
|
38
|
-
"*": [
|
|
39
|
-
"*"
|
|
40
|
-
]
|
|
41
|
-
},
|
|
42
|
-
"lib": [
|
|
43
|
-
"es2018",
|
|
44
|
-
"dom"
|
|
45
|
-
],
|
|
46
|
-
"rootDirs": [
|
|
47
|
-
"build/root"
|
|
48
|
-
],
|
|
49
|
-
// "typeRoots": [],
|
|
50
|
-
//"types": [],
|
|
51
|
-
"allowSyntheticDefaultImports": true,
|
|
52
|
-
// Allow default imports from modules with no default export. This does not affect code emit, just typechecking
|
|
53
|
-
"esModuleInterop": true,
|
|
54
|
-
// Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'.
|
|
55
|
-
// "preserveSymlinks": true, // Do not resolve the real path of symlinks.
|
|
56
|
-
// "allowUmdGlobalAccess": true, // Allow accessing UMD globals from modules.
|
|
57
|
-
//"sourceRoot": "./src", // Specify the location where debugger should locate TypeScript files instead of source locations.
|
|
58
|
-
//"mapRoot": "../.map", // Specify the location where debugger should locate map files instead of generated locations.
|
|
59
|
-
// "inlineSourceMap": true, // Emit a single file with source maps instead of having a separate file.
|
|
60
|
-
// "inlineSources": true, // Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set.
|
|
61
|
-
"experimentalDecorators": true,
|
|
62
|
-
// Experimental Options
|
|
63
|
-
// "emitDecoratorMetadata": true, // Enables experimental support for emitting type metadata for decorators.
|
|
64
|
-
"forceConsistentCasingInFileNames": true
|
|
65
|
-
},
|
|
66
|
-
"exclude": [
|
|
67
|
-
"./lib",
|
|
68
|
-
"./dump",
|
|
69
|
-
"tsconfig-*.js",
|
|
70
|
-
"node_modules"
|
|
71
|
-
]
|
|
72
|
-
}
|