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
160
0
Share
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
130
Other Decks in Programming
See All in Programming
AWSはOSSをどのように 考えているのか?
akihisaikeda
0
110
AIを導入する前にやるべきこと
negima
2
350
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
600
AlarmKitで明後日起きれるアラームアプリを作る
trickart
0
130
ソースコード→AST→オペコード、の旅を覗いてみる
o0h
PRO
1
130
GitHubCopilotCLIをはじめよう.pdf
htkym
0
330
書籍「ユーザーストーリーマッピング」が私のバイブル
asumikam
4
490
運転動画を検索可能にする〜Cosmos-Embed1とDatabricks Vector Searchで〜/cosmos-embed1-databricks-vector-search
studio_graph
1
720
WebAssembly を読み込むベストプラクティス 2026年春版 / Best Practices for Loading WebAssembly (Spring 2026)
petamoriken
5
1.1k
20260514_its_the_context_window_stupid.pdf
heita
0
920
(Re)make Regexp in Ruby: Democratizing internals for the JIT
makenowjust
3
1k
継続的な負荷検証を目指して
pyama86
3
1.1k
Featured
See All Featured
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.2k
Color Theory Basics | Prateek | Gurzu
gurzu
0
310
Leo the Paperboy
mayatellez
7
1.8k
Building AI with AI
inesmontani
PRO
1
980
Writing Fast Ruby
sferik
630
63k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
320
Darren the Foodie - Storyboard
khoart
PRO
3
3.3k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
780
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
65
55k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
62
54k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.3k
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による型付けで補完が効いて開発が捗る • 型安全による安心感 •
静的型付けは正義
ご清聴ありがとうございました