ITADN

How to type colorspace[colorSpaceStr]?

#12Openskorphil 创建于 2024-12-30
S
skorphilcommented
Hi, i'm trying to use `colorspace[colorSpaceStr]`: ```ts import * as colorSpace from "@texel/color"; ... colorSpace[colorSpaceStr] // Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'typeof import("@texel/color")'. ``` What is the proper way to type `colorSpaceStr`? Can't figure this out :(
1 条评论