Upgrade to Pro — share decks privately, control downloads, hide ads and more …

TypeScript v3.7のおさらい / Learning TypeScript v3.7

linyows
October 15, 2019

TypeScript v3.7のおさらい / Learning TypeScript v3.7

Fukuoka.ts #2 でお話しした資料です。Oct 15, 2019

linyows

October 15, 2019
Tweet

More Decks by linyows

Other Decks in Programming

Transcript

  1. Fukuoka.ts #2 linyows / Tomohisa Oda GMO Pepabo, Inc.: Principal

    Engineer Blog: https://tomohisaoda.com 2
  2. Fukuoka.ts #2 TypeScript v3.7ʹೖΔݴޠ࢓༷ͷมߋ • Assert Signatures • Recursive Type

    References • Top Level Await • Null Coalescing • Optional Chaining • Private-Named Instance Fields 5
  3. Fukuoka.ts #2 TypeScript v3.7ʹೖΔݴޠ࢓༷ͷมߋ • Assert Signatures • Recursive Type

    References • Top Level Await • Null Coalescing • Optional Chaining • Private-Named Instance Fields 6
  4. Fukuoka.ts #2 User defined Type GuardsͱͲ͏ҧ͏ͷʁ w ܕड़ޠͱ͍͏ͱଞʹUser defined Type

    Guards͕͋͛ΒΕΔ w ͲͪΒ΋ίϯύΠϥʹܕΛ໌ࣔ͢Δ΋ͷ w Assert Signatures͸ɺ੍ޚϑϩʔղੳͷͨΊʹܕΛද໌͢Δ΋ͷͰɺUser defined Type Guards͸ɺܕਪ࿦ͷ֦ு w ࡶʹݴ͏ͱ໭Γ஋ͷҧ͍ User defined Type Guards͸BooleanɺAssert Signatures͸ܕද໌·ͨ͸ྫ֎ͷεϩʔ 16
  5. Fukuoka.ts #2 ·ͱΊ w TypeScript v3.7ʹೖΔ༧ఆͷݴޠ࢓༷Λ͓ͭ͞Β͍͠·ͨ͠ w Optional Chaining΍Null Coalescing΍Top

    Level AwaitͳͲͷศར࢓༷͸৽ ن͸΋ͪΖΜɺطଘͷίʔυΛ୹͘ॻ͖௚͢͜ͱ͕Ͱ͖ͦ͏Ͱ͢ w Assert Signatures͸Type Guardͱಉ͘͡ܕड़ޠͳͷͰॊೈੑͱҾ͖׵͑ʹܕ ҆શΛࣗ෼ͨͪͰ୲อ͢Δ͜ͱʹͳΓ·͢ w Recursive Type References͸Ͳ͏Ͱ͠ΐ͏ʢඞཁͳ৔໘ʹૺ۰ͨ͜͠ͱ͕ͳ ͍ʣ 17