Slide 24
Slide 24 text
TS の魅⼒ — 他の汎⽤プログラミング⾔語と⽐べて
ネストしたオブジェクトの型定義が⾒やすい
2 4
export type Input = {
googleCloud: {
projects: Array<{
cloudStorage: {
buckets: Array<{
name: string,
acl: Array<{
entity: string,
role:
| "OWNER"
| "READER"
| "WRITER",
}>,
type Input struct {
GoogleCloud GoogleCloud
}
type GoogleCloud struct {
Projects []GoogleCloudProject
}
type GoogleCloudProject struct {
CloudStorage GoogleCloudProjectCloudStorage
}
type GoogleCloudProjectCloudStorage struct {
Buckets []GoogleCloudProjectCloudStorageBuckets
}
type GoogleCloudProjectCloudStorageBuckets struct {
Name string
ACL []GoogleCloudProjectCloudStorageBucketsACL
IamPolicy GoogleCloudProjectCloudStorageBucketsIamPolicy
}
type GoogleCloudProjectCloudStorageBucketsACL struct {
Entity string
Role GoogleCloudProjectCloudStorageBucketsACLRole
}
type GoogleCloudProjectCloudStorageBucketsACLRole string
Go