saito-js 0.0.4 → 0.0.6

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.
Files changed (57) hide show
  1. package/browser/index.js +3669 -0
  2. package/configs.d.ts +26 -0
  3. package/configs.d.ts.map +1 -0
  4. package/index.node.d.ts +12 -0
  5. package/index.node.d.ts.map +1 -0
  6. package/index.web.d.ts +12 -0
  7. package/index.web.d.ts.map +1 -0
  8. package/lib/block.d.ts +18 -0
  9. package/lib/block.d.ts.map +1 -0
  10. package/lib/blockchain.d.ts +8 -0
  11. package/lib/blockchain.d.ts.map +1 -0
  12. package/lib/custom/custom_shared_methods.d.ts +22 -0
  13. package/lib/custom/custom_shared_methods.d.ts.map +1 -0
  14. package/lib/custom/shared_methods.web.d.ts +15 -0
  15. package/lib/custom/shared_methods.web.d.ts.map +1 -0
  16. package/lib/factory.d.ts +16 -0
  17. package/lib/factory.d.ts.map +1 -0
  18. package/lib/peer.d.ts +15 -0
  19. package/lib/peer.d.ts.map +1 -0
  20. package/lib/saito_factory.d.ts +1 -0
  21. package/lib/saito_factory.d.ts.map +1 -0
  22. package/lib/slip.d.ts +43 -0
  23. package/lib/slip.d.ts.map +1 -0
  24. package/lib/transaction.d.ts +70 -0
  25. package/lib/transaction.d.ts.map +1 -0
  26. package/lib/wallet.d.ts +18 -0
  27. package/lib/wallet.d.ts.map +1 -0
  28. package/package.json +2 -2
  29. package/saito.d.ts +52 -0
  30. package/saito.d.ts.map +1 -0
  31. package/server/index.js +3731 -0
  32. package/{shared_methods.ts → shared_methods.d.ts} +1 -18
  33. package/shared_methods.d.ts.map +1 -0
  34. package/tests/index.test.d.ts +1 -0
  35. package/tests/index.test.d.ts.map +1 -0
  36. package/.github/workflows/publish.yml +0 -50
  37. package/.prettierrc.json +0 -3
  38. package/babel.config.json +0 -13
  39. package/configs.ts +0 -26
  40. package/index.node.ts +0 -51
  41. package/index.web.ts +0 -47
  42. package/lib/block.ts +0 -42
  43. package/lib/blockchain.ts +0 -14
  44. package/lib/custom/custom_shared_methods.ts +0 -92
  45. package/lib/custom/shared_methods.web.ts +0 -123
  46. package/lib/factory.ts +0 -32
  47. package/lib/peer.ts +0 -50
  48. package/lib/saito_factory.ts +0 -18
  49. package/lib/slip.ts +0 -119
  50. package/lib/transaction.ts +0 -179
  51. package/lib/wallet.ts +0 -61
  52. package/saito.ts +0 -404
  53. package/tests/index.test.ts +0 -35
  54. package/tsconfig.json +0 -111
  55. package/tsconfig.testing.json +0 -19
  56. package/webpack.config.js +0 -136
  57. package/webpack.prod.config.js +0 -136
