plugin-typings
plugin-typings copied to clipboard
Use union type to indicate the getStyleById return type
this change will bring better type experience in bellow case
const style = figma.getStyleById(styleId)
if (style.type === 'TEXT') {
// TS would infer `style` is `TextStyle` type here
} else if (style.type === 'PAINT') {
// TS would infer `style` is `GridStyle` type here
}