@cssfn/css-types
Advanced tools
Comparing version 2.0.6 to 2.0.7
import type { OptionalOrBoolean, SingleOrDeepArray, ProductOrFactoryOrDeepArray, PartialNullish, MapOf } from '@cssfn/types'; | ||
import type { Properties, StandardLonghandProperties, StandardShorthandProperties, VendorLonghandProperties, VendorShorthandProperties, ObsoleteProperties, SvgProperties } from 'csstype'; | ||
export declare type CssSimpleNumericValue = (number & {}); | ||
export declare type CssSimpleLiteralValue = (string & {}); | ||
export declare type CssSimpleValue = CssSimpleNumericValue | CssSimpleLiteralValue | CssCustomKeyframesRef; | ||
export declare type CssComplexBaseValueOf<TValue> = TValue | CssCustomRef; | ||
export declare type CssComplexSingleValueOf<TValue> = CssComplexBaseValueOf<TValue> | [CssComplexBaseValueOf<TValue>, '!important']; | ||
export declare type CssComplexMultiValueOf<TValue> = CssComplexBaseValueOf<TValue>[] | CssComplexBaseValueOf<TValue>[][] | [...CssComplexBaseValueOf<TValue>[], '!important'] | [...CssComplexBaseValueOf<TValue>[][], '!important']; | ||
export declare type CssComplexValueOf<TValue> = CssComplexSingleValueOf<TValue> | CssComplexMultiValueOf<TValue>; | ||
export declare type CssCustomName = `--${string}`; | ||
export declare type CssCustomSimpleRef = `var(${CssCustomName})`; | ||
export declare type CssCustomRef = CssCustomSimpleRef | `var(${CssCustomName}, ${CssCustomSimpleRef})`; | ||
export declare type CssCustomValue = CssComplexValueOf<CssSimpleValue>; | ||
export declare type CssCustomProps = PartialNullish<{ | ||
export type CssSimpleNumericValue = (number & {}); | ||
export type CssSimpleLiteralValue = (string & {}); | ||
export type CssSimpleValue = CssSimpleNumericValue | CssSimpleLiteralValue | CssCustomKeyframesRef; | ||
export type CssComplexBaseValueOf<TValue> = TValue | CssCustomRef; | ||
export type CssComplexSingleValueOf<TValue> = CssComplexBaseValueOf<TValue> | [CssComplexBaseValueOf<TValue>, '!important']; | ||
export type CssComplexMultiValueOf<TValue> = CssComplexBaseValueOf<TValue>[] | CssComplexBaseValueOf<TValue>[][] | [...CssComplexBaseValueOf<TValue>[], '!important'] | [...CssComplexBaseValueOf<TValue>[][], '!important']; | ||
export type CssComplexValueOf<TValue> = CssComplexSingleValueOf<TValue> | CssComplexMultiValueOf<TValue>; | ||
export type CssCustomName = `--${string}`; | ||
export type CssCustomSimpleRef = `var(${CssCustomName})`; | ||
export type CssCustomRef = CssCustomSimpleRef | `var(${CssCustomName}, ${CssCustomSimpleRef})`; | ||
export type CssCustomValue = CssComplexValueOf<CssSimpleValue>; | ||
export type CssCustomProps = PartialNullish<{ | ||
[name: CssCustomName]: CssCustomValue; | ||
[name: CssCustomSimpleRef]: CssCustomValue; | ||
}>; | ||
export declare type CssCustomPropsMap = MapOf<CssCustomProps>; | ||
export declare type CssLength = (string & {}) | 0; | ||
export declare type CssDuration = (string & {}); | ||
export declare type CssKnownBaseProps<TLength = CssLength, TDuration = CssDuration> = Properties<TLength, TDuration>; | ||
declare type ShorthandProperties = PartialNullish<{ | ||
export type CssCustomPropsMap = MapOf<CssCustomProps>; | ||
export type CssLength = (string & {}) | 0; | ||
export type CssDuration = (string & {}); | ||
export type CssKnownBaseProps<TLength = CssLength, TDuration = CssDuration> = Properties<TLength, TDuration>; | ||
type ShorthandProperties = PartialNullish<{ | ||
/** | ||
@@ -251,9 +251,9 @@ * Alias of **`color`**. | ||
}>; | ||
export declare type CssKnownBaseExProps = CssKnownBaseProps & ShorthandProperties; | ||
export declare type CssKnownName = keyof CssKnownBaseExProps; | ||
export declare type CssKnownValueOf<TName extends CssKnownName> = Exclude<CssKnownBaseExProps[TName], undefined | null>; | ||
export declare type CssKnownPropsOf<TName extends CssKnownName, multiValue extends boolean = false> = PartialNullish<Pick<{ | ||
export type CssKnownBaseExProps = CssKnownBaseProps & ShorthandProperties; | ||
export type CssKnownName = keyof CssKnownBaseExProps; | ||
export type CssKnownValueOf<TName extends CssKnownName> = Exclude<CssKnownBaseExProps[TName], undefined | null>; | ||
export type CssKnownPropsOf<TName extends CssKnownName, multiValue extends boolean = false> = PartialNullish<Pick<{ | ||
[name in keyof CssKnownBaseExProps]?: multiValue extends false ? CssComplexSingleValueOf<CssKnownValueOf<name> | CssCustomKeyframesRef> : CssComplexValueOf<CssKnownValueOf<name> | CssCustomKeyframesRef>; | ||
}, TName>>; | ||
export declare type CssLonghandFontFaceProps = CssKnownPropsOf<'fontFamily', true> & CssKnownPropsOf<'fontVariantCaps' | 'fontVariantLigatures' | 'fontVariantPosition' | 'fontStretch' | 'fontWeight', false> & CssKnownPropsOf<'fontVariantAlternates' | 'fontVariantEastAsian' | 'fontVariantNumeric' | 'fontStyle' | 'fontFeatureSettings' | 'fontVariationSettings' | 'fontSizeAdjust', true> & PartialNullish<{ | ||
export type CssLonghandFontFaceProps = CssKnownPropsOf<'fontFamily', true> & CssKnownPropsOf<'fontVariantCaps' | 'fontVariantLigatures' | 'fontVariantPosition' | 'fontStretch' | 'fontWeight', false> & CssKnownPropsOf<'fontVariantAlternates' | 'fontVariantEastAsian' | 'fontVariantNumeric' | 'fontStyle' | 'fontFeatureSettings' | 'fontVariationSettings' | 'fontSizeAdjust', true> & PartialNullish<{ | ||
src?: CssComplexValueOf<CssSimpleLiteralValue | `url(${string})`>; | ||
@@ -265,32 +265,32 @@ unicodeRange?: CssComplexValueOf<CssSimpleLiteralValue>; | ||
}>; | ||
export declare type CssShorthandFontFaceProps = CssKnownPropsOf<'fontVariant', true>; | ||
export declare type CssFontFaceProps = CssLonghandFontFaceProps & CssShorthandFontFaceProps; | ||
export declare type CssKnownStandardLonghandProps = Omit<CssKnownPropsOf<keyof StandardLonghandProperties, true>, keyof CssLonghandFontFaceProps> & CssLonghandFontFaceProps; | ||
export declare type CssKnownStandardShorthandProps = Omit<CssKnownPropsOf<keyof StandardShorthandProperties, true>, keyof CssShorthandFontFaceProps> & CssShorthandFontFaceProps; | ||
export declare type CssKnownStandardProps = CssKnownStandardLonghandProps & CssKnownStandardShorthandProps; | ||
export declare type CssKnownShorthandProps = CssKnownPropsOf<keyof ShorthandProperties, true>; | ||
export declare type CssKnownVendorLonghandProps = CssKnownPropsOf<keyof VendorLonghandProperties, true>; | ||
export declare type CssKnownVendorShorthandProps = CssKnownPropsOf<keyof VendorShorthandProperties, true>; | ||
export declare type CssKnownVendorProps = CssKnownVendorLonghandProps & CssKnownVendorShorthandProps; | ||
export declare type CssKnownObsoleteProps = CssKnownPropsOf<keyof ObsoleteProperties, true>; | ||
export declare type CssKnownSvgProps = Omit<CssKnownPropsOf<keyof SvgProperties, true>, keyof CssFontFaceProps> & CssFontFaceProps; | ||
export declare type CssKnownProps = CssKnownStandardProps & CssKnownShorthandProps & CssKnownVendorProps & CssKnownObsoleteProps & CssKnownSvgProps; | ||
export declare type CssProps = CssCustomProps & CssKnownProps; | ||
export declare type CssPropsMap = CssCustomPropsMap & MapOf<CssKnownProps>; | ||
export declare type CssRuleData = readonly [CssRawSelector | CssFinalSelector, CssStyleCollection]; | ||
export declare type CssFinalRuleData = readonly [CssFinalSelector, CssFinalStyleMap]; | ||
export declare type CssRule = { | ||
export type CssShorthandFontFaceProps = CssKnownPropsOf<'fontVariant', true>; | ||
export type CssFontFaceProps = CssLonghandFontFaceProps & CssShorthandFontFaceProps; | ||
export type CssKnownStandardLonghandProps = Omit<CssKnownPropsOf<keyof StandardLonghandProperties, true>, keyof CssLonghandFontFaceProps> & CssLonghandFontFaceProps; | ||
export type CssKnownStandardShorthandProps = Omit<CssKnownPropsOf<keyof StandardShorthandProperties, true>, keyof CssShorthandFontFaceProps> & CssShorthandFontFaceProps; | ||
export type CssKnownStandardProps = CssKnownStandardLonghandProps & CssKnownStandardShorthandProps; | ||
export type CssKnownShorthandProps = CssKnownPropsOf<keyof ShorthandProperties, true>; | ||
export type CssKnownVendorLonghandProps = CssKnownPropsOf<keyof VendorLonghandProperties, true>; | ||
export type CssKnownVendorShorthandProps = CssKnownPropsOf<keyof VendorShorthandProperties, true>; | ||
export type CssKnownVendorProps = CssKnownVendorLonghandProps & CssKnownVendorShorthandProps; | ||
export type CssKnownObsoleteProps = CssKnownPropsOf<keyof ObsoleteProperties, true>; | ||
export type CssKnownSvgProps = Omit<CssKnownPropsOf<keyof SvgProperties, true>, keyof CssFontFaceProps> & CssFontFaceProps; | ||
export type CssKnownProps = CssKnownStandardProps & CssKnownShorthandProps & CssKnownVendorProps & CssKnownObsoleteProps & CssKnownSvgProps; | ||
export type CssProps = CssCustomProps & CssKnownProps; | ||
export type CssPropsMap = CssCustomPropsMap & MapOf<CssKnownProps>; | ||
export type CssRuleData = readonly [undefined | CssRawSelector | CssFinalSelector, CssStyleCollection]; | ||
export type CssFinalRuleData = readonly [CssFinalSelector, CssFinalStyleMap]; | ||
export type CssRule = { | ||
[name: symbol]: CssRuleData; | ||
}; | ||
export declare type CssFinalRule = { | ||
export type CssFinalRule = { | ||
[name: symbol]: CssFinalRuleData; | ||
}; | ||
export declare type CssRuleMap = MapOf<CssRule>; | ||
export declare type CssFinalRuleMap = MapOf<CssFinalRule>; | ||
export declare type CssRuleCollection = ProductOrFactoryOrDeepArray<OptionalOrBoolean<CssRule>>; | ||
export declare type CssStyle = CssProps & CssRule; | ||
export declare type CssStyleMap = CssPropsMap & CssRuleMap & CssFinalRuleMap; | ||
export declare type CssFinalStyleMap = CssPropsMap & CssFinalRuleMap; | ||
export declare type CssStyleCollection = ProductOrFactoryOrDeepArray<OptionalOrBoolean<CssStyle>>; | ||
export declare type CssFontFaceStyleCollection = ProductOrFactoryOrDeepArray<OptionalOrBoolean<CssFontFaceProps>>; | ||
export type CssRuleMap = MapOf<CssRule>; | ||
export type CssFinalRuleMap = MapOf<CssFinalRule>; | ||
export type CssRuleCollection = ProductOrFactoryOrDeepArray<OptionalOrBoolean<CssRule>>; | ||
export type CssStyle = CssProps & CssRule; | ||
export type CssStyleMap = CssPropsMap & CssRuleMap & CssFinalRuleMap; | ||
export type CssFinalStyleMap = CssPropsMap & CssFinalRuleMap; | ||
export type CssStyleCollection = ProductOrFactoryOrDeepArray<OptionalOrBoolean<CssStyle>>; | ||
export type CssFontFaceStyleCollection = ProductOrFactoryOrDeepArray<OptionalOrBoolean<CssFontFaceProps>>; | ||
export interface CssCustomKeyframesRef { | ||
@@ -300,12 +300,12 @@ value: string | null; | ||
} | ||
export declare type CssKeyframes = { | ||
export type CssKeyframes = { | ||
[name: string]: CssStyleCollection; | ||
}; | ||
export declare type CssKeyframesMap = MapOf<CssKeyframes>; | ||
export declare type CssKeyframesRule = CssRule & { | ||
export type CssKeyframesMap = MapOf<CssKeyframes>; | ||
export type CssKeyframesRule = CssRule & { | ||
[name: symbol]: readonly [`@keyframes ${string}`, CssRuleCollection]; | ||
}; | ||
export declare type CssKeyframesRuleMap = MapOf<CssKeyframesRule>; | ||
export declare type CssSelector = (string & {}); | ||
export declare type CssSelectorCollection = SingleOrDeepArray<OptionalOrBoolean<CssSelector>>; | ||
export type CssKeyframesRuleMap = MapOf<CssKeyframesRule>; | ||
export type CssSelector = (string & {}); | ||
export type CssSelectorCollection = SingleOrDeepArray<OptionalOrBoolean<CssSelector>>; | ||
export interface CssSelectorOptions { | ||
@@ -317,12 +317,12 @@ performGrouping?: boolean; | ||
} | ||
export declare type CssRawSelector = readonly [CssSelectorCollection, CssSelectorOptions | undefined]; | ||
export declare type CssFinalSelector = CssSelector & {}; | ||
export declare type CssClassName = string & {}; | ||
export declare type CssScopeName = string & {}; | ||
export declare type CssScopeOptions = Omit<CssSelectorOptions, 'performGrouping'>; | ||
export declare type CssScopeEntry<TCssScopeName extends CssScopeName> = readonly [TCssScopeName, CssStyleCollection, CssScopeOptions | undefined]; | ||
export declare type CssScopeList<TCssScopeName extends CssScopeName> = CssScopeEntry<TCssScopeName>[]; | ||
export declare type CssScopeMap<TCssScopeName extends CssScopeName> = { | ||
export type CssRawSelector = readonly [CssSelectorCollection, CssSelectorOptions | undefined]; | ||
export type CssFinalSelector = CssSelector & {}; | ||
export type CssClassName = string & {}; | ||
export type CssScopeName = string & {}; | ||
export type CssScopeOptions = Omit<CssSelectorOptions, 'performGrouping'>; | ||
export type CssScopeEntry<TCssScopeName extends CssScopeName> = readonly [TCssScopeName, CssStyleCollection, CssScopeOptions | undefined]; | ||
export type CssScopeList<TCssScopeName extends CssScopeName> = CssScopeEntry<TCssScopeName>[]; | ||
export type CssScopeMap<TCssScopeName extends CssScopeName> = { | ||
[name in TCssScopeName]: CssClassName; | ||
}; | ||
export {}; |
{ | ||
"name": "@cssfn/css-types", | ||
"version": "2.0.6", | ||
"version": "2.0.7", | ||
"description": "CSS typescript definitions.", | ||
@@ -33,3 +33,4 @@ "keywords": [ | ||
"csstype": "^3.1.1" | ||
} | ||
}, | ||
"gitHead": "cb9755c614f545159f304f7db3753478955de44d" | ||
} |
@@ -411,4 +411,4 @@ // cssfn: | ||
export type CssRuleData = readonly [CssRawSelector|CssFinalSelector, CssStyleCollection] | ||
export type CssFinalRuleData = readonly [ CssFinalSelector, CssFinalStyleMap ] | ||
export type CssRuleData = readonly [undefined|CssRawSelector|CssFinalSelector, CssStyleCollection] | ||
export type CssFinalRuleData = readonly [ CssFinalSelector, CssFinalStyleMap ] | ||
export type CssRule = { // do not use Record<symbol, CssRuleData> => doesn't support circular ref | ||
@@ -415,0 +415,0 @@ [name: symbol] : CssRuleData |
35963