sass-embedded 1.0.0-beta.4 → 1.0.0-rc.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/CHANGELOG.md +40 -0
- package/dist/.gitignore +1 -0
- package/dist/lib/index.js +40 -11
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/src/{embedded-compiler/compiler.js → async-compiler.js} +13 -13
- package/dist/lib/src/async-compiler.js.map +1 -0
- package/dist/lib/src/compile.js +187 -85
- package/dist/lib/src/compile.js.map +1 -1
- package/dist/lib/src/compiler-path.js +18 -0
- package/dist/lib/src/compiler-path.js.map +1 -0
- package/dist/lib/src/deprotofy-span.js +51 -0
- package/dist/lib/src/deprotofy-span.js.map +1 -0
- package/dist/lib/src/{embedded-protocol/dispatcher.js → dispatcher.js} +47 -41
- package/dist/lib/src/dispatcher.js.map +1 -0
- package/dist/lib/src/exception.js +20 -0
- package/dist/lib/src/exception.js.map +1 -0
- package/dist/lib/src/function-registry.js +92 -0
- package/dist/lib/src/function-registry.js.map +1 -0
- package/dist/lib/src/importer-registry.js +127 -0
- package/dist/lib/src/importer-registry.js.map +1 -0
- package/dist/lib/src/legacy/importer.js +186 -0
- package/dist/lib/src/legacy/importer.js.map +1 -0
- package/dist/lib/src/legacy/index.js +261 -0
- package/dist/lib/src/legacy/index.js.map +1 -0
- package/dist/lib/src/legacy/resolve-path.js +101 -0
- package/dist/lib/src/legacy/resolve-path.js.map +1 -0
- package/dist/lib/src/legacy/value/base.js +17 -0
- package/dist/lib/src/legacy/value/base.js.map +1 -0
- package/dist/lib/src/legacy/value/color.js +64 -0
- package/dist/lib/src/legacy/value/color.js.map +1 -0
- package/dist/lib/src/legacy/value/index.js +23 -0
- package/dist/lib/src/legacy/value/index.js.map +1 -0
- package/dist/lib/src/legacy/value/list.js +50 -0
- package/dist/lib/src/legacy/value/list.js.map +1 -0
- package/dist/lib/src/legacy/value/map.js +74 -0
- package/dist/lib/src/legacy/value/map.js.map +1 -0
- package/dist/lib/src/legacy/value/number.js +60 -0
- package/dist/lib/src/legacy/value/number.js.map +1 -0
- package/dist/lib/src/legacy/value/string.js +27 -0
- package/dist/lib/src/legacy/value/string.js.map +1 -0
- package/dist/lib/src/legacy/value/wrap.js +83 -0
- package/dist/lib/src/legacy/value/wrap.js.map +1 -0
- package/dist/lib/src/{embedded-protocol/message-transformer.js → message-transformer.js} +11 -10
- package/dist/lib/src/message-transformer.js.map +1 -0
- package/dist/lib/src/{embedded-compiler/packet-transformer.js → packet-transformer.js} +2 -1
- package/dist/lib/src/packet-transformer.js.map +1 -0
- package/dist/lib/src/protofier.js +272 -0
- package/dist/lib/src/protofier.js.map +1 -0
- package/dist/lib/src/{embedded-protocol/request-tracker.js → request-tracker.js} +1 -0
- package/dist/lib/src/request-tracker.js.map +1 -0
- package/dist/lib/src/sync-compiler.js +52 -0
- package/dist/lib/src/sync-compiler.js.map +1 -0
- package/dist/lib/src/{exception/span.js → sync-process/event.js} +2 -2
- package/dist/lib/src/sync-process/event.js.map +1 -0
- package/dist/lib/src/sync-process/index.js +122 -0
- package/dist/lib/src/sync-process/index.js.map +1 -0
- package/dist/lib/src/sync-process/sync-message-port.js +128 -0
- package/dist/lib/src/sync-process/sync-message-port.js.map +1 -0
- package/dist/lib/src/sync-process/worker.js +51 -0
- package/dist/lib/src/sync-process/worker.js.map +1 -0
- package/dist/lib/src/utils.js +96 -1
- package/dist/lib/src/utils.js.map +1 -1
- package/dist/lib/src/value/argument-list.js +31 -0
- package/dist/lib/src/value/argument-list.js.map +1 -0
- package/dist/lib/src/value/boolean.js +22 -5
- package/dist/lib/src/value/boolean.js.map +1 -1
- package/dist/lib/src/value/color.js +258 -0
- package/dist/lib/src/value/color.js.map +1 -0
- package/dist/lib/src/value/function.js +34 -0
- package/dist/lib/src/value/function.js.map +1 -0
- package/dist/lib/src/value/{value.js → index.js} +28 -14
- package/dist/lib/src/value/index.js.map +1 -0
- package/dist/lib/src/value/list.js +99 -0
- package/dist/lib/src/value/list.js.map +1 -0
- package/dist/lib/src/value/map.js +91 -0
- package/dist/lib/src/value/map.js.map +1 -0
- package/dist/lib/src/value/null.js +16 -3
- package/dist/lib/src/value/null.js.map +1 -1
- package/dist/lib/src/value/number.js +41 -46
- package/dist/lib/src/value/number.js.map +1 -1
- package/dist/lib/src/value/string.js +18 -12
- package/dist/lib/src/value/string.js.map +1 -1
- package/dist/lib/src/value/utils.js +27 -2
- package/dist/lib/src/value/utils.js.map +1 -1
- package/dist/lib/src/vendor/embedded-protocol/embedded_sass_pb.js +1395 -101
- package/dist/lib/src/vendor/embedded-protocol/embedded_sass_pb.js.map +1 -1
- package/dist/package.json +23 -20
- package/dist/tool/utils.js +50 -18
- package/dist/tool/utils.js.map +1 -1
- package/dist/types/compile.d.ts +152 -0
- package/dist/types/exception.d.ts +41 -0
- package/dist/types/importer.d.ts +294 -0
- package/dist/types/index.d.ts +80 -0
- package/dist/types/legacy/exception.d.ts +54 -0
- package/dist/types/legacy/function.d.ts +756 -0
- package/dist/types/legacy/importer.d.ts +168 -0
- package/dist/types/legacy/options.d.ts +642 -0
- package/dist/types/legacy/plugin_this.d.ts +73 -0
- package/dist/types/legacy/render.d.ts +139 -0
- package/dist/types/logger/index.d.ts +94 -0
- package/dist/types/logger/source_location.d.ts +21 -0
- package/dist/types/logger/source_span.d.ts +34 -0
- package/dist/types/options.d.ts +418 -0
- package/dist/types/util/promise_or.d.ts +17 -0
- package/dist/types/value/argument_list.d.ts +47 -0
- package/dist/types/value/boolean.d.ts +29 -0
- package/dist/types/value/color.d.ts +107 -0
- package/dist/types/value/function.d.ts +22 -0
- package/dist/types/value/index.d.ts +173 -0
- package/dist/types/value/list.d.ts +54 -0
- package/dist/types/value/map.d.ts +41 -0
- package/dist/types/value/number.d.ts +305 -0
- package/dist/types/value/string.d.ts +84 -0
- package/package.json +23 -20
- package/dist/lib/index.d.ts +0 -7
- package/dist/lib/src/compile.d.ts +0 -20
- package/dist/lib/src/embedded-compiler/compiler.d.ts +0 -19
- package/dist/lib/src/embedded-compiler/compiler.js.map +0 -1
- package/dist/lib/src/embedded-compiler/packet-transformer.d.ts +0 -34
- package/dist/lib/src/embedded-compiler/packet-transformer.js.map +0 -1
- package/dist/lib/src/embedded-protocol/dispatcher.d.ts +0 -60
- package/dist/lib/src/embedded-protocol/dispatcher.js.map +0 -1
- package/dist/lib/src/embedded-protocol/message-transformer.d.ts +0 -47
- package/dist/lib/src/embedded-protocol/message-transformer.js.map +0 -1
- package/dist/lib/src/embedded-protocol/request-tracker.d.ts +0 -20
- package/dist/lib/src/embedded-protocol/request-tracker.js.map +0 -1
- package/dist/lib/src/embedded-protocol/utils.d.ts +0 -7
- package/dist/lib/src/embedded-protocol/utils.js +0 -52
- package/dist/lib/src/embedded-protocol/utils.js.map +0 -1
- package/dist/lib/src/exception/exception.d.ts +0 -19
- package/dist/lib/src/exception/exception.js +0 -36
- package/dist/lib/src/exception/exception.js.map +0 -1
- package/dist/lib/src/exception/location.d.ts +0 -11
- package/dist/lib/src/exception/location.js +0 -6
- package/dist/lib/src/exception/location.js.map +0 -1
- package/dist/lib/src/exception/span.d.ts +0 -29
- package/dist/lib/src/exception/span.js.map +0 -1
- package/dist/lib/src/node-sass/render.d.ts +0 -60
- package/dist/lib/src/node-sass/render.js +0 -126
- package/dist/lib/src/node-sass/render.js.map +0 -1
- package/dist/lib/src/utils.d.ts +0 -12
- package/dist/lib/src/value/boolean.d.ts +0 -25
- package/dist/lib/src/value/null.d.ts +0 -12
- package/dist/lib/src/value/number.d.ts +0 -189
- package/dist/lib/src/value/string.d.ts +0 -56
- package/dist/lib/src/value/utils.d.ts +0 -36
- package/dist/lib/src/value/value.d.ts +0 -103
- package/dist/lib/src/value/value.js.map +0 -1
- package/dist/lib/src/vendor/embedded-protocol/embedded_sass_pb.d.ts +0 -1
- package/dist/tool/utils.d.ts +0 -32
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
import { List } from 'immutable';
|
|
2
|
-
import { Value } from './value';
|
|
3
|
-
/** A SassScript number. */
|
|
4
|
-
export declare class SassNumber extends Value {
|
|
5
|
-
private valueInternal;
|
|
6
|
-
private numeratorUnitsInternal;
|
|
7
|
-
private denominatorUnitsInternal;
|
|
8
|
-
/** Creates a number, optionally with a single numerator unit. */
|
|
9
|
-
constructor(value: number, unit?: string);
|
|
10
|
-
/**
|
|
11
|
-
* Creates a number with `numeratorUnits` and `denominatorUnits`.
|
|
12
|
-
*
|
|
13
|
-
* Upon construction, any compatible numerator and denominator units are
|
|
14
|
-
* simplified away according to the conversion factor between them.
|
|
15
|
-
*/
|
|
16
|
-
static withUnits(value: number, options?: {
|
|
17
|
-
numeratorUnits?: string[] | List<string>;
|
|
18
|
-
denominatorUnits?: string[] | List<string>;
|
|
19
|
-
}): SassNumber;
|
|
20
|
-
/** `this`'s value. */
|
|
21
|
-
get value(): number;
|
|
22
|
-
/** Whether `value` is an integer. */
|
|
23
|
-
get isInt(): boolean;
|
|
24
|
-
/**
|
|
25
|
-
* If `value` is an integer according to `isInt`, returns `value` rounded to
|
|
26
|
-
* that integer.
|
|
27
|
-
*
|
|
28
|
-
* Otherwise, returns null.
|
|
29
|
-
*/
|
|
30
|
-
get asInt(): number | null;
|
|
31
|
-
/** `this`'s numerator units. */
|
|
32
|
-
get numeratorUnits(): List<string>;
|
|
33
|
-
/** `this`'s denominator units. */
|
|
34
|
-
get denominatorUnits(): List<string>;
|
|
35
|
-
/** Whether `this` has any units. */
|
|
36
|
-
get hasUnits(): boolean;
|
|
37
|
-
assertNumber(): SassNumber;
|
|
38
|
-
/**
|
|
39
|
-
* If `value` is an integer according to `isInt`, returns it as an integer.
|
|
40
|
-
*
|
|
41
|
-
* Otherwise, throws an error.
|
|
42
|
-
*
|
|
43
|
-
* If `this` came from a function argument, `name` is the argument name
|
|
44
|
-
* (without the `$`) and is used for error reporting.
|
|
45
|
-
*/
|
|
46
|
-
assertInt(name?: string): number;
|
|
47
|
-
/**
|
|
48
|
-
* If `value` is within `min` and `max`, returns `value`, or if it
|
|
49
|
-
* `fuzzyEquals` `min` or `max`, returns `value` clamped to that value.
|
|
50
|
-
*
|
|
51
|
-
* Otherwise, throws an error.
|
|
52
|
-
*
|
|
53
|
-
* If `this` came from a function argument, `name` is the argument name
|
|
54
|
-
* (without the `$`) and is used for error reporting.
|
|
55
|
-
*/
|
|
56
|
-
assertInRange(min: number, max: number, name?: string): number;
|
|
57
|
-
/**
|
|
58
|
-
* If `this` has no units, returns `this`.
|
|
59
|
-
*
|
|
60
|
-
* Otherwise, throws an error.
|
|
61
|
-
*
|
|
62
|
-
* If `this` came from a function argument, `name` is the argument name
|
|
63
|
-
* (without the `$`) and is used for error reporting.
|
|
64
|
-
*/
|
|
65
|
-
assertNoUnits(name?: string): SassNumber;
|
|
66
|
-
/**
|
|
67
|
-
* If `this` has `unit` as its only unit (and as a numerator), returns `this`.
|
|
68
|
-
*
|
|
69
|
-
* Otherwise, throws an error.
|
|
70
|
-
*
|
|
71
|
-
* If `this` came from a function argument, `name` is the argument name
|
|
72
|
-
* (without the `$`) and is used for error reporting.
|
|
73
|
-
*/
|
|
74
|
-
assertUnit(unit: string, name?: string): SassNumber;
|
|
75
|
-
/** Whether `this` has `unit` as its only unit (and as a numerator). */
|
|
76
|
-
hasUnit(unit: string): boolean;
|
|
77
|
-
/** Whether `this` is compatible with `unit`. */
|
|
78
|
-
compatibleWithUnit(unit: string): boolean;
|
|
79
|
-
/**
|
|
80
|
-
* Returns a copy of `this`, converted to the units represented by
|
|
81
|
-
* `newNumerators` and `newDenominators`.
|
|
82
|
-
*
|
|
83
|
-
* Throws an error if `this`'s units are incompatible with `newNumerators` and
|
|
84
|
-
* `newDenominators`. Also throws an error if `this` is unitless and either
|
|
85
|
-
* `newNumerators` or `newDenominators` are not empty, or vice-versa.
|
|
86
|
-
*
|
|
87
|
-
* If `this` came from a function argument, `name` is the argument name
|
|
88
|
-
* (without the `$`) and is used for error reporting.
|
|
89
|
-
*/
|
|
90
|
-
convert(newNumerators: string[] | List<string>, newDenominators: string[] | List<string>, name?: string): SassNumber;
|
|
91
|
-
/**
|
|
92
|
-
* Returns `value`, converted to the units represented by `newNumerators` and
|
|
93
|
-
* `newDenominators`.
|
|
94
|
-
*
|
|
95
|
-
* Throws an error if `this`'s units are incompatible with `newNumerators` and
|
|
96
|
-
* `newDenominators`. Also throws an error if `this` is unitless and either
|
|
97
|
-
* `newNumerators` or `newDenominators` are not empty, or vice-versa.
|
|
98
|
-
*
|
|
99
|
-
* If `this` came from a function argument, `name` is the argument name
|
|
100
|
-
* (without the `$`) and is used for error reporting.
|
|
101
|
-
*/
|
|
102
|
-
convertValue(newNumerators: string[] | List<string>, newDenominators: string[] | List<string>, name?: string): number;
|
|
103
|
-
/**
|
|
104
|
-
* Returns a copy of `this`, converted to the same units as `other`.
|
|
105
|
-
*
|
|
106
|
-
* Throws an error if `this`'s units are incompatible with `other`'s units, or
|
|
107
|
-
* if either number is unitless but the other is not.
|
|
108
|
-
*
|
|
109
|
-
* If `this` came from a function argument, `name` is the argument name
|
|
110
|
-
* and `otherName` is the argument name for `other` (both without the `$`).
|
|
111
|
-
* They are used for error reporting.
|
|
112
|
-
*/
|
|
113
|
-
convertToMatch(other: SassNumber, name?: string, otherName?: string): SassNumber;
|
|
114
|
-
/**
|
|
115
|
-
* Returns `value`, converted to the same units as `other`.
|
|
116
|
-
*
|
|
117
|
-
* Throws an error if `this`'s units are incompatible with `other`'s units, or
|
|
118
|
-
* if either number is unitless but the other is not.
|
|
119
|
-
*
|
|
120
|
-
* If `this` came from a function argument, `name` is the argument name
|
|
121
|
-
* and `otherName` is the argument name for `other` (both without the `$`).
|
|
122
|
-
* They are used for error reporting.
|
|
123
|
-
*/
|
|
124
|
-
convertValueToMatch(other: SassNumber, name?: string, otherName?: string): number;
|
|
125
|
-
/**
|
|
126
|
-
* Returns a copy of `this`, converted to the units represented by
|
|
127
|
-
* `newNumerators` and `newDenominators`.
|
|
128
|
-
*
|
|
129
|
-
* Does *not* throw an error if this number is unitless and either
|
|
130
|
-
* `newNumerators` or `newDenominators` are not empty, or vice-versa. Instead,
|
|
131
|
-
* it treats all unitless numbers as convertible to and from all units
|
|
132
|
-
* without changing the value.
|
|
133
|
-
*
|
|
134
|
-
* Throws an error if `this`'s units are incompatible with `newNumerators` and
|
|
135
|
-
* `newDenominators`.
|
|
136
|
-
*
|
|
137
|
-
* If `this` came from a function argument, `name` is the argument name
|
|
138
|
-
* (without the `$`) and is used for error reporting.
|
|
139
|
-
*/
|
|
140
|
-
coerce(newNumerators: string[] | List<string>, newDenominators: string[] | List<string>, name?: string): SassNumber;
|
|
141
|
-
/**
|
|
142
|
-
* Returns `value`, converted to the units represented by `newNumerators` and
|
|
143
|
-
* `newDenominators`.
|
|
144
|
-
*
|
|
145
|
-
* Does *not* throw an error if this number is unitless and either
|
|
146
|
-
* `newNumerators` or `newDenominators` are not empty, or vice-versa. Instead,
|
|
147
|
-
* it treats all unitless numbers as convertible to and from all units
|
|
148
|
-
* without changing the value.
|
|
149
|
-
*
|
|
150
|
-
* Throws an error if `this`'s units are incompatible with `newNumerators` and
|
|
151
|
-
* `newDenominators`.
|
|
152
|
-
*
|
|
153
|
-
* If `this` came from a function argument, `name` is the argument name
|
|
154
|
-
* (without the `$`) and is used for error reporting.
|
|
155
|
-
*/
|
|
156
|
-
coerceValue(newNumerators: string[] | List<string>, newDenominators: string[] | List<string>, name?: string): number;
|
|
157
|
-
/**
|
|
158
|
-
* Returns a copy of `this`, converted to the same units as `other`.
|
|
159
|
-
*
|
|
160
|
-
* Does *not* throw an error if `this` is unitless and `other` is not, or
|
|
161
|
-
* vice-versa. Instead, it treats all unitless numbers as convertible to and
|
|
162
|
-
* from all units without changing the value.
|
|
163
|
-
*
|
|
164
|
-
* Throws an error if `this`'s units are incompatible with `other`'s units.
|
|
165
|
-
*
|
|
166
|
-
* If `this` came from a function argument, `name` is the argument name
|
|
167
|
-
* and `otherName` is the argument name for `other` (both without the `$`).
|
|
168
|
-
* They are used for error reporting.
|
|
169
|
-
*/
|
|
170
|
-
coerceToMatch(other: SassNumber, name?: string, otherName?: string): SassNumber;
|
|
171
|
-
/**
|
|
172
|
-
* Returns `value`, converted to the same units as `other`.
|
|
173
|
-
*
|
|
174
|
-
* Does *not* throw an error if `this` is unitless and `other` is not, or
|
|
175
|
-
* vice-versa. Instead, it treats all unitless numbers as convertible to and
|
|
176
|
-
* from all units without changing the value.
|
|
177
|
-
*
|
|
178
|
-
* Throws an error if `this`'s units are incompatible with `other`'s units.
|
|
179
|
-
*
|
|
180
|
-
* If `this` came from a function argument, `name` is the argument name
|
|
181
|
-
* and `otherName` is the argument name for `other` (both without the `$`).
|
|
182
|
-
* They are used for error reporting.
|
|
183
|
-
*/
|
|
184
|
-
coerceValueToMatch(other: SassNumber, name?: string, otherName?: string): number;
|
|
185
|
-
equals(other: Value): boolean;
|
|
186
|
-
hashCode(): number;
|
|
187
|
-
toString(): string;
|
|
188
|
-
private convertOrCoerce;
|
|
189
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { Value } from './value';
|
|
2
|
-
/** A SassScript string. */
|
|
3
|
-
export declare class SassString extends Value {
|
|
4
|
-
private readonly textInternal;
|
|
5
|
-
private readonly hasQuotesInternal;
|
|
6
|
-
/** Creates a string with `text`, optionally with quotes. */
|
|
7
|
-
constructor(text: string, options?: {
|
|
8
|
-
quotes?: boolean;
|
|
9
|
-
});
|
|
10
|
-
/** Creates an empty string, optionally with quotes. */
|
|
11
|
-
static empty(options?: {
|
|
12
|
-
quotes?: boolean;
|
|
13
|
-
}): SassString;
|
|
14
|
-
/** `this`'s text. */
|
|
15
|
-
get text(): string;
|
|
16
|
-
/** Whether `this` has quotes. */
|
|
17
|
-
get hasQuotes(): boolean;
|
|
18
|
-
assertString(): SassString;
|
|
19
|
-
/**
|
|
20
|
-
* Sass's notion of `this`'s length.
|
|
21
|
-
*
|
|
22
|
-
* Sass treats strings as a series of Unicode code points while JS treats them
|
|
23
|
-
* as a series of UTF-16 code units. For example, the character U+1F60A,
|
|
24
|
-
* Smiling Face With Smiling Eyes, is a single Unicode code point but is
|
|
25
|
-
* represented in UTF-16 as two code units (`0xD83D` and `0xDE0A`). So in
|
|
26
|
-
* JS, `"n😊b".length` returns `4`, whereas in Sass `string.length("n😊b")`
|
|
27
|
-
* returns `3`.
|
|
28
|
-
*/
|
|
29
|
-
sassLength(): number;
|
|
30
|
-
/**
|
|
31
|
-
* Converts `sassIndex` to a JS index into `text`.
|
|
32
|
-
*
|
|
33
|
-
* Sass indices are one-based, while JS indices are zero-based. Sass
|
|
34
|
-
* indices may also be negative in order to index from the end of the string.
|
|
35
|
-
*
|
|
36
|
-
* In addition, Sass indices refer to Unicode code points while JS string
|
|
37
|
-
* indices refer to UTF-16 code units. For example, the character U+1F60A,
|
|
38
|
-
* Smiling Face With Smiling Eyes, is a single Unicode code point but is
|
|
39
|
-
* represented in UTF-16 as two code units (`0xD83D` and `0xDE0A`). So in
|
|
40
|
-
* JS, `"n😊b".charAt(1)` returns `0xD83D`, whereas in Sass
|
|
41
|
-
* `string.slice("n😊b", 1, 1)` returns `"😊"`.
|
|
42
|
-
*
|
|
43
|
-
* This function converts Sass's code point indices to JS's code unit
|
|
44
|
-
* indices. This means it's O(n) in the length of `text`.
|
|
45
|
-
*
|
|
46
|
-
* Throws an error `sassIndex` isn't a number, if that number isn't an
|
|
47
|
-
* integer, or if that integer isn't a valid index for this string.
|
|
48
|
-
*
|
|
49
|
-
* If `sassIndex` came from a function argument, `name` is the argument name
|
|
50
|
-
* (without the `$`) and is used for error reporting.
|
|
51
|
-
*/
|
|
52
|
-
sassIndexToStringIndex(sassIndex: Value, name?: string): number;
|
|
53
|
-
equals(other: Value): boolean;
|
|
54
|
-
hashCode(): number;
|
|
55
|
-
toString(): string;
|
|
56
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/** The precision of Sass numbers. */
|
|
2
|
-
export declare const precision = 10;
|
|
3
|
-
/** Whether `num1` and `num2` are equal within `epsilon`. */
|
|
4
|
-
export declare function fuzzyEquals(num1: number, num2: number): boolean;
|
|
5
|
-
/**
|
|
6
|
-
* Returns a hash code for `num`.
|
|
7
|
-
*
|
|
8
|
-
* Two numbers that `fuzzyEquals` each other must have the same hash code.
|
|
9
|
-
*/
|
|
10
|
-
export declare function fuzzyHashCode(num: number): number;
|
|
11
|
-
/** Whether `num1` < `num2`, within `epsilon`. */
|
|
12
|
-
export declare function fuzzyLessThan(num1: number, num2: number): boolean;
|
|
13
|
-
/** Whether `num1` <= `num2`, within `epsilon`. */
|
|
14
|
-
export declare function fuzzyLessThanOrEquals(num1: number, num2: number): boolean;
|
|
15
|
-
/** Whether `num1` > `num2`, within `epsilon`. */
|
|
16
|
-
export declare function fuzzyGreaterThan(num1: number, num2: number): boolean;
|
|
17
|
-
/** Whether `num1` >= `num2`, within `epsilon`. */
|
|
18
|
-
export declare function fuzzyGreaterThanOrEquals(num1: number, num2: number): boolean;
|
|
19
|
-
/** Whether `num` `fuzzyEquals` an integer. */
|
|
20
|
-
export declare function fuzzyIsInt(num: number): boolean;
|
|
21
|
-
/**
|
|
22
|
-
* If `num` `fuzzyIsInt`, returns it as an integer. Otherwise, returns `null`.
|
|
23
|
-
*/
|
|
24
|
-
export declare function fuzzyAsInt(num: number): number | null;
|
|
25
|
-
/**
|
|
26
|
-
* Rounds `num` to the nearest integer.
|
|
27
|
-
*
|
|
28
|
-
* If `num` `fuzzyEquals` `x.5`, rounds away from zero.
|
|
29
|
-
*/
|
|
30
|
-
export declare function fuzzyRound(num: number): number;
|
|
31
|
-
/**
|
|
32
|
-
* Returns `num` if it's within `min` and `max`, or `null` if it's not.
|
|
33
|
-
*
|
|
34
|
-
* If `num` `fuzzyEquals` `min` or `max`, it gets clamped to that value.
|
|
35
|
-
*/
|
|
36
|
-
export declare function fuzzyInRange(num: number, min: number, max: number): number | null;
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { List, OrderedMap, ValueObject } from 'immutable';
|
|
2
|
-
import { SassBoolean } from './boolean';
|
|
3
|
-
import { SassNumber } from './number';
|
|
4
|
-
import { SassString } from './string';
|
|
5
|
-
/**
|
|
6
|
-
* A SassScript value.
|
|
7
|
-
*
|
|
8
|
-
* All SassScript values are immutable.
|
|
9
|
-
*
|
|
10
|
-
* Concrete values (such as `SassColor`) are implemented as subclasses and get
|
|
11
|
-
* instantiated as normal JS classes.
|
|
12
|
-
*
|
|
13
|
-
* Untyped values can be cast to particular types using `assert*()` functions,
|
|
14
|
-
* which throw user-friendly error messages if they fail.
|
|
15
|
-
*
|
|
16
|
-
* All values, except `false` and `null`, count as `true`.
|
|
17
|
-
*
|
|
18
|
-
* All values can be used as lists. Maps count as lists of pairs, while all
|
|
19
|
-
* other values count as single-value lists.
|
|
20
|
-
*/
|
|
21
|
-
export declare abstract class Value implements ValueObject {
|
|
22
|
-
/** Whether `this` counts as `true`. */
|
|
23
|
-
get isTruthy(): boolean;
|
|
24
|
-
/** Returns JS null if `this` is `sassNull`. Otherwise, returns `this`. */
|
|
25
|
-
get realNull(): Value | null;
|
|
26
|
-
/** `this` as a list. */
|
|
27
|
-
get asList(): List<Value>;
|
|
28
|
-
/** The separator for `this` as a list. */
|
|
29
|
-
get separator(): null;
|
|
30
|
-
/** Whether `this`, as a list, has brackets. */
|
|
31
|
-
get hasBrackets(): boolean;
|
|
32
|
-
/**
|
|
33
|
-
* Converts `sassIndex` to a JS index into the array returned by `asList`.
|
|
34
|
-
*
|
|
35
|
-
* Sass indices start counting at 1, and may be negative in order to index
|
|
36
|
-
* from the end of the list.
|
|
37
|
-
*
|
|
38
|
-
* `sassIndex` must be...
|
|
39
|
-
* - a number, and
|
|
40
|
-
* - an integer, and
|
|
41
|
-
* - a valid index into `asList`.
|
|
42
|
-
*
|
|
43
|
-
* Otherwise, this throws an error.
|
|
44
|
-
*
|
|
45
|
-
* If `this` came from a function argument, `name` is the argument name
|
|
46
|
-
* (without the `$`) and is used for error reporting.
|
|
47
|
-
*/
|
|
48
|
-
sassIndexToListIndex(sassIndex: Value, name?: string): number;
|
|
49
|
-
/**
|
|
50
|
-
* Casts `this` to `SassBoolean`; throws if `this` isn't a boolean.
|
|
51
|
-
*
|
|
52
|
-
* If `this` came from a function argument, `name` is the argument name
|
|
53
|
-
* (without the `$`) and is used for error reporting.
|
|
54
|
-
*/
|
|
55
|
-
assertBoolean(name?: string): SassBoolean;
|
|
56
|
-
/**
|
|
57
|
-
* Casts `this` to `SassColor`; throws if `this` isn't a color.
|
|
58
|
-
*
|
|
59
|
-
* If `this` came from a function argument, `name` is the argument name
|
|
60
|
-
* (without the `$`) and is used for error reporting.
|
|
61
|
-
*/
|
|
62
|
-
assertColor(name?: string): Value;
|
|
63
|
-
/**
|
|
64
|
-
* Casts `this` to `SassFunction`; throws if `this` isn't a function
|
|
65
|
-
* reference.
|
|
66
|
-
*
|
|
67
|
-
* If `this` came from a function argument, `name` is the argument name
|
|
68
|
-
* (without the `$`) and is used for error reporting.
|
|
69
|
-
*/
|
|
70
|
-
assertFunction(name?: string): Value;
|
|
71
|
-
/**
|
|
72
|
-
* Casts `this` to `SassMap`; throws if `this` isn't a map.
|
|
73
|
-
*
|
|
74
|
-
* If `this` came from a function argument, `name` is the argument name
|
|
75
|
-
* (without the `$`) and is used for error reporting.
|
|
76
|
-
*/
|
|
77
|
-
assertMap(name?: string): Value;
|
|
78
|
-
/**
|
|
79
|
-
* Returns `this` as a `SassMap` if it counts as one (including empty lists),
|
|
80
|
-
* or `null` if it does not.
|
|
81
|
-
*/
|
|
82
|
-
tryMap(): OrderedMap<Value, Value> | null;
|
|
83
|
-
/**
|
|
84
|
-
* Casts `this` to `SassString`; throws if `this` isn't a string.
|
|
85
|
-
*
|
|
86
|
-
* If `this` came from a function argument, `name` is the argument name
|
|
87
|
-
* (without the `$`) and is used for error reporting.
|
|
88
|
-
*/
|
|
89
|
-
assertNumber(name?: string): SassNumber;
|
|
90
|
-
/**
|
|
91
|
-
* Casts `this` to `SassString`; throws if `this` isn't a string.
|
|
92
|
-
*
|
|
93
|
-
* If `this` came from a function argument, `name` is the argument name
|
|
94
|
-
* (without the `$`) and is used for error reporting.
|
|
95
|
-
*/
|
|
96
|
-
assertString(name?: string): SassString;
|
|
97
|
-
/** Whether `this == other` in SassScript. */
|
|
98
|
-
abstract equals(other: Value): boolean;
|
|
99
|
-
/** This is the same for values that are `==` in SassScript. */
|
|
100
|
-
abstract hashCode(): number;
|
|
101
|
-
/** A meaningful descriptor for this value. */
|
|
102
|
-
abstract toString(): string;
|
|
103
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"value.js","sourceRoot":"","sources":["../../../../lib/src/value/value.ts"],"names":[],"mappings":";AAAA,uEAAuE;AACvE,gEAAgE;AAChE,uCAAuC;;AAEvC,yCAAwD;AAKxD,oCAAoC;AAEpC;;;;;;;;;;;;;;;GAeG;AACH,MAAsB,KAAK;IACzB,uCAAuC;IACvC,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC;IACd,CAAC;IAED,0EAA0E;IAC1E,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC;IACd,CAAC;IAED,wBAAwB;IACxB,IAAI,MAAM;QACR,OAAO,gBAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IACtB,CAAC;IAED,0CAA0C;IAC1C,IAAI,SAAS;QACX,OAAO,IAAI,CAAC;QACZ,+DAA+D;IACjE,CAAC;IAED,+CAA+C;IAC/C,IAAI,WAAW;QACb,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACH,oBAAoB,CAAC,SAAgB,EAAE,IAAa;QAClD,cAAc;QACd,MAAM,KAAK,CAAC,qBAAqB,CAAC,CAAC;IACrC,CAAC;IAED;;;;;OAKG;IACH,aAAa,CAAC,IAAa;QACzB,MAAM,kBAAU,CAAC,GAAG,IAAI,mBAAmB,EAAE,IAAI,CAAC,CAAC;IACrD,CAAC;IAED;;;;;OAKG;IACH,WAAW,CAAC,IAAa;QACvB,MAAM,kBAAU,CAAC,GAAG,IAAI,iBAAiB,EAAE,IAAI,CAAC,CAAC;QACjD,oDAAoD;IACtD,CAAC;IAED;;;;;;OAMG;IACH,cAAc,CAAC,IAAa;QAC1B,MAAM,kBAAU,CAAC,GAAG,IAAI,8BAA8B,EAAE,IAAI,CAAC,CAAC;QAC9D,uDAAuD;IACzD,CAAC;IAED;;;;;OAKG;IACH,SAAS,CAAC,IAAa;QACrB,MAAM,kBAAU,CAAC,GAAG,IAAI,eAAe,EAAE,IAAI,CAAC,CAAC;QAC/C,kDAAkD;IACpD,CAAC;IAED;;;OAGG;IACH,MAAM;QACJ,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;OAKG;IACH,YAAY,CAAC,IAAa;QACxB,MAAM,kBAAU,CAAC,GAAG,IAAI,kBAAkB,EAAE,IAAI,CAAC,CAAC;IACpD,CAAC;IAED;;;;;OAKG;IACH,YAAY,CAAC,IAAa;QACxB,MAAM,kBAAU,CAAC,GAAG,IAAI,kBAAkB,EAAE,IAAI,CAAC,CAAC;IACpD,CAAC;CAUF;AAhID,sBAgIC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/tool/utils.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Gets the Embedded Protocol.
|
|
3
|
-
*
|
|
4
|
-
* Can download the release `version`, check out and build the source from a Git
|
|
5
|
-
* `ref`, or build from the source at `path`.
|
|
6
|
-
*
|
|
7
|
-
* By default, downloads the release version specified in package.json. Throws
|
|
8
|
-
* if an error occurs.
|
|
9
|
-
*/
|
|
10
|
-
export declare function getEmbeddedProtocol(outPath: string, options?: {
|
|
11
|
-
version: string;
|
|
12
|
-
} | {
|
|
13
|
-
ref: string;
|
|
14
|
-
} | {
|
|
15
|
-
path: string;
|
|
16
|
-
}): Promise<void>;
|
|
17
|
-
/**
|
|
18
|
-
* Gets the Dart Sass wrapper for the Embedded Compiler.
|
|
19
|
-
*
|
|
20
|
-
* Can download the release `version`, check out and build the source from a Git
|
|
21
|
-
* `ref`, or build from the source at `path`.
|
|
22
|
-
*
|
|
23
|
-
* By default, downloads the release version specified in package.json. Throws
|
|
24
|
-
* if an error occurs.
|
|
25
|
-
*/
|
|
26
|
-
export declare function getDartSassEmbedded(outPath: string, options?: {
|
|
27
|
-
version: string;
|
|
28
|
-
} | {
|
|
29
|
-
ref: string;
|
|
30
|
-
} | {
|
|
31
|
-
path: string;
|
|
32
|
-
}): Promise<void>;
|