@@ -6,34 +6,51 @@ declare namespace CssPropertyParser {
6
6
}
7
7
8
8
/**
9
- * Given a property and value attempts to expand the value into its longhand equivalents. Returns an object
10
- * mapping the property longhand names to the longhand values. If the property cannot be expanded (i.e. the property
11
- * is not a shorthand property) simply returns an object mapping the original property to the original value.
9
+ * Given a property and value attempts to expand the value into its longhand
10
+ * equivalents. Returns an object mapping the property longhand names to the
11
+ * longhand values. If the property cannot be expanded (i.e. the property is
12
+ * not a shorthand property) simply returns an object mapping the original
13
+ * property to the original value.
12
14
*
13
15
* @param {string } propertyName - the property name for the given value
14
16
* @param {string } propertyValue - the value of the property
15
- * @param {boolean } [recursivelyResolve=true] - recursively resolve additional longhand properties if the shorthands
16
- * expand to additional shorthands. For example, the border property
17
- * expands to border-width, which expands further to border-left-width,
18
- * border-right-width, etc.
17
+ * @param {boolean } [recursivelyResolve=true] - recursively resolve additional
18
+ * longhand properties if the shorthands expand to additional shorthands. For
19
+ * example, the border property expands to border-width, which expands
20
+ * further to border-left-width, border-right-width, etc.
21
+ * @param {boolean } [includeInitialValues=false] - when expanding the shorthand
22
+ * property, fill in any missing longhand values with their initial value.
23
+ * For example, the property declaration "border: 1px" only explicitly sets the
24
+ * "border-width" longhand property. If this param is true, the returned object
25
+ * will fill in the initial values for "border-style" and "border-color". By
26
+ * default, the returned object will only contain the "border-width".
19
27
*/
20
28
function expandShorthandProperty (
21
29
propertyName : string ,
22
30
propertyValue : string ,
23
- recursivelyResolve ?: boolean
31
+ recursivelyResolve ?: boolean ,
32
+ includeInitialValues ?: boolean ,
24
33
) : Declarations ;
25
34
26
35
/**
27
- * Given a shorthand property, returns an array of the computed properties for that shorthand property. If given
28
- * a known property that is not a shorthand, simply returns the given property. If given an unknown property,
29
- * returns an empty array.
36
+ * Given a shorthand property, returns an array of the computed properties for
37
+ * that shorthand property. If given a known property that is not a shorthand,
38
+ * simply returns the given property. If given an unknown property, returns an
39
+ * empty array.
30
40
*
31
- * @param {string } shorthandProperty - the shorthand property name. For example, "background" or "border".
32
- * @returns {Array } - an array containing the computed properties for the given shorthand property. Returns an
33
- * empty array if the given property is not a valid property.
41
+ * @param {string } shorthandProperty - the shorthand property name. For
42
+ * example, "background" or "border".
43
+ * @param {boolean } recursivelyResolve - recursively resolve additional
44
+ * longhand properties if the shorthands expand to additional shorthands. For
45
+ * example, the border property expands to border-width, which expands further
46
+ * to border-left-width, border-right-width, etc.
47
+ * @returns {Array } - an array containing the computed properties for the given
48
+ * shorthand property. Returns an empty array if the given property is not a
49
+ * valid property.
34
50
*/
35
51
function getShorthandComputedProperties (
36
- shorthandProperty : string
52
+ shorthandProperty : string ,
53
+ recursivelyResolve : boolean
37
54
) : Array < string > ;
38
55
39
56
/**
@@ -57,4 +74,4 @@ declare namespace CssPropertyParser {
57
74
value : string
58
75
) : boolean ;
59
76
60
- }
77
+ }
0 commit comments