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 + GASでAPIを作る / Build API with TypeS...
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
shike
April 11, 2019
Programming
170
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
TypeScript + GASでAPIを作る / Build API with TypeScript and GAS
Cluexの社内LT大会で発表した時の資料です。
shike
April 11, 2019
More Decks by shike
See All by shike
Code Generatorを作ってコンポーネントを自動生成しよう / Let's make code generator
shike0909
1
2.3k
Nuxt + TypeScriptで SPAを作る / Build SPA with Nuxt and TypeScript
shike0909
0
150
Lighthouseを使った認証必須のGraphQL API / GraphQL API authentication with Lighthouse
shike0909
0
2.3k
Reduxについて / Redux introduction and TODO example with Redux
shike0909
0
140
Other Decks in Programming
See All in Programming
AWS CDK を「作」ってみた 〜フルスクラッチで見えた CDK の裏側〜 / aws-cdk-from-scratch
gotok365
3
2.8k
進化を続けるGo toolsの現在地 / The Current State of Ever-Evolving Go Tools
hond0413
0
190
数百円から始めるRuby電子工作
tarosay
0
140
20260722_microCMSで考える、AI時代のコンテンツ運用設計
yosh1
0
380
the container ship “Apple Silicon”@WWDC26 Recap -Japan-\(region).swift
shingangan
0
120
Laravelで学ぶ Webアプリケーションチューニング入門/web_application_tuning_101
hanhan1978
4
1.7k
ITヒヤリハットを整理してみた ~ライフサイクルと原因から考える再発防止策~
koukimiura
1
140
変わらないものが、変わるものを決める — 意図駆動開発 × イベントソーシング × イミュータブル | What Doesn't Change Decides What Can — IDD × Event Sourcing × Immutability
tomohisa
0
1.5k
What's New in Android 2026
veronikapj
0
260
全PRの83%がAIレビューだけでマージできるようになった開発組織はその後どうなったか
athug
1
1.6k
テーブルをDELETEした
yuzneri
0
140
TSX の <Hoge<Fuga>> という構文に驚いた話 / tsx-type-argument-syntax
kanaru0928
0
210
Featured
See All Featured
The Spectacular Lies of Maps
axbom
PRO
1
900
Documentation Writing (for coders)
carmenintech
77
5.4k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
How to Think Like a Performance Engineer
csswizardry
28
2.7k
Product Roadmaps are Hard
iamctodd
55
12k
Mobile First: as difficult as doing things right
swwweet
225
10k
Into the Great Unknown - MozCon
thekraken
41
2.7k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
480
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
450
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
640
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
440
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
210
Transcript
TypeScript + GASで APIを作る Cluex Webグループ 柴山健吾
話すこと • GASでアプリケーションを作る • claspについて • TypeScriptについて • clasp +
TypeScriptでAPIを開発してみる
GASでアプリケーションを作る • Spread SheetsとかGoogle製品のAPIを使ってあんなこ とやこんなことできる • でも普通に作ろうとするとつらい ◦ ローカルで開発できない ◦
バージョン管理できない ◦ 補完も何も効かないザコい専用エディター
GASでアプリケーションを作る
clasp
claspとは • ローカルで開発できる ◦ バージョン管理できる • コマンド一つでデプロイできる • TypeScriptで開発できる!!!
_人人人人人人人人人人人人人人人人_ > TypeScriptで開発できる!! <  ̄Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^ ̄
TypeScript • 静的型付けをJavaScriptにもたらす JSのスーパーセット • 既存のJSコードをそのまま使っても動作する • JSコードにトランスパイルするので、 型情報はトランスパイル時に失われる •
そのため実行時には型は保証されない
clasp + TypeScriptで開発してみる Googleカレンダーから1週間の予定を取得して JSONで返すAPIを作ってみた
claspのインストールとログイン
Google Apps Script APIをオンに https://script.google.com/home/usersettings
ローカル環境初期設定
tsconfig.jsonを作成
src/appscript.jsonのtimeZoneを修正
src/Code.tsを実装
src/Code.t s を実装
src/Code.tsを実装
コードをデプロイ
公開
公開
公開URLを叩く
まとめ • clasp使えば自分の好きな開発環境で GASアプリケーションが開発できるし バージョン管理もできる • TypeScriptによる型付けで補完が効いて開発が捗る • 型安全による安心感 •
静的型付けは正義
ご清聴ありがとうございました