figma / plugin-typings

Typings for the Figma Plugin API
MIT License
195 stars 45 forks source link

Export all interfaces and types #19

Closed hanc1208 closed 3 years ago

hanc1208 commented 3 years ago

Resolves #18

Just exported all interfaces and types and excluded from global namespace.

I didn't adjust indent for easy reviewing.

emartinfigma commented 3 years ago

(Just found this PR.) I like the idea of this, but won't it break existing users who don't have import statements?

hanc1208 commented 3 years ago

@emartinfigma Typescript always have import statements, doesn't it?

emartinfigma commented 3 years ago

No, this file declares globals, which can be used without import statements. This matches the plugin hosting environment, where the figma symbol is available without any import.

hanc1208 commented 3 years ago

@emartinfigma I got it. I have written this PR to type the Figma API when I don't know that Figma API and Figma Plguin API is significally different. I will close this PR.