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
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
160
Lighthouseを使った認証必須のGraphQL API / GraphQL API authentication with Lighthouse
shike0909
0
2.4k
Reduxについて / Redux introduction and TODO example with Redux
shike0909
0
140
Other Decks in Programming
See All in Programming
Seeing Through Serverless: Observability for AWS Lambda with ADOT and CloudWatch Application Signals
seike460
PRO
1
120
iOS開発×AI駆動開発 〜最近使って便利だったスキルの話〜
nogu66
0
140
レビュー履歴をAIに食わせて、 Compose移行を加速するs
shihochan
0
270
アクセシビリティから考える情報設計
high_g_engineer
0
150
PyConJP2026_wat_Python × Signal Processing: How to Draw Pictures with Sound Using Spectrogram Art
wat
0
670
RSSとCodexを使ってX投稿自動化してみた
ochtum
0
110
新人はどこまで自力でやり、どこからAIに頼るべきか/エンジニア育成に向き合う_先輩たちの悩みと知見共有会
toppan_digital_dev
1
560
What We Talk About When We Talk About XP
m_seki
2
360
「AI時代、配布するPythonコードをどう守るか: 難読化の実験と判断軸」 #PyconJP2026
pkshadeck
PRO
2
170
Swift愛好会と私(ウホーイ) / Swift Fan Club and Uhooi
uhooi
0
140
Hono + Inertia + React で LP を構築した話
oukayuka
2
210
Gmail/Google DriveをトリガーにAIエージェントを動かそう! / Run AI agents with Gmail/Google Drive as triggers!
har1101
3
470
Featured
See All Featured
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.7k
Ruling the World: When Life Gets Gamed
codingconduct
0
320
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
810
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.8k
Unsuck your backbone
ammeep
672
58k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
sira's awesome portfolio website redesign presentation
elsirapls
0
400
Statistics for Hackers
jakevdp
799
230k
Being A Developer After 40
akosma
91
590k
We Are The Robots
honzajavorek
0
340
Odyssey Design
rkendrick25
PRO
2
800
The Cost Of JavaScript in 2023
addyosmani
55
10k
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による型付けで補完が効いて開発が捗る • 型安全による安心感 •
静的型付けは正義
ご清聴ありがとうございました