package/saito.ts DELETED
@@ -1,404 +0,0 @@
1
- import SharedMethods from "./shared_methods";
2
- import Transaction from "./lib/transaction";
3
- import Block from "./lib/block";
4
- import Factory from "./lib/factory";
5
- import Peer from "./lib/peer";
6
- import Wallet, {DefaultEmptyPrivateKey} from "./lib/wallet";
7
- import Blockchain from "./lib/blockchain";
8
-
9
- // export enum MessageType {
10
- // HandshakeChallenge = 1,
11
- // HandshakeResponse,
12
- // //HandshakeCompletion,
13
- // ApplicationMessage = 4,
14
- // Block,
15
- // Transaction,
16
- // BlockchainRequest,
17
- // BlockHeaderHash,
18
- // Ping,
19
- // SPVChain,
20
- // Services,
21
- // GhostChain,
22
- // GhostChainRequest,
23
- // Result,
24
- // Error,
25
- // ApplicationTransaction,
26
- // }
27
-
28
- export default class Saito {
29
- private static instance: Saito;
30
- private static libInstance: any;
31
- sockets: Map<bigint, any> = new Map<bigint, any>();
32
- nextIndex: bigint = BigInt(0);
33
- factory = new Factory();
34
- promises = new Map<number, any>();
35
- private callbackIndex: number = 1;
36
- private wallet: Wallet | null = null;
37
- private blockchain: Blockchain | null = null;
38
-
39
- public static async initialize(
40
- configs: any,
41
- sharedMethods: SharedMethods,
42
- factory = new Factory(),
43
- privateKey: string
44
- ) {
45
- this.instance = new Saito(factory);
46
-
47
- // @ts-ignore
48
- globalThis.shared_methods = {
49
- send_message: (peer_index: bigint, buffer: Uint8Array) => {
50
- sharedMethods.sendMessage(peer_index, buffer);
51
- },
52
- send_message_to_all: (buffer: Uint8Array, exceptions: Array<bigint>) => {
53
- sharedMethods.sendMessageToAll(buffer, exceptions);
54
- },
55
- connect_to_peer: (peer_data: any) => {
56
- sharedMethods.connectToPeer(peer_data);
57
- },
58
- write_value: (key: string, value: Uint8Array) => {
59
- return sharedMethods.writeValue(key, value);
60
- },
61
- read_value: (key: string) => {
62
- return sharedMethods.readValue(key);
63
- },
64
- load_block_file_list: () => {
65
- return sharedMethods.loadBlockFileList();
66
- },
67
- is_existing_file: (key: string) => {
68
- return sharedMethods.isExistingFile(key);
69
- },
70
- remove_value: (key: string) => {
71
- return sharedMethods.removeValue(key);
72
- },
73
- disconnect_from_peer: (peer_index: bigint) => {
74
- return sharedMethods.disconnectFromPeer(peer_index);
75
- },
76
- fetch_block_from_peer: (hash: Uint8Array, peer_index: bigint, url: string) => {
77
- console.log("fetching block : " + url);
78
- sharedMethods.fetchBlockFromPeer(url).then((buffer: Uint8Array) => {
79
- Saito.getLibInstance().process_fetched_block(buffer, hash, peer_index);
80
- });
81
- },
82
- process_api_call: (buffer: Uint8Array, msgIndex: number, peerIndex: bigint) => {
83
- return sharedMethods.processApiCall(buffer, msgIndex, peerIndex).then(() => {
84
- });
85
- },
86
- process_api_success: (buffer: Uint8Array, msgIndex: number, peerIndex: bigint) => {
87
- return sharedMethods.processApiSuccess(buffer, msgIndex, peerIndex);
88
- },
89
- process_api_error: (buffer: Uint8Array, msgIndex: number, peerIndex: bigint) => {
90
- return sharedMethods.processApiError(buffer, msgIndex, peerIndex);
91
- },
92
- send_interface_event: (event: string, peerIndex: bigint) => {
93
- return sharedMethods.sendInterfaceEvent(event, peerIndex);
94
- },
95
- save_wallet: (wallet: any) => {
96
- return sharedMethods.saveWallet(wallet);
97
- },
98
- load_wallet: (wallet: any) => {
99
- return sharedMethods.loadWallet(wallet);
100
- },
101
- save_blockchain: (blockchain: any) => {
102
- return sharedMethods.saveBlockchain(blockchain);
103
- },
104
- load_blockchain: (blockchain: any) => {
105
- return sharedMethods.loadBlockchain(blockchain);
106
- },
107
- };
108
- if (privateKey === "") {
109
- privateKey = DefaultEmptyPrivateKey;
110
- }
111
- await Saito.getLibInstance().initialize(JSON.stringify(configs), privateKey);
112
-
113
- console.log("saito initialized");
114
-
115
- setInterval(() => {
116
- Saito.getLibInstance().process_timer_event(BigInt(100));
117
- // console.log(`WASM memory usage is ${wasm.memory.buffer.byteLength} bytes`);
118
- }, 100);
119
- }
120
-
121
- constructor(factory: Factory) {
122
- this.factory = factory;
123
- }
124
-
125
- public static getInstance(): Saito {
126
- return Saito.instance;
127
- }
128
-
129
- public static getLibInstance(): any {
130
- return Saito.libInstance;
131
- }
132
-
133
- public static setLibInstance(instance: any) {
134
- Saito.libInstance = instance;
135
- }
136
-
137
- public addNewSocket(socket: any): bigint {
138
- this.nextIndex++;
139
- this.sockets.set(this.nextIndex, socket);
140
- return this.nextIndex;
141
- }
142
-
143
- public getSocket(index: bigint): any | null {
144
- return this.sockets.get(index);
145
- }
146
-
147
- public removeSocket(index: bigint) {
148
- let socket = this.sockets.get(index);
149
- this.sockets.delete(index);
150
- socket.close();
151
- }
152
-
153
- public async initialize(configs: any): Promise<any> {
154
- return Saito.getLibInstance().initialize(configs);
155
- }
156
-
157
- public async getLatestBlockHash(): Promise<string> {
158
- return Saito.getLibInstance().get_latest_block_hash();
159
- }
160
-
161
- public async getBlock<B extends Block>(blockHash: string): Promise<B> {
162
- let block = await Saito.getLibInstance().get_block(blockHash);
163
- return Saito.getInstance().factory.createBlock(block) as B;
164
- }
165
-
166
- // public async getPublicKey(): Promise<string> {
167
- // return Saito.getLibInstance().get_public_key();
168
- // }
169
- //
170
- // public async getPrivateKey(): Promise<string> {
171
- // return Saito.getLibInstance().get_private_key();
172
- // }
173
-
174
- public async processNewPeer(index: bigint, peer_config: any): Promise<void> {
175
- return Saito.getLibInstance().process_new_peer(index, peer_config);
176
- }
177
-
178
- public async processPeerDisconnection(peer_index: bigint): Promise<void> {
179
- return Saito.getLibInstance().process_peer_disconnection(peer_index);
180
- }
181
-
182
- public async processMsgBufferFromPeer(buffer: Uint8Array, peer_index: bigint): Promise<void> {
183
- return Saito.getLibInstance().process_msg_buffer_from_peer(buffer, peer_index);
184
- }
185
-
186
- public async processFetchedBlock(
187
- buffer: Uint8Array,
188
- hash: Uint8Array,
189
- peer_index: bigint
190
- ): Promise<void> {
191
- return Saito.getLibInstance().process_fetched_block(buffer, hash, peer_index);
192
- }
193
-
194
- public async processTimerEvent(duration_in_ms: bigint): Promise<void> {
195
- return Saito.getLibInstance().process_timer_event(duration_in_ms);
196
- }
197
-
198
- public hash(buffer: Uint8Array): string {
199
- return Saito.getLibInstance().hash(buffer);
200
- }
201
-
202
- public signBuffer(buffer: Uint8Array, privateKey: String): string {
203
- return Saito.getLibInstance().sign_buffer(buffer, privateKey);
204
- }
205
-
206
- public verifySignature(buffer: Uint8Array, signature: string, publicKey: string): boolean {
207
- return Saito.getLibInstance().verify_signature(buffer, signature, publicKey);
208
- }
209
-
210
- public async createTransaction<T extends Transaction>(
211
- publickey = "",
212
- amount = BigInt(0),
213
- fee = BigInt(0),
214
- force_merge = false
215
- ): Promise<T> {
216
- let wasmTx = await Saito.getLibInstance().create_transaction(
217
- publickey,
218
- amount,
219
- fee,
220
- force_merge
221
- );
222
- let tx = Saito.getInstance().factory.createTransaction(wasmTx) as T;
223
- tx.timestamp = new Date().getTime();
224
- return tx;
225
- }
226
-
227
- // public async signTransaction(tx: Transaction): Promise<Transaction> {
228
- // tx.packData();
229
- // await tx.wasmTransaction.sign();
230
- // return tx;
231
- // }
232
-
233
- // public async getPendingTransactions<Tx extends Transaction>(): Promise<Array<Tx>> {
234
- // let txs = await Saito.getLibInstance().get_pending_txs();
235
- // return txs.map((tx: any) => Saito.getInstance().factory.createTransaction(tx));
236
- // }
237
-
238
- // public async signAndEncryptTransaction(tx: Transaction) {
239
- // return tx.wasmTransaction.sign_and_encrypt();
240
- // }
241
-
242
- // public async getBalance(): Promise<bigint> {
243
- // return Saito.getLibInstance().get_balance();
244
- // }
245
-
246
- public async getPeers(): Promise<Array<Peer>> {
247
- let peers = await Saito.getLibInstance().get_peers();
248
- return peers.map((peer: any) => {
249
- return this.factory.createPeer(peer);
250
- });
251
- }
252
-
253
- public async getPeer(index: bigint): Promise<Peer | null> {
254
- let peer = await Saito.getLibInstance().get_peer(index);
255
- if (!peer) {
256
- return null;
257
- }
258
- return this.factory.createPeer(peer);
259
- }
260
-
261
- public generatePrivateKey(): string {
262
- return Saito.getLibInstance().generate_private_key();
263
- }
264
-
265
- public generatePublicKey(privateKey: string): string {
266
- return Saito.getLibInstance().generate_public_key(privateKey);
267
- }
268
-
269
- public async propagateTransaction(tx: Transaction) {
270
- return Saito.getLibInstance().propagate_transaction(tx.wasmTransaction);
271
- }
272
-
273
- public async sendApiCall(
274
- buffer: Uint8Array,
275
- peerIndex: bigint,
276
- waitForReply: boolean
277
- ): Promise<Uint8Array> {
278
- console.log("saito.sendApiCall : peer = " + peerIndex + " wait for reply = " + waitForReply);
279
- let callbackIndex = this.callbackIndex++;
280
- if (waitForReply) {
281
- return new Promise((resolve, reject) => {
282
- this.promises.set(callbackIndex, {
283
- resolve,
284
- reject,
285
- });
286
- Saito.getLibInstance().send_api_call(buffer, callbackIndex, peerIndex);
287
- });
288
- } else {
289
- return Saito.getLibInstance().send_api_call(buffer, callbackIndex, peerIndex);
290
- }
291
- }
292
-
293
- public async sendApiSuccess(msgId: number, buffer: Uint8Array, peerIndex: bigint) {
294
- await Saito.getLibInstance().send_api_success(buffer, msgId, peerIndex);
295
- }
296
-
297
- public async sendApiError(msgId: number, buffer: Uint8Array, peerIndex: bigint) {
298
- await Saito.getLibInstance().send_api_error(buffer, msgId, peerIndex);
299
- }
300
-
301
- public async sendTransactionWithCallback(
302
- transaction: Transaction,
303
- callback?: any,
304
- peerIndex?: bigint
305
- ): Promise<any> {
306
- // TODO : implement retry on fail
307
- // TODO : stun code goes here probably???
308
- console.log(
309
- "saito.sendTransactionWithCallback : peer = " + peerIndex + " sig = " + transaction.signature
310
- );
311
- let buffer = transaction.wasmTransaction.serialize();
312
- console.log(
313
- "sendTransactionWithCallback : " +
314
- peerIndex +
315
- " with length : " +
316
- buffer.byteLength +
317
- " sent : ",
318
- transaction.msg
319
- );
320
- await this.sendApiCall(buffer, peerIndex || BigInt(0), !!callback)
321
- .then((buffer: Uint8Array) => {
322
- if (callback) {
323
- // console.log("deserializing tx. buffer length = " + buffer.byteLength);
324
- console.log("sendTransactionWithCallback. buffer length = " + buffer.byteLength);
325
-
326
- let tx = this.factory.createTransaction();
327
- tx.data = buffer;
328
- tx.unpackData();
329
- // let tx = Transaction.deserialize(buffer, this.factory);
330
- // if (tx) {
331
- // console.log("sendTransactionWithCallback received : ", tx);
332
- // return callback(tx.data);
333
- // } else {
334
- // console.log("sendTransactionWithCallback sending direct buffer since tx deserialization failed");
335
- return callback(tx);
336
- // }
337
- }
338
- })
339
- .catch((error) => {
340
- console.error(error);
341
- if (callback) {
342
- return callback({err: error.toString()});
343
- }
344
- });
345
- }
346
-
347
- public async propagateServices(peerIndex: bigint, services: string[]) {
348
- return Saito.getLibInstance().propagate_services(peerIndex, services);
349
- }
350
-
351
- public async sendRequest(
352
- message: string,
353
- data: any = "",
354
- callback?: any,
355
- peerIndex?: bigint
356
- ): Promise<any> {
357
- console.log("saito.sendRequest : peer = " + peerIndex);
358
- let wallet = await this.getWallet();
359
- let publicKey = await wallet.getPublicKey();
360
- let tx = await this.createTransaction(publicKey, BigInt(0), BigInt(0));
361
- tx.msg = {
362
- request: message,
363
- data: data,
364
- };
365
- tx.packData();
366
- return this.sendTransactionWithCallback(
367
- tx,
368
- (tx: Transaction) => {
369
- if (callback) {
370
- return callback(tx.msg);
371
- }
372
- },
373
- peerIndex
374
- );
375
- }
376
-
377
- public async getWallet() {
378
- if (!this.wallet) {
379
- let w = await Saito.getLibInstance().get_wallet();
380
- this.wallet = this.factory.createWallet(w);
381
- }
382
- return this.wallet;
383
- }
384
-
385
- public async getBlockchain() {
386
- if (!this.blockchain) {
387
- let b = await Saito.getLibInstance().get_blockchain();
388
- this.blockchain = this.factory.createBlockchain(b);
389
- }
390
- return this.blockchain;
391
- }
392
-
393
- // public async loadWallet() {
394
- // return Saito.getLibInstance().load_wallet();
395
- // }
396
- //
397
- // public async saveWallet() {
398
- // return Saito.getLibInstance().save_wallet();
399
- // }
400
- //
401
- // public async resetWallet() {
402
- // return Saito.getLibInstance().reset_wallet();
403
- // }
404
- }
@@ -1,35 +0,0 @@
1
- // // @ts-ignore
2
- // import {expect} from "chai";
3
- // import SaitoJs from "../index";
4
- //
5
- //
6
- // describe('setup test', function () {
7
- // it('should load the wasm lib correctly', async function () {
8
- // console.log("loading...");
9
- //
10
- // // // @ts-ignore
11
- // // const s = await import("saito-wasm/dist/server");
12
- // // // @ts-ignore
13
- // //
14
- // // console.log("s = ", s);
15
- // // // @ts-ignore
16
- // // let s1 = await s;
17
- // // console.log("s1 = ", s1);
18
- // // // @ts-ignore
19
- // // let saito = s1.default;
20
- // // // console.log("s2 = ", saito);
21
- // //
22
- // // expect(saito).to.exist;
23
- // // // let s = await saito.default;
24
- // // // console.log(s);
25
- // // console.log("lib test 2 = ", saito);
26
- // let result = await SaitoJs.initialize();
27
- // expect(result).to.equal("initialized");
28
- //
29
- // let saito = SaitoJs.getInstance();
30
- //
31
- // expect(saito).to.exist;
32
- // expect(saito.get_public_key).to.exist;
33
- // expect(saito.get_public_key()).to.equal("publickey");
34
- // });
35
- // });
package/tsconfig.json DELETED
@@ -1,111 +0,0 @@
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": "es2020",
15
- /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
16
- // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
17
- // "jsx": "preserve", /* Specify what JSX code is generated. */
18
- // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
19
- // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
20
- // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h' */
21
- // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
22
- // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.` */
23
- // "reactNamespace": "", /* Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit. */
24
- // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
25
- // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
26
-
27
- /* Modules */
28
- "module": "es2020",
29
- /* Specify what module code is generated. */
30
- // "rootDir": "./", /* Specify the root folder within your source files. */
31
- "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
32
- // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
33
- // "paths": {
34
- // "*": ["saito-wasm","./node_modules/saito-wasm/dist/types/pkg/node/index.d.ts"]
35
- // }, /* Specify a set of entries that re-map imports to additional lookup locations. */
36
- // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
37
- // "typeRoots": [], /* Specify multiple folders that act like `./node_modules/@types`. */
38
- // "types": [], /* Specify type package names to be included without being referenced in a source file. */
39
- // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
40
- // "resolveJsonModule": true, /* Enable importing .json files */
41
- // "noResolve": true, /* Disallow `import`s, `require`s or `<reference>`s from expanding the number of files TypeScript should add to a project. */
42
-
43
- /* JavaScript Support */
44
- // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. */
45
- // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
46
- // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`. */
47
-
48
- /* Emit */
49
- "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
50
- "declarationMap": true, /* Create sourcemaps for d.ts files. */
51
- // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
52
- "sourceMap": true,
53
- /* Create source map files for emitted JavaScript files. */
54
- // "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. */
55
- "outDir": "dist",
56
- /* Specify an output folder for all emitted files. */
57
- // "removeComments": true, /* Disable emitting comments. */
58
- // "noEmit": true, /* Disable emitting files from a compilation. */
59
- // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
60
- // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types */
61
- // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
62
- // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
63
- // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
64
- // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
65
- // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
66
- // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
67
- // "newLine": "crlf", /* Set the newline character for emitting files. */
68
- // "stripInternal": true, /* Disable emitting declarations that have `@internal` in their JSDoc comments. */
69
- // "noEmitHelpers": true, /* Disable generating custom helper functions like `__extends` in compiled output. */
70
- // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
71
- // "preserveConstEnums": true, /* Disable erasing `const enum` declarations in generated code. */
72
- // "declarationDir": "./", /* Specify the output directory for generated declaration files. */
73
- // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
74
-
75
- /* Interop Constraints */
76
- // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
77
- "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
78
- "esModuleInterop": true,
79
- /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */
80
- // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
81
- "forceConsistentCasingInFileNames": true,
82
- /* Ensure that casing is correct in imports. */
83
-
84
- /* Type Checking */
85
- "strict": true,
86
- /* Enable all strict type-checking options. */
87
- // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied `any` type.. */
88
- // "strictNullChecks": true, /* When type checking, take into account `null` and `undefined`. */
89
- // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
90
- // "strictBindCallApply": true, /* Check that the arguments for `bind`, `call`, and `apply` methods match the original function. */
91
- // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
92
- // "noImplicitThis": true, /* Enable error reporting when `this` is given the type `any`. */
93
- // "useUnknownInCatchVariables": true, /* Type catch clause variables as 'unknown' instead of 'any'. */
94
- // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
95
- // "noUnusedLocals": true, /* Enable error reporting when a local variables aren't read. */
96
- // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read */
97
- // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
98
- // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
99
- // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
100
- // "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */
101
- // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
102
- // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type */
103
- // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
104
- // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
105
-
106
- /* Completeness */
107
- // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
108
- "skipLibCheck": true
109
- /* Skip type checking all .d.ts files. */
110
- }
111
- }
@@ -1,19 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "module": "commonjs",
4
- "target": "es2015",
5
- "lib": [
6
- "es2017"
7
- ],
8
- "declaration": false,
9
- "noImplicitAny": false,
10
- "removeComments": true,
11
- "inlineSourceMap": true,
12
- "moduleResolution": "node"
13
- },
14
- "include": [
15
- "scripts/**/*.ts",
16
- "src/**/*.ts",
17
- "node_modules/lodash-es/**/*.js"
18
- ]
19
- }