Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Sharing type definitions between TypeScript And...
Search
ikasoumen
June 18, 2019
Programming
910
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Sharing type definitions between TypeScript And Dart
ikasoumen
June 18, 2019
More Decks by ikasoumen
See All by ikasoumen
pixiv chatstory の PWA としての取り組み
ikasoumen
5
6.4k
Ionic 4 の話
ikasoumen
0
130
ただしく学ぼうPWA
ikasoumen
2
710
Angular + Ionicを使って iOSエンジニアにもやさしいPWA開発をした話
ikasoumen
0
940
Other Decks in Programming
See All in Programming
From 6 People Classroom Meetup to 100 People Regional Conference / FOSS4G Hiroshima 2026
furukawayasuto
0
200
AGENTS.md Is Not Enough:Build Skills, Don't Download Them
lx_t
0
120
LoopHub - ローカルで動く GitHub で、AI と共同開発
jugyo
1
550
JPUG勉強会 OSSデータベースの内部構造を理解しよう(第2回)
oga5
0
230
Claude Codeを組織的に動かして月400PRを実現した話
happy_ryo
0
280
フロントエンドUIフレームワークのこれまでとこれから
ssssota
5
2.8k
Are APIs Still Relevant in the AI Era?
soyuka
0
230
速習iPhone Duo対応
yuukiw00w
1
510
thread_parallel_with_free-threaded_Python_and_NumPy.pdf
riku_sakamoto
0
330
【高い買い物LT会】初任給で話題の国産フィジカルAIを買った話
akagami
PRO
0
160
AIを上手に使っていこうとしたら越境せざるを得なくなった話 〜実践1年で見えた境界を越えなければならない理由と進め方〜 / Crossing borders with AI
tomoyakitaura
4
1.2k
XP祭りでしか伝わらないフリップネタ #xpjug
murabayashi
0
150
Featured
See All Featured
Ethics towards AI in product and experience design
skipperchong
2
380
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.2k
Scaling GitHub
holman
464
140k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
690
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.6k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
203
76k
Agile that works and the tools we love
rasmusluckow
331
22k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
570
How Software Deployment tools have changed in the past 20 years
geshan
1
34k
Practical Orchestrator
shlominoach
192
12k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
18k
Transcript
5ZQF4DSJQU%BSUؒͰ ܕΛڞ༗͢Δ 2019/6/18 Fukuoka.ts #01 ikasoumen
w JLBTPVNFO w UXJUUFS!@JLBTPVNFO w QJYJWJLB@TPVNFO w HJUIVCJLBTPVNFO w ϐΫγϒԬΦϑΟε
w 5ZQF4DSJQU"OHVMBS͔Β w ࠷ۙ3FBDUͰԿͰ54Ͱॻ͘ w ΠϥετອըΛඳ͘ͷ͖ ࣗݾհ 2
ຊ
w ؒͷࣾһݚमͰ͏ΞϓϦΛ࡞Δ͜ͱʹͳͬͨ w ࣾͷΞυϨεͰ֤ࣾһ͕(PPHMFϩάΠϯͰ͖ͯ w ࣸਅ͕ߘͰ͖ͯ w ʮ͍͍ͶʂʯͰ͖Δ w ࡞ͬͨํ͕໘ന͍ͷͰ࡞Δ
w ࢼͯ͠Έ͍ٕͨज़Γ͜͏ͥʔʂ w 'MVUUFS $MPVE'JSFTUPSF γφϦΦ 4
w (PPHMFͷ/P42-%# w (00% w ΦϑϥΠϯ࣌ͰSFBEXSJUFͰ͖Δ w ߋ৽͞ΕͨσʔλΛͪ͜Β͔ΒऔΓʹߦ͘ඞཁ͕ͳ͍ w هड़͖࣮͕͍ͩ͢ͿݮΔ
w #"% w %#ʹεΩʔϚ͕ͳ͍ w σʔλͷݕࡧෳυΩϡϝϯτͷҰׅஔʹऑ͍ 'JSFTUPSF 5
͏·͍ो͚ͩٵ͍͍ͨ
ϦΞϧλΠϜߋ৽͚ͩ ඒຯ͍͖͍ͨͩͨ͘͠
εΩʔϚΛ༻ҙ͠·͠ΐ͏
None
w +40/ͷܕΛجʹଞݴޠͷܕͱͯ͠ग़ྗ w TPVSDF+40/ +40/4DIFNB 5ZQF4DSJQU w UBSHFU͍Ζ͍Ζ RVJDLUZQF 10
npx quicktype ./ts/models.ts -o ./dart/models.dart DPNNBOE
export type UserDoc = { name: string, role: Roles, /**
* @TJS-type integer */ createdAt: number, } export enum Roles { guest = "guest", member = "member", admin = "admin", } JOQVU5ZQF4DSJQU
class UserDoc { int createdAt; String name; Roles role; UserDoc({
this.createdAt, this.name, this.role, }); factory UserDoc.fromJson(Map<String, dynamic> json) => new UserDoc( createdAt: json["createdAt"], name: json["name"], role: rolesValues.map[json["role"]], ); Map<String, dynamic> toJson() => { "createdAt": createdAt, "name": name, "role": rolesValues.reverse[role], }; } PVUQVU%BSU
enum Roles { ADMIN, GUEST, MEMBER } final rolesValues =
new EnumValues({ "admin": Roles.ADMIN, "guest": Roles.GUEST, "member": Roles.MEMBER }); class EnumValues<T> { Map<String, T> map; Map<T, String> reverseMap; EnumValues(this.map); Map<T, String> get reverse { if (reverseMap == null) { reverseMap = map.map((k, v) => new MapEntry(v, k)); } return reverseMap; } } PVUQVU%BSU
w 'JSFTUPSF+40/֦ுͳσʔλΛอ࣋Ͱ͖Δ w 5ZQF4DSJQUΛTPVSDFʹͰ͖Δ w +40/4DIFNBهड़ྔ͕ଟ͍ˍ׳Ε͍ͯͳ͍ w ։ൃɾຊ൪σʔλͷೖεΫϦϓτΛ5ZQF4DSJQUͰॻ͖ ͍ͨ w
ಉ͡ܕσʔλ͔Βੜ·Ε࣮ͨͳͷͰɺ%#ʹೖͨ͠ σʔλͱΫϥΠΞϯτͷ࣮ͷࠩҟ͕ͳ͘ͳΔ બఆཧ༝ 15
w %#ͷσʔλͷܕ͕߹ͬͯͳ͍Τϥʔͷ໓ w ෆ׳Εͳٕज़ελοΫͰʮΤϥʔͷՄೳੑ͕͋ΔՕॴʯΛ ݮΒͤͨͷେ͖͍ w ෆਖ਼ͳσʔλͷ͍ͤͰϋϚΔͱർฐ͢Δ w ࠓ͍ΔϒϥϯνͷεΩʔϚΛҰൃͰ֬ೝͰ͖Δ w
͓͔͛ͰΞϓϦແࣄϦϦʔε͞ΕݚमΓ্͕Γ·͠ ͨͱ͞ ಋೖՌ 16
w 'JSFTUPSFʹεΩʔϚΛ༻ҙ͢Δ͜ͱʹΑͬͯ νʔϜʹͱͬͯ։ൃΛਐΊ͍͢ঢ়ଶʹͨ͠ w 5ZQF4DSJQUϓϩδΣΫτʹΈࠐΈ͍͢ w ๛ͳOQNύοέʔδࢿݯ w σʔλೖͱ͔ूܭͱ͔ w
ผݴޠͷܕͷࣗಈੜ·ͰͰ͖ͪΌ͏ ·ͱΊ 17