├── .editorconfig ├── .gitignore ├── README.md ├── package-lock.json ├── package.json ├── src ├── Inheritance.ts ├── abstract.ts ├── getters_setters.ts ├── interface3.ts ├── interfaces.ts ├── interfaces2.ts ├── main.ts ├── oo_basic.ts ├── oo_basic2.ts ├── oo_basic3.ts ├── oo_basic4.ts ├── static.ts ├── super.ts └── visibility.ts └── tsconfig.json /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: https://EditorConfig.org 2 | 3 | # top-most EditorConfig file 4 | root = true 5 | 6 | [*] 7 | indent_style = space 8 | indent_size = 2 9 | end_of_line = lf 10 | charset = utf-8 11 | trim_trailing_whitespace = false 12 | insert_final_newline = true -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | dist/ 3 | *.log 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Curso de TypeScript: Programação Orientada a Objetos com TypeScript 2 | 3 | Curso Completo Sobre Orientação a Objetos (POO) com TypeScript. 4 | 5 | - :movie_camera: [Acesse o Curso](https://academy.especializati.com.br/curso/typescript-poo). 6 | 7 | 8 | Links Úteis: 9 | 10 | - :tada: [Saiba Mais](https://linktr.ee/especializati) 11 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "typescript-oo", 3 | "version": "1.0.0", 4 | "lockfileVersion": 2, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "typescript-oo", 9 | "version": "1.0.0", 10 | "license": "ISC", 11 | "devDependencies": { 12 | "typescript": "^4.7.4" 13 | } 14 | }, 15 | "node_modules/typescript": { 16 | "version": "4.7.4", 17 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz", 18 | "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==", 19 | "dev": true, 20 | "bin": { 21 | "tsc": "bin/tsc", 22 | "tsserver": "bin/tsserver" 23 | }, 24 | "engines": { 25 | "node": ">=4.2.0" 26 | } 27 | } 28 | }, 29 | "dependencies": { 30 | "typescript": { 31 | "version": "4.7.4", 32 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz", 33 | "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==", 34 | "dev": true 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "typescript-oo", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "devDependencies": { 13 | "typescript": "^4.7.4" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Inheritance.ts: -------------------------------------------------------------------------------- 1 | export class User { 2 | protected name: string // public|protected|private 3 | private email: string 4 | private address: Address[] = [] 5 | private active: boolean = false 6 | 7 | constructor(name: string, email: string, active: boolean = false) { 8 | this.name = name 9 | this.email = email 10 | this.active = active 11 | 12 | // this.validation() 13 | } 14 | 15 | public addAddress(newAddress: Address): void { 16 | this.address.push(newAddress) 17 | } 18 | 19 | public changeName(newName: string): void { 20 | if (newName.length < 3) { 21 | throw new Error('invalid name') 22 | } 23 | 24 | this.name = newName 25 | } 26 | 27 | public getName(): string { 28 | return this.name 29 | } 30 | 31 | public getNumber(): number { 32 | return 123 33 | } 34 | } 35 | 36 | class Manager extends User { 37 | public getName(): string { 38 | return `Manager: ${this.name}` 39 | } 40 | 41 | public getNumber(): number { 42 | return 321 43 | } 44 | } 45 | class Admin extends User { 46 | public getName(): string { 47 | return `Adm: ${this.name} $ ` 48 | } 49 | 50 | public getNumber(): number { 51 | return 55342 52 | } 53 | } 54 | 55 | const manager1 = new Manager('Manager1', 'manager1@email.com', true) 56 | console.log(manager1.getName()) 57 | -------------------------------------------------------------------------------- /src/abstract.ts: -------------------------------------------------------------------------------- 1 | abstract class Person { 2 | protected abstract score: number 3 | 4 | constructor( 5 | protected name: string 6 | ) {} 7 | 8 | public setScore(score: number): void { 9 | if (score < 0 || score > 900) { 10 | throw new Error('Score invalid') 11 | } 12 | 13 | this.score = score 14 | } 15 | 16 | public abstract calcScore(): number; 17 | } 18 | 19 | class Student extends Person { 20 | protected score: number; 21 | 22 | constructor(name: string, score: number) { 23 | super(name) 24 | 25 | this.score = score 26 | } 27 | 28 | public calcScore(): number { 29 | return 800; 30 | } 31 | } 32 | 33 | class Teacher extends Person { 34 | protected score: number = 0; 35 | 36 | public calcScore(): number { 37 | return this.score + 800; 38 | } 39 | } 40 | 41 | const student1 = new Student('Carlos', 700) 42 | -------------------------------------------------------------------------------- /src/getters_setters.ts: -------------------------------------------------------------------------------- 1 | export class Address { 2 | private _address: string = ''; 3 | private _zipCode: string = ''; 4 | private _numberA?: number 5 | 6 | public set address(address: string){ 7 | if (address.length < 3) { 8 | throw new Error('invalid address') 9 | } 10 | 11 | this._address = address 12 | } 13 | 14 | public get address(): string { 15 | return this._address 16 | } 17 | 18 | public set zipCode(zipCode: string) { 19 | this._zipCode = zipCode 20 | } 21 | 22 | public get zipCode(): string { 23 | return this._zipCode.replace(/\D/g, '') 24 | } 25 | 26 | public set numberA(numberA: number) { 27 | this._numberA = numberA 28 | } 29 | 30 | public get numberA(): number { 31 | return this._numberA ?? 123 32 | } 33 | } 34 | const address1 = new Address() 35 | address1.zipCode = '75722-12' 36 | console.log(address1.zipCode) 37 | -------------------------------------------------------------------------------- /src/interface3.ts: -------------------------------------------------------------------------------- 1 | type DefaultResponse = { 2 | id: (string|number), 3 | name: string, 4 | createdAt: string 5 | } 6 | type ID = (string|number) 7 | type InputDto = {name: string, active: boolean} 8 | 9 | interface Repository { 10 | readonly model: any; 11 | findAll(): DefaultResponse[], 12 | findById(id: ID): DefaultResponse 13 | insert(data: InputDto): DefaultResponse 14 | update(id: ID, data: InputDto): DefaultResponse 15 | destroy(id: ID): boolean 16 | } 17 | 18 | interface Searchable { 19 | search(filter: string): DefaultResponse[] 20 | } 21 | 22 | interface EventManager { 23 | dispatch(payload: object): void 24 | } 25 | 26 | interface FullRepository extends Repository, Searchable, EventManager { 27 | } 28 | 29 | // class UserRepository implements Repository, Searchable, EventManager { 30 | class UserRepository implements FullRepository { 31 | dispatch(payload: object): void { 32 | throw new Error("Method not implemented."); 33 | } 34 | search(filter: string): DefaultResponse[] { 35 | throw new Error("Method not implemented."); 36 | } 37 | model: any; 38 | findAll(): DefaultResponse[] { 39 | throw new Error("Method not implemented."); 40 | } 41 | findById(id: ID): DefaultResponse { 42 | throw new Error("Method not implemented."); 43 | } 44 | insert(data: InputDto): DefaultResponse { 45 | throw new Error("Method not implemented."); 46 | } 47 | update(id: ID, data: InputDto): DefaultResponse { 48 | throw new Error("Method not implemented."); 49 | } 50 | destroy(id: ID): boolean { 51 | throw new Error("Method not implemented."); 52 | } 53 | 54 | } 55 | 56 | export {} 57 | -------------------------------------------------------------------------------- /src/interfaces.ts: -------------------------------------------------------------------------------- 1 | interface Location { 2 | latitude: number, 3 | longitude: number, 4 | readonly numberLocation: number 5 | 6 | getLocation(): string; 7 | } 8 | 9 | const getLocation = (location: Location): string => { 10 | return `${location.latitude} - ${location.longitude}` 11 | } 12 | 13 | // const location = { 14 | // latitude: 12312, 15 | // longitude2: 321 16 | // } 17 | // getLocation(location) 18 | 19 | // const location: Location = { 20 | // latitude: 123, 21 | // longitude: 321, 22 | // numberLocation: 123 23 | // } 24 | // location.numberLocation = 32132 // error 25 | // getLocation(location) 26 | 27 | class LocationMap implements Location { 28 | latitude: number; 29 | longitude: number; 30 | numberLocation: number = 0; 31 | 32 | constructor(latitude: number, longitude: number) { 33 | this.latitude = latitude 34 | this.longitude = longitude 35 | } 36 | 37 | getLocation(): string { 38 | return 'any'; 39 | } 40 | } 41 | class LocationMapBR implements Location { 42 | latitude: number; 43 | longitude: number; 44 | numberLocation: number = 0; 45 | 46 | constructor(latitude: number, longitude: number) { 47 | this.latitude = latitude 48 | this.longitude = longitude 49 | } 50 | 51 | getLocation(): string { 52 | return 'any'; 53 | } 54 | } 55 | getLocation(new LocationMapBR(123, 321)) 56 | 57 | export {} 58 | -------------------------------------------------------------------------------- /src/interfaces2.ts: -------------------------------------------------------------------------------- 1 | type DefaultResponse = { 2 | id: (string|number), 3 | name: string, 4 | createdAt: string 5 | } 6 | type ID = (string|number) 7 | type InputDto = {name: string, active: boolean} 8 | 9 | interface Repository { 10 | readonly model: any; 11 | findAll(): DefaultResponse[], 12 | findById(id: ID): DefaultResponse 13 | insert(data: InputDto): DefaultResponse 14 | update(id: ID, data: InputDto): DefaultResponse 15 | destroy(id: ID): boolean 16 | } 17 | 18 | class UserRepositoryMySQL implements Repository { 19 | model: any; 20 | 21 | constructor(model: any) { 22 | this.model = model 23 | } 24 | 25 | findAll(): DefaultResponse[] { 26 | throw new Error("Method not implemented."); 27 | } 28 | findById(id: ID): DefaultResponse { 29 | throw new Error("Method not implemented."); 30 | } 31 | insert(data: InputDto): DefaultResponse { 32 | throw new Error("Method not implemented."); 33 | } 34 | update(id: ID, data: InputDto): DefaultResponse { 35 | throw new Error("Method not implemented."); 36 | } 37 | destroy(id: ID): boolean { 38 | throw new Error("Method not implemented."); 39 | } 40 | } 41 | 42 | class UserRepositoryMongo implements Repository { 43 | model: any; 44 | findAll(): DefaultResponse[] { 45 | throw new Error("Method not implemented."); 46 | } 47 | findById(id: ID): DefaultResponse { 48 | throw new Error("Method not implemented."); 49 | } 50 | insert(data: InputDto): DefaultResponse { 51 | throw new Error("Method not implemented."); 52 | } 53 | update(id: ID, data: InputDto): DefaultResponse { 54 | throw new Error("Method not implemented."); 55 | } 56 | destroy(id: ID): boolean { 57 | throw new Error("Method not implemented."); 58 | } 59 | } 60 | 61 | const getAllUsers = (repository: Repository): DefaultResponse[] => { 62 | return repository.findAll() 63 | } 64 | 65 | export {} 66 | -------------------------------------------------------------------------------- /src/main.ts: -------------------------------------------------------------------------------- 1 | console.log('test') 2 | -------------------------------------------------------------------------------- /src/oo_basic.ts: -------------------------------------------------------------------------------- 1 | class User { 2 | name: string 3 | email: string 4 | active: boolean = false 5 | 6 | constructor(name: string, email: string, active: boolean = false) { 7 | console.log('constructor called') 8 | this.name = name 9 | this.email = email 10 | this.active = active 11 | } 12 | } 13 | 14 | const carlos = new User('Carlos', 'carlos@email.com') 15 | console.log(carlos.name) 16 | const user2 = new User('User2', 'user2@email.com', true) 17 | console.log(user2) 18 | const user3 = new User('User3', 'user3@email.com') 19 | console.log(user3) 20 | -------------------------------------------------------------------------------- /src/oo_basic2.ts: -------------------------------------------------------------------------------- 1 | class Address { 2 | constructor( 3 | public address: string, 4 | public zipCode: string, 5 | public number?: number 6 | ) {} 7 | } 8 | 9 | export class User { 10 | name: string 11 | email: string 12 | address: Address 13 | active: boolean = false 14 | 15 | constructor(name: string, email: string, address: Address, active: boolean = false) { 16 | this.name = name 17 | this.email = email 18 | this.address = address 19 | this.active = active 20 | } 21 | } 22 | const address1 = new Address('Rua x', '75702-050', 187); 23 | const user1 = new User('User 01', 'user1@email.com', address1) 24 | console.log(user1) 25 | 26 | const address2 = new Address('Rua y', '75702-051', 188); 27 | const user2 = new User('User 02', 'user2@email.com', address2) 28 | console.log(user2.address) 29 | -------------------------------------------------------------------------------- /src/oo_basic3.ts: -------------------------------------------------------------------------------- 1 | class Address { 2 | constructor( 3 | public address: string, 4 | public zipCode: string, 5 | public number?: number 6 | ) {} 7 | } 8 | 9 | export class User { 10 | name: string 11 | email: string 12 | address: Address[] = [] 13 | active: boolean = false 14 | 15 | constructor(name: string, email: string, active: boolean = false) { 16 | this.name = name 17 | this.email = email 18 | this.active = active 19 | } 20 | 21 | addAddress(newAddress: Address): void { 22 | this.address.push(newAddress) 23 | } 24 | 25 | getAddress(): Address[] { 26 | return this.address 27 | } 28 | } 29 | 30 | const address1 = new Address('Rua x', '75702-050', 187); 31 | const user1 = new User('User 01', 'user1@email.com') 32 | console.log(user1) 33 | user1.addAddress(address1) 34 | user1.addAddress(address1) 35 | user1.addAddress(address1) 36 | console.log(user1) 37 | -------------------------------------------------------------------------------- /src/oo_basic4.ts: -------------------------------------------------------------------------------- 1 | class Address { 2 | constructor( 3 | public address: string, 4 | public readonly zipCode: string, 5 | public number?: number 6 | ) {} 7 | 8 | changeZipCode(newZipCode: string): void { 9 | // this.zipCode = newZipCode 10 | } 11 | } 12 | 13 | const address1 = new Address('Rua x', '75702-050', 187) 14 | console.log(address1.zipCode) 15 | -------------------------------------------------------------------------------- /src/static.ts: -------------------------------------------------------------------------------- 1 | export class Address { 2 | private _address: string = ''; 3 | private _zipCode: string = ''; 4 | private _numberA?: number 5 | private static defaultCepValidation = 75000000 6 | 7 | public set address(address: string){ 8 | if (address.length < 3) { 9 | throw new Error('invalid address') 10 | } 11 | 12 | this._address = address 13 | } 14 | 15 | public get address(): string { 16 | return this._address 17 | } 18 | 19 | public set zipCode(zipCode: string) { 20 | this._zipCode = zipCode 21 | } 22 | 23 | public get zipCode(): string { 24 | return this._zipCode.replace(/\D/g, '') 25 | } 26 | 27 | public set numberA(numberA: number) { 28 | this._numberA = numberA 29 | } 30 | 31 | public get numberA(): number { 32 | return this._numberA ?? 123 33 | } 34 | 35 | public static isCepValid(zipCode: string): boolean { 36 | return parseInt(zipCode.replace(/\D/g, '')) > Address.defaultCepValidation 37 | } 38 | } 39 | console.log(Address.isCepValid('75605-987')) 40 | console.log(Address.isCepValid('74605-987')) 41 | -------------------------------------------------------------------------------- /src/super.ts: -------------------------------------------------------------------------------- 1 | export class User { 2 | protected name: string // public|protected|private 3 | private email: string 4 | private active: boolean = false 5 | 6 | constructor(name: string, email: string, active: boolean = false) { 7 | this.name = name 8 | this.email = email 9 | this.active = active 10 | 11 | // this.validation() 12 | } 13 | 14 | public changeName(newName: string): void { 15 | if (newName.length < 3) { 16 | throw new Error('invalid name') 17 | } 18 | 19 | this.name = newName 20 | } 21 | 22 | public getName(): string { 23 | return this.name 24 | } 25 | 26 | public getNumber(): number { 27 | return 123 28 | } 29 | } 30 | 31 | class Manager extends User { 32 | constructor(name: string, email: string, active: boolean, code: string) { 33 | console.log(code) 34 | super(name, email, active) 35 | } 36 | 37 | public getName(): string { 38 | return `Manager: ${this.name}` 39 | } 40 | 41 | public getNumber(): number { 42 | return super.getNumber() + 10 43 | } 44 | } 45 | class Admin extends User { 46 | public getName(): string { 47 | return `Adm: ${this.name} $ ` 48 | } 49 | 50 | public getNumber(): number { 51 | return 55342 52 | } 53 | } 54 | 55 | const manager1 = new Manager('Manager1', 'manager1@email.com', true, 'sdf') 56 | console.log(manager1.getNumber()) 57 | -------------------------------------------------------------------------------- /src/visibility.ts: -------------------------------------------------------------------------------- 1 | export class User { 2 | private name: string // public|protected|private 3 | private email: string 4 | private address: Address[] = [] 5 | private active: boolean = false 6 | 7 | constructor(name: string, email: string, active: boolean = false) { 8 | this.name = name 9 | this.email = email 10 | this.active = active 11 | 12 | // this.validation() 13 | } 14 | 15 | public addAddress(newAddress: Address): void { 16 | this.address.push(newAddress) 17 | } 18 | 19 | public changeName(newName: string): void { 20 | if (newName.length < 3) { 21 | throw new Error('invalid name') 22 | } 23 | 24 | this.name = newName 25 | } 26 | 27 | public getName(): string { 28 | return this.name 29 | } 30 | } 31 | 32 | const user1 = new User('User 01', 'user1@email.com') 33 | console.log(user1.getName()) 34 | user1.changeName('new name') 35 | console.log(user1.getName()) 36 | -------------------------------------------------------------------------------- /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": "ES2020", /* 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": "./", /* 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 | --------------------------------------------------------------------------------