fix model

This commit is contained in:
2023-03-03 09:09:03 +01:00
parent 93d9a8f79e
commit 5027eebb0d
11 changed files with 397 additions and 97 deletions
+145
View File
@@ -0,0 +1,145 @@
"use strict";
/*
* For a detailed explanation regarding each configuration property and type check, visit:
* https://jestjs.io/docs/configuration
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = {
// All imported modules in your tests should be mocked automatically
// automock: false,
// Stop running tests after `n` failures
// bail: 0,
// The directory where Jest should store its cached dependency information
// cacheDirectory: "C:\\Users\\legon\\AppData\\Local\\Temp\\jest",
// Automatically clear mock calls, instances, contexts and results before every test
// clearMocks: false,
// Indicates whether the coverage information should be collected while executing the test
collectCoverage: true,
// An array of glob patterns indicating a set of files for which coverage information should be collected
// collectCoverageFrom: undefined,
// The directory where Jest should output its coverage files
coverageDirectory: "coverage",
// An array of regexp pattern strings used to skip coverage collection
// coveragePathIgnorePatterns: [
// "\\\\node_modules\\\\"
// ],
// Indicates which provider should be used to instrument code for coverage
// coverageProvider: "babel",
// A list of reporter names that Jest uses when writing coverage reports
// coverageReporters: [
// "json",
// "text",
// "lcov",
// "clover"
// ],
// An object that configures minimum threshold enforcement for coverage results
// coverageThreshold: undefined,
// A path to a custom dependency extractor
// dependencyExtractor: undefined,
// Make calling deprecated APIs throw helpful error messages
// errorOnDeprecated: false,
// The default configuration for fake timers
// fakeTimers: {
// "enableGlobally": false
// },
// Force coverage collection from ignored files using an array of glob patterns
// forceCoverageMatch: [],
// A path to a module which exports an async function that is triggered once before all test suites
// globalSetup: undefined,
// A path to a module which exports an async function that is triggered once after all test suites
// globalTeardown: undefined,
// A set of global variables that need to be available in all test environments
// globals: {},
// The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers.
// maxWorkers: "50%",
// An array of directory names to be searched recursively up from the requiring module's location
// moduleDirectories: [
// "node_modules"
// ],
// An array of file extensions your modules use
// moduleFileExtensions: [
// "js",
// "mjs",
// "cjs",
// "jsx",
// "ts",
// "tsx",
// "json",
// "node"
// ],
// A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
// moduleNameMapper: {},
// An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
// modulePathIgnorePatterns: [],
// Activates notifications for test results
// notify: false,
// An enum that specifies notification mode. Requires { notify: true }
// notifyMode: "failure-change",
// A preset that is used as a base for Jest's configuration
// preset: undefined,
// Run tests from one or more projects
// projects: undefined,
// Use this configuration option to add custom reporters to Jest
// reporters: undefined,
// Automatically reset mock state before every test
// resetMocks: false,
// Reset the module registry before running each individual test
// resetModules: false,
// A path to a custom resolver
// resolver: undefined,
// Automatically restore mock state and implementation before every test
// restoreMocks: false,
// The root directory that Jest should scan for tests and modules within
// rootDir: undefined,
// A list of paths to directories that Jest should use to search for files in
// roots: [
// "<rootDir>"
// ],
// Allows you to use a custom runner instead of Jest's default test runner
// runner: "jest-runner",
// The paths to modules that run some code to configure or set up the testing environment before each test
// setupFiles: [],
// A list of paths to modules that run some code to configure or set up the testing framework before each test
// setupFilesAfterEnv: [],
// The number of seconds after which a test is considered as slow and reported as such in the results.
// slowTestThreshold: 5,
// A list of paths to snapshot serializer modules Jest should use for snapshot testing
// snapshotSerializers: [],
// The test environment that will be used for testing
// testEnvironment: "jest-environment-node",
// Options that will be passed to the testEnvironment
// testEnvironmentOptions: {},
// Adds a location field to test results
// testLocationInResults: false,
// The glob patterns Jest uses to detect test files
// testMatch: [
// "**/__tests__/**/*.[jt]s?(x)",
// "**/?(*.)+(spec|test).[tj]s?(x)"
// ],
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
// testPathIgnorePatterns: [
// "\\\\node_modules\\\\"
// ],
// The regexp pattern or array of patterns that Jest uses to detect test files
// testRegex: [],
// This option allows the use of a custom results processor
// testResultsProcessor: undefined,
// This option allows use of a custom test runner
// testRunner: "jest-circus/runner",
// A map from regular expressions to paths to transformers
// transform: undefined,
// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
// transformIgnorePatterns: [
// "\\\\node_modules\\\\",
// "\\.pnp\\.[^\\\\]+$"
// ],
// An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them
// unmockedModulePathPatterns: undefined,
// Indicates whether each individual test should be reported during the run
// verbose: undefined,
// An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode
// watchPathIgnorePatterns: [],
// Whether to use watchman for file crawling
// watchman: true,
};
//# sourceMappingURL=jest.config.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"jest.config.js","sourceRoot":"","sources":["jest.config.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAEH,kBAAe;IACb,oEAAoE;IACpE,mBAAmB;IAEnB,wCAAwC;IACxC,WAAW;IAEX,0EAA0E;IAC1E,kEAAkE;IAElE,oFAAoF;IACpF,qBAAqB;IAErB,0FAA0F;IAC1F,eAAe,EAAE,IAAI;IAErB,yGAAyG;IACzG,kCAAkC;IAElC,4DAA4D;IAC5D,iBAAiB,EAAE,UAAU;IAE7B,sEAAsE;IACtE,gCAAgC;IAChC,2BAA2B;IAC3B,KAAK;IAEL,0EAA0E;IAC1E,6BAA6B;IAE7B,wEAAwE;IACxE,uBAAuB;IACvB,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,aAAa;IACb,KAAK;IAEL,+EAA+E;IAC/E,gCAAgC;IAEhC,0CAA0C;IAC1C,kCAAkC;IAElC,4DAA4D;IAC5D,4BAA4B;IAE5B,4CAA4C;IAC5C,gBAAgB;IAChB,4BAA4B;IAC5B,KAAK;IAEL,+EAA+E;IAC/E,0BAA0B;IAE1B,mGAAmG;IACnG,0BAA0B;IAE1B,kGAAkG;IAClG,6BAA6B;IAE7B,+EAA+E;IAC/E,eAAe;IAEf,iOAAiO;IACjO,qBAAqB;IAErB,iGAAiG;IACjG,uBAAuB;IACvB,mBAAmB;IACnB,KAAK;IAEL,+CAA+C;IAC/C,0BAA0B;IAC1B,UAAU;IACV,WAAW;IACX,WAAW;IACX,WAAW;IACX,UAAU;IACV,WAAW;IACX,YAAY;IACZ,WAAW;IACX,KAAK;IAEL,oIAAoI;IACpI,wBAAwB;IAExB,wHAAwH;IACxH,gCAAgC;IAEhC,2CAA2C;IAC3C,iBAAiB;IAEjB,sEAAsE;IACtE,gCAAgC;IAEhC,2DAA2D;IAC3D,qBAAqB;IAErB,sCAAsC;IACtC,uBAAuB;IAEvB,gEAAgE;IAChE,wBAAwB;IAExB,mDAAmD;IACnD,qBAAqB;IAErB,gEAAgE;IAChE,uBAAuB;IAEvB,8BAA8B;IAC9B,uBAAuB;IAEvB,wEAAwE;IACxE,uBAAuB;IAEvB,wEAAwE;IACxE,sBAAsB;IAEtB,6EAA6E;IAC7E,WAAW;IACX,gBAAgB;IAChB,KAAK;IAEL,0EAA0E;IAC1E,yBAAyB;IAEzB,0GAA0G;IAC1G,kBAAkB;IAElB,8GAA8G;IAC9G,0BAA0B;IAE1B,sGAAsG;IACtG,wBAAwB;IAExB,sFAAsF;IACtF,2BAA2B;IAE3B,qDAAqD;IACrD,4CAA4C;IAE5C,qDAAqD;IACrD,8BAA8B;IAE9B,wCAAwC;IACxC,gCAAgC;IAEhC,mDAAmD;IACnD,eAAe;IACf,mCAAmC;IACnC,qCAAqC;IACrC,KAAK;IAEL,wGAAwG;IACxG,4BAA4B;IAC5B,2BAA2B;IAC3B,KAAK;IAEL,8EAA8E;IAC9E,iBAAiB;IAEjB,2DAA2D;IAC3D,mCAAmC;IAEnC,iDAAiD;IACjD,oCAAoC;IAEpC,0DAA0D;IAC1D,wBAAwB;IAExB,4HAA4H;IAC5H,6BAA6B;IAC7B,4BAA4B;IAC5B,yBAAyB;IACzB,KAAK;IAEL,6IAA6I;IAC7I,yCAAyC;IAEzC,2EAA2E;IAC3E,sBAAsB;IAEtB,mHAAmH;IACnH,+BAA+B;IAE/B,4CAA4C;IAC5C,kBAAkB;CACnB,CAAC"}
+1 -1
View File
@@ -372,7 +372,7 @@ components:
- attacker_type - attacker_type
- victim - victim
PlayerID: PlayerID:
title: EntityID title: PlayerId
x-stoplight: x-stoplight:
id: 9icavmq5bgsqp id: 9icavmq5bgsqp
type: integer type: integer
+10 -23
View File
@@ -1,7 +1,7 @@
import { Kysely, PostgresDialect } from 'kysely' import { InsertObject, Kysely, PostgresDialect } from 'kysely'
import { Pool } from 'pg' import { Pool } from 'pg'
import migrateToLatest from './migrations' import migrateToLatest from './migrations'
import Database from './model' import Database, { KillTable } from './model'
const migration = migrateToLatest() const migration = migrateToLatest()
// You'd create one of these when you start your app. // You'd create one of these when you start your app.
@@ -17,28 +17,15 @@ const db = new Kysely<Database>({
}) })
}) })
interface KillRecord { interface RemoveFromKill {
server: string id: unknown
attacker: number unix_time: unknown
victim: number
weapon: number
map: number
distance: number
date: Date
} }
export async function CreateKillRecord({
server, type KillRecord = Omit<KillTable, keyof RemoveFromKill>
attacker,
victim, export async function CreateKillRecord(data: KillRecord) {
weapon, await db.insertInto('kill').values({ ...data })
map,
distance,
date
}: KillRecord) {
await db
.insertInto('kill')
.values({ server, attacker, victim, weapon, map, distance })
.execute()
} }
/* /*
async function demo() { async function demo() {
+56 -44
View File
@@ -1,54 +1,66 @@
import { Kysely, sql } from "kysely"; import { Kysely, sql } from 'kysely'
export async function up(db: Kysely<any>): Promise<void> { export async function up(db: Kysely<any>): Promise<void> {
await db.schema await db.schema
.createTable("entity") .createTable('player')
.addColumn("id", "integer", (col) => col.unique().primaryKey()) .addColumn('id', 'integer', (col) => col.unique().primaryKey())
.addColumn("name", "varchar") .addColumn('name', 'varchar')
.execute(); .addColumn('optout', 'boolean')
.addColumn('hide_TOS', 'boolean')
.execute()
await db.schema await db.schema
.createTable("weapon") .createTable('weapon')
.addColumn("id", "varchar", (col) => col.unique().primaryKey()) .addColumn('id', 'varchar', (col) => col.unique().primaryKey())
.addColumn("name", "varchar") .addColumn('name', 'varchar')
.addColumn("description", "varchar") .addColumn('description', 'varchar')
.addColumn("image", "varchar") .addColumn('image', 'varchar')
.execute(); .execute()
await db.schema await db.schema
.createTable("map") .createTable('map')
.addColumn("id", "varchar", (col) => col.unique().primaryKey()) .addColumn('id', 'varchar', (col) => col.unique().primaryKey())
.addColumn("name", "varchar") .addColumn('name', 'varchar')
.addColumn("description", "varchar") .addColumn('description', 'varchar')
.addColumn("image", "varchar") .addColumn('image', 'varchar')
.execute(); .execute()
await db.schema await db.schema
.createTable("server") .createTable('server')
.addColumn("name", "varchar", (col) => col.unique().primaryKey()) .addColumn('id', 'integer')
.addColumn("description", "varchar") .addColumn('name', 'varchar', (col) => col.unique().primaryKey())
.addColumn("token", "varchar") .addColumn('description', 'varchar')
.execute(); .addColumn('token', 'varchar')
.execute()
await db.schema await db.schema
.createTable("kill") .createTable('kill')
.addColumn("id", "serial", (col) => col.primaryKey()) .addColumn('id', 'serial', (col) => col.primaryKey())
.addColumn("server", "varchar", (col) => .addColumn('server', 'integer', (col) =>
col.references("server.name").notNull() col.references('server.id').notNull().onDelete('cascade')
) )
.addColumn("attacker", "integer", (col) => .addColumn('damage_source', 'varchar')
col.references("entity.id").notNull() .addColumn('attacker', 'integer')
) .addColumn('attacker_type', 'varchar')
.addColumn("victim", "integer", (col) => .addColumn('attacker_weapon', 'varchar')
col.references("entity.id").notNull() .addColumn('attacker_weapon_2', 'varchar')
) .addColumn('attacker_weapon_3', 'varchar')
.addColumn("weapon", "varchar", (col) => .addColumn('attacker_ordnance', 'varchar')
col.references("weapon.id").notNull() .addColumn('attacker_ability', 'varchar')
) .addColumn('attacker_kit_1', 'varchar')
.addColumn("map", "varchar", (col) => col.references("map.id").notNull()) .addColumn('attacker_kit_2', 'varchar')
.addColumn("distance", "integer", (col) => col.notNull()) .addColumn('victim', 'integer')
.addColumn("date", "varchar", (col) => col.defaultTo(sql`now()`).notNull()) .addColumn('victim_weapon', 'varchar')
.execute(); .addColumn('victim_weapon_2', 'integer')
.addColumn('victim_weapon_3', 'integer')
.addColumn('victim_ordnance', 'integer')
.addColumn('victim_ability', 'integer')
.addColumn('victim_kit_1', 'integer')
.addColumn('victim_kit_2', 'integer')
.addColumn('map', 'varchar')
.addColumn('distance', 'integer')
.addColumn('date', 'varchar', (col) => col.defaultTo(sql`now()`).notNull())
.execute()
/*await db.schema /*await db.schema
.createTable("pet") .createTable("pet")
@@ -68,9 +80,9 @@ export async function up(db: Kysely<any>): Promise<void> {
} }
export async function down(db: Kysely<any>): Promise<void> { export async function down(db: Kysely<any>): Promise<void> {
await db.schema.dropTable("kill").execute(); await db.schema.dropTable('kill').execute()
await db.schema.dropTable("entity").execute(); await db.schema.dropTable('entity').execute()
await db.schema.dropTable("weapon").execute(); await db.schema.dropTable('weapon').execute()
await db.schema.dropTable("map").execute(); await db.schema.dropTable('map').execute()
await db.schema.dropTable("server").execute(); await db.schema.dropTable('server').execute()
} }
+36 -7
View File
@@ -2,18 +2,47 @@ import { ColumnType, Generated } from 'kysely'
export interface KillTable { export interface KillTable {
id: Generated<number> id: Generated<number>
server: string server: number
attacker: number tone_version: string
victim: number match_id: string
weapon: string game_mode: string
map: string map: string
unix_time: Generated<Date>
game_time: number
player_count: number
attacker_name: string
attacker_id: number
attacker_current_weapon: string
attacker_current_weapon_mods: string
attacker_weapon_1: string
attacker_weapon_1_mods: string
attacker_weapon_2: string
attacker_weapon_2_mods: string
attacker_weapon_3: string
attacker_weapon_3_mods: string
attacker_offhand_weapon_1: string
attacker_offhand_weapon_2: string
victim_name: string
victim_id: number
victim_current_weapon: string
victim_current_weapon_mods: string
victim_weapon_1: string
victim_weapon_1_mods: string
victim_weapon_2: string
victim_weapon_2_mods: string
victim_weapon_3: string
victim_weapon_3_mods: string
victim_offhand_weapon_1: string
victim_offhand_weapon_2: string
cause_of_death: string
distance: number distance: number
date: ColumnType<Date, string | Date | undefined, never>
} }
interface EntityTable { interface PlayerTable {
id: number id: number
name: string name: string
'opt-out': boolean
hide_TOS: boolean
} }
interface WeaponTable { interface WeaponTable {
id: string id: string
@@ -34,7 +63,7 @@ interface ServerTable {
} }
interface Database { interface Database {
kill: KillTable kill: KillTable
entity: EntityTable player: PlayerTable
weapon: WeaponTable weapon: WeaponTable
maps: MapTable maps: MapTable
server: ServerTable server: ServerTable
+3 -1
View File
@@ -8,7 +8,9 @@ import server from './server'
console.log('dotenv') console.log('dotenv')
const app = express() const app = express()
const port = 3000 const port = 3001
app.use(express.json())
app.get('/', (req, res) => { app.get('/', (req, res) => {
res.send('Hello World!') res.send('Hello World!')
+124 -11
View File
@@ -1,23 +1,136 @@
import { Router } from 'express' import { Router } from 'express'
import { CreateKillRecord } from './db/db' import db, { CreateKillRecord } from './db/db'
import { body } from 'express-validator' import { body } from 'express-validator'
const router = Router() const router = Router()
//auth middleware //auth middleware, maybe some timeout ?
router.post('/*', (req, res, next) => { router.post('/*', (req, res, next) => {
next() next()
}) })
router.post( router.post(
'/severs/:serverId/kills', '/servers/:serverId/kills',
body('server').isString(), body(
body('attacker').isInt(), ['attacker_id', 'victim_id'],
body('victim').isInt(), 'attacker and victim must be player UIDs'
body('weapon').isString(), ).isInt(),
body('map').isString(), body(
body('distance').isInt(), [
'tone_version',
'match_id',
'game_mode',
'map',
'player_count',
'attacker_name',
'attacker_current_weapon',
'attacker_current_weapon_mods',
'attacker_weapon_1',
'attacker_weapon_1_mods',
'attacker_weapon_2',
'attacker_weapon_2_mods',
'attacker_weapon_3',
'attacker_weapon_3_mods',
'attacker_offhand_weapon_1',
'attacker_offhand_weapon_2',
'victim_name',
'victim_current_weapon',
'victim_current_weapon_mods',
'victim_weapon_1',
'victim_weapon_1_mods',
'victim_weapon_2',
'victim_weapon_2_mods',
'victim_weapon_3',
'victim_weapon_3_mods',
'victim_offhand_weapon_1',
'victim_offhand_weapon_2',
'cause_of_death'
],
'values must be composed of a maximum of 50 valid ascii characters'
)
.isString()
.isLength({ max: 50 })
.isAscii(),
body(
['distance', 'game_time'],
'distance and game_time must be postitive floats'
).isFloat({
min: 0
}),
body(
['cause_of_death', 'victim_id'],
'cause_of_death and victim_id are mandatory'
).notEmpty(),
(req, res, next) => { (req, res, next) => {
//CreateKillRecord({ server, attacker, victim, weapon, map, distance }) const server = 1 // set server ID here
res.send(400) const {
tone_version,
match_id,
game_mode,
map,
game_time,
player_count,
attacker_name,
attacker_id,
attacker_current_weapon,
attacker_current_weapon_mods,
attacker_weapon_1,
attacker_weapon_1_mods,
attacker_weapon_2,
attacker_weapon_2_mods,
attacker_weapon_3,
attacker_weapon_3_mods,
attacker_offhand_weapon_1,
attacker_offhand_weapon_2,
victim_name,
victim_id,
victim_current_weapon,
victim_current_weapon_mods,
victim_weapon_1,
victim_weapon_1_mods,
victim_weapon_2,
victim_weapon_2_mods,
victim_weapon_3,
victim_weapon_3_mods,
victim_offhand_weapon_1,
victim_offhand_weapon_2,
cause_of_death,
distance
} = req.body
CreateKillRecord({
tone_version,
server,
match_id,
game_mode,
map,
game_time,
player_count,
attacker_name,
attacker_id,
attacker_current_weapon,
attacker_current_weapon_mods,
attacker_weapon_1,
attacker_weapon_1_mods,
attacker_weapon_2,
attacker_weapon_2_mods,
attacker_weapon_3,
attacker_weapon_3_mods,
attacker_offhand_weapon_1,
attacker_offhand_weapon_2,
victim_name,
victim_id,
victim_current_weapon,
victim_current_weapon_mods,
victim_weapon_1,
victim_weapon_1_mods,
victim_weapon_2,
victim_weapon_2_mods,
victim_weapon_3,
victim_weapon_3_mods,
victim_offhand_weapon_1,
victim_offhand_weapon_2,
cause_of_death,
distance
})
res.send(200)
} }
) )
export default router export default router
+9
View File
@@ -0,0 +1,9 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const globals_1 = require("@jest/globals");
(0, globals_1.describe)('integer module', () => {
(0, globals_1.test)('3', () => {
(0, globals_1.expect)(3).toBe(3);
});
});
//# sourceMappingURL=tess.test.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"tess.test.js","sourceRoot":"","sources":["tess.test.ts"],"names":[],"mappings":";;AAAA,2CAAsD;AAEtD,IAAA,kBAAQ,EAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,IAAA,cAAI,EAAC,GAAG,EAAE,GAAG,EAAE;QACb,IAAA,gBAAM,EAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACnB,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
+11 -10
View File
@@ -11,7 +11,7 @@
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
/* Language and Environment */ /* Language and Environment */
"target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ "target": "es2016" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
// "jsx": "preserve", /* Specify what JSX code is generated. */ // "jsx": "preserve", /* Specify what JSX code is generated. */
// "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */ // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
@@ -25,8 +25,8 @@
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
/* Modules */ /* Modules */
"module": "commonjs", /* Specify what module code is generated. */ "module": "commonjs" /* Specify what module code is generated. */,
// "rootDir": "./", /* Specify the root folder within your source files. */ // "rootDir": "./" /* Specify the root folder within your source files. */,
// "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */ // "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
@@ -47,9 +47,9 @@
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
// "declarationMap": true, /* Create sourcemaps for d.ts files. */ // "declarationMap": true, /* Create sourcemaps for d.ts files. */
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
"sourceMap": true, /* Create source map files for emitted JavaScript files. */ "sourceMap": true /* Create source map files for emitted JavaScript files. */,
// "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. */ // "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. */
"outDir": "./out/", /* Specify an output folder for all emitted files. */ "outDir": "./out/" /* Specify an output folder for all emitted files. */,
// "removeComments": true, /* Disable emitting comments. */ // "removeComments": true, /* Disable emitting comments. */
// "noEmit": true, /* Disable emitting files from a compilation. */ // "noEmit": true, /* Disable emitting files from a compilation. */
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
@@ -71,12 +71,12 @@
/* Interop Constraints */ /* Interop Constraints */
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
/* Type Checking */ /* Type Checking */
"strict": true, /* Enable all strict type-checking options. */ "strict": true /* Enable all strict type-checking options. */,
// "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
// "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
@@ -98,6 +98,7 @@
/* Completeness */ /* Completeness */
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
"skipLibCheck": true /* Skip type checking all .d.ts files. */ "skipLibCheck": true /* Skip type checking all .d.ts files. */
} },
"compileOnSave": true
} }