Skip to content

FelixYu2021202/ts-tutorial

Repository files navigation

Contents

  1. basic types:

    • basic type

      boolean: 1
      number: 6
      string: 15
      array: 22
      tuple: 27
      enum: 37
      any: 63
      void: 71
      never: 81
      object: 93

  2. variable declaring:

    • variable declaring

      var: 1
      var scoping: 16
      let: 25
      const: 39
      destructing: 56
      spreading: 75

  3. types:

    • class

      class: 1
      extending: 13
      ES private keyword: 25
      public, private and protected: 38
      constructor parameter property readonly: 58
      accessors: 70
      static: 89
      abstract 101
      interfaces-implements class: 121

    • enum

      number enum: 1
      string enum: 6
      mixed enum: 18
      use enums as types: 30
      silly bugs finding: 37
      get enum keys: 46
      amient enum: 52

    • function

      simple function: 1
      type function: 7
      arrow function: 13
      arrow type function: 17
      optional, default and rest parameters: 22
      'this' and arrow function: 37
      overloads: 61

    • generic function

      converting: 1
      step 1: 3
      step 2: 9
      step 3: 15
      generic type extends: 21
      generic type class: 28

    • interface

      required member: 1
      optional member: 15
      readonly member: 30
      >>ReadonlyArray: 47
      assertion: 51
      function interface: 57
      indexer: 66
      type indexer: 72
      class interface: 78

  4. type operations:

    • compatibilities

      type compatibilities: 1
      function type compatibilities: 15
      rest and optional parameters: 31
      enum type compatibilities: 38
      generics type cmopatibilities: 43

    • inference

      type inference: 1
      basic inference: 3
      best common type: 7

    • intersection

      intersection type: 1

  5. advanced types:

    • advanced types

      intersection type: 1
      union type: 7
      type guard: 11
      type perdict: 19
      'in' keyword: 26
      'typeof' keyword: 32
      'instanceof' keyword: 37
      nullable types: 44
      value types: 50
      enum member type: 59
      this type: 69
      indexer type: 75
      >>example: 76
      >>answer: 82
      mapped type: 88
      conditional type: 94
      'infer' keyword: 117
      multiple type inference: 122
      predefined types in lib.d.ts: 142
      >>1. Partial: 144
      >>2. Required: 150
      >>3. Readonly: 157
      >>4. Pick: 163
      >>5. Record: 171
      >>6. Exclude: 175
      >>7. Omit: 179
      >>8. NonNullable: 187
      >>9. Parameters 191
      >>10. ConstructorParameters: 195
      >>11. Retrun Type: 199
      >>12. InstanceType: 206
      >>13. ThisParameterType: 210
      >>14. OmitThisParameter: 214

    • iterator and generator

      iterator: 1
      generators: 3 runners: 33
      >>1. '...': 35
      >>2. for in: 41
      >>3. for of: 47
      >>4. custom '.next': 53

    • symbol

      symbols: 1
      with description: 5
      Symbol.for: 14
      Symbol.keyFor: 20
      well-known symbols: 24
      >>1. hasInstance: 26
      >>2. inConcatSpreadable: 38
      >>3. iterator: 47
      >>4. match: 49
      >>5. replace: 57
      >>6. search: 65
      >>7. species: 73
      >>8. split: 75
      >>9. primitive: 84
      >>10. toStringTag: 98
      >>11. unscopables: 105

    • decorator:
    • triple-slash:
  6. Namespaces and modules

  7. Others

Tip:
  1. the codes with jsdoc are suggested to be copied or downloaded to real ts files in order to view them. (download link: FelixYu2021202.github.io/ts-tutorial)

About

edited, featured from ts official website

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published