WorryFree Computers   »   [go: up one dir, main page]

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

Real World Type Puzzle and Code Generation

Real World Type Puzzle and Code Generation

TSKaigi 2024
https://tskaigi.org/

Yuku Kotani

May 11, 2024
Tweet

More Decks by Yuku Kotani

Other Decks in Technology

Transcript

  1. 小谷 優空 - @yukukotani ・Software Engineer @ Ubie, Inc. (2019/05~)

      ・Lead Architect ・Maintainer of Kuma UI ・Student @ Univ. Tsukuba (2019/04~)   ・情報科学類 自己紹介
  2. GetSelectIncludeResult<P, A> 条件型 `T extends { foo: infer S }

    ? S : never`パターンで、selectした中身を取る
  3. まとめ:型パズルのエッセンス 型パズルを要素分解すると組み立てやすq Uf 型引数の推論によって入力の型を得‘ Df 型引数の制約を につけ‘ E インターナルな型引数は補完不要なので頑張らなくて良q Bf

    入力の型を条件型で絞り込みながら出力の型を組み立て‘ E 事前生成したマスタ型(Payload)を参照してシンプル化 入力時の補完・エラーのため