import * as t from '@babel/types' ; import type { State } from '../types' ; param node { t . Expression } param state { State } returns { boolean } export const isCompiledCSSCallExpression = ( node , state ) : node is t . CallExpression => t . isCallExpression ( node ) && t . isIdentifier ( node . callee ) && node . callee . name === state . compiledImports ?. css ; param node { t . Expression } param state { State } returns { boolean } export const isCompiledCSSTaggedTemplateExpression = ( node , state ) : node is t . TaggedTemplateExpression => t . isTaggedTemplateExpression ( node ) && t . isIdentifier ( node . tag ) && node . tag . name === state . compiledImports ?. css ; param node { t . Node } param state { State } returns { boolean } export const isCompiledKeyframesCallExpression = ( node , state ) : node is t . CallExpression => t . isCallExpression ( node ) && t . isIdentifier ( node . callee ) && node . callee . name === state . compiledImports ?. keyframes ; param node { t . Node } param state { State } returns { boolean } export const isCompiledKeyframesTaggedTemplateExpression = ( node , state ) : node is t . TaggedTemplateExpression => t . isTaggedTemplateExpression ( node ) && t . isIdentifier ( node . tag ) && node . tag . name === state . compiledImports ?. keyframes ; param node { t . Node } param state { State } returns { boolean } const isCompiledStyledMemberExpression = ( node , state ) : node is t . MemberExpression => t . isMemberExpression ( node ) && t . isIdentifier ( node . object ) && node . object . name === state . compiledImports ?. styled ; param node { t . Node } param state { State } returns { boolean } const isCompiledStyledCompositionCallExpression = ( node , state ) : node is t . CallExpression => t . isCallExpression ( node ) && t . isIdentifier ( node . callee ) && node . callee . name === state . compiledImports ?. styled ; param node { t . Expression } param state { State } returns { boolean } export const isCompiledStyledCallExpression = ( node , state ) : node is t . CallExpression => t . isCallExpression ( node ) && ( isCompiledStyledMemberExpression ( node . callee , state ) || isCompiledStyledCompositionCallExpression ( node . callee , state ) ) ; param node { t . Node } param state { State } returns { boolean } export const isCompiledStyledTaggedTemplateExpression = ( node , state ) : node is t . TaggedTemplateExpression => t . isTaggedTemplateExpression ( node ) && ( isCompiledStyledMemberExpression ( node . tag , state ) || isCompiledStyledCompositionCallExpression ( node . tag , state ) ) ;