@mkbabb/value.js 0.4.6 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -674
- package/dist/{src/parsing → parsing}/color.d.ts +4 -3
- package/dist/{src/parsing → parsing}/index.d.ts +4 -3
- package/dist/{src/parsing → parsing}/math.d.ts +1 -1
- package/dist/{src/parsing → parsing}/units.d.ts +9 -8
- package/dist/{src/parsing → parsing}/utils.d.ts +5 -5
- package/dist/value.js +2128 -2934
- package/package.json +7 -9
- package/dist/value.d.ts +0 -2
- /package/dist/{src/easing.d.ts → easing.d.ts} +0 -0
- /package/dist/{src/index.d.ts → index.d.ts} +0 -0
- /package/dist/{src/math.d.ts → math.d.ts} +0 -0
- /package/dist/{src/transform → transform}/decompose.d.ts +0 -0
- /package/dist/{src/units → units}/color/colorFilter.d.ts +0 -0
- /package/dist/{src/units → units}/color/constants.d.ts +0 -0
- /package/dist/{src/units → units}/color/gamut.d.ts +0 -0
- /package/dist/{src/units → units}/color/index.d.ts +0 -0
- /package/dist/{src/units → units}/color/matrix.d.ts +0 -0
- /package/dist/{src/units → units}/color/normalize.d.ts +0 -0
- /package/dist/{src/units → units}/color/utils.d.ts +0 -0
- /package/dist/{src/units → units}/constants.d.ts +0 -0
- /package/dist/{src/units → units}/index.d.ts +0 -0
- /package/dist/{src/units → units}/normalize.d.ts +0 -0
- /package/dist/{src/units → units}/utils.d.ts +0 -0
- /package/dist/{src/utils.d.ts → utils.d.ts} +0 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Parser } from '@mkbabb/parse-that';
|
|
1
2
|
import { ValueUnit } from '../units';
|
|
2
3
|
type ComponentExpr = {
|
|
3
4
|
type: "ref";
|
|
@@ -15,9 +16,9 @@ export declare const CSSColor: {
|
|
|
15
16
|
Value: Parser<ValueUnit<any, string | undefined>>;
|
|
16
17
|
colorValue: Parser<ValueUnit<any, string | undefined>>;
|
|
17
18
|
componentExpr: Parser<ComponentExpr>;
|
|
18
|
-
sep:
|
|
19
|
-
alphaSep:
|
|
20
|
-
div:
|
|
19
|
+
sep: Parser<string>;
|
|
20
|
+
alphaSep: Parser<string>;
|
|
21
|
+
div: Parser<string>;
|
|
21
22
|
};
|
|
22
23
|
export declare function registerColorNames(names: Record<string, string>): void;
|
|
23
24
|
export declare function clearCustomColorNames(): void;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
+
import { Parser } from '@mkbabb/parse-that';
|
|
1
2
|
import { FunctionValue, ValueArray, ValueUnit } from '../units';
|
|
2
3
|
export declare const CSS_WIDE_KEYWORDS: readonly ["inherit", "initial", "unset", "revert", "revert-layer"];
|
|
3
|
-
export declare const CSSString:
|
|
4
|
+
export declare const CSSString: Parser<ValueUnit<string, string | undefined>>;
|
|
4
5
|
export declare const CSSFunction: {
|
|
5
6
|
Function: Parser<any>;
|
|
6
7
|
Value: Parser<any>;
|
|
7
8
|
FunctionArgs: Parser<ValueArray<any>>;
|
|
8
9
|
};
|
|
9
|
-
export declare const CSSJSON: any
|
|
10
|
+
export declare const CSSJSON: Parser<ValueUnit<any, string>>;
|
|
10
11
|
export declare const CSSValues: {
|
|
11
12
|
Value: Parser<any>;
|
|
12
|
-
Values: any
|
|
13
|
+
Values: Parser<any[]>;
|
|
13
14
|
};
|
|
14
15
|
export declare const parseCSSValue: ((input: string) => ValueUnit | FunctionValue) & {
|
|
15
16
|
cache: Map<string, {
|
|
@@ -14,7 +14,7 @@ export declare function createCalcParser(valueParser: Parser<any>, mathFunctionP
|
|
|
14
14
|
* Returns a parser that handles calc(), min(), max(), clamp(), etc.
|
|
15
15
|
*/
|
|
16
16
|
export declare function createMathFunctionParsers(valueParser: Parser<any>): {
|
|
17
|
-
calcFn: any
|
|
17
|
+
calcFn: Parser<FunctionValue<any, "calc">>;
|
|
18
18
|
mathFunction: Parser<any>;
|
|
19
19
|
calcSum: Parser<any>;
|
|
20
20
|
};
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
+
import { Parser } from '@mkbabb/parse-that';
|
|
1
2
|
import { ValueUnit } from '../units';
|
|
2
3
|
import { CSSColor, parseCSSColor, registerColorNames, clearCustomColorNames, getCustomColorNames } from './color';
|
|
3
4
|
export { CSSColor, parseCSSColor, registerColorNames, clearCustomColorNames, getCustomColorNames };
|
|
4
5
|
export declare const CSSValueUnit: {
|
|
5
|
-
Length:
|
|
6
|
-
Angle:
|
|
7
|
-
Time:
|
|
6
|
+
Length: Parser<ValueUnit<number, string>>;
|
|
7
|
+
Angle: Parser<ValueUnit<number, string>>;
|
|
8
|
+
Time: Parser<ValueUnit<number, string>>;
|
|
8
9
|
TimePercentage: Parser<ValueUnit<any, string | undefined>>;
|
|
9
|
-
Frequency:
|
|
10
|
-
Resolution:
|
|
11
|
-
Flex:
|
|
10
|
+
Frequency: Parser<ValueUnit<number, string>>;
|
|
11
|
+
Resolution: Parser<ValueUnit<number, string>>;
|
|
12
|
+
Flex: Parser<ValueUnit<number, string>>;
|
|
12
13
|
Percentage: Parser<ValueUnit<any, string | undefined>>;
|
|
13
14
|
Color: Parser<ValueUnit<any, string | undefined>>;
|
|
14
|
-
Slash:
|
|
15
|
+
Slash: Parser<ValueUnit<string, string>>;
|
|
15
16
|
Value: Parser<ValueUnit<any, string | undefined>>;
|
|
16
|
-
sep:
|
|
17
|
+
sep: Parser<string>;
|
|
17
18
|
};
|
|
18
19
|
export declare function parseCSSValueUnit(input: string): ValueUnit;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Parser } from '@mkbabb/parse-that';
|
|
2
2
|
/** Case-insensitive string match. Returns the matched portion of the input. */
|
|
3
|
-
export declare const istring: (str: string) =>
|
|
4
|
-
export declare const identifier:
|
|
5
|
-
export declare const none:
|
|
6
|
-
export declare const integer:
|
|
7
|
-
export declare const number:
|
|
3
|
+
export declare const istring: (str: string) => Parser<string>;
|
|
4
|
+
export declare const identifier: Parser<string>;
|
|
5
|
+
export declare const none: Parser<string>;
|
|
6
|
+
export declare const integer: Parser<number>;
|
|
7
|
+
export declare const number: Parser<number>;
|
|
8
8
|
/** Parser that always succeeds with the given value without consuming input. */
|
|
9
9
|
export declare function succeed<T>(value: T): Parser<T>;
|
|
10
10
|
/** Parser that always fails with the given message. */
|