Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
ポケモンの型をTypeScriptの型システムで表現してみた
Search
subroh_0508
June 10, 2026
Technology
460
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
ポケモンの型をTypeScriptの型システムで表現してみた
TSKaigi Night talks 〜after conference〜 のLT資料です
https://findy.connpass.com/event/392420/
subroh_0508
June 10, 2026
More Decks by subroh_0508
See All by subroh_0508
個人の生産性は青天井、そんな時代のエンジニアはチームに何をなすべきか
subroh0508
0
59
非定型なドキュメントを効率よくリファクタする 〜えぇ!?仕様書27本の移行が1日で終わったって!?〜
subroh0508
3
1.2k
Pull Request、AIレビューだけでマージしてOK?
subroh0508
1
93
ぼっちではじめた登壇が「51名」「241件」の発信に化けた
subroh0508
1
580
"スキルファースト"で作る、AIの自走環境
subroh0508
2
970
AIを賢くしたいなら、まずは人間の改善ループから
subroh0508
0
250
"S/N-GUL4R1TY"に向けて人類は何をすべきなのか
subroh0508
0
72
画面の向こうから「気づき」を得る 画面の向こうを「物差し」として捉える
subroh0508
1
410
蓮ノ空女学院スクールアイドルクラブはなぜ強いのか
subroh0508
0
100
Other Decks in Technology
See All in Technology
AIは実装を速くする。では、私たちは何を今作るべきか?-立場を越えてリリースに向き合ったチーム開発の実践 / 20260801 Hiromi Nakaya and Naoki Takahashi
shift_evolve
PRO
3
440
[ChatGPT Work LT]事務作業が苦手な人のための バックオフィスの「半」自動化
chimaki_iot
0
250
【CEDEC2026】専門性の高いデフォルメチームが挑んだ人材育成戦略 〜Cygames Academiaの企画から実施まで〜
cygames
PRO
0
530
20260801_スクフェス大阪
kgnkhkr
2
1.2k
Agent 時代の Kaggle 展望 / kaggle-in-the-agentic-era
upura
1
650
Flutterをカメラで動かしたかった話
sony
1
130
ガバメント AI 源内を地方自治体は活用できるのか可能性と課題、期待について
takeda_h
1
340
もう一度考える SRE チームの作り方・育て方 / Rethinking SRE #1: Building and Growing SRE Teams
rrreeeyyy
6
1k
SO-101×VLAによる3色キューブのピック&プレース
abeja
0
120
Data Hubグループ 紹介資料
sansan33
PRO
0
3.1k
【CEDEC2026】『GRANBLUE FANTASY: Relink - Endless Ragnarok』のバトル制作事例 ~最高のキャラゲーを目指して~
cygames
PRO
0
220
【5分でわかる】セーフィー エンジニア向け会社紹介
safie_recruit
0
53k
Featured
See All Featured
Test your architecture with Archunit
thirion
1
2.3k
Designing Powerful Visuals for Engaging Learning
tmiket
1
480
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
980
Exploring anti-patterns in Rails
aemeredith
3
460
Abbi's Birthday
coloredviolet
3
9.3k
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.5k
From π to Pie charts
rasagy
0
260
Thoughts on Productivity
jonyablonski
76
5.3k
What's in a price? How to price your products and services
michaelherold
247
13k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Visualization
eitanlees
152
17k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
230
Transcript
None
None
None
None
None
None
None
None
None
None
None
None
None
None
➔ ➔ ➔
species: regulations: - champions-m-a nature: up: down: ability: item: X
moves: - - - - --- party: regulation: champions-m-a members: - ../individuals/garchomp.yaml - ../individuals/dragonite.yaml # … ---
pnpm check:party dragon-standard.md : pnpm analyze:coverage dragon-standard.md : 5 /
0 : 4 / 1 : 4 / 0
species: regulations: - champions-m-a moves: - - - - #
pnpm check:individual charizard-invalid.yaml charizard-invalid.yaml:9: MoveNotLearnedBy: Type 'string' is not assignable to type 'MoveNotLearnedBy< "champions-m-a", "charizard", "surf" >'.
codegen tsc --noEmit OK NG YAML TypeScript tsc --noEmit
species: regulations: - champions-m-a moves: - - - - //
@source charizard.yaml:4 const charizard_moves_champions_m_a: ValidMoves< "champions-m-a", "charizard", readonly [ "flare-blitz", "dragon-claw", "earthquake", "roost" ] > = [ "flare-blitz", "dragon-claw", "earthquake", "roost" ]; ValidMoves charizard_moves_champions_m_a
species: regulations: - champions-m-a moves: - - - - #
// @source charizard-invalid.yaml:4 const charizard_moves_champions_m_a: ValidMoves< "champions-m-a", "charizard", readonly [ "flare-blitz", "dragon-claw", "earthquake", "surf" ] > = [ "flare-blitz", "dragon-claw", "earthquake", "surf" ];
species: regulations: - champions-m-a moves: - - - - #
// @source charizard-invalid.yaml:4 const charizard_moves_champions_m_a: ValidMoves< "champions-m-a", "charizard", readonly [ "flare-blitz", "dragon-claw", "earthquake", "surf" ] > = [ "flare-blitz", "dragon-claw", "earthquake", "surf" ]; roost surf
species: regulations: - champions-m-a moves: - - - - #
roost surf
export type ValidMoves< R extends RegulationId, // S extends SpeciesIdIn<R>,
// Ms extends readonly string[], // > = { readonly [I in keyof Ms]: ValidMove<R, S, Ms[I] & string>; }; Ms
export type ValidMove< R extends RegulationId, // S extends SpeciesIdIn<R>,
// M extends string, // > = M extends SpeciesEntryOf< R, S >["moves"][number] ? M : MoveNotLearnedBy<R, S, M>; SpeciesEntryOf<"champions-m-a", "charizard"> { readonly id: "charizard"; readonly moves: readonly [ "flare-blitz", "dragon-claw", "roost", "earthquake", "swords-dance", ... ] // M-A ... }
export type ValidMove< R extends RegulationId, // S extends SpeciesIdIn<R>,
// M extends string, // > = M extends SpeciesEntryOf< R, S >["moves"][number] ? M : MoveNotLearnedBy<R, S, M>; M [ "flare-blitz", "dragon-claw", "earthquake", "surf" ] → [ "flare-blitz", "dragon-claw", "earthquake", MoveNotLearnedBy ]
charizard_moves_champions_m_a [string, ..., MoveNotLearnedBy] [string, ..., string]
None
None