This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Arquivo: defaultProps-jsx.ts | |
| * Author: Glaucia Lemos | |
| * Data: 23/08/2018 | |
| */ | |
| // Antes: | |
| /*export interface Props { name?: string } | |
| export class Saudar extends React.Component<Props> { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Arquivo: defaultProps-jsx.ts | |
| * Author: Glaucia Lemos | |
| * Data: 23/08/2018 | |
| */ | |
| // Antes: | |
| export interface Props { name?: string } | |
| export class Saudar extends React.Component<Props> { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Arquivo: unknown-type.ts | |
| * Author: Glaucia Lemos | |
| * Data: 23/08/2018 | |
| */ | |
| // Agora sim.. vai funfar!! | |
| let textoExemplo: unknown = 10; | |
| // Aqui vamos colocar com o tipo ‘any’ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Arquivo: unknown-type.ts | |
| * Author: Glaucia Lemos | |
| * Data: 23/08/2018 | |
| */ | |
| let textoExemplo: unknown = 10; | |
| // O código abaixo não irá executar uma vez que 'textoExemplo' é do tipo 'unknown' | |
| textoExemplo.x.prop; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Arquivo: optional-elements.ts | |
| * Author: Glaucia Lemos | |
| * Data: 23/08/2018 | |
| * | |
| */ | |
| let teste: [number, string?, boolean?]; | |
| teste = [42, 'chocolate', true]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Arquivo: generic-rest-parameters.ts | |
| * Author: Glaucia Lemos | |
| * Data: 23/08/2018 | |
| */ | |
| declare function bind<G, L extends any[], U>(f: (x: G, ...args: L) => U, x: U): (...args: L) => U; | |
| declare function f3(x: number, y: string, z: boolean) : void; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Arquivo: tuplas-spread-expression.ts | |
| * Author: Glaucia Lemos | |
| * Data: 23/08/2018 | |
| */ | |
| // Exemplo de tuplas sem uso da expressão spread | |
| const args: [number, string, boolean] = [32, 'chocolate', true]; | |
| foo(32, 'chocolate', true); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Arquivo: tuplas-rest-parameters.ts | |
| * Author: Glaucia Lemos | |
| * Data: 23/08/2018 | |
| */ | |
| // Aqui um exemplo de declaração de expressão com uso parâmetros rest com Tuplas | |
| declare function foo(...args: [number, string, boolean]): void; | |
| // Aqui o equivalente a declaração da função acima! :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Arquivo: tuple-basic.ts | |
| * Author: Glaucia Lemos | |
| * Data: 23/08/2018 | |
| */ | |
| // Aqui estamos declarando x com um tipo 'tupla' | |
| let x: [string, number]; | |
| // Aqui não haverá erro! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="pt-br"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
| <title>Gráfico de Ganhos - iMasters</title> | |
| <!-- Inclusão da biblioteca do D3.js via cdn --> |