diff --git a/types/styled-system/index.d.ts b/types/styled-system/index.d.ts index b16bbd0ec6..aeccbe4423 100644 --- a/types/styled-system/index.d.ts +++ b/types/styled-system/index.d.ts @@ -7,595 +7,577 @@ // Eloy Durán // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + /** - * Original Author: https://gist.github.com/maxdeviant/cfed775121829eb02283347083915383 + * Core */ -declare module "styled-system" { - /** - * Core - */ - - export type GlobalStyleValues = "inherit" | "initial" | "unset"; - - export interface BaseTheme { - breakpoints?: number[]; - space?: number[]; - fontSizes?: number[]; - colors?: { - [name: string]: string; - }; - } - - /** - * Space - */ - - type ResponsiveValue = T | Array; - - export type SpaceValue = number | string; - export type ResponsiveSpaceValue = ResponsiveValue; - - export interface SpaceProps { - m?: ResponsiveSpaceValue; - mt?: ResponsiveSpaceValue; - mr?: ResponsiveSpaceValue; - mb?: ResponsiveSpaceValue; - ml?: ResponsiveSpaceValue; - mx?: ResponsiveSpaceValue; - my?: ResponsiveSpaceValue; - p?: ResponsiveSpaceValue; - pt?: ResponsiveSpaceValue; - pr?: ResponsiveSpaceValue; - pb?: ResponsiveSpaceValue; - pl?: ResponsiveSpaceValue; - px?: ResponsiveSpaceValue; - py?: ResponsiveSpaceValue; - } - - export function space(...args: any[]): any; - - /** - * Width - */ - - export type WidthValue = number | string; - export type ResponsiveWidthValue = ResponsiveValue; - - export interface WidthProps { - width?: ResponsiveWidthValue; - } - - export interface MinWidthProps { - minWidth?: ResponsiveWidthValue; - } - - export interface MaxWidthProps { - maxWidth?: ResponsiveWidthValue; - } - - export function width(...args: any[]): any; - export function minWidth(...args: any[]): any; - export function maxWidth(...args: any[]): any; - - /** - * Height - */ - - export type HeightValue = number | string; - export type ResponsiveHeightValue = ResponsiveValue; - - export interface HeightProps { - height?: ResponsiveHeightValue; - } - - export interface MinHeightProps { - minHeight?: ResponsiveHeightValue; - } - - export interface MaxHeightProps { - maxHeight?: ResponsiveHeightValue; - } - - export function height(...args: any[]): any; - export function minHeight(...args: any[]): any; - export function maxHeight(...args: any[]): any; - - /** - * Font Size - */ - - export type FontSizeValue = number | string; - export type ResponsiveFontSizeValue = ResponsiveValue; - - export interface FontSizeProps { - fontSize?: ResponsiveFontSizeValue; - } - - export function fontSize(...args: any[]): any; - - /** - * Color - */ - export type ColorValue = string; - export type ResponsiveColorValue = ResponsiveValue; - - export function color(...args: any[]): any; - - /** - * Typography - */ - export interface FontFamilyProps { - fontFamily?: string; - } - export function fontFamily(...args: any[]): any; - - export type TextAlignValue = - | "left" - | "right" - | "center" - | "justify" - | "justify-all" - | "start" - | "end" - | "match-parent"; - export type ResponsiveTextAlignValue = ResponsiveValue; - - export interface TextAlignProps { - align?: ResponsiveTextAlignValue; - } - - export function textAlign(...args: any[]): any; - - export type LineHeightValue = number | string; - export type ResponsiveLineHeightValue = ResponsiveValue; - export interface LineHeightProps { - lineHeight?: ResponsiveLineHeightValue; - } - export function lineHeight(...args: any[]): any; - - export type FontWeightValue = - | GlobalStyleValues - | "normal" - | "bold" - | "lighter" - | "bolder" - | number; - - export interface FontWeightProps { - fontWeight?: FontWeightValue; - } - - export function fontWeight(...args: any[]): any; - - export type LetterSpacingValue = number | string; - export type ResponsiveLetterSpacingValue = ResponsiveValue< - LetterSpacingValue - >; - export interface LetterSpacingProps { - letterSpacing?: ResponsiveLetterSpacingValue; - } - export function letterSpacing(...args: any[]): any; - - /** - * Layout - */ - - export type DisplayValue = - | "inline" - | "block" - | "contents" - | "flex" - | "grid" - | "inline-block"; - - export interface DisplayProps { - display?: DisplayValue; - } - - export function display(...args: any[]): any; - - export interface SizeProps { - size?: ResponsiveWidthValue | ResponsiveHeightValue; - } - - export function size(...args: any[]): any; - - export type RatioValue = SpaceValue; - - export interface RatioProps { - ratio?: RatioValue; - } - - export function ratio(...args: any[]): any; - - /** - * Flexbox - */ - - export type AlignItemsValue = - | "normal" - | "stretch" - | "center" - | "start" - | "end" - | "flex-start" - | "flex-end" - | "self-start" - | "self-end" - | "left" - | "right" - | "baseline" - | "first baseline" - | "last baseline" - | "safe center" - | "unsafe center"; - export type ResponsiveAlignItemsValue = ResponsiveValue; - - export interface AlignItemsProps { - align?: ResponsiveAlignItemsValue; - alignItems?: ResponsiveAlignItemsValue; - } - - export function alignItems(...args: any[]): any; - - export type JustifyContentValue = - | "center" - | "start" - | "end" - | "flex-start" - | "flex-end" - | "left" - | "right" - | "baseline" - | "first baseline" - | "last baseline" - | "space-between" - | "space-around" - | "space-evenly" - | "stretch" - | "safe center" - | "unsafe center"; - export type ResponsiveJustifyContentValue = ResponsiveValue< - JustifyContentValue - >; - - export interface JustifyContentProps { - justify?: ResponsiveJustifyContentValue; - justifyContent?: ResponsiveJustifyContentValue; - } - - export function justifyContent(...args: any[]): any; - - export type FlexWrapValue = true | "nowrap" | "wrap" | "wrap-reverse"; - - export interface FlexWrapProps { - wrap?: FlexWrapValue; - } - - export function flexWrap(...args: any[]): any; - - export type FlexDirectionValue = - | GlobalStyleValues - | "row" - | "row-reverse" - | "column" - | "column-reverse"; - - export type ResponsiveFlexDirectionValue = ResponsiveValue< - FlexDirectionValue - >; - - export interface FlexDirectionProps { - flexDirection?: ResponsiveFlexDirectionValue; - } - - export function flexDirection(...args: any[]): any; - - export type FlexValue = number | string; - export type ResponsiveFlexValue = ResponsiveValue; - - export interface FlexProps { - flex?: ResponsiveFlexValue; - } - - export function flex(...args: any[]): any; - - export type AlignContentValue = - | GlobalStyleValues - | "center" - | "start" - | "end" - | "flex-start" - | "flex-end" - | "normal" - | "baseline" - | "first baseline" - | "last baseline" - | "space-between" - | "space-around" - | "space-evenly" - | "stretch" - | "safe center" - | "unsafe center"; - export type ResponsiveAlignContentValue = ResponsiveValue< - AlignContentValue - >; - - export interface AlignContentProps { - alignContent?: ResponsiveAlignItemsValue; - } - - export function alignContent(...args: any[]): any; - - export type JustifySelfValue = - | GlobalStyleValues - | "auto" - | "normal" - | "stretch" - | "center" - | "start" - | "end" - | "flex-start" - | "flex-end" - | "self-start" - | "self-end" - | "left" - | "right" - | "baseline" - | "first baseline" - | "last baseline" - | "safe center" - | "unsafe center"; - - export type ResponsiveJustifySelfValue = ResponsiveValue; - - export interface JustifySelfProps { - justifySelf?: ResponsiveJustifySelfValue; - } - - export function justifySelf(...args: any[]): any; - - export type AlignSelfValue = - | "auto" - | "normal" - | "center" - | "start" - | "end" - | "self-start" - | "self-end" - | "flex-start" - | "flex-end" - | "left" - | "right" - | "baseline" - | "first baseline" - | "last baseline" - | "stretch" - | "safe center" - | "unsafe center"; - export type ResponsiveAlignSelfValue = ResponsiveValue; - - export interface AlignSelfProps { - alignSelf?: ResponsiveAlignSelfValue; - } - - export function alignSelf(...args: any[]): any; - - export type OrderValue = GlobalStyleValues | number; - export type ResponsiveOrderValue = ResponsiveValue; - - export interface OrderProps { - order?: ResponsiveOrderValue; - } - - export function order(...args: any[]): any; - - export type FlexBasisValue = - | GlobalStyleValues - | "auto" - | "fill" - | "max-content" - | "min-content" - | "fit-content" - | "content"; - - export interface FlexBasisProps { - // TODO: The FlexBasisValue currently really only exists for documentation - // purposes, because flex-basis also accepts `Nem` and `Npx` strings. - // Not sure there’s a way to still have the union values show up as - // auto-completion results. - flexBasis?: FlexBasisValue | string; - } - - export function flexBasis(...args: any[]): any; - - /** - * Grid Layout - */ - - /** - * Background - * // TODO: Flesh out these values more - */ - - export type BackgroundValue = string; - export interface BackgroundProps { - background?: BackgroundValue; - } - - export function background(...args: any[]): any; - - export type BackgroundImageValue = string; - export interface BackgroundImageProps { - /** - * Value will be wrapped in url() - */ - backgroundImage?: BackgroundImageValue; - } - - export function backgroundImage(...args: any[]): any; - - export type BackgroundSizeValue = string; - export interface BackgroundSizeProps { - backgroundImage?: BackgroundSizeValue; - } - - export function backgroundSize(...args: any[]): any; - - export type BackgroundPositionValue = string; - export interface BackgroundPositionProps { - backgroundImage?: BackgroundPositionValue; - } - - export function backgroundPosition(...args: any[]): any; - - export type BackgroundRepeatValue = string; - export interface BackgroundRepeatProps { - backgroundImage?: BackgroundRepeatValue; - } - - export function backgroundRepeat(...args: any[]): any; - - /** - * Misc - */ - - export type BorderRadiusValue = string | number; - export interface BorderRadiusProps { - borderRadius?: BorderRadiusValue; - } - export function borderRadius(...args: any[]): any; - - export type BorderColorValue = string; - export interface BorderColorProps { - borderColor?: BorderColorValue; - } - export function borderColor(...args: any[]): any; - - export type BorderValue = string | number; - export type ResponsiveBorderValue = ResponsiveValue; - export interface BorderProps { - border?: ResponsiveBorderValue; - borderTop?: ResponsiveBorderValue; - borderRight?: ResponsiveBorderValue; - borderBottom?: ResponsiveBorderValue; - borderLeft?: ResponsiveBorderValue; - } - export function borders(...args: any[]): any; - - export type BoxShadowValue = string; - export interface BoxShadowProps { - boxShadow?: BoxShadowValue; - } - export function boxShadow(...arg: any[]): any; - - /** - * Position - */ - - export type PositionValue = - | "static" - | "relative" - | "absolute" - | "sticky" - | "fixed"; - export type ResponsivePositionValue = ResponsiveValue; - export interface PositionProps { - position?: ResponsivePositionValue; - } - export function position(...args: any[]): any; - - export type TopValue = string | number; - export type ResponsiveTopValue = ResponsiveValue; - export interface TopProps { - top?: ResponsiveTopValue; - } - export function top(...args: any[]): any; - - export type RightValue = string | number; - export type ResponsiveRightValue = ResponsiveValue; - export interface RightProps { - right?: ResponsiveRightValue; - } - export function right(...args: any[]): any; - - export type BottomValue = string | number; - export type ResponsiveBottomValue = ResponsiveValue; - export interface BottomProps { - bottom?: ResponsiveBottomValue; - } - export function bottom(...args: any[]): any; - - export type LeftValue = string | number; - export type ResponsiveLeftValue = ResponsiveValue; - export interface LeftProps { - left?: ResponsiveLeftValue; - } - export function left(...args: any[]): any; - - /** - * Pseudo-classes - */ - - export type PseudoStyleValue = { - color?: string; - backgroundColor?: string; - borderColor?: string; - boxShadow?: number; +type GlobalStyleValues = "inherit" | "initial" | "unset"; + +interface BaseTheme { + breakpoints?: number[]; + space?: number[]; + fontSizes?: number[]; + colors?: { + [name: string]: string; }; - export type HoverValue = PseudoStyleValue; - export interface HoverProps { - hover?: HoverValue; - } - export function hover(...args: any[]): any; - - export type FocusValue = PseudoStyleValue; - export interface FocusProps { - focus?: FocusValue; - } - export function focus(...args: any[]): any; - - export type ActiveValue = PseudoStyleValue; - export interface ActiveProps { - active?: ActiveValue; - } - export function active(...args: any[]): any; - - export type DisabledValue = PseudoStyleValue; - export interface DisabledProps { - disabledStyle?: DisabledValue; - } - export function disabled(...args: any[]): any; - - // TODO: Continue from here - - /** - * Utilities - */ - - export function theme(keys: string): any; - export function themeGet(keys: string): any; - - export function cleanElement(component: any): any; - - export function removeProps(props: any): any; - - /** - * Low-level style functions - */ - - export interface LowLevelStyleFunctionArguments { - prop: string; - cssProperty?: string; - key?: string; - numberToPx?: boolean; - alias?: string; - } - - export function style(args: LowLevelStyleFunctionArguments): any; - - export function responsiveStyle(args: LowLevelStyleFunctionArguments): any; - - export function pseudoStyle(args: LowLevelStyleFunctionArguments): any; } + +/** + * Space + */ + +type ResponsiveValue = T | Array; + +type SpaceValue = number | string; +type ResponsiveSpaceValue = ResponsiveValue; + +interface SpaceProps { + m?: ResponsiveSpaceValue; + mt?: ResponsiveSpaceValue; + mr?: ResponsiveSpaceValue; + mb?: ResponsiveSpaceValue; + ml?: ResponsiveSpaceValue; + mx?: ResponsiveSpaceValue; + my?: ResponsiveSpaceValue; + p?: ResponsiveSpaceValue; + pt?: ResponsiveSpaceValue; + pr?: ResponsiveSpaceValue; + pb?: ResponsiveSpaceValue; + pl?: ResponsiveSpaceValue; + px?: ResponsiveSpaceValue; + py?: ResponsiveSpaceValue; +} + +declare function space(...args: any[]): any; + +/** + * Width + */ + +type WidthValue = number | string; +type ResponsiveWidthValue = ResponsiveValue; + +interface WidthProps { + width?: ResponsiveWidthValue; +} + +interface MinWidthProps { + minWidth?: ResponsiveWidthValue; +} + +interface MaxWidthProps { + maxWidth?: ResponsiveWidthValue; +} + +declare function width(...args: any[]): any; +declare function minWidth(...args: any[]): any; +declare function maxWidth(...args: any[]): any; + +/** + * Height + */ + +type HeightValue = number | string; +type ResponsiveHeightValue = ResponsiveValue; + +interface HeightProps { + height?: ResponsiveHeightValue; +} + +interface MinHeightProps { + minHeight?: ResponsiveHeightValue; +} + +interface MaxHeightProps { + maxHeight?: ResponsiveHeightValue; +} + +declare function height(...args: any[]): any; +declare function minHeight(...args: any[]): any; +declare function maxHeight(...args: any[]): any; + +/** + * Font Size + */ + +type FontSizeValue = number | string; +type ResponsiveFontSizeValue = ResponsiveValue; + +interface FontSizeProps { + fontSize?: ResponsiveFontSizeValue; +} + +declare function fontSize(...args: any[]): any; + +/** + * Color + */ +type ColorValue = string; +type ResponsiveColorValue = ResponsiveValue; + +declare function color(...args: any[]): any; + +/** + * Typography + */ +interface FontFamilyProps { + fontFamily?: string; +} +declare function fontFamily(...args: any[]): any; + +type TextAlignValue = + | "left" + | "right" + | "center" + | "justify" + | "justify-all" + | "start" + | "end" + | "match-parent"; +type ResponsiveTextAlignValue = ResponsiveValue; + +interface TextAlignProps { + align?: ResponsiveTextAlignValue; +} + +declare function textAlign(...args: any[]): any; + +type LineHeightValue = number | string; +type ResponsiveLineHeightValue = ResponsiveValue; +interface LineHeightProps { + lineHeight?: ResponsiveLineHeightValue; +} +declare function lineHeight(...args: any[]): any; + +type FontWeightValue = + | GlobalStyleValues + | "normal" + | "bold" + | "lighter" + | "bolder" + | number; + +interface FontWeightProps { + fontWeight?: FontWeightValue; +} + +declare function fontWeight(...args: any[]): any; + +type LetterSpacingValue = number | string; +type ResponsiveLetterSpacingValue = ResponsiveValue; +interface LetterSpacingProps { + letterSpacing?: ResponsiveLetterSpacingValue; +} +declare function letterSpacing(...args: any[]): any; + +/** + * Layout + */ + +type DisplayValue = + | "inline" + | "block" + | "contents" + | "flex" + | "grid" + | "inline-block"; + +interface DisplayProps { + display?: DisplayValue; +} + +declare function display(...args: any[]): any; + +interface SizeProps { + size?: ResponsiveWidthValue | ResponsiveHeightValue; +} + +declare function size(...args: any[]): any; + +type RatioValue = SpaceValue; + +interface RatioProps { + ratio?: RatioValue; +} + +declare function ratio(...args: any[]): any; + +/** + * Flexbox + */ + +type AlignItemsValue = + | "normal" + | "stretch" + | "center" + | "start" + | "end" + | "flex-start" + | "flex-end" + | "self-start" + | "self-end" + | "left" + | "right" + | "baseline" + | "first baseline" + | "last baseline" + | "safe center" + | "unsafe center"; +type ResponsiveAlignItemsValue = ResponsiveValue; + +interface AlignItemsProps { + align?: ResponsiveAlignItemsValue; + alignItems?: ResponsiveAlignItemsValue; +} + +declare function alignItems(...args: any[]): any; + +type JustifyContentValue = + | "center" + | "start" + | "end" + | "flex-start" + | "flex-end" + | "left" + | "right" + | "baseline" + | "first baseline" + | "last baseline" + | "space-between" + | "space-around" + | "space-evenly" + | "stretch" + | "safe center" + | "unsafe center"; +type ResponsiveJustifyContentValue = ResponsiveValue; + +interface JustifyContentProps { + justify?: ResponsiveJustifyContentValue; + justifyContent?: ResponsiveJustifyContentValue; +} + +declare function justifyContent(...args: any[]): any; + +type FlexWrapValue = true | "nowrap" | "wrap" | "wrap-reverse"; + +interface FlexWrapProps { + wrap?: FlexWrapValue; +} + +declare function flexWrap(...args: any[]): any; + +type FlexDirectionValue = + | GlobalStyleValues + | "row" + | "row-reverse" + | "column" + | "column-reverse"; + +type ResponsiveFlexDirectionValue = ResponsiveValue; + +interface FlexDirectionProps { + flexDirection?: ResponsiveFlexDirectionValue; +} + +declare function flexDirection(...args: any[]): any; + +type FlexValue = number | string; +type ResponsiveFlexValue = ResponsiveValue; + +interface FlexProps { + flex?: ResponsiveFlexValue; +} + +declare function flex(...args: any[]): any; + +type AlignContentValue = + | GlobalStyleValues + | "center" + | "start" + | "end" + | "flex-start" + | "flex-end" + | "normal" + | "baseline" + | "first baseline" + | "last baseline" + | "space-between" + | "space-around" + | "space-evenly" + | "stretch" + | "safe center" + | "unsafe center"; +type ResponsiveAlignContentValue = ResponsiveValue; + +interface AlignContentProps { + alignContent?: ResponsiveAlignItemsValue; +} + +declare function alignContent(...args: any[]): any; + +type JustifySelfValue = + | GlobalStyleValues + | "auto" + | "normal" + | "stretch" + | "center" + | "start" + | "end" + | "flex-start" + | "flex-end" + | "self-start" + | "self-end" + | "left" + | "right" + | "baseline" + | "first baseline" + | "last baseline" + | "safe center" + | "unsafe center"; + +type ResponsiveJustifySelfValue = ResponsiveValue; + +interface JustifySelfProps { + justifySelf?: ResponsiveJustifySelfValue; +} + +declare function justifySelf(...args: any[]): any; + +type AlignSelfValue = + | "auto" + | "normal" + | "center" + | "start" + | "end" + | "self-start" + | "self-end" + | "flex-start" + | "flex-end" + | "left" + | "right" + | "baseline" + | "first baseline" + | "last baseline" + | "stretch" + | "safe center" + | "unsafe center"; +type ResponsiveAlignSelfValue = ResponsiveValue; + +interface AlignSelfProps { + alignSelf?: ResponsiveAlignSelfValue; +} + +declare function alignSelf(...args: any[]): any; + +type OrderValue = GlobalStyleValues | number; +type ResponsiveOrderValue = ResponsiveValue; + +interface OrderProps { + order?: ResponsiveOrderValue; +} + +declare function order(...args: any[]): any; + +type FlexBasisValue = + | GlobalStyleValues + | "auto" + | "fill" + | "max-content" + | "min-content" + | "fit-content" + | "content"; + +interface FlexBasisProps { + // TODO: The FlexBasisValue currently really only exists for documentation + // purposes, because flex-basis also accepts `Nem` and `Npx` strings. + // Not sure there’s a way to still have the union values show up as + // auto-completion results. + flexBasis?: FlexBasisValue | string; +} + +declare function flexBasis(...args: any[]): any; + +/** + * Grid Layout + */ + +// TODO: Add grid values + +/** + * Background + */ + +type BackgroundValue = string; +interface BackgroundProps { + background?: BackgroundValue; +} + +declare function background(...args: any[]): any; + +type BackgroundImageValue = string; +interface BackgroundImageProps { + /** + * Value will be wrapped in url() + */ + backgroundImage?: BackgroundImageValue; +} + +declare function backgroundImage(...args: any[]): any; + +type BackgroundSizeValue = string; +interface BackgroundSizeProps { + backgroundImage?: BackgroundSizeValue; +} + +declare function backgroundSize(...args: any[]): any; + +type BackgroundPositionValue = string; +interface BackgroundPositionProps { + backgroundImage?: BackgroundPositionValue; +} + +declare function backgroundPosition(...args: any[]): any; + +type BackgroundRepeatValue = string; +interface BackgroundRepeatProps { + backgroundImage?: BackgroundRepeatValue; +} + +declare function backgroundRepeat(...args: any[]): any; + +/** + * Misc + */ + +type BorderRadiusValue = string | number; +interface BorderRadiusProps { + borderRadius?: BorderRadiusValue; +} +declare function borderRadius(...args: any[]): any; + +type BorderColorValue = string; +interface BorderColorProps { + borderColor?: BorderColorValue; +} +declare function borderColor(...args: any[]): any; + +type BorderValue = string | number; +type ResponsiveBorderValue = ResponsiveValue; +interface BorderProps { + border?: ResponsiveBorderValue; + borderTop?: ResponsiveBorderValue; + borderRight?: ResponsiveBorderValue; + borderBottom?: ResponsiveBorderValue; + borderLeft?: ResponsiveBorderValue; +} +declare function borders(...args: any[]): any; + +type BoxShadowValue = string; +interface BoxShadowProps { + boxShadow?: BoxShadowValue; +} +declare function boxShadow(...arg: any[]): any; + +/** + * Position + */ + +type PositionValue = "static" | "relative" | "absolute" | "sticky" | "fixed"; +type ResponsivePositionValue = ResponsiveValue; +interface PositionProps { + position?: ResponsivePositionValue; +} +declare function position(...args: any[]): any; + +type TopValue = string | number; +type ResponsiveTopValue = ResponsiveValue; +interface TopProps { + top?: ResponsiveTopValue; +} +declare function top(...args: any[]): any; + +type RightValue = string | number; +type ResponsiveRightValue = ResponsiveValue; +interface RightProps { + right?: ResponsiveRightValue; +} +declare function right(...args: any[]): any; + +type BottomValue = string | number; +type ResponsiveBottomValue = ResponsiveValue; +interface BottomProps { + bottom?: ResponsiveBottomValue; +} +declare function bottom(...args: any[]): any; + +type LeftValue = string | number; +type ResponsiveLeftValue = ResponsiveValue; +interface LeftProps { + left?: ResponsiveLeftValue; +} +declare function left(...args: any[]): any; + +/** + * Pseudo-classes + */ + +interface PseudoStyleValue { + color?: string; + backgroundColor?: string; + borderColor?: string; + boxShadow?: number; +} +type HoverValue = PseudoStyleValue; +interface HoverProps { + hover?: HoverValue; +} +declare function hover(...args: any[]): any; + +type FocusValue = PseudoStyleValue; +interface FocusProps { + focus?: FocusValue; +} +declare function focus(...args: any[]): any; + +type ActiveValue = PseudoStyleValue; +interface ActiveProps { + active?: ActiveValue; +} +declare function active(...args: any[]): any; + +type DisabledValue = PseudoStyleValue; +interface DisabledProps { + disabledStyle?: DisabledValue; +} +declare function disabled(...args: any[]): any; + +/** + * Utilities + */ + +declare function theme(keys: string): any; +declare function themeGet(keys: string): any; + +declare function cleanElement(component: any): any; + +declare function removeProps(props: any): any; + +/** + * Low-level style declare functions + */ + +interface LowLevelStylefunctionArguments { + prop: string; + cssProperty?: string; + key?: string; + numberToPx?: boolean; + alias?: string; +} + +declare function style(args: LowLevelStylefunctionArguments): any; + +declare function responsiveStyle(args: LowLevelStylefunctionArguments): any; + +declare function pseudoStyle(args: LowLevelStylefunctionArguments): any; diff --git a/types/styled-system/tsconfig.json b/types/styled-system/tsconfig.json index cbbfcbb662..12bdc137c0 100644 --- a/types/styled-system/tsconfig.json +++ b/types/styled-system/tsconfig.json @@ -1,22 +1,16 @@ { "compilerOptions": { "module": "commonjs", - "lib": [ - "es6" - ], + "lib": ["es6"], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", - "typeRoots": [ - "../" - ], + "typeRoots": ["../"], "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true }, - "files": [ - "index.d.ts", - "styled-system-tests.ts" - ] + "files": ["index.d.ts", "styled-system-tests.ts"] }