├── .vscode └── launch.json ├── dist ├── arrays.js ├── arrays.js.map ├── enums.js ├── enums.js.map ├── index.js ├── index.js.map ├── types-variables.js └── types-variables.js.map ├── src ├── arrays.ts ├── enums.ts ├── functions.ts ├── intersection-types.ts ├── literal-types.ts ├── nullable-types.ts ├── objects.ts ├── oop │ └── car.ts ├── optional-chaining.ts ├── type-aliases.ts ├── types-variables.ts └── union-types.ts └── tsconfig.json /.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 | "preLaunchTask": "tsc: build - tsconfig.json", 14 | "outFiles": ["${workspaceFolder}/**/*.js"] 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /dist/arrays.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | //# sourceMappingURL=arrays.js.map -------------------------------------------------------------------------------- /dist/arrays.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"arrays.js","sourceRoot":"","sources":["../src/arrays.ts"],"names":[],"mappings":""} -------------------------------------------------------------------------------- /dist/enums.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var Size; 3 | (function (Size) { 4 | Size[Size["Small"] = 1] = "Small"; 5 | Size[Size["Medium"] = 2] = "Medium"; 6 | Size[Size["Large"] = 3] = "Large"; 7 | })(Size || (Size = {})); 8 | let mySize = Size.Medium; 9 | console.log(mySize); 10 | //# sourceMappingURL=enums.js.map -------------------------------------------------------------------------------- /dist/enums.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"enums.js","sourceRoot":"","sources":["../src/enums.ts"],"names":[],"mappings":";AAcA,IAAK,IAAiC;AAAtC,WAAK,IAAI;IAAG,iCAAS,CAAA;IAAE,mCAAM,CAAA;IAAE,iCAAK,CAAA;AAAC,CAAC,EAAjC,IAAI,KAAJ,IAAI,QAA6B;AACtC,IAAI,MAAM,GAAS,IAAI,CAAC,MAAM,CAAC;AAC/B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA"} -------------------------------------------------------------------------------- /dist/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /dist/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""} -------------------------------------------------------------------------------- /dist/types-variables.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | let sales = 123456789; 3 | let course = 'TypeScript'; 4 | let is_published = true; 5 | let level; 6 | function render(document) { 7 | console.log(document); 8 | } 9 | //# sourceMappingURL=types-variables.js.map -------------------------------------------------------------------------------- /dist/types-variables.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"types-variables.js","sourceRoot":"","sources":["../src/types-variables.ts"],"names":[],"mappings":";AAWA,IAAI,KAAK,GAAW,SAAW,CAAC;AAChC,IAAI,MAAM,GAAG,YAAY,CAAC;AAC1B,IAAI,YAAY,GAAY,IAAI,CAAC;AACjC,IAAI,KAAK,CAAC;AAIV,SAAS,MAAM,CAAC,QAAa;IACzB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;AACzB,CAAC"} -------------------------------------------------------------------------------- /src/arrays.ts: -------------------------------------------------------------------------------- 1 | /* 2 | Javascript'te diziler veya objelerin her biri 3 | değişik türde tipler alabileceği için aşağıda verilen 4 | örnekte numbers ile set edilmiş dizi değişkeninde 5 | içeriğin sadece number olabileceğini söylüyoruz, bu nedenle 6 | '3' bir string olduğundan dolayı hata veriyor. 7 | */ 8 | // @Hata : let numbers: number[] = [1, 2, '3']; 9 | 10 | // Çözüm 11 | // 1, 'Mahmut' 12 | // let user: [number, string, boolean, number] = [1, 'Mahmut', true, 0]; 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/enums.ts: -------------------------------------------------------------------------------- 1 | // Enums 2 | // const small = 1; 3 | // const medium = 2; 4 | // const large = 3; 5 | 6 | 7 | /* 8 | enum (Sıralı liste) özelliği, TypeScript'te sembolik adları 9 | olan bir sabit değer kümesi oluşturmanızı sağlayan bir özelliktir. 10 | Bu sembolik adlar, kodun daha okunaklı ve anlaşılır olmasını 11 | sağlar. 12 | */ 13 | 14 | // PascalCase 15 | enum Size { Small = 1, Medium, Large } 16 | let mySize: Size = Size.Medium; 17 | console.log(mySize) -------------------------------------------------------------------------------- /src/functions.ts: -------------------------------------------------------------------------------- 1 | // void, herhangi bir veri döndürmeyeceğini belirtir. 2 | 3 | // eğer burada () void olarak belirtmiş olsaydık 4 | // herhangi bir veri dönmeyeceğini set ederdik 5 | // ki default olarak bu geliyor, ancak içeride void yazmadan 6 | // herhangi bir veri return ediyorsak bu void'i default olarak 7 | // kaldıracak 8 | 9 | function calculateTax(income: number) : number 10 | /*: void Type 'number' is not assignable to type 'void'.ts(2322) */ 11 | { 12 | // : void default olarak kaldırıldı. Veri return ediliyor. 13 | return 0; 14 | } 15 | 16 | 17 | // taxYear kısmına taxYear?: number olarak set ettiğimizde bunu opsiyonel bırakabiliyoruz 18 | // default olarak geçmesi gereken parametreye ihtiyaç olmadığını belirtebiliriz. 19 | function calculateTX(income: number, taxYear = 2022) : number { 20 | // @Hata: Hata vermesini bekliyoruz çünkü bu verinin gerçekten gelip gelmeyeceği hakkında kesin bir sonuç yok. 21 | // if (taxYear < 2022) 22 | // return income * 1.2; 23 | // return income * 1.3; 24 | 25 | // @Çözüm: Default olarak ya parametre içinde set edeceğiz 26 | // ya da if bloğunun içinde belirteceğiz 27 | // Buradaki "best practice" her zaman için opsiyonel bırakmayıp 28 | // Veriyi default parameters value olarak geçmek olacak 29 | // function calculateTX(income: number, taxYear = 2022) : number 30 | if (taxYear < 2022) 31 | return income * 1.2; 32 | return income * 1.3; 33 | } 34 | 35 | calculateTX(10_000, 2023); -------------------------------------------------------------------------------- /src/intersection-types.ts: -------------------------------------------------------------------------------- 1 | /* 2 | - Problem? 3 | Union typelarda number veya string olmalıydı ancak 4 | İmkansız olsa da olabilecek bir diğer senaryo 5 | Değişkenin veya default parametre içinde geçilen type'ın 6 | Hem string hem de number olabilme olasılığı yönünde? :D 7 | Olur mu olur. 8 | */ 9 | 10 | // let weight: number & string; 11 | 12 | // Tertemiz örnek 13 | type Draggable = { 14 | drag: () => void; 15 | } 16 | type Resizable = { 17 | resize: () => void; 18 | } 19 | type UIWidget = Draggable & Resizable; 20 | 21 | let textBox: UIWidget = { 22 | drag: () => {}, 23 | resize: () => {} 24 | } -------------------------------------------------------------------------------- /src/literal-types.ts: -------------------------------------------------------------------------------- 1 | // Değişmeyen typelar. Spesific olarak sadece kullanabilecek 2 | // built-in ile gelmeyen bizim set ettiğimiz typelar. 3 | 4 | // Kesin veya özel değer! 1 5 | // let quantity: 50 = 50; 6 | 7 | // Kesin veya özel değer! 2 8 | // let quantity: 50 | 100 = 100; 9 | 10 | // Type alias ile kullanım 11 | type Quantity = 50 | 100; 12 | type Metric = 'cm' |'inch'; 13 | 14 | let quantity: Quantity | 100 = 100; 15 | let metric: Metric = 'cm'; -------------------------------------------------------------------------------- /src/nullable-types.ts: -------------------------------------------------------------------------------- 1 | // typescript null veya undefined verilerde çok sıkıymış. 2 | /* 3 | * Problem? 4 | - Typescript'in bu konuda sıkı olmasının nedeni açık 5 | Eğer null bir değer geliyorsa ve fonksiyon içerisinde 6 | gerçekleştirmesi gereken bir işlevi gerçekleştiremiyorsa 7 | hata fırlatması olası. Çünkü olmayan bir veri için bir 8 | işlem gerçekleştiremeye çalışıyor. Aşağıdaki örnek gibi 9 | greet() adında bir fonksiyon yazdık lakin veri null geldiği 10 | için bunu .toUpperCase fonksiyonu ile gerçekleştiremiyor. 11 | */ 12 | // function greet(name: string) { 13 | // console.log(name.toUpperCase); 14 | // } 15 | 16 | // greet(null); 17 | 18 | // @Çözüm: 19 | // burada gelen veriyi kontrol etmeliyiz 20 | // çünkü bir sonuç döneceğimiz için bir veri çıkarmamız gerek 21 | // union type kullanarak fonksiyon içine null | undefined 22 | // olarak geçmemiz yeterli. 23 | function greet(name: string | null | undefined) { 24 | if (name) 25 | console.log(name.toUpperCase); 26 | else 27 | console.log("Selam Mahmut!") 28 | } 29 | 30 | greet(undefined); -------------------------------------------------------------------------------- /src/objects.ts: -------------------------------------------------------------------------------- 1 | // Javascript literatüründe objeler her zaman dinamiktir 2 | // dolayısıyla burada type belirlerken dikkat etmemiz gereken 3 | // noktalar var. 4 | // @Hata: 5 | // let employee = {id : 1}; 6 | // employee.name = "Mahmut"; 7 | 8 | // 1. Çözüm 9 | // let employee: { 10 | // id: number, 11 | // name?: string // Optional bırakabiliriz 12 | // } = {id : 1}; 13 | // employee.name = "Mahmut"; 14 | 15 | // 2. Çözüm 16 | // let employee: { 17 | // id: number, 18 | // name: string 19 | // } = {id : 1, name: "Mahmut"}; // Default value geçebiliriz. 20 | // employee.name = "Mahmut"; 21 | 22 | // Bazen objelerde sonrasında değiştirilmeyecek veriler olabilir. 23 | // Annotation'da `readonly` atamamız yeterlidir. 24 | 25 | // let employee: { 26 | // readonly id: number, 27 | // name: string 28 | // } = {id : 1, name: "Mahmut"}; 29 | // employee.id = 0; // Yapamayız, id readonly annotations aldı. -------------------------------------------------------------------------------- /src/oop/car.ts: -------------------------------------------------------------------------------- 1 | /* 2 | Burada interface olarak aracın alabileceği 3 | Değerleri önceden set ediyorum. Bu değerler dışında veri girişi olmaması için 4 | */ 5 | interface CarModel { 6 | brand: string; 7 | model: number; 8 | plate: string; 9 | used: boolean; 10 | } 11 | // Interface ile set ettiğim Interface'i class içinde kullanıyorum 12 | class Car implements CarModel { 13 | // brand! non-null assertion 14 | /* 15 | "!" işaretini kullanarak, brand, model, plate ve used özelliklerinin null veya undefined olamayacağını belirttik. 16 | Bu sayede hata vermesini önlemek için özelliklere bir değer atandığından emin olduğumuz durumlarda faydalı olabilir. 17 | */ 18 | brand!: string; 19 | model!: number; 20 | plate!: string; 21 | used!: boolean; 22 | cars: CarModel[] = []; 23 | // yapıcı metod 24 | constructor(cars: CarModel[] = []) { 25 | this.cars = cars; 26 | } 27 | // Yeni bir araba ekliyorum. 28 | new(brand: string, model: number, plate: string, used: boolean) { 29 | /* 30 | CarModel arayüzü, bir aracın özelliklerinin neler olabileceğini tanımlayan bir şablon gibi düşünebilirsiniz. 31 | Bu özellikler arasında brand, model, plate ve used yer almaktadır. 32 | */ 33 | const car: CarModel = { 34 | brand: brand, 35 | model: model, 36 | plate: plate, 37 | used: used 38 | }; 39 | this.cars.push(car); 40 | console.log("Yeni bir araba eklendi."); 41 | } 42 | /* 43 | keyof ts'te kullanılan bir anahtar kelime olup, bir nesnenin özellik adlarını, yani nesnenin özelliklerinin keylerini temsil eder. 44 | propertyValue parametresi ise özelliğin değerini belirtir. 45 | Bu değer herhangi bir şey olabilir, 46 | bu nedenle propertyValue parametresinin tipi any olarak belirtilmiştir. 47 | */ 48 | // Özelliğine göre arabamı getiriyorum. 49 | getCar(propertyName: keyof CarModel, propertyValue: any): CarModel[] { 50 | return this.cars.filter(car => car[propertyName] === propertyValue); 51 | } 52 | } 53 | 54 | // Sınıfımı çağır 55 | const carClass = new Car(); 56 | // Yeni bir araç ekle 57 | carClass.new('Audi', 2018, '07JKL321', false); 58 | // Plakası '07JKL321' olan aracımı getir. 59 | const carByPlate = carClass.getCar('plate', '07JKL321'); 60 | console.log(carByPlate); -------------------------------------------------------------------------------- /src/optional-chaining.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhcifci/typescript-derslerim/0938f5d508ec3d0bb2740782b4d69ef6e0c2672d/src/optional-chaining.ts -------------------------------------------------------------------------------- /src/type-aliases.ts: -------------------------------------------------------------------------------- 1 | // Mosh abimiz DRY kelimesinden bahsetti 2 | // Demek istediği notation'u bir defa tanımla her defasında 3 | // kullan. Dont Repeat Yourself 4 | 5 | // @NEDEN? Problemin ana kaynağı 6 | // Her defasında bir employee objesi için type tanımlamak. 7 | 8 | // let employee: { 9 | // readonly id: number, 10 | // name: string , 11 | // retire: (date: Date) => void; 12 | // } = { 13 | // id : 1, 14 | // name: "Mahmut", 15 | // retire: (date: Date) => { 16 | // console.log(date); 17 | // } 18 | // }; 19 | 20 | // BAL GİBİ ÇÖZÜM! Alias tanımla geç 21 | type Employee = { 22 | readonly id: number, 23 | name: string , 24 | retire: (date: Date) => void; 25 | } 26 | 27 | let employee: Employee = { 28 | id : 1, 29 | name: "Mahmut", 30 | retire: (date: Date) => { 31 | console.log(date); 32 | } 33 | }; 34 | -------------------------------------------------------------------------------- /src/types-variables.ts: -------------------------------------------------------------------------------- 1 | // Type annotation 2 | // let age: number = 20; 3 | // if (age < 50) 4 | // age +=10; 5 | // console.log(age); 6 | 7 | /* 8 | Type annotation yaparken veriyi set edebilirsin ve 9 | bu veri türü ne ise annotation'ını veri türüne göre 10 | yapar. 11 | */ 12 | let sales: number = 123_456_789; // Number 13 | let course = 'TypeScript'; // String 14 | let is_published: boolean = true; // boolean 15 | let level; // any 16 | //level = 1; 17 | //level = 'a'; 18 | 19 | function render(document: any) { 20 | console.log(document) 21 | } 22 | -------------------------------------------------------------------------------- /src/union-types.ts: -------------------------------------------------------------------------------- 1 | // Union typelar ile ile bir değişkene veya bir 2 | // fonksiyon parametresine birden fazla type verebiliriz 3 | 4 | 5 | // Buradaki weight parametresi string'de gelebilir, number'da 6 | // bu durumda tam olarak union types kullanıyoruz 7 | // function kgToLbs(weight: number | string) {} 8 | // kgToLbs(10); 9 | // kgToLbs("10kg") 10 | 11 | function kgToLbs(weight: number | string) : number { 12 | // Narrowing (Daralma) 13 | // Burada veri hem number hem string formatta olabileceği 14 | // gibi iki senerayoyuda ele almamız gerekiyor aksi halde 15 | // hata almamız kaçınılmaz 16 | 17 | // Numbersa? 18 | if ( typeof weight === "number") { 19 | return weight * 2.2; 20 | } else { 21 | // String ise? 22 | return parseInt(weight) * 2.2; 23 | } 24 | 25 | } 26 | kgToLbs(10); 27 | kgToLbs("10kg") -------------------------------------------------------------------------------- /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": "ES2016" /* 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 TC39 stage 2 draft 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": "node", /* 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 | // "resolveJsonModule": true, /* Enable importing .json files. */ 39 | // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ 40 | 41 | /* JavaScript Support */ 42 | // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ 43 | // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ 44 | // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ 45 | 46 | /* Emit */ 47 | // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ 48 | // "declarationMap": true, /* Create sourcemaps for d.ts files. */ 49 | // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ 50 | "sourceMap": true /* Create source map files for emitted JavaScript files. */, 51 | // "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. */ 52 | "outDir": "./dist" /* Specify an output folder for all emitted files. */, 53 | "removeComments": true /* Disable emitting comments. */, 54 | // "noEmit": true, /* Disable emitting files from a compilation. */ 55 | // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ 56 | // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */ 57 | // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ 58 | // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ 59 | // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ 60 | // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ 61 | // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ 62 | // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ 63 | // "newLine": "crlf", /* Set the newline character for emitting files. */ 64 | // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ 65 | // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ 66 | "noEmitOnError": true /* Disable emitting files if any type checking errors are reported. */, 67 | // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ 68 | // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ 69 | // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ 70 | 71 | /* Interop Constraints */ 72 | // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ 73 | // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ 74 | "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */, 75 | // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ 76 | "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */, 77 | 78 | /* Type Checking */ 79 | "strict": true /* Enable all strict type-checking options. */, 80 | // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ 81 | // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ 82 | // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ 83 | // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ 84 | // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ 85 | // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ 86 | // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ 87 | // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ 88 | "noUnusedLocals": true /* Enable error reporting when local variables aren't read. */, 89 | "noUnusedParameters": true /* Raise an error when a function parameter isn't read. */, 90 | // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ 91 | // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ 92 | // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ 93 | // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ 94 | // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ 95 | // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ 96 | // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ 97 | // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ 98 | 99 | /* Completeness */ 100 | // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ 101 | "skipLibCheck": true /* Skip type checking all .d.ts files. */ 102 | } 103 | } 104 | --------------------------------------------------------------------------------