UNPKG

2.92 kBTypeScriptView Raw
1import type { CompositionStyleObject } from "./css.types";
2interface Token<T> {
3 value: T;
4 description?: string;
5}
6interface Recursive<T> {
7 [key: string]: Recursive<T> | T;
8}
9type TextStyleProperty = "fontSize" | "fontSizeAdjust" | "fontVariationSettings" | "fontVariantPosition" | "fontVariantCaps" | "fontVariantNumeric" | "fontVariantAlternates" | "fontVariantLigatures" | "fontFamily" | "fontWeight" | "fontSynthesis" | "fontStyle" | "fontVariant" | "lineHeight" | "letterSpacing" | "textDecoration" | "textTransform" | "textIndent" | "textDecorationColor" | "textDecorationLine" | "textDecorationStyle" | "textEmphasisColor" | "textEmphasisPosition" | "textEmphasisStyle" | "hyphenateCharacter" | "textOrientation" | "textOverflow" | "textRendering";
10export type TextStyle = CompositionStyleObject<TextStyleProperty>;
11export type TextStyles = Recursive<Token<TextStyle>>;
12type LogicalPlacement = "Inline" | "Block" | "InlineStart" | "InlineEnd" | "BlockStart" | "BlockEnd";
13type PhysicalPlacement = "Top" | "Right" | "Bottom" | "Left";
14type Placement = PhysicalPlacement | LogicalPlacement;
15type Radius = `Top${"Right" | "Left"}` | `Bottom${"Right" | "Left"}` | `Start${"Start" | "End"}` | `End${"Start" | "End"}`;
16type LayerStyleProperty = "background" | "bg" | "backgroundColor" | "bgColor" | "backgroundImage" | "bgImage" | "content" | "borderRadius" | "border" | "borderWidth" | "borderColor" | "borderStyle" | "boxShadow" | "boxShadowColor" | "filter" | "backdropFilter" | "transform" | "cursor" | "color" | "opacity" | "backgroundBlendMode" | "backgroundAttachment" | "backgroundClip" | "backgroundOrigin" | "backgroundPosition" | "backgroundRepeat" | "backgroundSize" | `border${Placement}` | `border${Placement}Width` | "borderRadius" | `border${Radius}Radius` | `border${Placement}Color` | `border${Placement}Style` | "padding" | "position" | "zIndex" | `padding${Placement}` | "height" | "width" | "minHeight" | "minWidth" | "maxHeight" | "maxWidth" | `margin${Placement}` | "inset" | `inset${LogicalPlacement}` | Lowercase<PhysicalPlacement> | "outline" | "outlineColor" | "outlineStyle" | "outlineWidth" | "outlineOffset";
17export type LayerStyle = CompositionStyleObject<LayerStyleProperty>;
18export type LayerStyles = Recursive<Token<LayerStyle>>;
19type AnimationStyleProperty = "animation" | "animationComposition" | "animationDelay" | "animationDirection" | "animationDuration" | "animationFillMode" | "animationIterationCount" | "animationName" | "animationPlayState" | "animationTimingFunction" | "animationRange" | "animationRangeStart" | "animationRangeEnd" | "animationTimeline" | "transformOrigin";
20export type AnimationStyle = CompositionStyleObject<AnimationStyleProperty>;
21export type AnimationStyles = Recursive<Token<AnimationStyle>>;
22export interface CompositionStyles {
23 textStyles: TextStyles;
24 layerStyles: LayerStyles;
25 animationStyles: AnimationStyles;
26}
27export {};