GithubHelp home page GithubHelp logo

dheysonalves / typescript-guide Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 460 KB

Typescript general studies with mini-apps with the superset, tuples, generics, decorators, typed annotations, and typed arrays.

JavaScript 4.41% TypeScript 87.95% HTML 7.63%
typescript javascript decorators generics typed-array annotations ts-node tuples faker-br type-guards

typescript-guide's Introduction

TYPESCRIPT PERSONAL GUIDE

Typescript general studies with mini-apps about tuples, generics, decorators, typed annotations, and typed arrays.

Lessons

Focused studies about tuples, generics, decorators, typed annotations, and typed arrays.

Lesson 1

The lesson was focused about the advantages of using the superset. Creating a specific scenario with axios to fetch json data, and how library can be better used with custom types for your requests.

  • /lesson1/fetchjson

Lesson 2

The lesson was focused some specifics subjects from the documentation:

Variables

  • Primitives and Objects typing;
  • Variables assertions and inferences;

Functions

  • Contextual Typing;
  • Function Anotations;
  • Function Inferences;

Classes and interfaces

  • Classes assertions and inferences;
  • Interface typing;

Typed Arrays, Tuples

  • Tuples typing
type Drink = [string, boolean, number];

const pepsi: Drink = ["brown", true, 40];
  • Typed Arrays
let carMakers: string[];
const dates = [new Date(), new Date()];
const carsByMake = [["f15"], ["corolla"]];

// Flexible types
const importantDates = [new Date(), "2030-10-10"];
const importantValues: (Date | string)[] = [];

Mini Apps

Focusing in praticing typescript typing with some OOP design patterns with the superset.

Maps with Google Maps API

Maps desktop mini-app

Overview

A location API using Google Maps API and Faker BR for data generation. Not focusing on style

The purpose of the application was using OOP with typescript and some design patterns.

Design Patterns
  • Facade
Typescript
  • Utility Types
  • Inference and annotations
  • Interfaces
  • Type Guards

typescript-guide's People

Contributors

dheysonalves avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.