import { figmaDataType } from '@typings/figmaDataType' ; import filterByPropertyName from './filterByNameProperty' ; import getPaintStyles from './getPaintStyles' ; import getGridStyles from './getGridStyles' ; import getTokenNodes from './getTokenNodes' ; import getTextStyles from './getTextStyles' ; import getEffectStyles from './getEffectStyles' ; import { Settings } from '@typings/settings' ; function param { PluginAPI } figma param options const buildFigmaData = ( figma , settings ) : figmaDataType => { const tokenFrames = getTokenNodes ( [ ... figma . root . children ] ) ; const userExclusionPrefixes = settings . exclusionPrefix . split ( ',' ) . map ( item => item . replace ( /\s+/g , '' ) ) ; return { tokenFrames : tokenFrames , paintStyles : getPaintStyles ( figma . getLocalPaintStyles ( ) ) . filter ( item => filterByPropertyName ( item , userExclusionPrefixes ) ) , gridStyles : getGridStyles ( figma . getLocalGridStyles ( ) ) . filter ( item => filterByPropertyName ( item , userExclusionPrefixes ) ) , textStyles : getTextStyles ( figma . getLocalTextStyles ( ) ) . filter ( item => filterByPropertyName ( item , userExclusionPrefixes ) ) , effectStyles : getEffectStyles ( figma . getLocalEffectStyles ( ) ) . filter ( item => filterByPropertyName ( item , userExclusionPrefixes ) ) } ; } ; export default buildFigmaData ;