import type { Theme as PuiTheme } from '@elliemae/pui-theme'; import type React from 'react'; import type { ElementType, Ref } from 'react'; import type { AnyStyledComponent, CSSObject, Interpolation, InterpolationFunction, StyledComponent, StyledComponentInnerComponent, StyledComponentPropsWithRef, ThemedStyledProps } from 'styled-components'; export interface Options { name: string | null; slot: string | null; preserveLegacyDataTestId?: boolean; } export interface Theme extends PuiTheme { layoutMode?: 'l' | 'm' | 's' | 'xs'; components?: { [componentName: string]: { styleOverrides?: CSSObject; variants?: { props: Record string; }>; style: CSSObject; }[]; }; }; } export type AnyStyledRef = React.MutableRefObject | ((_ref: T | null) => void) | false | null; export type StyleArg = TemplateStringsArray | CSSObject | InterpolationFunction; export type Expression = Interpolation; export type Expressions = Array>; export type ThemedExpression = Interpolation>; export type PropsWithTheme> = T & { theme: Theme; }; type ComponentInnerRef = T extends new (props: infer P) => React.Component ? Ref> | undefined : React.PropsWithRef>['ref']; export type StyledComponentInnerRef> = C extends AnyStyledComponent ? ComponentInnerRef> : ComponentInnerRef; export interface ThemedStyledFunctionBase, T extends object, O extends object = {}, A extends keyof any = never> { (first: StyleArg & O & U & OwnerInterface & InnerRefInterface, T>>, ...rest: Expressions & O & U & OwnerInterface & InnerRefInterface, T>>): StyledComponent, A>; } export type AttrsFunc> = (props: StyledComponentPropsWithRef>>) => Partial>>; export type InternalAttrsFunc> = (props: StyledComponentPropsWithRef; }>>>, meta: { options: Options; displayName: string | null; }) => Partial>>; export interface InnerRefInterface> { innerRef?: StyledComponentInnerRef; ref?: never; } export interface OwnerInterface { getOwnerProps?: () => object; getOwnerPropsArguments?: () => object; } export type PartProps = Record | ((args: object) => Record) | null | undefined; export {};