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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
ikasoumen
June 18, 2019
Programming
920
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
140
ただしく学ぼうPWA
ikasoumen
2
710
Angular + Ionicを使って iOSエンジニアにもやさしいPWA開発をした話
ikasoumen
0
940
Other Decks in Programming
See All in Programming
Verilogで学ぶCPU自作入門.pdf
uyuki234
8
4k
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
470
Unity6 URPによる海底をテーマにしたVJシステムの解説 | Unity Shader 完全に理解した 勉強会
gam0022
0
330
AIに “答え“を書かせるのを やめてみた
___akari11
0
110
機械に任せるテスト、人が見るテスト ⽣成AIで引き直した、運⽤保守フェーズの線引き
dske104
0
160
速習iPhone Duo対応
yuukiw00w
2
960
モデルのリファクタリングが難しいと思ったら、そもそも複雑だったのはビジネス仕様だった ? / is-the-business-domain-the-real-complexity
hatsu38
0
450
Simple Storage Service(S3) is not simple
iwatsukayura
0
210
Apple Intelligence を用いた個人情報誤送信防止、及びユーザーリクエスト体験の改善について
yukiny
0
310
JRuby: Past, Present, and Future
headius
0
220
残高管理から台帳サービスへの進化
artoy
0
170
パズルゲームの作り方 / how to make puzzle games
kaityo256
PRO
2
270
Featured
See All Featured
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.2k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.4k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
3k
HDC tutorial
michielstock
2
940
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
2
350
Reality Check: Gamification 10 Years Later
codingconduct
0
2.3k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
480
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
390
The agentic SEO stack - context over prompts
schlessera
0
970
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.5k
YesSQL, Process and Tooling at Scale
rocio
174
15k
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