TS2339: Property 'colors' does not exist on type 'ConstantsAPI' in Figma Plugin API
I'm working on a Figma plugin using the Figma Plugin API and TypeScript. I'm trying to access the figma.constants.colors object to get the FigJam base colors, but I'm encountering a TypeScript error.
Here's the code snippet that's causing the issue:
console.log(figma.constants.colors.figJamBase);
The error message I'm getting is:
TS2339: Property 'colors' does not exist on type 'ConstantsAPI'.
According to the Figma Plugin API documentation, the figma.constants.colors object should provide a set of color palettes, including figJamBase and figJamBaseLight, which map the names of all the FigJam base and light colors to their corresponding hex values.
I'm not sure why I'm getting this error. Any help would be appreciated.
oh, I think I got the repository wrong, this should probably have been posted here - https://github.com/figma/widget-typings
Hi! This definitely seems to be incorrect in our typings file. You should be able to use figma.constants.colors.figJamBase safely, and we will update the typings so that they are correct!