-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.d.ts
More file actions
46 lines (40 loc) · 1.53 KB
/
Copy pathindex.d.ts
File metadata and controls
46 lines (40 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*!
* css-box-shadow-parser v1.1.0
* Type definitions for the CSS box-shadow parser.
* https://github.com/html-code-generator/css-box-shadow-parser
*
* @author HTML Code Generator
* @website https://www.html-code-generator.com/javascript/box-shadow-parser
* @license MIT
*/
/** A single parsed box-shadow layer. */
export interface BoxShadowLayer {
/** True when the shadow uses the `inset` keyword. */
inset: boolean;
/** Horizontal offset (unitless number, px assumed). */
x: number;
/** Vertical offset (unitless number, px assumed). */
y: number;
/** Blur radius (unitless number, px assumed). */
blur: number;
/** Spread radius (unitless number, px assumed; can be negative). */
spread: number;
/** The original CSS color token as written. */
color: string;
/** Opacity from 0 to 1. */
alpha: number;
/** Resolved 6-digit hex color. */
hex: string;
}
/**
* Parse a full box-shadow value (single or multi-layer).
* Accepts raw values or complete CSS declarations.
*/
export function parse(shadow: string): BoxShadowLayer[];
/** Parse a single shadow token. Returns null for invalid input. */
export function parseSingle(token: string): BoxShadowLayer | null;
/** Split a compound value on top-level commas without parsing. */
export function split(shadow: string): string[];
/** Serialize a layer object, or array of layers, back into a CSS box-shadow string. */
export function stringify(input: BoxShadowLayer | BoxShadowLayer[]): string;
export as namespace BoxShadowParser;