Currently, we export many values including classes (Layer, Group) and methods (parse()). These expose implementation details and enable unsupported workflows (e.g. instantiating a Group directly).
To prevent this, we reduced our API surface:
Remove named export: parse() (not to be confused with Psd.parse(), which is a static method on the default-exportedPsd class)
Only export as types: Layer, Group
We also refactored our code to continue supporting some workflows (e.g. traverseNode()).
Note: We still export enums (ColorMode, Depth, GuideDirection, SliceOrigin) by value.
Currently, we export many values including classes (
Layer
,Group
) and methods (parse()
). These expose implementation details and enable unsupported workflows (e.g. instantiating aGroup
directly).To prevent this, we reduced our API surface:
parse()
(not to be confused withPsd.parse()
, which is a static method on the default-exportedPsd
class)Layer
,Group
We also refactored our code to continue supporting some workflows (e.g.
traverseNode()
).Note: We still export enums (
ColorMode
,Depth
,GuideDirection
,SliceOrigin
) by value.