/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * */ import type { NodePath } from '@babel/traverse'; import * as t from '@babel/types'; import StateManager from './state-manager'; export type StyleObject = { [key: string]: string | null | boolean }; export declare class ConditionalStyle { test: t.Expression; primary: null | undefined | StyleObject; fallback: null | undefined | StyleObject; constructor( test: t.Expression, primary: null | undefined | StyleObject, fallback: null | undefined | StyleObject, ); } export type ResolvedArg = (null | undefined | StyleObject) | ConditionalStyle; export type ResolvedArgs = ReadonlyArray; export type ResolveStyle = ( path: NodePath, ) => null | StyleObject | 'other'; export type ResolveStylexArgumentsResult = { resolvedArgs: ResolvedArgs; bailOut: boolean; bailOutIndex: null | undefined | number; conditionalCount: number; }; export declare function resolveStylexArguments( argsPaths: ReadonlyArray, resolveStyle: ResolveStyle, options?: { allowStylePath?: (path: NodePath) => boolean }, ): ResolveStylexArgumentsResult; export declare function collectStyleVarsToKeep( argumentPaths: ReadonlyArray, state: StateManager, options: { bailOutIndex: null | undefined | number; evaluateMemberExpression: ( path: NodePath, ) => Readonly<{ confident: boolean; value: any }>; isProxyStyle?: (value: any) => boolean; }, ): void; export declare function makeConditionalExpression( values: ResolvedArgs, buildResult: ( styles: ReadonlyArray, ) => t.Expression, ): t.Expression;