Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
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
0
150
TypeScript + GASでAPIを作る / Build API with TypeScript and GAS
Cluexの社内LT大会で発表した時の資料です。
shike
April 11, 2019
Tweet
Share
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
140
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
AI時代を生き抜く 新卒エンジニアの生きる道
coconala_engineer
1
120
JETLS.jl ─ A New Language Server for Julia
abap34
1
400
Giselleで作るAI QAアシスタント 〜 Pull Requestレビューに継続的QAを
codenote
0
190
C-Shared Buildで突破するAI Agent バックテストの壁
po3rin
0
390
配送計画の均等化機能を提供する取り組みについて(⽩⾦鉱業 Meetup Vol.21@六本⽊(数理最適化編))
izu_nori
0
150
S3 VectorsとStrands Agentsを利用したAgentic RAGシステムの構築
tosuri13
6
310
Microservices rules: What good looks like
cer
PRO
0
1.4k
LLM Çağında Backend Olmak: 10 Milyon Prompt'u Milisaniyede Sorgulamak
selcukusta
0
120
tparseでgo testの出力を見やすくする
utgwkk
2
220
Developing static sites with Ruby
okuramasafumi
0
290
まだ間に合う!Claude Code元年をふりかえる
nogu66
5
830
Rediscover the Console - SymfonyCon Amsterdam 2025
chalasr
2
160
Featured
See All Featured
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Optimising Largest Contentful Paint
csswizardry
37
3.5k
Six Lessons from altMBA
skipperchong
29
4.1k
Docker and Python
trallard
47
3.7k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.5k
Testing 201, or: Great Expectations
jmmastey
46
7.8k
Learning to Love Humans: Emotional Interface Design
aarron
274
41k
Bash Introduction
62gerente
615
210k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Agile that works and the tools we love
rasmusluckow
331
21k
Principles of Awesome APIs and How to Build Them.
keavy
127
17k
Making Projects Easy
brettharned
120
6.5k
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による型付けで補完が効いて開発が捗る • 型安全による安心感 •
静的型付けは正義
ご清聴ありがとうございました