diff --git a/packages/pigment-css-react/src/sx.d.ts b/packages/pigment-css-react/src/sx.d.ts index d9a19a42..4263a9e4 100644 --- a/packages/pigment-css-react/src/sx.d.ts +++ b/packages/pigment-css-react/src/sx.d.ts @@ -1,9 +1,11 @@ import type { CSSObjectNoCallback } from './base'; import type { ThemeArgs } from './theme'; +type GetTheme = Argument extends { theme: infer Theme } ? Theme : never; + export type SxProp = | CSSObjectNoCallback - | ((themeArgs: ThemeArgs['theme']) => CSSObjectNoCallback) - | ReadonlyArray CSSObjectNoCallback)>; + | ((theme: GetTheme) => CSSObjectNoCallback) + | ReadonlyArray) => CSSObjectNoCallback)>; -export default function sx(arg: SxProp | Array, componentClass?: string): string; +export default function sx(arg: SxProp, componentClass?: string): string;