import type * as CSSUtil from './css-util' import type * as Solid from 'solid-js' import type * as StyledComponent from './styled-component' import type * as ThemeUtil from './theme' import type * as Util from './util' /** Remove an index signature from a type */ export type RemoveIndex = { [k in keyof T as string extends k ? never : number extends k ? never : k]: T[k] } /** Stitches interface. */ export default interface Stitches { config: { prefix: Prefix media: Media theme: Theme themeMap: ThemeMap utils: Utils } prefix: Prefix /** The **prefix** property defined. * * [Read Documentation](https://stitches.dev/docs/variants) */ globalCss: { ( ...styles: ({ /** The **@import** CSS at-rule imports style rules from other style sheets. */ '@import'?: unknown /** The **@font-face** CSS at-rule specifies a custom font with which to display text. */ '@font-face'?: unknown } & { [K in keyof Styles]: K extends '@import' ? string | string[] : K extends '@font-face' ? CSSUtil.Native.AtRule.FontFace | Array : K extends `@keyframes ${string}` ? { [KeyFrame in string]: CSSUtil.CSS } : K extends `@property ${string}` ? CSSUtil.Native.AtRule.Property : CSSUtil.CSS })[] ): { (): string } } keyframes: { (style: { [offset: string]: CSSUtil.CSS }): { (): string name: string } } createTheme: { < Argument0 extends | string | ({ [Scale in keyof Theme]?: { [Token in keyof Theme[Scale]]?: boolean | number | string } } & { [scale in string]: { [token in number | string]: boolean | number | string } }), Argument1 extends | string | ({ [Scale in keyof Theme]?: { [Token in keyof Theme[Scale]]?: boolean | number | string } } & { [scale in string]: { [token in number | string]: boolean | number | string } }), >( nameOrScalesArg0: Argument0, nameOrScalesArg1?: Argument1, ): string & { className: string selector: string } & (Argument0 extends string ? ThemeTokens : ThemeTokens) } theme: string & { className: string selector: string } & { [Scale in keyof Theme]: { [Token in keyof Theme[Scale]]: ThemeUtil.Token, string, Extract, Extract> } } reset: { (): void } getCssText: { (): string } css: { | Util.Function | { [name: string]: unknown })[], CSS = CSSUtil.CSS>( ...composers: { [K in keyof Composers]: Composers[K] extends string | Solid.Component | Util.Function // Strings, Solid Components, and Functions can be skipped over ? Composers[K] : RemoveIndex & { /** The **variants** property lets you set a subclass of styles based on a key-value pair. * * [Read Documentation](https://stitches.dev/docs/variants) */ variants?: { [Name in string]: { [Pair in number | string]: CSS } } /** The **compoundVariants** property lets you to set a subclass of styles based on a combination of active variants. * * [Read Documentation](https://stitches.dev/docs/variants#compound-variants) */ compoundVariants?: (('variants' extends keyof Composers[K] ? { [Name in keyof Composers[K]['variants']]?: Util.Widen | Util.String } : Util.WideObject) & { css: CSS })[] /** The **defaultVariants** property allows you to predefine the active key-value pairs of variants. * * [Read Documentation](https://stitches.dev/docs/variants#default-variants) */ defaultVariants?: 'variants' extends keyof Composers[K] ? { [Name in keyof Composers[K]['variants']]?: Util.Widen | Util.String } : Util.WideObject } & CSS & { [K2 in keyof Composers[K]]: K2 extends 'compoundVariants' | 'defaultVariants' | 'variants' ? unknown : K2 extends keyof CSS ? CSS[K2] : unknown } } ): StyledComponent.CssComponent, StyledComponent.StyledComponentProps, Media, CSS> } styled: { < Type extends keyof Solid.JSX.IntrinsicElements | Solid.Component | Util.Function, Composers extends (Solid.Component | Util.Function | { [name: string]: unknown })[], CSS = CSSUtil.CSS, >( type: Type, ...composers: { [K in keyof Composers]: string extends Composers[K] ? Composers[K] : Composers[K] extends string | Solid.Component | Util.Function // Strings, Solid Components, and Functions can be skipped over ? Composers[K] : RemoveIndex & { /** The **variants** property lets you set a subclass of styles based on a key-value pair. * * [Read Documentation](https://stitches.dev/docs/variants) */ variants?: { [Name in string]: { [Pair in number | string]: CSS } } /** The **compoundVariants** property lets you to set a subclass of styles based on a combination of active variants. * * [Read Documentation](https://stitches.dev/docs/variants#compound-variants) */ compoundVariants?: (('variants' extends keyof Composers[K] ? { [Name in keyof Composers[K]['variants']]?: Util.Widen | Util.String } : Util.WideObject) & { css: CSS })[] /** The **defaultVariants** property allows you to predefine the active key-value pairs of variants. * * [Read Documentation](https://stitches.dev/docs/variants#default-variants) */ defaultVariants?: 'variants' extends keyof Composers[K] ? { [Name in keyof Composers[K]['variants']]?: Util.Widen | Util.String } : Util.WideObject } & CSS & { [K2 in keyof Composers[K]]: K2 extends 'compoundVariants' | 'defaultVariants' | 'variants' ? unknown : K2 extends keyof CSS ? CSS[K2] : unknown } } ): StyledComponent.StyledComponent, Media, CSSUtil.CSS> } } type ThemeTokens = { [Scale in keyof Values]: { [Token in keyof Values[Scale]]: ThemeUtil.Token, Values[Scale][Token], Extract, Extract> } }