├── .gitignore ├── 02.02 - Hello World └── script.js ├── 02.03 - Objetos └── script.js ├── 02.04 - Arrays de objetos └── script.js ├── 02.05 - Funções └── script.js ├── 02.06 - Condicionais (if else) └── index.js ├── 02.07 - Programação funcional vs. Imperativa └── index.js ├── 02.08 - Truthy e Falsy └── index.js ├── 03.02 - No JavaScript tudo é objeto └── index.js ├── 03.03 - Declarando variáveis com var └── index.html ├── 03.04 - Declarando constantes com const └── index.html ├── 03.05 - Declarando variáveis com let └── index.html ├── 03.06 - Funções └── index.html ├── 03.07 - Function.call e Function.apply └── index.html ├── 03.08 - Arrow functions └── index.html ├── 03.09 - Argumentos de função └── index.html ├── 03.10 - O que é hoisting └── index.html ├── 03.11 - Trabalhando melhor com strings └── index.html ├── 03.12 - Timers (setInterval e setTimeout) └── index.html ├── 04.02 - Criando uma classe └── index.html ├── 04.03 - Métodos em classes └── index.html ├── 04.04 - Constructor └── index.html ├── 04.05 - Herança └── index.html ├── 04.06 - Prototype e arrow functions └── index.html ├── 05.01 - O que é desestruturacao └── index.html ├── 05.02 - Desestruturando objetos └── index.html ├── 05.03 - Desestruturando arrays └── index.html ├── 05.04 - Desestruturando parametros e retornos └── index.html ├── 05.05 - Spread operator └── index.html ├── 05.06 - Clonando objetos com spread └── index.html ├── 05.07 - Spread em arrays └── index.html ├── 05.08 - Spread operator em funções └── index.html ├── 05.09 - Recebendo argumentos com Rest opetator └── index.html ├── 05.10 - Rest operator em desestruturações └── index.html ├── 06.02 - Array.from └── 06.02 - Array.from.html ├── 06.03 - Array.of └── 06.03 - Array.of.html ├── 06.04 - Array.forEach └── 06.04 - Array.forEach.html ├── 06.05 - Array.map └── 06.05 - Array.map.html ├── 06.06 - Array.filter └── 06.06 - Array.filter.html ├── 06.07 - Array.reduce └── 06.07 - Array.reduce.html ├── 06.08 - Array.find └── 06.08 - Array.find.html ├── 06.09 - Array.some e Array.every └── 06.09 - Array.some e Array.every.html ├── 07.02 - Criando uma Promise └── 07.02 - Criando uma Promise.html ├── 07.03 - Como funciona uma Promise └── 07.03 - Como funciona uma Promise.html ├── 07.04 - Async & Await └── 07.04 - Async & Await.html ├── 07.05 - Promise.all └── 07.05 - Promise.all.html ├── 07.06 - Promise chaining └── 07.06 - Promise chaining.html ├── 08.01 - Introdução aos módulos e pacotes ├── .gitignore └── package.json ├── 08.02 - Instalando um pacote ├── .gitignore ├── index.js ├── package-lock.json └── package.json ├── 08.03 - Gitignore e node_modules ├── .gitignore ├── index.js ├── package-lock.json └── package.json ├── 09.01 - Introdução ao TypeScript ├── index.js ├── index.ts ├── package-lock.json ├── package.json └── tsconfig.json ├── 09.02 - Tipando variáveis ├── index.js ├── index.ts ├── package-lock.json ├── package.json └── tsconfig.json ├── 09.03 - Type aliasing ├── index.ts ├── package-lock.json ├── package.json └── tsconfig.json ├── 09.04 - Tipando argumentos de função ├── index.js ├── index.ts ├── package-lock.json ├── package.json └── tsconfig.json ├── 09.05 - Tipando objetos ├── index.ts ├── package-lock.json ├── package.json └── tsconfig.json ├── 09.06 - Union vs. Intesection (pipe vs and) ├── index.ts ├── package-lock.json ├── package.json └── tsconfig.json ├── 09.07 - Interfaces ├── index.ts ├── package-lock.json ├── package.json ├── tsconfig.json └── yarn.lock ├── 09.08 - Exportando interfaces e types ├── Person.d.ts ├── index.ts ├── interfaces.ts ├── package-lock.json ├── package.json ├── tsconfig.json └── yarn.lock ├── 09.10 - Generics ├── index.ts ├── package-lock.json ├── package.json ├── tsconfig.json └── yarn.lock ├── README.md └── _assets ├── preview.png ├── wallpaper.png └── wallpaper_dark.png /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /02.02 - Hello World/script.js: -------------------------------------------------------------------------------- 1 | var batata = 'World' 2 | batata = 'Mergulhador' 3 | console.log('Hello, ' + batata) 4 | -------------------------------------------------------------------------------- /02.03 - Objetos/script.js: -------------------------------------------------------------------------------- 1 | var person = { 2 | name: 'Daniel', 3 | age: 22, 4 | sex: 'male' 5 | } 6 | 7 | person.age = 21 8 | person.age = 20 9 | 10 | console.log(person) 11 | -------------------------------------------------------------------------------- /02.04 - Arrays de objetos/script.js: -------------------------------------------------------------------------------- 1 | var person1 = { 2 | name: 'Daniel', 3 | age: 22 4 | } 5 | 6 | var person2 = { 7 | name: 'Rafaela', 8 | age: 32 9 | } 10 | 11 | var person3 = { 12 | name: 'Caio', 13 | age: 36 14 | } 15 | 16 | var list = [person1, person2, person3] 17 | 18 | for (var person of list) { 19 | console.log(person.name) 20 | } -------------------------------------------------------------------------------- /02.05 - Funções/script.js: -------------------------------------------------------------------------------- 1 | function greet (name = 'mergulhador') { 2 | return 'boa madrugada, ' + name 3 | } 4 | 5 | var greeting = greet('Daniel') 6 | 7 | console.log(greeting) -------------------------------------------------------------------------------- /02.06 - Condicionais (if else)/index.js: -------------------------------------------------------------------------------- 1 | var me = { 2 | name: 'Daniel', 3 | age: '18' 4 | } 5 | 6 | function checkAge (person) { 7 | if (person.age === '18') { 8 | console.log('caiu dentro do bloco') 9 | } 10 | } 11 | 12 | checkAge(me) -------------------------------------------------------------------------------- /02.07 - Programação funcional vs. Imperativa/index.js: -------------------------------------------------------------------------------- 1 | var person = { 2 | age: 17, 3 | name: 'Lucas' 4 | } 5 | 6 | // função pura 7 | function getRemainingYearsToMajorty (person) { 8 | return 18 - person.age 9 | } 10 | 11 | // função impura - gera efeitos colaterais 12 | function increasePersonAge (person) { 13 | person.age = person.age + 1 14 | } 15 | 16 | 17 | // chamou um método impuro 18 | increasePersonAge(person) 19 | 20 | 21 | var remainingYears = getRemainingYearsToMajorty(person) 22 | console.log(remainingYears) 23 | -------------------------------------------------------------------------------- /02.08 - Truthy e Falsy/index.js: -------------------------------------------------------------------------------- 1 | var array = []; 2 | var value = {}; 3 | 4 | console.log(!!value); 5 | 6 | if (array.length) { 7 | console.log('a condição é verdadeira') 8 | } 9 | 10 | else { 11 | console.log('a condição é falsa') 12 | } -------------------------------------------------------------------------------- /03.02 - No JavaScript tudo é objeto/index.js: -------------------------------------------------------------------------------- 1 | const length = 'uma string qualquer'.length 2 | 3 | console.log(length) 4 | -------------------------------------------------------------------------------- /03.03 - Declarando variáveis com var/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Document 5 | 6 | 7 | 11 | 12 | -------------------------------------------------------------------------------- /03.04 - Declarando constantes com const/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Document 5 | 6 | 7 | 16 | 17 | -------------------------------------------------------------------------------- /03.05 - Declarando variáveis com let/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Document 5 | 6 | 7 | 15 | 16 | -------------------------------------------------------------------------------- /03.06 - Funções/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Document 5 | 6 | 7 | 28 | 29 | -------------------------------------------------------------------------------- /03.07 - Function.call e Function.apply/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Function.call e Function.apply 5 | 6 | 7 | 15 | 16 | -------------------------------------------------------------------------------- /03.08 - Arrow functions/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Arrow functions 5 | 6 | 7 | 18 | 19 | -------------------------------------------------------------------------------- /03.09 - Argumentos de função/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Argumentos de função 5 | 6 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /03.10 - O que é hoisting/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Argumentos de função 5 | 6 | 7 | 16 | 17 | -------------------------------------------------------------------------------- /03.11 - Trabalhando melhor com strings/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Argumentos de função 5 | 6 | 7 | 36 | 37 | -------------------------------------------------------------------------------- /03.12 - Timers (setInterval e setTimeout)/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Argumentos de função 5 | 6 | 7 | 16 | 17 | -------------------------------------------------------------------------------- /04.02 - Criando uma classe/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Criando classes 5 | 6 | 7 | 14 | 15 | -------------------------------------------------------------------------------- /04.03 - Métodos em classes/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Criando classes 5 | 6 | 7 | 19 | 20 | -------------------------------------------------------------------------------- /04.04 - Constructor/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Criando classes 5 | 6 | 7 | 33 | 34 | -------------------------------------------------------------------------------- /04.05 - Herança/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Criando classes 5 | 6 | 7 | 41 | 42 | -------------------------------------------------------------------------------- /04.06 - Prototype e arrow functions/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Criando classes 5 | 6 | 7 | 26 | 27 | -------------------------------------------------------------------------------- /05.01 - O que é desestruturacao/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | O que é desestruturação 6 | 7 | 8 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /05.02 - Desestruturando objetos/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Desestruturando objetos 6 | 7 | 8 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /05.03 - Desestruturando arrays/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Desestruturando objetos 6 | 7 | 8 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /05.04 - Desestruturando parametros e retornos/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Desestruturando parâmetros e retornos de funções 6 | 7 | 8 | 23 | 24 | -------------------------------------------------------------------------------- /05.05 - Spread operator/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Spread Operator 6 | 7 | 8 | 26 | 27 | -------------------------------------------------------------------------------- /05.06 - Clonando objetos com spread/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Spread Operator 6 | 7 | 8 | 19 | 20 | -------------------------------------------------------------------------------- /05.07 - Spread em arrays/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Spread Operator 6 | 7 | 8 | 17 | 18 | -------------------------------------------------------------------------------- /05.08 - Spread operator em funções/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Spread operator 6 | 7 | 8 | 14 | 15 | -------------------------------------------------------------------------------- /05.09 - Recebendo argumentos com Rest opetator/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Spread operator 6 | 7 | 8 | 17 | 18 | -------------------------------------------------------------------------------- /05.10 - Rest operator em desestruturações/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Rest operator 6 | 7 | 8 | 12 | 13 | -------------------------------------------------------------------------------- /06.02 - Array.from/06.02 - Array.from.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Array.from 6 | 7 | 8 | 19 | 20 | -------------------------------------------------------------------------------- /06.03 - Array.of/06.03 - Array.of.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Array.of 6 | 7 | 8 | 11 | 12 | -------------------------------------------------------------------------------- /06.04 - Array.forEach/06.04 - Array.forEach.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Array.forEach 6 | 7 | 8 | 18 | 19 | -------------------------------------------------------------------------------- /06.05 - Array.map/06.05 - Array.map.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Array.map 6 | 7 | 8 | 15 | 16 | -------------------------------------------------------------------------------- /06.06 - Array.filter/06.06 - Array.filter.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Array.filter 6 | 7 | 8 | 21 | 22 | -------------------------------------------------------------------------------- /06.07 - Array.reduce/06.07 - Array.reduce.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Array.reduce 6 | 7 | 8 | 27 | 28 | -------------------------------------------------------------------------------- /06.08 - Array.find/06.08 - Array.find.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Array.find 6 | 7 | 8 | 24 | 25 | -------------------------------------------------------------------------------- /06.09 - Array.some e Array.every/06.09 - Array.some e Array.every.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Array.some e Array.every 6 | 7 | 8 | 23 | 24 | -------------------------------------------------------------------------------- /07.02 - Criando uma Promise/07.02 - Criando uma Promise.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Promise 6 | 7 | 8 | 18 | 19 | -------------------------------------------------------------------------------- /07.03 - Como funciona uma Promise/07.03 - Como funciona uma Promise.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Promise 6 | 7 | 8 | 28 | 29 | -------------------------------------------------------------------------------- /07.04 - Async & Await/07.04 - Async & Await.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Promise 6 | 7 | 8 | 21 | 22 | -------------------------------------------------------------------------------- /07.05 - Promise.all/07.05 - Promise.all.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Promise 6 | 7 | 8 | 30 | 31 | -------------------------------------------------------------------------------- /07.06 - Promise chaining/07.06 - Promise chaining.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Promise 6 | 7 | 8 | 13 | 14 | -------------------------------------------------------------------------------- /08.01 - Introdução aos módulos e pacotes/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /08.01 - Introdução aos módulos e pacotes/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "teste", 3 | "version": "1.0.0", 4 | "description": "Batata", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC" 11 | } 12 | -------------------------------------------------------------------------------- /08.02 - Instalando um pacote/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /08.02 - Instalando um pacote/index.js: -------------------------------------------------------------------------------- 1 | const chalk = require('chalk') 2 | 3 | console.log(chalk.red('olá'), chalk.cyan('mergulhador')) -------------------------------------------------------------------------------- /08.02 - Instalando um pacote/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "teste", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "ansi-styles": { 8 | "version": "4.3.0", 9 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", 10 | "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", 11 | "requires": { 12 | "color-convert": "^2.0.1" 13 | } 14 | }, 15 | "chalk": { 16 | "version": "4.1.0", 17 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", 18 | "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", 19 | "requires": { 20 | "ansi-styles": "^4.1.0", 21 | "supports-color": "^7.1.0" 22 | } 23 | }, 24 | "color-convert": { 25 | "version": "2.0.1", 26 | "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", 27 | "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", 28 | "requires": { 29 | "color-name": "~1.1.4" 30 | } 31 | }, 32 | "color-name": { 33 | "version": "1.1.4", 34 | "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", 35 | "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" 36 | }, 37 | "has-flag": { 38 | "version": "4.0.0", 39 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", 40 | "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" 41 | }, 42 | "supports-color": { 43 | "version": "7.2.0", 44 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", 45 | "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", 46 | "requires": { 47 | "has-flag": "^4.0.0" 48 | } 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /08.02 - Instalando um pacote/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "teste", 3 | "version": "1.0.0", 4 | "description": "Batata", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "chalk": "^4.1.0" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /08.03 - Gitignore e node_modules/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /08.03 - Gitignore e node_modules/index.js: -------------------------------------------------------------------------------- 1 | const chalk = require('chalk') 2 | 3 | console.log(chalk.red('olá'), chalk.cyan('mergulhador')) -------------------------------------------------------------------------------- /08.03 - Gitignore e node_modules/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "teste", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "ansi-styles": { 8 | "version": "4.3.0", 9 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", 10 | "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", 11 | "requires": { 12 | "color-convert": "^2.0.1" 13 | } 14 | }, 15 | "chalk": { 16 | "version": "4.1.0", 17 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", 18 | "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", 19 | "requires": { 20 | "ansi-styles": "^4.1.0", 21 | "supports-color": "^7.1.0" 22 | } 23 | }, 24 | "color-convert": { 25 | "version": "2.0.1", 26 | "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", 27 | "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", 28 | "requires": { 29 | "color-name": "~1.1.4" 30 | } 31 | }, 32 | "color-name": { 33 | "version": "1.1.4", 34 | "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", 35 | "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" 36 | }, 37 | "has-flag": { 38 | "version": "4.0.0", 39 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", 40 | "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" 41 | }, 42 | "supports-color": { 43 | "version": "7.2.0", 44 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", 45 | "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", 46 | "requires": { 47 | "has-flag": "^4.0.0" 48 | } 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /08.03 - Gitignore e node_modules/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "teste", 3 | "version": "1.0.0", 4 | "description": "Batata", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "chalk": "^4.1.0" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /09.01 - Introdução ao TypeScript/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const me = { 4 | name: 'Daniel', 5 | age: 22 6 | }; 7 | exports.default = me; 8 | -------------------------------------------------------------------------------- /09.01 - Introdução ao TypeScript/index.ts: -------------------------------------------------------------------------------- 1 | const me = { 2 | name: 'Daniel', 3 | age: 22 4 | } 5 | 6 | export default me -------------------------------------------------------------------------------- /09.01 - Introdução ao TypeScript/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "0901-introducao", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "typescript": { 8 | "version": "4.1.4", 9 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.4.tgz", 10 | "integrity": "sha512-+Uru0t8qIRgjuCpiSPpfGuhHecMllk5Zsazj5LZvVsEStEjmIRRBZe+jHjGQvsgS7M1wONy2PQXd67EMyV6acg==" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /09.01 - Introdução ao TypeScript/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "0901-introducao", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "build": "tsc" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "typescript": "^4.1.4" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /09.01 - Introdução ao TypeScript/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | /* Visit https://aka.ms/tsconfig.json to read more about this file */ 4 | 5 | /* Basic Options */ 6 | // "incremental": true, /* Enable incremental compilation */ 7 | "target": "ES2020", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */ 8 | "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */ 9 | // "lib": [], /* Specify library files to be included in the compilation. */ 10 | // "allowJs": true, /* Allow javascript files to be compiled. */ 11 | // "checkJs": true, /* Report errors in .js files. */ 12 | // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ 13 | // "declaration": true, /* Generates corresponding '.d.ts' file. */ 14 | // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ 15 | // "sourceMap": true, /* Generates corresponding '.map' file. */ 16 | // "outFile": "./", /* Concatenate and emit output to single file. */ 17 | // "outDir": "./", /* Redirect output structure to the directory. */ 18 | // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ 19 | // "composite": true, /* Enable project compilation */ 20 | // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ 21 | // "removeComments": true, /* Do not emit comments to output. */ 22 | // "noEmit": true, /* Do not emit outputs. */ 23 | // "importHelpers": true, /* Import emit helpers from 'tslib'. */ 24 | // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ 25 | // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ 26 | 27 | /* Strict Type-Checking Options */ 28 | "strict": true, /* Enable all strict type-checking options. */ 29 | // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ 30 | // "strictNullChecks": true, /* Enable strict null checks. */ 31 | // "strictFunctionTypes": true, /* Enable strict checking of function types. */ 32 | // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ 33 | // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ 34 | // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ 35 | // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ 36 | 37 | /* Additional Checks */ 38 | // "noUnusedLocals": true, /* Report errors on unused locals. */ 39 | // "noUnusedParameters": true, /* Report errors on unused parameters. */ 40 | // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ 41 | // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ 42 | // "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */ 43 | 44 | /* Module Resolution Options */ 45 | // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ 46 | // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ 47 | // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ 48 | // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ 49 | // "typeRoots": [], /* List of folders to include type definitions from. */ 50 | // "types": [], /* Type declaration files to be included in compilation. */ 51 | // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ 52 | "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ 53 | // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ 54 | // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ 55 | 56 | /* Source Map Options */ 57 | // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ 58 | // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ 59 | // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ 60 | // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ 61 | 62 | /* Experimental Options */ 63 | // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ 64 | // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ 65 | 66 | /* Advanced Options */ 67 | "skipLibCheck": true, /* Skip type checking of declaration files. */ 68 | "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */ 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /09.02 - Tipando variáveis/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | const personName = 'Daniel'; 3 | const personAge = 22; 4 | const personAlive = true; 5 | const personContacts = [ 6 | 0, 7 | 'daniel.bonifacio@algaworks.com', 8 | ]; 9 | -------------------------------------------------------------------------------- /09.02 - Tipando variáveis/index.ts: -------------------------------------------------------------------------------- 1 | const personName:string = 'Daniel' 2 | const personAge:number = 22 3 | const personAlive:boolean = true 4 | 5 | const personContacts:(string|number)[] = [ 6 | 0, 7 | 'daniel.bonifacio@algaworks.com', 8 | ] 9 | -------------------------------------------------------------------------------- /09.02 - Tipando variáveis/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "0901-introducao", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "typescript": { 8 | "version": "4.1.4", 9 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.4.tgz", 10 | "integrity": "sha512-+Uru0t8qIRgjuCpiSPpfGuhHecMllk5Zsazj5LZvVsEStEjmIRRBZe+jHjGQvsgS7M1wONy2PQXd67EMyV6acg==" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /09.02 - Tipando variáveis/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "0901-introducao", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "build": "tsc" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "typescript": "^4.1.4" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /09.02 - Tipando variáveis/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | /* Visit https://aka.ms/tsconfig.json to read more about this file */ 4 | 5 | /* Basic Options */ 6 | // "incremental": true, /* Enable incremental compilation */ 7 | "target": "ES2020", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */ 8 | "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */ 9 | // "lib": [], /* Specify library files to be included in the compilation. */ 10 | // "allowJs": true, /* Allow javascript files to be compiled. */ 11 | // "checkJs": true, /* Report errors in .js files. */ 12 | // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ 13 | // "declaration": true, /* Generates corresponding '.d.ts' file. */ 14 | // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ 15 | // "sourceMap": true, /* Generates corresponding '.map' file. */ 16 | // "outFile": "./", /* Concatenate and emit output to single file. */ 17 | // "outDir": "./", /* Redirect output structure to the directory. */ 18 | // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ 19 | // "composite": true, /* Enable project compilation */ 20 | // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ 21 | // "removeComments": true, /* Do not emit comments to output. */ 22 | // "noEmit": true, /* Do not emit outputs. */ 23 | // "importHelpers": true, /* Import emit helpers from 'tslib'. */ 24 | // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ 25 | // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ 26 | 27 | /* Strict Type-Checking Options */ 28 | "strict": true, /* Enable all strict type-checking options. */ 29 | // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ 30 | // "strictNullChecks": true, /* Enable strict null checks. */ 31 | // "strictFunctionTypes": true, /* Enable strict checking of function types. */ 32 | // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ 33 | // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ 34 | // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ 35 | // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ 36 | 37 | /* Additional Checks */ 38 | // "noUnusedLocals": true, /* Report errors on unused locals. */ 39 | // "noUnusedParameters": true, /* Report errors on unused parameters. */ 40 | // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ 41 | // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ 42 | // "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */ 43 | 44 | /* Module Resolution Options */ 45 | // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ 46 | // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ 47 | // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ 48 | // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ 49 | // "typeRoots": [], /* List of folders to include type definitions from. */ 50 | // "types": [], /* Type declaration files to be included in compilation. */ 51 | // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ 52 | "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ 53 | // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ 54 | // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ 55 | 56 | /* Source Map Options */ 57 | // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ 58 | // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ 59 | // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ 60 | // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ 61 | 62 | /* Experimental Options */ 63 | // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ 64 | // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ 65 | 66 | /* Advanced Options */ 67 | "skipLibCheck": true, /* Skip type checking of declaration files. */ 68 | "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */ 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /09.03 - Type aliasing/index.ts: -------------------------------------------------------------------------------- 1 | type Cpf = string | number 2 | type Sex = 'male' | 'female' | undefined 3 | 4 | const sex:Sex = undefined 5 | -------------------------------------------------------------------------------- /09.03 - Type aliasing/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "0901-introducao", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "typescript": { 8 | "version": "4.1.4", 9 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.4.tgz", 10 | "integrity": "sha512-+Uru0t8qIRgjuCpiSPpfGuhHecMllk5Zsazj5LZvVsEStEjmIRRBZe+jHjGQvsgS7M1wONy2PQXd67EMyV6acg==" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /09.03 - Type aliasing/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "0901-introducao", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "build": "tsc" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "typescript": "^4.1.4" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /09.03 - Type aliasing/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | /* Visit https://aka.ms/tsconfig.json to read more about this file */ 4 | 5 | /* Basic Options */ 6 | // "incremental": true, /* Enable incremental compilation */ 7 | "target": "ES2020", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */ 8 | "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */ 9 | // "lib": [], /* Specify library files to be included in the compilation. */ 10 | // "allowJs": true, /* Allow javascript files to be compiled. */ 11 | // "checkJs": true, /* Report errors in .js files. */ 12 | // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ 13 | // "declaration": true, /* Generates corresponding '.d.ts' file. */ 14 | // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ 15 | // "sourceMap": true, /* Generates corresponding '.map' file. */ 16 | // "outFile": "./", /* Concatenate and emit output to single file. */ 17 | // "outDir": "./", /* Redirect output structure to the directory. */ 18 | // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ 19 | // "composite": true, /* Enable project compilation */ 20 | // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ 21 | // "removeComments": true, /* Do not emit comments to output. */ 22 | // "noEmit": true, /* Do not emit outputs. */ 23 | // "importHelpers": true, /* Import emit helpers from 'tslib'. */ 24 | // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ 25 | // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ 26 | 27 | /* Strict Type-Checking Options */ 28 | "strict": true, /* Enable all strict type-checking options. */ 29 | // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ 30 | // "strictNullChecks": true, /* Enable strict null checks. */ 31 | // "strictFunctionTypes": true, /* Enable strict checking of function types. */ 32 | // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ 33 | // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ 34 | // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ 35 | // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ 36 | 37 | /* Additional Checks */ 38 | // "noUnusedLocals": true, /* Report errors on unused locals. */ 39 | // "noUnusedParameters": true, /* Report errors on unused parameters. */ 40 | // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ 41 | // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ 42 | // "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */ 43 | 44 | /* Module Resolution Options */ 45 | // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ 46 | // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ 47 | // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ 48 | // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ 49 | // "typeRoots": [], /* List of folders to include type definitions from. */ 50 | // "types": [], /* Type declaration files to be included in compilation. */ 51 | // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ 52 | "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ 53 | // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ 54 | // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ 55 | 56 | /* Source Map Options */ 57 | // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ 58 | // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ 59 | // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ 60 | // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ 61 | 62 | /* Experimental Options */ 63 | // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ 64 | // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ 65 | 66 | /* Advanced Options */ 67 | "skipLibCheck": true, /* Skip type checking of declaration files. */ 68 | "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */ 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /09.04 - Tipando argumentos de função/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | function greet(name) { 3 | console.log(`Hello, ${name}!`); 4 | } 5 | greet('Daniel'); 6 | greet(0); 7 | greet(true); 8 | -------------------------------------------------------------------------------- /09.04 - Tipando argumentos de função/index.ts: -------------------------------------------------------------------------------- 1 | function greet (name:string, age?:number) { 2 | console.log( 3 | `Hello, ${name.toUpperCase()}!` 4 | ) 5 | } 6 | 7 | greet('Daniel', 1) -------------------------------------------------------------------------------- /09.04 - Tipando argumentos de função/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "0901-introducao", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "typescript": { 8 | "version": "4.1.4", 9 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.4.tgz", 10 | "integrity": "sha512-+Uru0t8qIRgjuCpiSPpfGuhHecMllk5Zsazj5LZvVsEStEjmIRRBZe+jHjGQvsgS7M1wONy2PQXd67EMyV6acg==" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /09.04 - Tipando argumentos de função/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "0901-introducao", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "build": "tsc" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "typescript": "^4.1.4" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /09.04 - Tipando argumentos de função/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | /* Visit https://aka.ms/tsconfig.json to read more about this file */ 4 | 5 | /* Basic Options */ 6 | // "incremental": true, /* Enable incremental compilation */ 7 | "target": "ES2020", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */ 8 | "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */ 9 | // "lib": [], /* Specify library files to be included in the compilation. */ 10 | // "allowJs": true, /* Allow javascript files to be compiled. */ 11 | // "checkJs": true, /* Report errors in .js files. */ 12 | // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ 13 | // "declaration": true, /* Generates corresponding '.d.ts' file. */ 14 | // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ 15 | // "sourceMap": true, /* Generates corresponding '.map' file. */ 16 | // "outFile": "./", /* Concatenate and emit output to single file. */ 17 | // "outDir": "./", /* Redirect output structure to the directory. */ 18 | // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ 19 | // "composite": true, /* Enable project compilation */ 20 | // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ 21 | // "removeComments": true, /* Do not emit comments to output. */ 22 | // "noEmit": true, /* Do not emit outputs. */ 23 | // "importHelpers": true, /* Import emit helpers from 'tslib'. */ 24 | // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ 25 | // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ 26 | 27 | /* Strict Type-Checking Options */ 28 | "strict": true, /* Enable all strict type-checking options. */ 29 | // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ 30 | // "strictNullChecks": true, /* Enable strict null checks. */ 31 | // "strictFunctionTypes": true, /* Enable strict checking of function types. */ 32 | // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ 33 | // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ 34 | // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ 35 | // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ 36 | 37 | /* Additional Checks */ 38 | // "noUnusedLocals": true, /* Report errors on unused locals. */ 39 | // "noUnusedParameters": true, /* Report errors on unused parameters. */ 40 | // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ 41 | // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ 42 | // "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */ 43 | 44 | /* Module Resolution Options */ 45 | // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ 46 | // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ 47 | // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ 48 | // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ 49 | // "typeRoots": [], /* List of folders to include type definitions from. */ 50 | // "types": [], /* Type declaration files to be included in compilation. */ 51 | // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ 52 | "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ 53 | // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ 54 | // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ 55 | 56 | /* Source Map Options */ 57 | // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ 58 | // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ 59 | // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ 60 | // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ 61 | 62 | /* Experimental Options */ 63 | // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ 64 | // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ 65 | 66 | /* Advanced Options */ 67 | "skipLibCheck": true, /* Skip type checking of declaration files. */ 68 | "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */ 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /09.05 - Tipando objetos/index.ts: -------------------------------------------------------------------------------- 1 | type Person = { 2 | name: string 3 | age: number 4 | contacts?: string[] 5 | isAlive: boolean 6 | } 7 | 8 | const person: Person = { 9 | age: 22, 10 | name: 'Lucas', 11 | isAlive: true, 12 | contacts: [ 13 | 'daniel.bonifacio@algaworks.com' 14 | ] 15 | } 16 | 17 | const person2: Person = { 18 | name: 'Joao', 19 | age: 43, 20 | isAlive: true 21 | } -------------------------------------------------------------------------------- /09.05 - Tipando objetos/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "0901-introducao", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "typescript": { 8 | "version": "4.1.4", 9 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.4.tgz", 10 | "integrity": "sha512-+Uru0t8qIRgjuCpiSPpfGuhHecMllk5Zsazj5LZvVsEStEjmIRRBZe+jHjGQvsgS7M1wONy2PQXd67EMyV6acg==" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /09.05 - Tipando objetos/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "0901-introducao", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "build": "tsc" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "typescript": "^4.1.4" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /09.05 - Tipando objetos/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | /* Visit https://aka.ms/tsconfig.json to read more about this file */ 4 | 5 | /* Basic Options */ 6 | // "incremental": true, /* Enable incremental compilation */ 7 | "target": "ES2020", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */ 8 | "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */ 9 | // "lib": [], /* Specify library files to be included in the compilation. */ 10 | // "allowJs": true, /* Allow javascript files to be compiled. */ 11 | // "checkJs": true, /* Report errors in .js files. */ 12 | // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ 13 | // "declaration": true, /* Generates corresponding '.d.ts' file. */ 14 | // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ 15 | // "sourceMap": true, /* Generates corresponding '.map' file. */ 16 | // "outFile": "./", /* Concatenate and emit output to single file. */ 17 | // "outDir": "./", /* Redirect output structure to the directory. */ 18 | // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ 19 | // "composite": true, /* Enable project compilation */ 20 | // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ 21 | // "removeComments": true, /* Do not emit comments to output. */ 22 | // "noEmit": true, /* Do not emit outputs. */ 23 | // "importHelpers": true, /* Import emit helpers from 'tslib'. */ 24 | // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ 25 | // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ 26 | 27 | /* Strict Type-Checking Options */ 28 | "strict": true, /* Enable all strict type-checking options. */ 29 | // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ 30 | // "strictNullChecks": true, /* Enable strict null checks. */ 31 | // "strictFunctionTypes": true, /* Enable strict checking of function types. */ 32 | // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ 33 | // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ 34 | // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ 35 | // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ 36 | 37 | /* Additional Checks */ 38 | // "noUnusedLocals": true, /* Report errors on unused locals. */ 39 | // "noUnusedParameters": true, /* Report errors on unused parameters. */ 40 | // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ 41 | // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ 42 | // "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */ 43 | 44 | /* Module Resolution Options */ 45 | // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ 46 | // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ 47 | // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ 48 | // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ 49 | // "typeRoots": [], /* List of folders to include type definitions from. */ 50 | // "types": [], /* Type declaration files to be included in compilation. */ 51 | // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ 52 | "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ 53 | // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ 54 | // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ 55 | 56 | /* Source Map Options */ 57 | // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ 58 | // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ 59 | // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ 60 | // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ 61 | 62 | /* Experimental Options */ 63 | // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ 64 | // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ 65 | 66 | /* Advanced Options */ 67 | "skipLibCheck": true, /* Skip type checking of declaration files. */ 68 | "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */ 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /09.06 - Union vs. Intesection (pipe vs and)/index.ts: -------------------------------------------------------------------------------- 1 | type Cpf = string | number 2 | 3 | function findPerson (cpf: Cpf) { 4 | if (typeof cpf === 'string') { 5 | return cpf.toUpperCase() 6 | } 7 | 8 | return cpf.toFixed(2) 9 | } 10 | 11 | type Animal = { sex: 'male' | 'female' } 12 | type Human = { hungry: boolean } 13 | 14 | type Person = Animal & Human 15 | 16 | function getPersonStatus (person: Person) { 17 | return person. 18 | } -------------------------------------------------------------------------------- /09.06 - Union vs. Intesection (pipe vs and)/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "0901-introducao", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "typescript": { 8 | "version": "4.1.4", 9 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.4.tgz", 10 | "integrity": "sha512-+Uru0t8qIRgjuCpiSPpfGuhHecMllk5Zsazj5LZvVsEStEjmIRRBZe+jHjGQvsgS7M1wONy2PQXd67EMyV6acg==" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /09.06 - Union vs. Intesection (pipe vs and)/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "0901-introducao", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "build": "tsc" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "typescript": "^4.1.4" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /09.06 - Union vs. Intesection (pipe vs and)/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | /* Visit https://aka.ms/tsconfig.json to read more about this file */ 4 | 5 | /* Basic Options */ 6 | // "incremental": true, /* Enable incremental compilation */ 7 | "target": "ES2020", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */ 8 | "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */ 9 | // "lib": [], /* Specify library files to be included in the compilation. */ 10 | // "allowJs": true, /* Allow javascript files to be compiled. */ 11 | // "checkJs": true, /* Report errors in .js files. */ 12 | // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ 13 | // "declaration": true, /* Generates corresponding '.d.ts' file. */ 14 | // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ 15 | // "sourceMap": true, /* Generates corresponding '.map' file. */ 16 | // "outFile": "./", /* Concatenate and emit output to single file. */ 17 | // "outDir": "./", /* Redirect output structure to the directory. */ 18 | // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ 19 | // "composite": true, /* Enable project compilation */ 20 | // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ 21 | // "removeComments": true, /* Do not emit comments to output. */ 22 | // "noEmit": true, /* Do not emit outputs. */ 23 | // "importHelpers": true, /* Import emit helpers from 'tslib'. */ 24 | // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ 25 | // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ 26 | 27 | /* Strict Type-Checking Options */ 28 | "strict": true, /* Enable all strict type-checking options. */ 29 | // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ 30 | // "strictNullChecks": true, /* Enable strict null checks. */ 31 | // "strictFunctionTypes": true, /* Enable strict checking of function types. */ 32 | // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ 33 | // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ 34 | // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ 35 | // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ 36 | 37 | /* Additional Checks */ 38 | // "noUnusedLocals": true, /* Report errors on unused locals. */ 39 | // "noUnusedParameters": true, /* Report errors on unused parameters. */ 40 | // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ 41 | // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ 42 | // "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */ 43 | 44 | /* Module Resolution Options */ 45 | // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ 46 | // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ 47 | // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ 48 | // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ 49 | // "typeRoots": [], /* List of folders to include type definitions from. */ 50 | // "types": [], /* Type declaration files to be included in compilation. */ 51 | // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ 52 | "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ 53 | // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ 54 | // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ 55 | 56 | /* Source Map Options */ 57 | // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ 58 | // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ 59 | // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ 60 | // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ 61 | 62 | /* Experimental Options */ 63 | // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ 64 | // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ 65 | 66 | /* Advanced Options */ 67 | "skipLibCheck": true, /* Skip type checking of declaration files. */ 68 | "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */ 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /09.07 - Interfaces/index.ts: -------------------------------------------------------------------------------- 1 | interface Animal { 2 | sex: 'male' | 'female' 3 | } 4 | 5 | interface Human extends Animal { 6 | name: string 7 | age: number 8 | } 9 | 10 | const person: Human = { 11 | age: 22, 12 | name: 'Lucas', 13 | sex: 'male' 14 | } -------------------------------------------------------------------------------- /09.07 - Interfaces/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "0901-introducao", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "typescript": { 8 | "version": "4.1.4", 9 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.4.tgz", 10 | "integrity": "sha512-+Uru0t8qIRgjuCpiSPpfGuhHecMllk5Zsazj5LZvVsEStEjmIRRBZe+jHjGQvsgS7M1wONy2PQXd67EMyV6acg==" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /09.07 - Interfaces/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "0901-introducao", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "build": "tsc" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "typescript": "^4.1.4" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /09.07 - Interfaces/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | /* Visit https://aka.ms/tsconfig.json to read more about this file */ 4 | 5 | /* Basic Options */ 6 | // "incremental": true, /* Enable incremental compilation */ 7 | "target": "ES2020", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */ 8 | "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */ 9 | // "lib": [], /* Specify library files to be included in the compilation. */ 10 | // "allowJs": true, /* Allow javascript files to be compiled. */ 11 | // "checkJs": true, /* Report errors in .js files. */ 12 | // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ 13 | // "declaration": true, /* Generates corresponding '.d.ts' file. */ 14 | // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ 15 | // "sourceMap": true, /* Generates corresponding '.map' file. */ 16 | // "outFile": "./", /* Concatenate and emit output to single file. */ 17 | // "outDir": "./", /* Redirect output structure to the directory. */ 18 | // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ 19 | // "composite": true, /* Enable project compilation */ 20 | // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ 21 | // "removeComments": true, /* Do not emit comments to output. */ 22 | // "noEmit": true, /* Do not emit outputs. */ 23 | // "importHelpers": true, /* Import emit helpers from 'tslib'. */ 24 | // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ 25 | // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ 26 | 27 | /* Strict Type-Checking Options */ 28 | "strict": true, /* Enable all strict type-checking options. */ 29 | // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ 30 | // "strictNullChecks": true, /* Enable strict null checks. */ 31 | // "strictFunctionTypes": true, /* Enable strict checking of function types. */ 32 | // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ 33 | // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ 34 | // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ 35 | // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ 36 | 37 | /* Additional Checks */ 38 | // "noUnusedLocals": true, /* Report errors on unused locals. */ 39 | // "noUnusedParameters": true, /* Report errors on unused parameters. */ 40 | // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ 41 | // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ 42 | // "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */ 43 | 44 | /* Module Resolution Options */ 45 | // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ 46 | // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ 47 | // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ 48 | // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ 49 | // "typeRoots": [], /* List of folders to include type definitions from. */ 50 | // "types": [], /* Type declaration files to be included in compilation. */ 51 | // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ 52 | "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ 53 | // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ 54 | // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ 55 | 56 | /* Source Map Options */ 57 | // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ 58 | // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ 59 | // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ 60 | // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ 61 | 62 | /* Experimental Options */ 63 | // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ 64 | // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ 65 | 66 | /* Advanced Options */ 67 | "skipLibCheck": true, /* Skip type checking of declaration files. */ 68 | "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */ 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /09.07 - Interfaces/yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | typescript@^4.1.4: 6 | version "4.1.5" 7 | resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.1.5.tgz#123a3b214aaff3be32926f0d8f1f6e704eb89a72" 8 | integrity sha512-6OSu9PTIzmn9TCDiovULTnET6BgXtDYL4Gg4szY+cGsc3JP1dQL8qvE8kShTRx1NIw4Q9IBHlwODjkjWEtMUyA== 9 | -------------------------------------------------------------------------------- /09.08 - Exportando interfaces e types/Person.d.ts: -------------------------------------------------------------------------------- 1 | declare namespace Person { 2 | type Email = string 3 | 4 | export interface Default { 5 | name: string 6 | age: number 7 | } 8 | 9 | export interface WithContacts extends Default { 10 | contacs: Email[] 11 | } 12 | } -------------------------------------------------------------------------------- /09.08 - Exportando interfaces e types/index.ts: -------------------------------------------------------------------------------- 1 | const person: Person.WithContacts = { 2 | name: 'Lucas', 3 | age: 32, 4 | contacs: [] 5 | } -------------------------------------------------------------------------------- /09.08 - Exportando interfaces e types/interfaces.ts: -------------------------------------------------------------------------------- 1 | export type Email = string 2 | 3 | export interface Person { 4 | name: string 5 | age: number 6 | } 7 | -------------------------------------------------------------------------------- /09.08 - Exportando interfaces e types/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "0901-introducao", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "typescript": { 8 | "version": "4.1.4", 9 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.4.tgz", 10 | "integrity": "sha512-+Uru0t8qIRgjuCpiSPpfGuhHecMllk5Zsazj5LZvVsEStEjmIRRBZe+jHjGQvsgS7M1wONy2PQXd67EMyV6acg==" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /09.08 - Exportando interfaces e types/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "0901-introducao", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "build": "tsc" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "typescript": "^4.1.4" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /09.08 - Exportando interfaces e types/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | /* Visit https://aka.ms/tsconfig.json to read more about this file */ 4 | 5 | /* Basic Options */ 6 | // "incremental": true, /* Enable incremental compilation */ 7 | "target": "ES2020", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */ 8 | "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */ 9 | // "lib": [], /* Specify library files to be included in the compilation. */ 10 | // "allowJs": true, /* Allow javascript files to be compiled. */ 11 | // "checkJs": true, /* Report errors in .js files. */ 12 | // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ 13 | // "declaration": true, /* Generates corresponding '.d.ts' file. */ 14 | // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ 15 | // "sourceMap": true, /* Generates corresponding '.map' file. */ 16 | // "outFile": "./", /* Concatenate and emit output to single file. */ 17 | // "outDir": "./", /* Redirect output structure to the directory. */ 18 | // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ 19 | // "composite": true, /* Enable project compilation */ 20 | // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ 21 | // "removeComments": true, /* Do not emit comments to output. */ 22 | // "noEmit": true, /* Do not emit outputs. */ 23 | // "importHelpers": true, /* Import emit helpers from 'tslib'. */ 24 | // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ 25 | // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ 26 | 27 | /* Strict Type-Checking Options */ 28 | "strict": true, /* Enable all strict type-checking options. */ 29 | // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ 30 | // "strictNullChecks": true, /* Enable strict null checks. */ 31 | // "strictFunctionTypes": true, /* Enable strict checking of function types. */ 32 | // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ 33 | // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ 34 | // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ 35 | // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ 36 | 37 | /* Additional Checks */ 38 | // "noUnusedLocals": true, /* Report errors on unused locals. */ 39 | // "noUnusedParameters": true, /* Report errors on unused parameters. */ 40 | // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ 41 | // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ 42 | // "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */ 43 | 44 | /* Module Resolution Options */ 45 | // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ 46 | // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ 47 | // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ 48 | // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ 49 | // "typeRoots": [], /* List of folders to include type definitions from. */ 50 | // "types": [], /* Type declaration files to be included in compilation. */ 51 | // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ 52 | "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ 53 | // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ 54 | // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ 55 | 56 | /* Source Map Options */ 57 | // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ 58 | // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ 59 | // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ 60 | // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ 61 | 62 | /* Experimental Options */ 63 | // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ 64 | // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ 65 | 66 | /* Advanced Options */ 67 | "skipLibCheck": true, /* Skip type checking of declaration files. */ 68 | "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */ 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /09.08 - Exportando interfaces e types/yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | typescript@^4.1.4: 6 | version "4.1.5" 7 | resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.1.5.tgz#123a3b214aaff3be32926f0d8f1f6e704eb89a72" 8 | integrity sha512-6OSu9PTIzmn9TCDiovULTnET6BgXtDYL4Gg4szY+cGsc3JP1dQL8qvE8kShTRx1NIw4Q9IBHlwODjkjWEtMUyA== 9 | -------------------------------------------------------------------------------- /09.10 - Generics/index.ts: -------------------------------------------------------------------------------- 1 | interface Photo { 2 | albumId: number; 3 | id: number; 4 | title: string; 5 | url: string; 6 | thumbnailUrl: string; 7 | } 8 | 9 | fetch("http://jsonplaceholder.typicode.com/photos?_start=0&_limit=3"); 10 | 11 | async function enhancedFetch (url: string) { 12 | const res = await fetch(url); 13 | const data: ResponseData = await res.json(); 14 | 15 | return { 16 | status: res.status, 17 | data 18 | }; 19 | } 20 | 21 | enhancedFetch("http://jsonplaceholder.typicode.com/photos?_start=0&_limit=3") 22 | .then(res => { 23 | res.data.map(item => console.log(item.albumId)) 24 | }); 25 | -------------------------------------------------------------------------------- /09.10 - Generics/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "0901-introducao", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "typescript": { 8 | "version": "4.1.4", 9 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.4.tgz", 10 | "integrity": "sha512-+Uru0t8qIRgjuCpiSPpfGuhHecMllk5Zsazj5LZvVsEStEjmIRRBZe+jHjGQvsgS7M1wONy2PQXd67EMyV6acg==" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /09.10 - Generics/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "0901-introducao", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "build": "tsc" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "typescript": "^4.1.4" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /09.10 - Generics/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | /* Visit https://aka.ms/tsconfig.json to read more about this file */ 4 | 5 | /* Basic Options */ 6 | // "incremental": true, /* Enable incremental compilation */ 7 | "target": "ES2020", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */ 8 | "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */ 9 | // "lib": [], /* Specify library files to be included in the compilation. */ 10 | // "allowJs": true, /* Allow javascript files to be compiled. */ 11 | // "checkJs": true, /* Report errors in .js files. */ 12 | // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ 13 | // "declaration": true, /* Generates corresponding '.d.ts' file. */ 14 | // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ 15 | // "sourceMap": true, /* Generates corresponding '.map' file. */ 16 | // "outFile": "./", /* Concatenate and emit output to single file. */ 17 | // "outDir": "./", /* Redirect output structure to the directory. */ 18 | // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ 19 | // "composite": true, /* Enable project compilation */ 20 | // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ 21 | // "removeComments": true, /* Do not emit comments to output. */ 22 | // "noEmit": true, /* Do not emit outputs. */ 23 | // "importHelpers": true, /* Import emit helpers from 'tslib'. */ 24 | // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ 25 | // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ 26 | 27 | /* Strict Type-Checking Options */ 28 | "strict": true, /* Enable all strict type-checking options. */ 29 | // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ 30 | // "strictNullChecks": true, /* Enable strict null checks. */ 31 | // "strictFunctionTypes": true, /* Enable strict checking of function types. */ 32 | // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ 33 | // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ 34 | // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ 35 | // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ 36 | 37 | /* Additional Checks */ 38 | // "noUnusedLocals": true, /* Report errors on unused locals. */ 39 | // "noUnusedParameters": true, /* Report errors on unused parameters. */ 40 | // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ 41 | // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ 42 | // "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */ 43 | 44 | /* Module Resolution Options */ 45 | // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ 46 | // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ 47 | // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ 48 | // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ 49 | // "typeRoots": [], /* List of folders to include type definitions from. */ 50 | // "types": [], /* Type declaration files to be included in compilation. */ 51 | // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ 52 | "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ 53 | // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ 54 | // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ 55 | 56 | /* Source Map Options */ 57 | // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ 58 | // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ 59 | // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ 60 | // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ 61 | 62 | /* Experimental Options */ 63 | // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ 64 | // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ 65 | 66 | /* Advanced Options */ 67 | "skipLibCheck": true, /* Skip type checking of declaration files. */ 68 | "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */ 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /09.10 - Generics/yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | typescript@^4.1.4: 6 | version "4.1.5" 7 | resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.1.5.tgz#123a3b214aaff3be32926f0d8f1f6e704eb89a72" 8 | integrity sha512-6OSu9PTIzmn9TCDiovULTnET6BgXtDYL4Gg4szY+cGsc3JP1dQL8qvE8kShTRx1NIw4Q9IBHlwODjkjWEtMUyA== 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Curso: Mergulhando no JavaScript 🤿 2 | 3 | Fala, mergulhador! Como é que cê tá? Tudo bem? 4 | 5 | Esse repositório é referente ao curso [Mergulhando no JavaScript](#), criado pela [AlgaWorks](https://algaworks.com) e pelo instrutor [Daniel Bonifacio](https://github.com/danielbonifacio). 6 | 7 | O objetivo deste curso é ensiar JavaScript moderno **qualquer pessoa**, independente de um contato anterior com a linguagem. 8 | 9 | ## Wallpapers exclusivos 10 | 11 | Faça o Download dos Wallpapers exclusivos do curso Mergulhando no JavaScript 🤿! 12 | 13 | ![Wallpapers curso Mergulhando no JavaScript](./_assets/preview.png) 14 | 15 | - [Wallpaper versão light (amarelo)](./_assets/wallpaper.png) 16 | - [Wallpaper versão dark](./_assets/wallpaper_dark.png) 17 | 18 | 19 | ## Informações sobre o curso: 20 | 21 | *Obs.: Essas informações podem estar desatualizadas, sempre consulte a ementa na página de vendas antes de adquirir o curso para saber com exatidão quais as aulas disponíveis.* 22 | 23 | | Módulos | Aulas | Tempo aproximado | 24 | | ------------------------------------------|:-----:| ----------------:| 25 | | Colocando os pés na água | 4 | 30m | 26 | | A superfície do JavaScript | 7 | 1h | 27 | | Mergulhando nos fundamentos do JavaScript | 12 | 1h30 | 28 | | Orientação a Objetos | 6 | 30m | 29 | | Desestruturação e Spread | 10 | 1h | 30 | | Manipulação de listas (Arrays) | 9 | 40m | 31 | | Promises e código assíncrono | 6 | 40m | 32 | | Módulos e pacotes | 5 | 30m | 33 | | TypeScript | 10 | 1h30 | 34 | 35 | -------------------------------------------------------------------------------- /_assets/preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/curso-mergulhando-no-javascript/d21eabc07e1b38c92bf7ce79907bbaaed7078047/_assets/preview.png -------------------------------------------------------------------------------- /_assets/wallpaper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/curso-mergulhando-no-javascript/d21eabc07e1b38c92bf7ce79907bbaaed7078047/_assets/wallpaper.png -------------------------------------------------------------------------------- /_assets/wallpaper_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/curso-mergulhando-no-javascript/d21eabc07e1b38c92bf7ce79907bbaaed7078047/_assets/wallpaper_dark.png --------------------------------------------------------------------------------