├── .gitignore ├── .vscode └── launch.json ├── Intro OOP.pptx ├── Typescript intro.pptx ├── dist ├── alias.js ├── array.js ├── dump.ts ├── function.js ├── index.js ├── object.js └── other.js ├── package-lock.json ├── package.json ├── src ├── alias.ts ├── array.ts ├── function.ts ├── index.ts ├── module3 │ ├── asynchronous.ts │ ├── conditional-type.ts │ ├── generic-function.ts │ ├── generic-interface.ts │ ├── generic-keyof-constraints.ts │ ├── generic-type.ts │ ├── genric-constraints.ts │ ├── interface.ts │ ├── mapped-types.ts │ └── type-assertion.ts ├── module4 │ ├── abstraction.ts │ ├── access-modifiers.ts │ ├── getter-setter.ts │ ├── inheritence.ts │ ├── object.ts │ ├── polymorphisom.ts │ ├── static.ts │ └── type-guard.ts ├── nullable-unknown-never.ts ├── object.ts ├── other.ts ├── question-mark.ts └── union-intersection.ts └── tsconfig.json /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "type": "node", 9 | "request": "launch", 10 | "name": "Launch Program", 11 | "skipFiles": ["/**"], 12 | "program": "${workspaceFolder}\\src\\index.ts", 13 | "outFiles": ["${workspaceFolder}/**/*.js"] 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /Intro OOP.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apollo-Level2-Web-Dev/typescript-module-4/85c018aa88679ac17fb86b1daa4fe34c41487081/Intro OOP.pptx -------------------------------------------------------------------------------- /Typescript intro.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apollo-Level2-Web-Dev/typescript-module-4/85c018aa88679ac17fb86b1daa4fe34c41487081/Typescript intro.pptx -------------------------------------------------------------------------------- /dist/alias.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | const user = { 3 | name: 4 | }; 5 | -------------------------------------------------------------------------------- /dist/array.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | const names = ["abul ", "kabul", "babul", 77, , true]; 3 | const boyfriends = ["abul", true]; 4 | //number -> string 5 | -------------------------------------------------------------------------------- /dist/dump.ts: -------------------------------------------------------------------------------- 1 | // const searchStudent = (searchTerm: string | null) => { 2 | // if (searchTerm === null) { 3 | // console.log(`There is no search term.`); 4 | // } else { 5 | // console.log(`Searching.`); 6 | // } 7 | // }; 8 | 9 | // searchStudent(null); 10 | 11 | // const getSpeed = (param: unknown) => { 12 | // if (typeof param === "string") { 13 | // const speed = param.split(" "); 14 | // console.log(`Speed is ${speed[0]}`); 15 | // } else if (typeof param === "number") { 16 | // console.log(`Speed is ${param}`); 17 | // } else { 18 | // console.log(" Dure gia moro"); 19 | // } 20 | // }; 21 | 22 | // getSpeed(10); 23 | 24 | // getSpeed("10 kmh^-1"); 25 | 26 | // type myCrush = { 27 | // name: string; 28 | // }; 29 | 30 | // function fetchData() { 31 | // return new Promise((resolve, reject) => { 32 | // // perform some asynchronous operation, such as fetching data from a server 33 | // const data = "Some data fetched from the server"; 34 | // if (data) { 35 | // resolve({ name: "Kate" }); 36 | // } else { 37 | // reject("Failed to fetch data from the server"); 38 | // } 39 | // }); 40 | // } 41 | 42 | // async function fetchAndLogData() { 43 | // try { 44 | // const data = await fetchData(); 45 | // console.log("Fetched data:", data); 46 | // } catch (error: unknown) { 47 | // console.error("Failed to fetch data:", error); 48 | // } 49 | // } 50 | 51 | // type customErr = { 52 | // message: string; 53 | // }; 54 | // try { 55 | // } catch (error) { 56 | // (error as customErr).message; 57 | // } 58 | 59 | // type Operation = "add" | "concat"; 60 | 61 | // const calculateMath = (num1: number, num2: number, operation: Operation) => { 62 | // if (operation === "add") { 63 | // return num1 + num2; 64 | // } 65 | // return num1.toString() + num2.toString(); 66 | // }; 67 | 68 | // const res: string = calculateMath(2, 2, "add") as string; 69 | // const res2: string = calculateMath(2, 2, "concat") as string; 70 | 71 | // let baby: any; 72 | // baby = "hi"; 73 | 74 | // const l = (baby as string).length; 75 | -------------------------------------------------------------------------------- /dist/function.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | //normal function 3 | function add(num1, num2) { 4 | return num1 + num2; 5 | } 6 | const addArrow = (num1, num2) => num1 + num2; 7 | const arr = [1, 4, 5, 7]; 8 | const newArray = arr.map((elem) => elem * elem); 9 | const person = { 10 | name: "Mezba", 11 | balance: 5, 12 | addBalance(money) { 13 | console.log(`My New Balance is ${this.balance + money}`); 14 | }, 15 | }; 16 | -------------------------------------------------------------------------------- /dist/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | let course = undefined; 3 | course = "jj"; 4 | console.log(course); 5 | //Primitive Types 6 | //string 7 | //number 8 | //boolean 9 | //null 10 | //undefined 11 | -------------------------------------------------------------------------------- /dist/object.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | const user = { 3 | company: "Programming Hero", 4 | name: "Montu Mia", 5 | age: 52, 6 | isMarried: true, 7 | }; 8 | user.company = "Programming Hero"; 9 | -------------------------------------------------------------------------------- /dist/other.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | console.log("Hello"); 3 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "module-1", 3 | "version": "1.0.0", 4 | "lockfileVersion": 3, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "module-1", 9 | "version": "1.0.0", 10 | "license": "ISC", 11 | "dependencies": { 12 | "node-fetch": "^3.3.1", 13 | "ts-node-dev": "^2.0.0" 14 | }, 15 | "devDependencies": { 16 | "nodemon": "^2.0.22" 17 | } 18 | }, 19 | "node_modules/@cspotcode/source-map-support": { 20 | "version": "0.8.1", 21 | "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", 22 | "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", 23 | "dependencies": { 24 | "@jridgewell/trace-mapping": "0.3.9" 25 | }, 26 | "engines": { 27 | "node": ">=12" 28 | } 29 | }, 30 | "node_modules/@jridgewell/resolve-uri": { 31 | "version": "3.1.1", 32 | "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", 33 | "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", 34 | "engines": { 35 | "node": ">=6.0.0" 36 | } 37 | }, 38 | "node_modules/@jridgewell/sourcemap-codec": { 39 | "version": "1.4.15", 40 | "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", 41 | "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" 42 | }, 43 | "node_modules/@jridgewell/trace-mapping": { 44 | "version": "0.3.9", 45 | "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", 46 | "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", 47 | "dependencies": { 48 | "@jridgewell/resolve-uri": "^3.0.3", 49 | "@jridgewell/sourcemap-codec": "^1.4.10" 50 | } 51 | }, 52 | "node_modules/@tsconfig/node10": { 53 | "version": "1.0.9", 54 | "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", 55 | "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==" 56 | }, 57 | "node_modules/@tsconfig/node12": { 58 | "version": "1.0.11", 59 | "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", 60 | "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==" 61 | }, 62 | "node_modules/@tsconfig/node14": { 63 | "version": "1.0.3", 64 | "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", 65 | "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==" 66 | }, 67 | "node_modules/@tsconfig/node16": { 68 | "version": "1.0.3", 69 | "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.3.tgz", 70 | "integrity": "sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==" 71 | }, 72 | "node_modules/@types/node": { 73 | "version": "18.15.11", 74 | "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.11.tgz", 75 | "integrity": "sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q==", 76 | "peer": true 77 | }, 78 | "node_modules/@types/strip-bom": { 79 | "version": "3.0.0", 80 | "resolved": "https://registry.npmjs.org/@types/strip-bom/-/strip-bom-3.0.0.tgz", 81 | "integrity": "sha512-xevGOReSYGM7g/kUBZzPqCrR/KYAo+F0yiPc85WFTJa0MSLtyFTVTU6cJu/aV4mid7IffDIWqo69THF2o4JiEQ==" 82 | }, 83 | "node_modules/@types/strip-json-comments": { 84 | "version": "0.0.30", 85 | "resolved": "https://registry.npmjs.org/@types/strip-json-comments/-/strip-json-comments-0.0.30.tgz", 86 | "integrity": "sha512-7NQmHra/JILCd1QqpSzl8+mJRc8ZHz3uDm8YV1Ks9IhK0epEiTw8aIErbvH9PI+6XbqhyIQy3462nEsn7UVzjQ==" 87 | }, 88 | "node_modules/abbrev": { 89 | "version": "1.1.1", 90 | "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", 91 | "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", 92 | "dev": true 93 | }, 94 | "node_modules/acorn": { 95 | "version": "8.8.2", 96 | "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", 97 | "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", 98 | "bin": { 99 | "acorn": "bin/acorn" 100 | }, 101 | "engines": { 102 | "node": ">=0.4.0" 103 | } 104 | }, 105 | "node_modules/acorn-walk": { 106 | "version": "8.2.0", 107 | "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", 108 | "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", 109 | "engines": { 110 | "node": ">=0.4.0" 111 | } 112 | }, 113 | "node_modules/anymatch": { 114 | "version": "3.1.3", 115 | "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", 116 | "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", 117 | "dependencies": { 118 | "normalize-path": "^3.0.0", 119 | "picomatch": "^2.0.4" 120 | }, 121 | "engines": { 122 | "node": ">= 8" 123 | } 124 | }, 125 | "node_modules/arg": { 126 | "version": "4.1.3", 127 | "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", 128 | "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==" 129 | }, 130 | "node_modules/balanced-match": { 131 | "version": "1.0.2", 132 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", 133 | "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" 134 | }, 135 | "node_modules/binary-extensions": { 136 | "version": "2.2.0", 137 | "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", 138 | "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", 139 | "engines": { 140 | "node": ">=8" 141 | } 142 | }, 143 | "node_modules/brace-expansion": { 144 | "version": "1.1.11", 145 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", 146 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", 147 | "dependencies": { 148 | "balanced-match": "^1.0.0", 149 | "concat-map": "0.0.1" 150 | } 151 | }, 152 | "node_modules/braces": { 153 | "version": "3.0.2", 154 | "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", 155 | "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", 156 | "dependencies": { 157 | "fill-range": "^7.0.1" 158 | }, 159 | "engines": { 160 | "node": ">=8" 161 | } 162 | }, 163 | "node_modules/buffer-from": { 164 | "version": "1.1.2", 165 | "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", 166 | "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" 167 | }, 168 | "node_modules/chokidar": { 169 | "version": "3.5.3", 170 | "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", 171 | "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", 172 | "funding": [ 173 | { 174 | "type": "individual", 175 | "url": "https://paulmillr.com/funding/" 176 | } 177 | ], 178 | "dependencies": { 179 | "anymatch": "~3.1.2", 180 | "braces": "~3.0.2", 181 | "glob-parent": "~5.1.2", 182 | "is-binary-path": "~2.1.0", 183 | "is-glob": "~4.0.1", 184 | "normalize-path": "~3.0.0", 185 | "readdirp": "~3.6.0" 186 | }, 187 | "engines": { 188 | "node": ">= 8.10.0" 189 | }, 190 | "optionalDependencies": { 191 | "fsevents": "~2.3.2" 192 | } 193 | }, 194 | "node_modules/concat-map": { 195 | "version": "0.0.1", 196 | "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", 197 | "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" 198 | }, 199 | "node_modules/create-require": { 200 | "version": "1.1.1", 201 | "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", 202 | "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==" 203 | }, 204 | "node_modules/data-uri-to-buffer": { 205 | "version": "4.0.1", 206 | "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz", 207 | "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==", 208 | "engines": { 209 | "node": ">= 12" 210 | } 211 | }, 212 | "node_modules/debug": { 213 | "version": "3.2.7", 214 | "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", 215 | "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", 216 | "dev": true, 217 | "dependencies": { 218 | "ms": "^2.1.1" 219 | } 220 | }, 221 | "node_modules/diff": { 222 | "version": "4.0.2", 223 | "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", 224 | "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", 225 | "engines": { 226 | "node": ">=0.3.1" 227 | } 228 | }, 229 | "node_modules/dynamic-dedupe": { 230 | "version": "0.3.0", 231 | "resolved": "https://registry.npmjs.org/dynamic-dedupe/-/dynamic-dedupe-0.3.0.tgz", 232 | "integrity": "sha512-ssuANeD+z97meYOqd50e04Ze5qp4bPqo8cCkI4TRjZkzAUgIDTrXV1R8QCdINpiI+hw14+rYazvTRdQrz0/rFQ==", 233 | "dependencies": { 234 | "xtend": "^4.0.0" 235 | } 236 | }, 237 | "node_modules/fetch-blob": { 238 | "version": "3.2.0", 239 | "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", 240 | "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", 241 | "funding": [ 242 | { 243 | "type": "github", 244 | "url": "https://github.com/sponsors/jimmywarting" 245 | }, 246 | { 247 | "type": "paypal", 248 | "url": "https://paypal.me/jimmywarting" 249 | } 250 | ], 251 | "dependencies": { 252 | "node-domexception": "^1.0.0", 253 | "web-streams-polyfill": "^3.0.3" 254 | }, 255 | "engines": { 256 | "node": "^12.20 || >= 14.13" 257 | } 258 | }, 259 | "node_modules/fill-range": { 260 | "version": "7.0.1", 261 | "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", 262 | "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", 263 | "dependencies": { 264 | "to-regex-range": "^5.0.1" 265 | }, 266 | "engines": { 267 | "node": ">=8" 268 | } 269 | }, 270 | "node_modules/formdata-polyfill": { 271 | "version": "4.0.10", 272 | "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", 273 | "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", 274 | "dependencies": { 275 | "fetch-blob": "^3.1.2" 276 | }, 277 | "engines": { 278 | "node": ">=12.20.0" 279 | } 280 | }, 281 | "node_modules/fs.realpath": { 282 | "version": "1.0.0", 283 | "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", 284 | "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" 285 | }, 286 | "node_modules/function-bind": { 287 | "version": "1.1.1", 288 | "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", 289 | "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" 290 | }, 291 | "node_modules/glob": { 292 | "version": "7.2.3", 293 | "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", 294 | "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", 295 | "dependencies": { 296 | "fs.realpath": "^1.0.0", 297 | "inflight": "^1.0.4", 298 | "inherits": "2", 299 | "minimatch": "^3.1.1", 300 | "once": "^1.3.0", 301 | "path-is-absolute": "^1.0.0" 302 | }, 303 | "engines": { 304 | "node": "*" 305 | }, 306 | "funding": { 307 | "url": "https://github.com/sponsors/isaacs" 308 | } 309 | }, 310 | "node_modules/glob-parent": { 311 | "version": "5.1.2", 312 | "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", 313 | "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", 314 | "dependencies": { 315 | "is-glob": "^4.0.1" 316 | }, 317 | "engines": { 318 | "node": ">= 6" 319 | } 320 | }, 321 | "node_modules/has": { 322 | "version": "1.0.3", 323 | "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", 324 | "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", 325 | "dependencies": { 326 | "function-bind": "^1.1.1" 327 | }, 328 | "engines": { 329 | "node": ">= 0.4.0" 330 | } 331 | }, 332 | "node_modules/has-flag": { 333 | "version": "3.0.0", 334 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", 335 | "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", 336 | "dev": true, 337 | "engines": { 338 | "node": ">=4" 339 | } 340 | }, 341 | "node_modules/ignore-by-default": { 342 | "version": "1.0.1", 343 | "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", 344 | "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==", 345 | "dev": true 346 | }, 347 | "node_modules/inflight": { 348 | "version": "1.0.6", 349 | "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", 350 | "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", 351 | "dependencies": { 352 | "once": "^1.3.0", 353 | "wrappy": "1" 354 | } 355 | }, 356 | "node_modules/inherits": { 357 | "version": "2.0.4", 358 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 359 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" 360 | }, 361 | "node_modules/is-binary-path": { 362 | "version": "2.1.0", 363 | "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", 364 | "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", 365 | "dependencies": { 366 | "binary-extensions": "^2.0.0" 367 | }, 368 | "engines": { 369 | "node": ">=8" 370 | } 371 | }, 372 | "node_modules/is-core-module": { 373 | "version": "2.12.0", 374 | "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.0.tgz", 375 | "integrity": "sha512-RECHCBCd/viahWmwj6enj19sKbHfJrddi/6cBDsNTKbNq0f7VeaUkBo60BqzvPqo/W54ChS62Z5qyun7cfOMqQ==", 376 | "dependencies": { 377 | "has": "^1.0.3" 378 | }, 379 | "funding": { 380 | "url": "https://github.com/sponsors/ljharb" 381 | } 382 | }, 383 | "node_modules/is-extglob": { 384 | "version": "2.1.1", 385 | "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", 386 | "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", 387 | "engines": { 388 | "node": ">=0.10.0" 389 | } 390 | }, 391 | "node_modules/is-glob": { 392 | "version": "4.0.3", 393 | "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", 394 | "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", 395 | "dependencies": { 396 | "is-extglob": "^2.1.1" 397 | }, 398 | "engines": { 399 | "node": ">=0.10.0" 400 | } 401 | }, 402 | "node_modules/is-number": { 403 | "version": "7.0.0", 404 | "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", 405 | "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", 406 | "engines": { 407 | "node": ">=0.12.0" 408 | } 409 | }, 410 | "node_modules/make-error": { 411 | "version": "1.3.6", 412 | "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", 413 | "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==" 414 | }, 415 | "node_modules/minimatch": { 416 | "version": "3.1.2", 417 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", 418 | "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", 419 | "dependencies": { 420 | "brace-expansion": "^1.1.7" 421 | }, 422 | "engines": { 423 | "node": "*" 424 | } 425 | }, 426 | "node_modules/minimist": { 427 | "version": "1.2.8", 428 | "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", 429 | "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", 430 | "funding": { 431 | "url": "https://github.com/sponsors/ljharb" 432 | } 433 | }, 434 | "node_modules/mkdirp": { 435 | "version": "1.0.4", 436 | "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", 437 | "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", 438 | "bin": { 439 | "mkdirp": "bin/cmd.js" 440 | }, 441 | "engines": { 442 | "node": ">=10" 443 | } 444 | }, 445 | "node_modules/ms": { 446 | "version": "2.1.3", 447 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", 448 | "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", 449 | "dev": true 450 | }, 451 | "node_modules/node-domexception": { 452 | "version": "1.0.0", 453 | "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", 454 | "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", 455 | "funding": [ 456 | { 457 | "type": "github", 458 | "url": "https://github.com/sponsors/jimmywarting" 459 | }, 460 | { 461 | "type": "github", 462 | "url": "https://paypal.me/jimmywarting" 463 | } 464 | ], 465 | "engines": { 466 | "node": ">=10.5.0" 467 | } 468 | }, 469 | "node_modules/node-fetch": { 470 | "version": "3.3.1", 471 | "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.1.tgz", 472 | "integrity": "sha512-cRVc/kyto/7E5shrWca1Wsea4y6tL9iYJE5FBCius3JQfb/4P4I295PfhgbJQBLTx6lATE4z+wK0rPM4VS2uow==", 473 | "dependencies": { 474 | "data-uri-to-buffer": "^4.0.0", 475 | "fetch-blob": "^3.1.4", 476 | "formdata-polyfill": "^4.0.10" 477 | }, 478 | "engines": { 479 | "node": "^12.20.0 || ^14.13.1 || >=16.0.0" 480 | }, 481 | "funding": { 482 | "type": "opencollective", 483 | "url": "https://opencollective.com/node-fetch" 484 | } 485 | }, 486 | "node_modules/nodemon": { 487 | "version": "2.0.22", 488 | "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.22.tgz", 489 | "integrity": "sha512-B8YqaKMmyuCO7BowF1Z1/mkPqLk6cs/l63Ojtd6otKjMx47Dq1utxfRxcavH1I7VSaL8n5BUaoutadnsX3AAVQ==", 490 | "dev": true, 491 | "dependencies": { 492 | "chokidar": "^3.5.2", 493 | "debug": "^3.2.7", 494 | "ignore-by-default": "^1.0.1", 495 | "minimatch": "^3.1.2", 496 | "pstree.remy": "^1.1.8", 497 | "semver": "^5.7.1", 498 | "simple-update-notifier": "^1.0.7", 499 | "supports-color": "^5.5.0", 500 | "touch": "^3.1.0", 501 | "undefsafe": "^2.0.5" 502 | }, 503 | "bin": { 504 | "nodemon": "bin/nodemon.js" 505 | }, 506 | "engines": { 507 | "node": ">=8.10.0" 508 | }, 509 | "funding": { 510 | "type": "opencollective", 511 | "url": "https://opencollective.com/nodemon" 512 | } 513 | }, 514 | "node_modules/nopt": { 515 | "version": "1.0.10", 516 | "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", 517 | "integrity": "sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg==", 518 | "dev": true, 519 | "dependencies": { 520 | "abbrev": "1" 521 | }, 522 | "bin": { 523 | "nopt": "bin/nopt.js" 524 | }, 525 | "engines": { 526 | "node": "*" 527 | } 528 | }, 529 | "node_modules/normalize-path": { 530 | "version": "3.0.0", 531 | "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", 532 | "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", 533 | "engines": { 534 | "node": ">=0.10.0" 535 | } 536 | }, 537 | "node_modules/once": { 538 | "version": "1.4.0", 539 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", 540 | "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", 541 | "dependencies": { 542 | "wrappy": "1" 543 | } 544 | }, 545 | "node_modules/path-is-absolute": { 546 | "version": "1.0.1", 547 | "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", 548 | "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", 549 | "engines": { 550 | "node": ">=0.10.0" 551 | } 552 | }, 553 | "node_modules/path-parse": { 554 | "version": "1.0.7", 555 | "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", 556 | "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" 557 | }, 558 | "node_modules/picomatch": { 559 | "version": "2.3.1", 560 | "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", 561 | "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", 562 | "engines": { 563 | "node": ">=8.6" 564 | }, 565 | "funding": { 566 | "url": "https://github.com/sponsors/jonschlinkert" 567 | } 568 | }, 569 | "node_modules/pstree.remy": { 570 | "version": "1.1.8", 571 | "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", 572 | "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==", 573 | "dev": true 574 | }, 575 | "node_modules/readdirp": { 576 | "version": "3.6.0", 577 | "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", 578 | "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", 579 | "dependencies": { 580 | "picomatch": "^2.2.1" 581 | }, 582 | "engines": { 583 | "node": ">=8.10.0" 584 | } 585 | }, 586 | "node_modules/resolve": { 587 | "version": "1.22.3", 588 | "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.3.tgz", 589 | "integrity": "sha512-P8ur/gp/AmbEzjr729bZnLjXK5Z+4P0zhIJgBgzqRih7hL7BOukHGtSTA3ACMY467GRFz3duQsi0bDZdR7DKdw==", 590 | "dependencies": { 591 | "is-core-module": "^2.12.0", 592 | "path-parse": "^1.0.7", 593 | "supports-preserve-symlinks-flag": "^1.0.0" 594 | }, 595 | "bin": { 596 | "resolve": "bin/resolve" 597 | }, 598 | "funding": { 599 | "url": "https://github.com/sponsors/ljharb" 600 | } 601 | }, 602 | "node_modules/rimraf": { 603 | "version": "2.7.1", 604 | "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", 605 | "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", 606 | "dependencies": { 607 | "glob": "^7.1.3" 608 | }, 609 | "bin": { 610 | "rimraf": "bin.js" 611 | } 612 | }, 613 | "node_modules/semver": { 614 | "version": "5.7.1", 615 | "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", 616 | "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", 617 | "dev": true, 618 | "bin": { 619 | "semver": "bin/semver" 620 | } 621 | }, 622 | "node_modules/simple-update-notifier": { 623 | "version": "1.1.0", 624 | "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-1.1.0.tgz", 625 | "integrity": "sha512-VpsrsJSUcJEseSbMHkrsrAVSdvVS5I96Qo1QAQ4FxQ9wXFcB+pjj7FB7/us9+GcgfW4ziHtYMc1J0PLczb55mg==", 626 | "dev": true, 627 | "dependencies": { 628 | "semver": "~7.0.0" 629 | }, 630 | "engines": { 631 | "node": ">=8.10.0" 632 | } 633 | }, 634 | "node_modules/simple-update-notifier/node_modules/semver": { 635 | "version": "7.0.0", 636 | "resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz", 637 | "integrity": "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==", 638 | "dev": true, 639 | "bin": { 640 | "semver": "bin/semver.js" 641 | } 642 | }, 643 | "node_modules/source-map": { 644 | "version": "0.6.1", 645 | "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", 646 | "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", 647 | "engines": { 648 | "node": ">=0.10.0" 649 | } 650 | }, 651 | "node_modules/source-map-support": { 652 | "version": "0.5.21", 653 | "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", 654 | "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", 655 | "dependencies": { 656 | "buffer-from": "^1.0.0", 657 | "source-map": "^0.6.0" 658 | } 659 | }, 660 | "node_modules/strip-bom": { 661 | "version": "3.0.0", 662 | "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", 663 | "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", 664 | "engines": { 665 | "node": ">=4" 666 | } 667 | }, 668 | "node_modules/strip-json-comments": { 669 | "version": "2.0.1", 670 | "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", 671 | "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", 672 | "engines": { 673 | "node": ">=0.10.0" 674 | } 675 | }, 676 | "node_modules/supports-color": { 677 | "version": "5.5.0", 678 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", 679 | "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", 680 | "dev": true, 681 | "dependencies": { 682 | "has-flag": "^3.0.0" 683 | }, 684 | "engines": { 685 | "node": ">=4" 686 | } 687 | }, 688 | "node_modules/supports-preserve-symlinks-flag": { 689 | "version": "1.0.0", 690 | "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", 691 | "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", 692 | "engines": { 693 | "node": ">= 0.4" 694 | }, 695 | "funding": { 696 | "url": "https://github.com/sponsors/ljharb" 697 | } 698 | }, 699 | "node_modules/to-regex-range": { 700 | "version": "5.0.1", 701 | "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", 702 | "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", 703 | "dependencies": { 704 | "is-number": "^7.0.0" 705 | }, 706 | "engines": { 707 | "node": ">=8.0" 708 | } 709 | }, 710 | "node_modules/touch": { 711 | "version": "3.1.0", 712 | "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz", 713 | "integrity": "sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==", 714 | "dev": true, 715 | "dependencies": { 716 | "nopt": "~1.0.10" 717 | }, 718 | "bin": { 719 | "nodetouch": "bin/nodetouch.js" 720 | } 721 | }, 722 | "node_modules/tree-kill": { 723 | "version": "1.2.2", 724 | "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", 725 | "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", 726 | "bin": { 727 | "tree-kill": "cli.js" 728 | } 729 | }, 730 | "node_modules/ts-node": { 731 | "version": "10.9.1", 732 | "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", 733 | "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", 734 | "dependencies": { 735 | "@cspotcode/source-map-support": "^0.8.0", 736 | "@tsconfig/node10": "^1.0.7", 737 | "@tsconfig/node12": "^1.0.7", 738 | "@tsconfig/node14": "^1.0.0", 739 | "@tsconfig/node16": "^1.0.2", 740 | "acorn": "^8.4.1", 741 | "acorn-walk": "^8.1.1", 742 | "arg": "^4.1.0", 743 | "create-require": "^1.1.0", 744 | "diff": "^4.0.1", 745 | "make-error": "^1.1.1", 746 | "v8-compile-cache-lib": "^3.0.1", 747 | "yn": "3.1.1" 748 | }, 749 | "bin": { 750 | "ts-node": "dist/bin.js", 751 | "ts-node-cwd": "dist/bin-cwd.js", 752 | "ts-node-esm": "dist/bin-esm.js", 753 | "ts-node-script": "dist/bin-script.js", 754 | "ts-node-transpile-only": "dist/bin-transpile.js", 755 | "ts-script": "dist/bin-script-deprecated.js" 756 | }, 757 | "peerDependencies": { 758 | "@swc/core": ">=1.2.50", 759 | "@swc/wasm": ">=1.2.50", 760 | "@types/node": "*", 761 | "typescript": ">=2.7" 762 | }, 763 | "peerDependenciesMeta": { 764 | "@swc/core": { 765 | "optional": true 766 | }, 767 | "@swc/wasm": { 768 | "optional": true 769 | } 770 | } 771 | }, 772 | "node_modules/ts-node-dev": { 773 | "version": "2.0.0", 774 | "resolved": "https://registry.npmjs.org/ts-node-dev/-/ts-node-dev-2.0.0.tgz", 775 | "integrity": "sha512-ywMrhCfH6M75yftYvrvNarLEY+SUXtUvU8/0Z6llrHQVBx12GiFk5sStF8UdfE/yfzk9IAq7O5EEbTQsxlBI8w==", 776 | "dependencies": { 777 | "chokidar": "^3.5.1", 778 | "dynamic-dedupe": "^0.3.0", 779 | "minimist": "^1.2.6", 780 | "mkdirp": "^1.0.4", 781 | "resolve": "^1.0.0", 782 | "rimraf": "^2.6.1", 783 | "source-map-support": "^0.5.12", 784 | "tree-kill": "^1.2.2", 785 | "ts-node": "^10.4.0", 786 | "tsconfig": "^7.0.0" 787 | }, 788 | "bin": { 789 | "ts-node-dev": "lib/bin.js", 790 | "tsnd": "lib/bin.js" 791 | }, 792 | "engines": { 793 | "node": ">=0.8.0" 794 | }, 795 | "peerDependencies": { 796 | "node-notifier": "*", 797 | "typescript": "*" 798 | }, 799 | "peerDependenciesMeta": { 800 | "node-notifier": { 801 | "optional": true 802 | } 803 | } 804 | }, 805 | "node_modules/tsconfig": { 806 | "version": "7.0.0", 807 | "resolved": "https://registry.npmjs.org/tsconfig/-/tsconfig-7.0.0.tgz", 808 | "integrity": "sha512-vZXmzPrL+EmC4T/4rVlT2jNVMWCi/O4DIiSj3UHg1OE5kCKbk4mfrXc6dZksLgRM/TZlKnousKH9bbTazUWRRw==", 809 | "dependencies": { 810 | "@types/strip-bom": "^3.0.0", 811 | "@types/strip-json-comments": "0.0.30", 812 | "strip-bom": "^3.0.0", 813 | "strip-json-comments": "^2.0.0" 814 | } 815 | }, 816 | "node_modules/typescript": { 817 | "version": "5.0.4", 818 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", 819 | "integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==", 820 | "peer": true, 821 | "bin": { 822 | "tsc": "bin/tsc", 823 | "tsserver": "bin/tsserver" 824 | }, 825 | "engines": { 826 | "node": ">=12.20" 827 | } 828 | }, 829 | "node_modules/undefsafe": { 830 | "version": "2.0.5", 831 | "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", 832 | "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==", 833 | "dev": true 834 | }, 835 | "node_modules/v8-compile-cache-lib": { 836 | "version": "3.0.1", 837 | "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", 838 | "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==" 839 | }, 840 | "node_modules/web-streams-polyfill": { 841 | "version": "3.2.1", 842 | "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz", 843 | "integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==", 844 | "engines": { 845 | "node": ">= 8" 846 | } 847 | }, 848 | "node_modules/wrappy": { 849 | "version": "1.0.2", 850 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", 851 | "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" 852 | }, 853 | "node_modules/xtend": { 854 | "version": "4.0.2", 855 | "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", 856 | "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", 857 | "engines": { 858 | "node": ">=0.4" 859 | } 860 | }, 861 | "node_modules/yn": { 862 | "version": "3.1.1", 863 | "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", 864 | "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", 865 | "engines": { 866 | "node": ">=6" 867 | } 868 | } 869 | } 870 | } 871 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "module-1", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "start": "ts-node-dev --respawn --transpile-only src", 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "keywords": [], 11 | "author": "", 12 | "license": "ISC", 13 | "devDependencies": { 14 | "nodemon": "^2.0.22" 15 | }, 16 | "dependencies": { 17 | "node-fetch": "^3.3.1", 18 | "ts-node-dev": "^2.0.0" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/alias.ts: -------------------------------------------------------------------------------- 1 | type CrushType = { 2 | name: string; 3 | age?: number; 4 | profession: string; 5 | address: string; 6 | }; 7 | 8 | const crush1: CrushType = { 9 | name: "Moina Pakhi", 10 | age: 22, 11 | profession: "Web Developer", 12 | address: "Uganda", 13 | }; 14 | 15 | const crush2: CrushType = { 16 | name: "Tia Pakhi", 17 | profession: "Next Level web developer", 18 | address: "mexico", 19 | }; 20 | 21 | type CrushMarriedType = boolean; 22 | 23 | const isCrushMarried: CrushMarriedType = false; 24 | 25 | type CourseNameType = string; 26 | 27 | const courseName: CourseNameType = "Next Level Web Development"; 28 | 29 | type OperationType = (x: number, y: number) => number; 30 | 31 | const calculate = ( 32 | number1: number, // 10 33 | number2: number, //20 34 | operation: OperationType // (x, y) => x - y) (10,20)=>10-20 35 | ) => { 36 | return operation(number1, number2); 37 | }; 38 | 39 | calculate(10, 20, (x, y) => x + y); 40 | calculate(10, 20, (x, y) => x - y); 41 | calculate(10, 20, (x, y) => x * y); 42 | -------------------------------------------------------------------------------- /src/array.ts: -------------------------------------------------------------------------------- 1 | // const names = ["abul ", "kabul", "babul", 77, , true]; 2 | 3 | // const boyfriends: [string, boolean] = ["abul", true]; 4 | // //number -> string 5 | -------------------------------------------------------------------------------- /src/function.ts: -------------------------------------------------------------------------------- 1 | // //normal function 2 | // //default parameter 3 | // function add(num1: number, num2: number = 10): number { 4 | // return num1 + num2; 5 | // } 6 | 7 | // add(30, 50); 8 | 9 | // //spread opearator 10 | 11 | // const myFriends = ["chandler", "joey", "ross"]; 12 | // const newFriends = ["monica", "rachel", "pheobe"]; 13 | // const myBestFriend = { 14 | // fullName: "Abul Bashar", 15 | // age: 24, 16 | // }; 17 | 18 | // const [besfriend] = myFriends; 19 | // const { fullName: string } = myBestFriend; 20 | 21 | // console.log({ string }); 22 | 23 | // myFriends.push(...newFriends); 24 | // // console.log(myFriends); 25 | 26 | // //rest paaremeter 27 | 28 | // const greetFriends = (...friends: string[]): void => 29 | // friends.forEach((friend) => console.log(`Hi ${friend}`)); 30 | 31 | // greetFriends( 32 | // "kashem", 33 | // "hashem", 34 | // "gashem", 35 | // "lashem", 36 | // "bangla bhai", 37 | // "english bhai" 38 | // ); 39 | 40 | // //array and object destructuring 41 | 42 | // const addArrow = (num1: number, num2: number): number => num1 + num2; 43 | 44 | // const arr = [1, 4, 5, 7]; 45 | 46 | // const newArray = arr.map((elem: number) => elem * elem); 47 | 48 | // const person: { 49 | // name: string; 50 | // balance: number; 51 | // addBalance(money: number): void; 52 | // } = { 53 | // name: "Mezba", 54 | // balance: 5, 55 | // addBalance(money: number) { 56 | // console.log(`My New Balance is ${this.balance + money}`); 57 | // }, 58 | // }; 59 | 60 | // // person.addBalance(555); 61 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | // let course = undefined; 2 | // course = "jj"; 3 | // console.log(course); 4 | // //Primitive Types 5 | // //string 6 | // //number 7 | // //boolean 8 | // //null 9 | // //undefined 10 | -------------------------------------------------------------------------------- /src/module3/asynchronous.ts: -------------------------------------------------------------------------------- 1 | // Mocking 2 | 3 | // Json Place Holder 4 | 5 | interface ITodo { 6 | userId: number; 7 | id: number; 8 | title: string; 9 | completed: boolean; 10 | } 11 | 12 | const getTodo = async (): Promise => { 13 | const response = await fetch("https://jsonplaceholder.typicode.com/todos/1"); 14 | return await response.json(); 15 | }; 16 | 17 | const getTodoData = async (): Promise => { 18 | const result = await getTodo(); 19 | console.log(result); 20 | }; 21 | 22 | getTodoData(); 23 | 24 | const makePromise = (): Promise => { 25 | return new Promise((resolve, reject) => { 26 | const data: string = "Data is fetched"; 27 | if (data) { 28 | resolve(data); 29 | } else { 30 | reject("Failed to feted data!"); 31 | } 32 | }); 33 | }; 34 | 35 | const makePromiseBoolean = (): Promise => { 36 | return new Promise((resolve, reject) => { 37 | const data: boolean = true; 38 | if (data) { 39 | resolve(data); 40 | } else { 41 | reject("Failed to feted data!"); 42 | } 43 | }); 44 | }; 45 | 46 | interface DataType { 47 | data: string; 48 | } 49 | 50 | const makePromiseObject = (): Promise => { 51 | return new Promise((resolve, reject) => { 52 | const data: DataType = { data: "Data is fetched" }; 53 | if (data) { 54 | resolve(data); 55 | } else { 56 | reject("Failed to feted data!"); 57 | } 58 | }); 59 | }; 60 | 61 | const getPromiseDataObject = async (): Promise => { 62 | const data = await makePromiseObject(); 63 | return data; 64 | }; 65 | 66 | const getPromiseData = async (): Promise => { 67 | const data = await makePromise(); 68 | return data; 69 | }; 70 | 71 | const getPromiseDataBoolean = async (): Promise => { 72 | const data = await makePromiseBoolean(); 73 | return data; 74 | }; 75 | 76 | // Promise Promise Promise 77 | -------------------------------------------------------------------------------- /src/module3/conditional-type.ts: -------------------------------------------------------------------------------- 1 | // a type is dependent on another type 2 | 3 | type a1 = number; 4 | type a3 = undefined; 5 | type a4 = number; 6 | 7 | type a2 = a1 extends string ? string : null; 8 | //nested conditional type 9 | type d = a1 extends null 10 | ? null 11 | : a3 extends number 12 | ? number 13 | : a4 extends null 14 | ? null 15 | : never; 16 | 17 | type Sheikh = { 18 | wife1: string; 19 | wife2: string; 20 | }; 21 | 22 | type A = keyof Sheikh; // 'wife1' | 'wife2' 23 | // 'wife3' extends 'wife1' | 'wife2 24 | type CheckProperty = K extends keyof Sheikh ? true : false; 25 | 26 | type CheckWife2 = CheckProperty; 27 | 28 | // check korbe ei Sheikh Type a wife3 ase kina ? true : false 29 | 30 | //Matha Kharap Example 31 | 32 | type Bandhubi = "Monika" | "Rachel" | "Pheobe"; 33 | 34 | type RemoveBadhubi = T extends K ? never : T; 35 | 36 | type CurrentBandhubi = RemoveBadhubi; 37 | -------------------------------------------------------------------------------- /src/module3/generic-function.ts: -------------------------------------------------------------------------------- 1 | //Arrow Function 2 | 3 | const createArray = (param: string): string[] => { 4 | return [param]; 5 | }; 6 | const createArray1 = (param1: X, param2: Y): [X, Y] => { 7 | return [param1, param2]; 8 | }; 9 | 10 | function createArray2(param1: X, param2: Y): [X, Y] { 11 | return [param1, param2]; 12 | } 13 | 14 | const result1 = createArray1("Bangladesh", "I love My Country"); 15 | const result2 = createArray1>(false, ["USA"]); 16 | 17 | type Name = { name: string }; 18 | 19 | const result3 = createArray1({ name: "Bangladesh" }, false); 20 | 21 | //Spread Operator 22 | 23 | // const newData = {...myInfo ,crush}; 24 | const addMeInMyCrushMind = (myInfo: T) => { 25 | const crush = "kate Winslet"; 26 | const newData = { ...myInfo, crush }; 27 | return newData; 28 | }; 29 | 30 | const myInfo = { 31 | name: "Persian", 32 | age: 100, 33 | salary: 100000000, 34 | }; 35 | const result5 = addMeInMyCrushMind(myInfo); 36 | result5. 37 | -------------------------------------------------------------------------------- /src/module3/generic-interface.ts: -------------------------------------------------------------------------------- 1 | // Generic Interface 2 | 3 | interface CrushInterface { 4 | name: string; 5 | husband: T; 6 | wife?: U; 7 | other: V; 8 | } 9 | 10 | interface PersonInterface { 11 | name: string; 12 | age: number; 13 | } 14 | 15 | const crush4: CrushInterface = { 16 | name: "Kate", 17 | husband: { 18 | name: "Persian", 19 | age: 30, 20 | }, 21 | wife: { 22 | name: "Winslet", 23 | age: 40, 24 | }, 25 | }; 26 | 27 | const crush1: CrushInterface = { 28 | name: "Kate Winslet", 29 | husband: true, 30 | wife: "Chokina", 31 | }; 32 | 33 | const crush2: CrushInterface = { 34 | name: "Kate Winslet", 35 | husband: "Persian", 36 | }; 37 | 38 | interface HusbandInterface { 39 | name: string; 40 | salary: number; 41 | } 42 | 43 | const crush3: CrushInterface = { 44 | name: "Kate Winslet", 45 | husband: { 46 | name: "Persian", 47 | salary: 0.01, 48 | }, 49 | }; 50 | 51 | type GenericTuple = [X, Y]; 52 | 53 | const relation: GenericTuple = ["Persian", "Kate Winslet"]; 54 | 55 | // type RelationWithSalaryType = { name: string; salary: number }; 56 | 57 | interface RelationWithSalaryInterface { 58 | name: string; 59 | salary: number; 60 | } 61 | 62 | const relationWithSalary: GenericTuple = [ 63 | { 64 | name: "Persian", 65 | salary: 1000000000, 66 | }, 67 | "Kate Winslet", 68 | ]; 69 | 70 | const relationWithSalary2: GenericTuple = [ 71 | { 72 | name: "Persian", 73 | salary: 1000000000, 74 | }, 75 | "Kate Winslet", 76 | ]; 77 | 78 | type GenericArray = Array; 79 | 80 | const rollNumbers: GenericArray = [44, 12, 4]; 81 | const rollNumbers2: GenericArray = ["44", "12", "4"]; 82 | const rolllNumbers3: GenericArray = [true, false]; 83 | 84 | type NameRollType = { name: string; roll: number }; 85 | 86 | const userNameAndRollNumbers: GenericArray = [ 87 | { 88 | name: "Mr. X", 89 | roll: 1, 90 | }, 91 | { 92 | name: "Mr. Y", 93 | roll: 2, 94 | }, 95 | ]; 96 | 97 | add(x, y, z); 98 | add(3, 4, 5); 99 | -------------------------------------------------------------------------------- /src/module3/generic-keyof-constraints.ts: -------------------------------------------------------------------------------- 1 | // type PersonType = { 2 | // name: string; 3 | // age: number; 4 | // address: string; 5 | // }; 6 | 7 | // type newType = "name" | "age" | "address"; // manully korsi 8 | 9 | // type newTypeUsingKeyOf = keyof PersonType; 10 | 11 | // // const a: newType= 'age' 12 | // // const b: newTypeUsingKeyOf='hh' 13 | 14 | // // Y = 'name' |'age' 15 | 16 | // function getProperty(obj: X, key: Y) { 17 | // obj[key]; 18 | // } 19 | 20 | // const property = getProperty({ name: "Mr.X", age: 100 }, "jjj"); 21 | 22 | // // ({name: 'Mr.X' ,age:100} , 'age') //100 23 | // // const a={ 24 | // // name: 'Mr.X' ,age:100 25 | // // } 26 | // // a['age'] 27 | -------------------------------------------------------------------------------- /src/module3/generic-type.ts: -------------------------------------------------------------------------------- 1 | type GenericTuple = [X, Y]; 2 | 3 | const relation: GenericTuple = ["Persian", "Kate Winslet"]; 4 | 5 | // type RelationWithSalaryType = { name: string; salary: number }; 6 | 7 | interface RelationWithSalaryInterface { 8 | name: string; 9 | salary: number; 10 | } 11 | 12 | const relationWithSalary: GenericTuple = [ 13 | { 14 | name: "Persian", 15 | salary: 1000000000, 16 | }, 17 | "Kate Winslet", 18 | ]; 19 | 20 | const relationWithSalary2: GenericTuple = [ 21 | { 22 | name: "Persian", 23 | salary: 1000000000, 24 | }, 25 | "Kate Winslet", 26 | ]; 27 | 28 | type GenericArray = Array; 29 | 30 | const rollNumbers: GenericArray = [44, 12, 4]; 31 | const rollNumbers2: GenericArray = ["44", "12", "4"]; 32 | const rolllNumbers3: GenericArray = [true, false]; 33 | 34 | type NameRollType = { name: string; roll: number }; 35 | 36 | const userNameAndRollNumbers: GenericArray = [ 37 | { 38 | name: "Mr. X", 39 | roll: 1, 40 | }, 41 | { 42 | name: "Mr. Y", 43 | roll: 2, 44 | }, 45 | ]; 46 | 47 | add(x, y, z); 48 | add(3, 4, 5); 49 | -------------------------------------------------------------------------------- /src/module3/genric-constraints.ts: -------------------------------------------------------------------------------- 1 | // const newData = {...myInfo ,crush}; 2 | 3 | type MandatoryTypes = { name: string; age: number; salary: number }; 4 | interface MandatoryInterface { 5 | name: string; 6 | age: number; 7 | salary: number; 8 | } 9 | 10 | const addMeInMyCrushMind = (myInfo: T) => { 11 | const crush = "kate Winslet"; 12 | const newData = { ...myInfo, crush }; 13 | return newData; 14 | }; 15 | 16 | type MyInFoType = { 17 | name: string; 18 | age: number; 19 | salary: number; 20 | other1: boolean; 21 | other2: null; 22 | }; 23 | const myInfo = { 24 | name: "Persian", 25 | age: 100, 26 | salary: 100000000, 27 | other1: false, 28 | other2: null, 29 | }; 30 | const result5 = addMeInMyCrushMind(myInfo); 31 | -------------------------------------------------------------------------------- /src/module3/interface.ts: -------------------------------------------------------------------------------- 1 | type User = { 2 | name: string; 3 | age: number; 4 | }; 5 | 6 | type extendedUser = User & { 7 | role: string; 8 | }; 9 | 10 | interface IUser { 11 | name: string; 12 | age: number; 13 | } 14 | 15 | interface IExtendedUser extends IUser { 16 | role: string; 17 | } 18 | 19 | type rollNumber = number; 20 | 21 | //Object , Function , Array 22 | 23 | type addNumbersType = (num1: number, num2: number) => number; 24 | 25 | interface IAddNumbers { 26 | (num1: number, num2: number): number; 27 | } 28 | 29 | type rollNumbersType = number[]; 30 | interface IRollNumbers { 31 | [index: number]: string; 32 | } 33 | const rollNumbers: IRollNumbers = ["1", "4", "5"]; //[index] 34 | 35 | const addNumbers: addNumbersType = (num1, num2) => num1 + num2; 36 | 37 | const user: extendedUser = { 38 | name: "Omanush", 39 | age: 2000, 40 | role: "Unknown", 41 | }; 42 | // const userWithTypeAlias: User = { 43 | // name: "Type Alias", 44 | // age: 100, 45 | // }; 46 | 47 | // const userWithInterface: IUser = { 48 | // name: "Interface", 49 | // age: 200, 50 | // }; 51 | // userWithInterface. 52 | -------------------------------------------------------------------------------- /src/module3/mapped-types.ts: -------------------------------------------------------------------------------- 1 | const arrayofNumbers = [1, 2, 3]; // ['1','2','3'] 2 | const arrayOfStrings = arrayofNumbers.map((number) => number.toString()); 3 | console.log(arrayOfStrings); 4 | 5 | type AreaNumber = { 6 | height: number; 7 | width: number; 8 | }; 9 | 10 | type AreaString = { 11 | height: string; 12 | width: string; 13 | }; 14 | 15 | const rectangularArea: AreaNumber = { 16 | height: 10, 17 | width: 12, 18 | }; 19 | 20 | type A = AreaNumber["height"]; // look up types 21 | type B = keyof AreaNumber; // 'width' | 'height' 22 | 23 | // const obj={ 24 | // name:'Persian' 25 | // } 26 | // obj['name'] 27 | -------------------------------------------------------------------------------- /src/module3/type-assertion.ts: -------------------------------------------------------------------------------- 1 | // // let emni: any; 2 | 3 | // // emni = "Next level web devlopment"; 4 | 5 | // // (emni as string).length; 6 | // // emni.length; 7 | 8 | // // function kgToGram(param: string | number): string | number | undefined { 9 | // // if (typeof param === "string") { 10 | // // const value = parseFloat(param) * 1000; 11 | // // return `The Converted result is: ${value} gram`; 12 | // // } 13 | // // if (typeof param === "number") { 14 | // // const value = param * 1000; 15 | // // return value; 16 | // // } 17 | // // } 18 | 19 | // // const resultToBeNumber = kgToGram(1000); 20 | // // const resultToBeString = kgToGram("1000"); 21 | 22 | // // type CustomErrorType = { 23 | // // message: string; 24 | // // }; 25 | 26 | // // try { 27 | // // } catch (err) { 28 | // // console.log((err as CustomErrorType).message); 29 | // // } 30 | 31 | // // const rollNumbers: number[] = [1, 4, 7]; 32 | 33 | // type ArrayType = [X,Y]; 34 | 35 | // interface Name{ 36 | // name:string, 37 | // } 38 | // const generic1: ArrayType = ["1", "4", "7"]; 39 | // const generic2: ArrayType = [1, 2, 3]; 40 | // const generic3: ArrayType=[{name:'Persian'},{age:'i'}] 41 | 42 | // interface CrushInterface{ 43 | // name:'Kate Winslet', 44 | // husband:T 45 | // } 46 | 47 | // const husband1 :CrushInterface = {name:'Kate Winslet',husband:true} 48 | 49 | // const rollNumbers1: Array = [1, 4, 7]; 50 | // const rollNumbers2: Array = ["1", "2"]; 51 | 52 | // const makeArray = (param1: X, param2: Y): [X, Y] => [param1, param2]; 53 | 54 | // function makeArray2(param1: X, param2: Y): [X, Y] { 55 | // return [param1, param2]; 56 | // } 57 | 58 | // const array1 = makeArray(1, 4); 59 | // const array2 = makeArray("5", 6); 60 | 61 | // const addMeToCrushMind = (param: object) => { 62 | // const crushName = "Kate Winslet"; 63 | // const newMind = { ...param, crushName }; 64 | // return newMind; 65 | // }; 66 | const addMeToCrushMind = (param: T) => { 67 | const crushName = "Kate Winslet"; 68 | const newMind = { ...param, crushName }; 69 | return newMind; 70 | }; 71 | 72 | const result = addMeToCrushMind({ name: "Farhan" }); 73 | 74 | // result. 75 | -------------------------------------------------------------------------------- /src/module4/abstraction.ts: -------------------------------------------------------------------------------- 1 | //interface 2 | 3 | // interface IVehicle { 4 | // name: string; 5 | // model: string; 6 | // } 7 | 8 | // const vehicle: IVehicle = { 9 | // name: "Car", 10 | // model: "2000", 11 | // }; 12 | 13 | interface Vehicle { 14 | startEngine(): void; 15 | stopEngine(): void; 16 | move?(): void; 17 | } 18 | 19 | class Car implements Vehicle { 20 | constructor( 21 | public name: string, 22 | public brand: string, 23 | public model: number 24 | ) {} 25 | startEngine(): void { 26 | console.log(" I am starting engine... "); 27 | } 28 | stopEngine(): void { 29 | console.log(" I am syopping engine"); 30 | } 31 | // move(): void { 32 | // console.log(" I am syopping engine"); 33 | // } 34 | } 35 | 36 | const vehicle1 = new Vehicle("Car", "Toyota", 2000); 37 | 38 | // //abstract class 39 | 40 | // abstract class Vehicle { 41 | // constructor( 42 | // public name: string, 43 | // public brand: string, 44 | // public model: number 45 | // ) {} 46 | // abstract startEngine(): void 47 | // abstract stopEngine(): void 48 | // move(): void { 49 | // console.log(" I am syopping engine"); 50 | // } 51 | 52 | // } 53 | 54 | // class Car extends Vehicle{ 55 | // startEngine(): void { 56 | // console.log(" I am starting engine... "); 57 | // } 58 | // stopEngine(): void { 59 | // console.log(" I am stopping engine... "); 60 | // } 61 | 62 | // } 63 | 64 | const car1= new Vehicle('Car','Honda',2015) 65 | car1. -------------------------------------------------------------------------------- /src/module4/access-modifiers.ts: -------------------------------------------------------------------------------- 1 | class BankAccount { 2 | public readonly id: number; 3 | public name: string; 4 | protected _balance: number; 5 | 6 | constructor(id: number, name: string, balance: number) { 7 | this.id = id; 8 | this.name = name; 9 | this._balance = balance; 10 | } 11 | getBalance() { 12 | console.log(`My Current Balance is : ${this._balance}`); 13 | } 14 | addDeposit(amount: number) { 15 | this._balance = this._balance + amount; 16 | } 17 | } 18 | 19 | class StudentAccount extends BankAccount{ 20 | test(){ 21 | this. 22 | } 23 | } 24 | 25 | const myAccount = new BankAccount(444, "Persian", 20); 26 | myAccount.addDeposit(20); 27 | myAccount.getBalance(); 28 | 29 | type Add = (a: number, b: number) => number; 30 | 31 | const add: Add = (a, b) => { 32 | return a + b; 33 | }; 34 | 35 | // const sum = add(2, 3); // 5 36 | 37 | class Calculator { 38 | add(a: number, b: number): number { 39 | return a + b; 40 | } 41 | } 42 | 43 | const calculator = new Calculator(); 44 | const sum = calculator.add(2, 3); // 5 45 | 46 | -------------------------------------------------------------------------------- /src/module4/getter-setter.ts: -------------------------------------------------------------------------------- 1 | class BankAccount { 2 | public readonly id: number; 3 | public name: string; 4 | private _balance: number; 5 | 6 | constructor(id: number, name: string, balance: number) { 7 | this.id = id; 8 | this.name = name; 9 | this._balance = balance; 10 | } 11 | 12 | private getTestBalance(): number{ 13 | return this._balance 14 | } 15 | 16 | get Test():number{ 17 | return this.getTestBalance() 18 | } 19 | //getter 20 | get balance(): number { 21 | return this._balance; 22 | } 23 | // getBalance(): number { 24 | // return this._balance; 25 | // } 26 | 27 | //setter 28 | set deposit(amount: number) { 29 | this._balance = this.balance + amount; 30 | } 31 | // addDeposit(amount: number) { 32 | // this._balance = this._balance + amount; 33 | // } 34 | } 35 | 36 | class StudentAccount extends BankAccount { 37 | test() { 38 | this. 39 | } 40 | } 41 | 42 | const myAccount = new BankAccount(444, "Persian", 30); 43 | // myAccount.addDeposit(20); 44 | // myAccount.getBalance(); 45 | // myAccount.getBalance(); 46 | console.log(myAccount.balance); 47 | myAccount.deposit = 30; 48 | console.log(myAccount.balance); 49 | -------------------------------------------------------------------------------- /src/module4/inheritence.ts: -------------------------------------------------------------------------------- 1 | class Parent { 2 | name: string; 3 | age: number; 4 | address: string; 5 | 6 | constructor(name: string, age: number, address: string) { 7 | this.name = name; 8 | this.age = age; 9 | this.address = address; 10 | } 11 | 12 | makeSleep(hours: number): string { 13 | return `This ${this.name} will sleep for ${hours}`; 14 | } 15 | } 16 | 17 | class Student extends Parent { 18 | constructor(name: string, age: number, address: string) { 19 | super(name, age, address); 20 | } 21 | } 22 | 23 | const student1 = new Student('Mr.X',15,'Uganda'); 24 | student1. 25 | 26 | class Teacher extends Parent { 27 | designation: string 28 | 29 | constructor(name: string, age: number, address: string, designation: string) { 30 | super(name,age,address) 31 | this.designation = designation; 32 | } 33 | 34 | takeClasses(numOfClass: number): string { 35 | return `This ${this.name} will take ${numOfClass} class`; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/module4/object.ts: -------------------------------------------------------------------------------- 1 | class Animal { 2 | constructor( 3 | public name: string, 4 | public species: string, 5 | public sound: string 6 | ) {} 7 | public makeSound() { 8 | console.log(`The ${this.name} says ${this.sound}`); // 'German Shephard says Ghew Ghew' 9 | } 10 | } 11 | 12 | const dog = new Animal("German Shepard", "dog", "Ghew Ghew"); 13 | const cat = new Animal("Persian", "cat", "meaw meaw"); 14 | dog.makeSound(); 15 | cat.makeSound(); 16 | 17 | cat.name = "Special Cat"; 18 | -------------------------------------------------------------------------------- /src/module4/polymorphisom.ts: -------------------------------------------------------------------------------- 1 | class Person { 2 | takeNap(): void { 3 | console.log("I am sleeping 8 hours per day"); 4 | } 5 | } 6 | 7 | class Student extends Person { 8 | takeNap(): void { 9 | console.log(`I am sleeping 10 hours per day`); 10 | } 11 | } 12 | 13 | class Developer extends Person { 14 | takeNap(): void { 15 | console.log(`I am sleeping 5 hours per day`); 16 | } 17 | } 18 | 19 | function getNap(param: Person) { 20 | param.takeNap(); 21 | } 22 | 23 | const person1 = new Person(); 24 | const person2 = new Student(); 25 | const person3 = new Developer(); 26 | getNap(person1); 27 | getNap(person2); 28 | getNap(person3); 29 | 30 | class Shape { 31 | getArea(): number { 32 | return 0; 33 | } 34 | } 35 | 36 | // area -> pi *r *r 37 | class Circle extends Shape { 38 | radius: number; 39 | constructor(radius: number) { 40 | super(); 41 | this.radius = radius; 42 | } 43 | getArea(): number { 44 | return Math.PI * this.radius * this.radius; 45 | } 46 | } 47 | 48 | class Rectangle extends Shape { 49 | height: number; 50 | width: number; 51 | constructor(height: number, width: number) { 52 | super(); 53 | this.height = height; 54 | this.width = width; 55 | } 56 | getArea(): number { 57 | return this.width * this.height; 58 | } 59 | } 60 | 61 | function getAreaOfShape(param: Shape) { 62 | console.log(param.getArea()); 63 | } 64 | 65 | getAreaOfShape(new Circle(10)); 66 | getAreaOfShape(new Rectangle(10, 12)); 67 | -------------------------------------------------------------------------------- /src/module4/static.ts: -------------------------------------------------------------------------------- 1 | class Counter { 2 | static counter: number = 0; 3 | 4 | static increment(): number { 5 | return (Counter.counter = Counter.counter + 1); 6 | } 7 | static decrement(): number { 8 | return (Counter.counter = Counter.counter - 1); 9 | } 10 | } 11 | 12 | // const instance1 = new Counter(); 13 | // const instance2 = new Counter(); 14 | console.log(Counter.increment()); // 0-1 15 | console.log(Counter.increment()); // 1-2 16 | -------------------------------------------------------------------------------- /src/module4/type-guard.ts: -------------------------------------------------------------------------------- 1 | //keyof guard 2 | type Alphaneumeric = string | number; 3 | // keyof guard 4 | function add(param1: Alphaneumeric, param2: Alphaneumeric): Alphaneumeric { 5 | if (typeof param1 == "number" && typeof param2 === "number") { 6 | return param1 + param2; 7 | } else { 8 | return param1.toString() + param2.toString(); 9 | } 10 | } 11 | 12 | add("1", "2"); 13 | add(1, 2); 14 | 15 | //in guard 16 | 17 | type NormalUserType = { 18 | name: string; 19 | }; 20 | 21 | type AdminUserType = { 22 | name: string; 23 | role: "admin"; 24 | }; 25 | 26 | function getUser(user: NormalUserType | AdminUserType): string { 27 | if ("role" in user) { 28 | return `I am an admin and my role is ${user.role}`; 29 | } else { 30 | return `I am a normal user`; 31 | } 32 | } 33 | 34 | const normalUser1: NormalUserType = { name: "Mr. kallu" }; 35 | const adminUser1: AdminUserType = { name: "Mr. Gallu", role: "admin" }; 36 | 37 | console.log(getUser(normalUser1)); 38 | console.log(getUser(adminUser1)); 39 | 40 | //instaceof guard 41 | 42 | class Animal { 43 | name: string; 44 | species: string; 45 | constructor(name: string, species: string) { 46 | this.name = name; 47 | this.species = species; 48 | } 49 | 50 | makeSound() { 51 | console.log("I am making sound"); 52 | } 53 | } 54 | 55 | class Dog extends Animal { 56 | constructor(name: string, species: string) { 57 | super(name, species); 58 | } 59 | makeBark() { 60 | console.log(" I am barking"); 61 | } 62 | } 63 | class Cat extends Animal { 64 | constructor(name: string, species: string) { 65 | super(name, species); 66 | } 67 | makeMeaw() { 68 | console.log("I am Meawing"); 69 | } 70 | } 71 | 72 | function isDog(animal: Animal): animal is Dog { 73 | return animal instanceof Dog; 74 | } 75 | 76 | function isCat(animal: Animal): animal is Cat { 77 | return animal instanceof Cat; 78 | } 79 | 80 | function getAnimal(animal: Animal) { 81 | if (isDog(animal)) { 82 | animal.makeBark(); 83 | } else if (isCat(animal)) { 84 | animal.makeMeaw(); 85 | } else { 86 | animal.makeSound(); 87 | } 88 | } 89 | 90 | const animal1 = new Dog("German Bhai", "dog"); // instance -> Dog 91 | const animal2 = new Cat("Persian Bhai", "cat"); // inatance -> Cat 92 | 93 | getAnimal(animal2); 94 | -------------------------------------------------------------------------------- /src/nullable-unknown-never.ts: -------------------------------------------------------------------------------- 1 | // const searchName = (value: string | null) => { 2 | // if (value === null) { 3 | // console.log("There is nothing to search"); 4 | // } else { 5 | // console.log("Searching..."); 6 | // } 7 | // }; 8 | 9 | // searchName(null); 10 | 11 | // // kmh^-1 --> ms^-1 12 | 13 | // const getMyCarSpeed = (speed: unknown) => { 14 | // if (typeof speed === "number") { 15 | // const convertedSpeed = (speed * 1000) / 3600; 16 | // console.log(`My speed is ${convertedSpeed}`); 17 | // } 18 | // if (typeof speed === "string") { 19 | // const [value, unit] = speed.split(" "); // ['10' ,'kmh^-1'] 20 | 21 | // const convertedSpeed = (parseFloat(value) * 1000) / 3600; 22 | // console.log(`My speed is ${convertedSpeed}`); 23 | // } else { 24 | // console.log("There is wrong type"); 25 | // } 26 | // }; 27 | 28 | // getMyCarSpeed(10); 29 | // getMyCarSpeed("10 kmh^-1"); // 10 kmh-1 30 | // getMyCarSpeed(true); 31 | 32 | // function throwError(message: string): never { 33 | // throw new Error(message); 34 | // } 35 | 36 | // throwError("Bhai bhai error hyeche , kandi dimu"); 37 | -------------------------------------------------------------------------------- /src/object.ts: -------------------------------------------------------------------------------- 1 | // const user: { 2 | // company: "Programming Hero"; 3 | // name: string; 4 | // age: number; 5 | // isMarried: boolean; 6 | // wife?: string; 7 | // } = { 8 | // company: "Programming Hero", 9 | // name: "Montu Mia", 10 | // age: 52, 11 | // isMarried: true, 12 | // }; 13 | 14 | // user.company = "Programming Hero"; 15 | -------------------------------------------------------------------------------- /src/other.ts: -------------------------------------------------------------------------------- 1 | // console.log("Hello"); 2 | -------------------------------------------------------------------------------- /src/question-mark.ts: -------------------------------------------------------------------------------- 1 | // //ternary operator 2 | // const age: number = 15; 3 | 4 | // // if (age >= 18) { 5 | // // console.log("Yes"); 6 | // // } else { 7 | // // console.log("No"); 8 | // // } 9 | 10 | // const isAdult = age >= 18 ? " Yes" : "No"; 11 | // // console.log(isAdult); 12 | 13 | // // Nullish Coalesnace Operator 14 | // // Null and Undefined 15 | 16 | // const isAuthenticatedUser = ""; 17 | // const userName = isAuthenticatedUser ?? "Guest"; 18 | // const userName2 = isAuthenticatedUser ? isAuthenticatedUser : "Guest"; 19 | 20 | // console.log({ userName }, { userName2 }); 21 | 22 | // type Manush = { 23 | // name: string; 24 | // age: number; 25 | // address: { 26 | // city: "NO City"; 27 | // road: "No Road"; 28 | // home?: ""; 29 | // }; 30 | // }; 31 | 32 | // const manush1: Manush = { 33 | // name: "Manush", 34 | // age: 100, 35 | // address: { 36 | // city: "NO City", 37 | // road: "No Road", 38 | // }, 39 | // }; 40 | 41 | // const home = manush1?.address?.home ?? "No Home"; // default 'No Home' 42 | // console.log({ home }); 43 | -------------------------------------------------------------------------------- /src/union-intersection.ts: -------------------------------------------------------------------------------- 1 | // type NoobDeveloper = { 2 | // name: string; 3 | // }; 4 | 5 | // // type JuniorDeveloper = { 6 | // // name: string; 7 | // // expertise: string; 8 | // // experience: number; 9 | // // }; 10 | 11 | // type JuniorDeveloper = NoobDeveloper & { 12 | // expertise: string; 13 | // experience: number; 14 | // }; 15 | 16 | // type NextLevelDeveloper = JuniorDeveloper & { 17 | // leadershipExperience: number; 18 | // level: "junior" | "mid" | "senior"; 19 | // }; 20 | 21 | // const newDeveloper: NoobDeveloper | JuniorDeveloper = { 22 | // name: "Moznu Mia", 23 | // expertise: "Javascript", 24 | // experience: 1, 25 | // }; 26 | 27 | // const developer: NextLevelDeveloper = { 28 | // name: "Next Bhai", 29 | // expertise: "Typescript", 30 | // experience: 2, 31 | // leadershipExperience: 1, 32 | // level: "senior", 33 | // }; 34 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | /* Visit https://aka.ms/tsconfig to read more about this file */ 4 | 5 | /* Projects */ 6 | // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ 7 | // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ 8 | // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ 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": "ES6" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */, 15 | // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ 16 | // "jsx": "preserve", /* Specify what JSX code is generated. */ 17 | // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */ 18 | // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ 19 | // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ 20 | // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ 21 | // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ 22 | // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ 23 | // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ 24 | // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ 25 | // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ 26 | 27 | /* Modules */ 28 | "module": "commonjs" /* Specify what module code is generated. */, 29 | "rootDir": "./src" /* Specify the root folder within your source files. */, 30 | // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */ 31 | // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ 32 | // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ 33 | // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ 34 | // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ 35 | // "types": [], /* Specify type package names to be included without being referenced in a source file. */ 36 | // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ 37 | // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ 38 | // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */ 39 | // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */ 40 | // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */ 41 | // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */ 42 | // "resolveJsonModule": true, /* Enable importing .json files. */ 43 | // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ 44 | // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ 45 | 46 | /* JavaScript Support */ 47 | // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ 48 | // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ 49 | // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ 50 | 51 | /* Emit */ 52 | // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ 53 | // "declarationMap": true, /* Create sourcemaps for d.ts files. */ 54 | // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ 55 | // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ 56 | // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ 57 | // "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. */ 58 | "outDir": "./dist" /* Specify an output folder for all emitted files. */, 59 | // "removeComments": true, /* Disable emitting comments. */ 60 | // "noEmit": true, /* Disable emitting files from a compilation. */ 61 | // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ 62 | // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */ 63 | // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ 64 | // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ 65 | // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ 66 | // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ 67 | // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ 68 | // "newLine": "crlf", /* Set the newline character for emitting files. */ 69 | // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ 70 | // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ 71 | // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ 72 | // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ 73 | // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ 74 | // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ 75 | 76 | /* Interop Constraints */ 77 | // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ 78 | // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */ 79 | // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ 80 | "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */, 81 | // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ 82 | "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */, 83 | 84 | /* Type Checking */ 85 | "strict": true /* Enable all strict type-checking options. */, 86 | "noImplicitAny": true /* Enable error reporting for expressions and declarations with an implied 'any' type. */, 87 | // "strictNullChecks": true /* When type checking, take into account 'null' and 'undefined'. */, 88 | // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ 89 | // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ 90 | // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ 91 | // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ 92 | // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ 93 | // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ 94 | // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ 95 | // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ 96 | // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ 97 | // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ 98 | // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ 99 | // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ 100 | // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ 101 | // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ 102 | // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ 103 | // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ 104 | 105 | /* Completeness */ 106 | // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ 107 | "skipLibCheck": true /* Skip type checking all .d.ts files. */ 108 | } 109 | } 110 | --------------------------------------------------------------------------------