5.1.6 • Published 6 months ago

@types/styled-system__core v5.1.6

Weekly downloads
1,473
License
MIT
Repository
github
Last release
6 months ago

Installation

npm install --save @types/styled-system__core

Summary

This package contains type definitions for @styled-system/core (https://github.com/styled-system/styled-system).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/styled-system__core.

index.d.ts

// Type definitions for @styled-system/core 5.1
// Project: https://github.com/styled-system/styled-system
// Definitions by: Leo Toneff <https://github.com/bragle>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.1

import * as CSS from 'csstype';

export function get(obj: any, ...paths: Array<string | number>): any;

export type ObjectOrArray<T, K extends keyof any = keyof any> = T[] | Record<K, T | Record<K, T> | T[]>;

export type Scale = ObjectOrArray<number | string>;

export interface styleFn {
    (...args: any[]): any;

    config?: object | undefined;
    propNames?: string[] | undefined;
    cache?: object | undefined;
}

export interface ConfigStyle {
    /** The CSS property to use in the returned style object (overridden by `properties` if present). */
    property?: keyof CSS.Properties | undefined;
    /**
     * An array of multiple properties (e.g. `['marginLeft', 'marginRight']`) to which this style's value will be
     * assigned (overrides `property` when present).
     */
    properties?: Array<keyof CSS.Properties> | undefined;
    /** A string referencing a key in the `theme` object. */
    scale?: string | undefined;
    /** A fallback scale object for when there isn't one defined in the `theme` object. */
    defaultScale?: Scale | undefined;
    /** A function to transform the raw value based on the scale. */
    transform?: ((value: any, scale?: Scale) => any) | undefined;
}

export interface Config {
    /** Property name exposed for use in components */
    [customStyleName: string]: ConfigStyle | boolean;
}

export function compose(...parsers: styleFn[]): styleFn;

export function system(styleDefinitions: Config): styleFn;

export function createParser(config: ConfigStyle): styleFn;

export function createStyleFunction(args: ConfigStyle): styleFn;

Additional Details

  • Last updated: Fri, 02 Jul 2021 22:33:06 GMT
  • Dependencies: @types/csstype
  • Global values: none

Credits

These definitions were written by Leo Toneff.

5.1.5

7 months ago

5.1.4

7 months ago

5.1.6

6 months ago

5.1.3

3 years ago

5.1.2

4 years ago

5.1.1

4 years ago

5.1.0

4 years ago