2.0.5 • Published 5 months ago

@types/styletron-standard v2.0.5

Weekly downloads
7,983
License
MIT
Repository
github
Last release
5 months ago

Installation

npm install --save @types/styletron-standard

Summary

This package contains type definitions for styletron-standard (https://github.com/styletron/styletron).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/styletron-standard.

index.d.ts

// Type definitions for styletron-standard 2.0
// Project: https://github.com/styletron/styletron
// Definitions by: Eric Taylor <https://github.com/erictaylor>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.9

import * as CSS from 'csstype';

export type Properties = CSS.Properties<string | number>;
export type FontFace = CSS.AtRule.FontFace;
export interface KeyframesPercentageObject {
    [key: string]: Properties;
}

export type KeyframesObject = KeyframesPercentageObject & {
    from?: Properties | undefined;
    to?: Properties | undefined;
};

// Unrecognized properties are assumed to be media queries
// or pseudo selectors w/ nested style objects.
// See: https://github.com/styletron/styletron-standard
export type StyleObject = Properties &
    { [key in string]: Properties[keyof Properties] | StyleObject };

export interface StandardEngine {
    renderStyle(style: StyleObject): string;
    renderKeyframes(keyframes: KeyframesObject): string;
    renderFontFace(fontFace: FontFace): string;
}

export function driver(style: StyleObject, styletron: StandardEngine): string;

export function getInitialStyle(): StyleObject;

export function renderDeclarativeRules(
    style: StyleObject,
    styletrong: StandardEngine
): StyleObject;

Additional Details

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

Credits

These definitions were written by Eric Taylor.