/* tslint:disable */ /** * This file was automatically generated by json-schema-to-typescript. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run json-schema-to-typescript to regenerate this file. */ export type String = string; /** * A CSS rule. */ export type Rule = | { type: "media"; value: MediaRule; } | { type: "import"; value: ImportRule; } | { type: "style"; value: StyleRule; } | { type: "keyframes"; value: KeyframesRule; } | { type: "font-face"; value: FontFaceRule; } | { type: "font-palette-values"; value: FontPaletteValuesRule; } | { type: "page"; value: PageRule; } | { type: "supports"; value: SupportsRule; } | { type: "counter-style"; value: CounterStyleRule; } | { type: "namespace"; value: NamespaceRule; } | { type: "moz-document"; value: MozDocumentRule; } | { type: "nesting"; value: NestingRule; } | { type: "viewport"; value: ViewportRule; } | { type: "custom-media"; value: CustomMediaRule; } | { type: "layer-statement"; value: LayerStatementRule; } | { type: "layer-block"; value: LayerBlockRule; } | { type: "property"; value: PropertyRule; } | { type: "container"; value: ContainerRule; } | { type: "scope"; value: ScopeRule; } | { type: "starting-style"; value: StartingStyleRule; } | { type: "ignored"; } | { type: "unknown"; value: UnknownAtRule; } | { type: "custom"; value: DefaultAtRule; }; /** * Represents a media condition. */ export type MediaCondition = | { type: "feature"; value: QueryFeatureFor_MediaFeatureId; } | { type: "not"; value: MediaCondition; } | { /** * The conditions for the operator. */ conditions: MediaCondition[]; /** * The operator for the conditions. */ operator: Operator; type: "operation"; }; /** * A generic media feature or container feature. */ export type QueryFeatureFor_MediaFeatureId = | { /** * The name of the feature. */ name: MediaFeatureNameFor_MediaFeatureId; type: "plain"; /** * The feature value. */ value: MediaFeatureValue; } | { /** * The name of the feature. */ name: MediaFeatureNameFor_MediaFeatureId; type: "boolean"; } | { /** * The name of the feature. */ name: MediaFeatureNameFor_MediaFeatureId; /** * A comparator. */ operator: MediaFeatureComparison; type: "range"; /** * The feature value. */ value: MediaFeatureValue; } | { /** * The end value. */ end: MediaFeatureValue; /** * A comparator for the end value. */ endOperator: MediaFeatureComparison; /** * The name of the feature. */ name: MediaFeatureNameFor_MediaFeatureId; /** * A start value. */ start: MediaFeatureValue; /** * A comparator for the start value. */ startOperator: MediaFeatureComparison; type: "interval"; }; /** * A media feature name. */ export type MediaFeatureNameFor_MediaFeatureId = MediaFeatureId | String | String; /** * A media query feature identifier. */ export type MediaFeatureId = | "width" | "height" | "aspect-ratio" | "orientation" | "overflow-block" | "overflow-inline" | "horizontal-viewport-segments" | "vertical-viewport-segments" | "display-mode" | "resolution" | "scan" | "grid" | "update" | "environment-blending" | "color" | "color-index" | "monochrome" | "color-gamut" | "dynamic-range" | "inverted-colors" | "pointer" | "hover" | "any-pointer" | "any-hover" | "nav-controls" | "video-color-gamut" | "video-dynamic-range" | "scripting" | "prefers-reduced-motion" | "prefers-reduced-transparency" | "prefers-contrast" | "forced-colors" | "prefers-color-scheme" | "prefers-reduced-data" | "device-width" | "device-height" | "device-aspect-ratio" | "-webkit-device-pixel-ratio" | "-moz-device-pixel-ratio"; /** * [media feature value](https://drafts.csswg.org/mediaqueries/#typedef-mf-value) within a media query. * * See [MediaFeature](MediaFeature). */ export type MediaFeatureValue = | { type: "length"; value: Length; } | { type: "number"; value: number; } | { type: "integer"; value: number; } | { type: "boolean"; value: boolean; } | { type: "resolution"; value: Resolution; } | { type: "ratio"; value: Ratio; } | { type: "ident"; value: String; } | { type: "env"; value: EnvironmentVariable; }; /** * A CSS [``](https://www.w3.org/TR/css-values-4/#lengths) value, with support for `calc()`. */ export type Length = | { type: "value"; value: LengthValue; } | { type: "calc"; value: CalcFor_Length; }; export type LengthUnit = | "px" | "in" | "cm" | "mm" | "q" | "pt" | "pc" | "em" | "rem" | "ex" | "rex" | "ch" | "rch" | "cap" | "rcap" | "ic" | "ric" | "lh" | "rlh" | "vw" | "lvw" | "svw" | "dvw" | "cqw" | "vh" | "lvh" | "svh" | "dvh" | "cqh" | "vi" | "svi" | "lvi" | "dvi" | "cqi" | "vb" | "svb" | "lvb" | "dvb" | "cqb" | "vmin" | "svmin" | "lvmin" | "dvmin" | "cqmin" | "vmax" | "svmax" | "lvmax" | "dvmax" | "cqmax"; /** * A mathematical expression used within the [`calc()`](https://www.w3.org/TR/css-values-4/#calc-func) function. * * This type supports generic value types. Values such as [Length](super::length::Length), [Percentage](super::percentage::Percentage), [Time](super::time::Time), and [Angle](super::angle::Angle) support `calc()` expressions. */ export type CalcFor_Length = | { type: "value"; value: Length; } | { type: "number"; value: number; } | { type: "sum"; /** * @minItems 2 * @maxItems 2 */ value: [CalcFor_Length, CalcFor_Length]; } | { type: "product"; /** * @minItems 2 * @maxItems 2 */ value: [number, CalcFor_Length]; } | { type: "function"; value: MathFunctionFor_Length; }; /** * A CSS [math function](https://www.w3.org/TR/css-values-4/#math-function). * * Math functions may be used in most properties and values that accept numeric values, including lengths, percentages, angles, times, etc. */ export type MathFunctionFor_Length = | { type: "calc"; value: CalcFor_Length; } | { type: "min"; value: CalcFor_Length[]; } | { type: "max"; value: CalcFor_Length[]; } | { type: "clamp"; /** * @minItems 3 * @maxItems 3 */ value: [CalcFor_Length, CalcFor_Length, CalcFor_Length]; } | { type: "round"; /** * @minItems 3 * @maxItems 3 */ value: [RoundingStrategy, CalcFor_Length, CalcFor_Length]; } | { type: "rem"; /** * @minItems 2 * @maxItems 2 */ value: [CalcFor_Length, CalcFor_Length]; } | { type: "mod"; /** * @minItems 2 * @maxItems 2 */ value: [CalcFor_Length, CalcFor_Length]; } | { type: "abs"; value: CalcFor_Length; } | { type: "sign"; value: CalcFor_Length; } | { type: "hypot"; value: CalcFor_Length[]; }; /** * A [rounding strategy](https://www.w3.org/TR/css-values-4/#typedef-rounding-strategy), as used in the `round()` function. */ export type RoundingStrategy = "nearest" | "up" | "down" | "to-zero"; /** * A CSS [``](https://www.w3.org/TR/css-values-4/#resolution) value. */ export type Resolution = | { type: "dpi"; value: number; } | { type: "dpcm"; value: number; } | { type: "dppx"; value: number; }; /** * A CSS [``](https://www.w3.org/TR/css-values-4/#ratios) value, representing the ratio of two numeric values. * * @minItems 2 * @maxItems 2 */ export type Ratio = [number, number]; /** * A raw CSS token, or a parsed value. */ export type TokenOrValue = | { type: "token"; value: Token; } | { type: "color"; value: CssColor; } | { type: "unresolved-color"; value: UnresolvedColor; } | { type: "url"; value: Url; } | { type: "var"; value: Variable; } | { type: "env"; value: EnvironmentVariable; } | { type: "function"; value: Function; } | { type: "length"; value: LengthValue; } | { type: "angle"; value: Angle; } | { type: "time"; value: Time; } | { type: "resolution"; value: Resolution; } | { type: "dashed-ident"; value: String; } | { type: "animation-name"; value: AnimationName; }; /** * A raw CSS token. */ export type Token = | { type: "ident"; value: String; } | { type: "at-keyword"; value: String; } | { type: "hash"; value: String; } | { type: "id-hash"; value: String; } | { type: "string"; value: String; } | { type: "unquoted-url"; value: String; } | { type: "delim"; value: string; } | { type: "number"; /** * The value as a float */ value: number; } | { type: "percentage"; /** * The value as a float, divided by 100 so that the nominal range is 0.0 to 1.0. */ value: number; } | { type: "dimension"; /** * The unit, e.g. "px" in `12px` */ unit: String; /** * The value as a float */ value: number; } | { type: "white-space"; value: String; } | { type: "comment"; value: String; } | { type: "colon"; } | { type: "semicolon"; } | { type: "comma"; } | { type: "include-match"; } | { type: "dash-match"; } | { type: "prefix-match"; } | { type: "suffix-match"; } | { type: "substring-match"; } | { type: "cdo"; } | { type: "cdc"; } | { type: "function"; value: String; } | { type: "parenthesis-block"; } | { type: "square-bracket-block"; } | { type: "curly-bracket-block"; } | { type: "bad-url"; value: String; } | { type: "bad-string"; value: String; } | { type: "close-parenthesis"; } | { type: "close-square-bracket"; } | { type: "close-curly-bracket"; }; /** * A CSS [``](https://www.w3.org/TR/css-color-4/#color-type) value. * * CSS supports many different color spaces to represent colors. The most common values are stored as RGBA using a single byte per component. Less common values are stored using a `Box` to reduce the amount of memory used per color. * * Each color space is represented as a struct that implements the `From` and `Into` traits for all other color spaces, so it is possible to convert between color spaces easily. In addition, colors support [interpolation](#method.interpolate) as in the `color-mix()` function. */ export type CssColor = CurrentColor | RGBColor | LABColor | PredefinedColor | FloatColor | LightDark | SystemColor; export type CurrentColor = { type: "currentcolor"; }; export type RGBColor = { /** * The alpha component. */ alpha: number; /** * The blue component. */ b: number; /** * The green component. */ g: number; /** * The red component. */ r: number; type: "rgb"; }; /** * A color in a LAB color space, including the `lab()`, `lch()`, `oklab()`, and `oklch()` functions. */ export type LABColor = | { /** * The a component. */ a: number; /** * The alpha component. */ alpha: number; /** * The b component. */ b: number; /** * The lightness component. */ l: number; type: "lab"; } | { /** * The alpha component. */ alpha: number; /** * The chroma component. */ c: number; /** * The hue component. */ h: number; /** * The lightness component. */ l: number; type: "lch"; } | { /** * The a component. */ a: number; /** * The alpha component. */ alpha: number; /** * The b component. */ b: number; /** * The lightness component. */ l: number; type: "oklab"; } | { /** * The alpha component. */ alpha: number; /** * The chroma component. */ c: number; /** * The hue component. */ h: number; /** * The lightness component. */ l: number; type: "oklch"; }; /** * A color in a predefined color space, e.g. `display-p3`. */ export type PredefinedColor = | { /** * The alpha component. */ alpha: number; /** * The blue component. */ b: number; /** * The green component. */ g: number; /** * The red component. */ r: number; type: "srgb"; } | { /** * The alpha component. */ alpha: number; /** * The blue component. */ b: number; /** * The green component. */ g: number; /** * The red component. */ r: number; type: "srgb-linear"; } | { /** * The alpha component. */ alpha: number; /** * The blue component. */ b: number; /** * The green component. */ g: number; /** * The red component. */ r: number; type: "display-p3"; } | { /** * The alpha component. */ alpha: number; /** * The blue component. */ b: number; /** * The green component. */ g: number; /** * The red component. */ r: number; type: "a98-rgb"; } | { /** * The alpha component. */ alpha: number; /** * The blue component. */ b: number; /** * The green component. */ g: number; /** * The red component. */ r: number; type: "prophoto-rgb"; } | { /** * The alpha component. */ alpha: number; /** * The blue component. */ b: number; /** * The green component. */ g: number; /** * The red component. */ r: number; type: "rec2020"; } | { /** * The alpha component. */ alpha: number; type: "xyz-d50"; /** * The x component. */ x: number; /** * The y component. */ y: number; /** * The z component. */ z: number; } | { /** * The alpha component. */ alpha: number; type: "xyz-d65"; /** * The x component. */ x: number; /** * The y component. */ y: number; /** * The z component. */ z: number; }; /** * A floating point representation of color types that are usually stored as RGBA. These are used when there are any `none` components, which are represented as NaN. */ export type FloatColor = | { /** * The alpha component. */ alpha: number; /** * The blue component. */ b: number; /** * The green component. */ g: number; /** * The red component. */ r: number; type: "rgb"; } | { /** * The alpha component. */ alpha: number; /** * The hue component. */ h: number; /** * The lightness component. */ l: number; /** * The saturation component. */ s: number; type: "hsl"; } | { /** * The alpha component. */ alpha: number; /** * The blackness component. */ b: number; /** * The hue component. */ h: number; type: "hwb"; /** * The whiteness component. */ w: number; }; export type LightDark = { dark: CssColor; light: CssColor; type: "light-dark"; }; /** * A CSS [system color](https://drafts.csswg.org/css-color/#css-system-colors) keyword. */ export type SystemColor = | "accentcolor" | "accentcolortext" | "activetext" | "buttonborder" | "buttonface" | "buttontext" | "canvas" | "canvastext" | "field" | "fieldtext" | "graytext" | "highlight" | "highlighttext" | "linktext" | "mark" | "marktext" | "selecteditem" | "selecteditemtext" | "visitedtext" | "activeborder" | "activecaption" | "appworkspace" | "background" | "buttonhighlight" | "buttonshadow" | "captiontext" | "inactiveborder" | "inactivecaption" | "inactivecaptiontext" | "infobackground" | "infotext" | "menu" | "menutext" | "scrollbar" | "threeddarkshadow" | "threedface" | "threedhighlight" | "threedlightshadow" | "threedshadow" | "window" | "windowframe" | "windowtext"; /** * A color value with an unresolved alpha value (e.g. a variable). These can be converted from the modern slash syntax to older comma syntax. This can only be done when the only unresolved component is the alpha since variables can resolve to multiple tokens. */ export type UnresolvedColor = | { /** * The unresolved alpha component. */ alpha: TokenOrValue[]; /** * The blue component. */ b: number; /** * The green component. */ g: number; /** * The red component. */ r: number; type: "rgb"; } | { /** * The unresolved alpha component. */ alpha: TokenOrValue[]; /** * The hue component. */ h: number; /** * The lightness component. */ l: number; /** * The saturation component. */ s: number; type: "hsl"; } | { /** * The dark value. */ dark: TokenOrValue[]; /** * The light value. */ light: TokenOrValue[]; type: "light-dark"; }; /** * Defines where the class names referenced in the `composes` property are located. * * See [Composes](Composes). */ export type Specifier = | { type: "global"; } | { type: "file"; value: String; } | { type: "source-index"; value: number; }; /** * A CSS [``](https://www.w3.org/TR/css-values-4/#angles) value. * * Angles may be explicit or computed by `calc()`, but are always stored and serialized as their computed value. */ export type Angle = | { type: "deg"; value: number; } | { type: "rad"; value: number; } | { type: "grad"; value: number; } | { type: "turn"; value: number; }; /** * A CSS [`