import { SKLayer , Shadow } from '../types' ; import { transSketchColor } from '../common/utils' ; param layer export const parseShadow = ( layer ) : Shadow [ ] => { const { shadows = [ ] , innerShadows = [ ] } = layer . style ; return [ ... shadows , ... innerShadows ] . filter ( ( { isEnabled } ) => isEnabled ) . map ( ( { offsetX , offsetY , blurRadius , spread , color , _class } ) => ( { type : _class === 'innerShadow' ? 0 : 1 , offsetX , offsetY , blurRadius , spread , color : transSketchColor ( color ) } ) ) ; } ;