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
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
仕様駆動開発による爆速プロダクト開発 / Bakusoku Spec Driven Development
kobakei
0
190
JRuby: Past, Present, and Future
headius
0
220
モジュールの視点からSwiftを読み解く #iosdc
s_shimotori
0
350
Ghostty + Neovimで作る 透明でカッコ良い開発環境
j341nono
0
150
UnityでSystem.Net.WebSocketsなWebSocketサーバが動かないのでUnity Monoのコードを覗いてみた / about implementing websocket server with unity mono
drumath2237
1
550
ハーネス設計入門 〜 基礎知識の整理から実務へのステップアップ 〜
kinopeee
20
21k
Agentic Software Factoryに、すごく賢いIF文を。 / super smart IF statement into the Agentic Software Factory.
rkaga
7
1.9k
カツオ、ご期待ください
suneo3476
0
150
[ハンズオン]AIへの指示だけで「五目並べ」を作ってみよう
satoshi256kbyte
1
350
R8 の設定見直しでアプリサイズ削減
andpad
0
160
WebRTC映像をAirPlayに対応させる挑戦.pdf
monolithic_adam
0
340
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
530
Featured
See All Featured
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3k
Docker and Python
trallard
47
4.2k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
610
Prompt Engineering for Job Search
mfonobong
0
480
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
540
Bootstrapping a Software Product
garrettdimon
PRO
306
120k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
510
AI Search: Where Are We & What Can We Do About It?
aleyda
0
8k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
590
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
Into the Great Unknown - MozCon
thekraken
41
2.8k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
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