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
FreeBSDでZabbixを動かす.pdf
kenkino
0
270
WebRTC映像をAirPlayに対応させる挑戦.pdf
monolithic_adam
0
240
手動確認はもう限界 〜XCUITestでCustom URL Schemeの遷移を起動種別ごとに自動テストする〜 / Testing Custom URL Schemes with XCUITest
otouto
0
280
kubernetes コンポーネント開発入門 / 新卒N年目の勉強会&交流会!〜〇〇への誘い〜 #n_study
mazrean
0
240
アクセシビリティから考える情報設計
high_g_engineer
0
370
速習iPhone Duo対応
yuukiw00w
1
260
Family mrubyの進捗
kishima
1
120
Vue Fes Japan 2026 タイムテーブル徹底解説
448jp
0
130
AI に Inclusive UI を書かせよう — Design Rules Skill で Compose UI を作り直す
theoriatec2024
1
490
大喜利で理解するLLM as a Judge / Understanding LLM-as-a-Judge through Ogiri
rockname
0
100
JPUG勉強会 OSSデータベースの内部構造を理解しよう(第2回)
oga5
0
220
[DroidKaigi 2026] Bring your own phones to Gradle Managed Devices
f2lk
0
120
Featured
See All Featured
Ethics towards AI in product and experience design
skipperchong
2
370
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
280
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
330
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.8k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
490
First, design no harm
axbom
PRO
2
1.3k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.6k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
56
3.5k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
800
Embracing the Ebb and Flow
colly
88
5.2k
New Earth Scene 8
popppiees
4
2.6k
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