sass 1.62.1 → 1.63.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 +35 -35
- package/README.md +2 -2
- package/package.json +1 -1
- package/sass.dart.js +3069 -2493
- package/sass.default.cjs +8 -0
- package/sass.default.js +31 -7
- package/sass.js +6 -2
- package/sass.node.cjs +11 -0
- package/sass.node.js +35 -0
- package/types/compile.d.ts +25 -24
- package/types/exception.d.ts +7 -7
- package/types/importer.d.ts +58 -54
- package/types/legacy/exception.d.ts +13 -12
- package/types/legacy/function.d.ts +59 -58
- package/types/legacy/importer.d.ts +31 -30
- package/types/legacy/options.d.ts +65 -65
- package/types/legacy/plugin_this.d.ts +18 -17
- package/types/legacy/render.d.ts +21 -21
- package/types/logger/index.d.ts +4 -4
- package/types/logger/source_location.d.ts +2 -2
- package/types/logger/source_span.d.ts +3 -3
- package/types/options.d.ts +74 -70
- package/types/util/promise_or.d.ts +4 -4
- package/types/value/argument_list.d.ts +6 -6
- package/types/value/function.d.ts +1 -1
- package/types/value/index.d.ts +13 -13
- package/types/value/list.d.ts +1 -1
- package/types/value/map.d.ts +3 -3
- package/types/value/number.d.ts +49 -49
- package/types/value/string.d.ts +1 -1
package/types/options.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ export type OutputStyle = 'expanded' | 'compressed';
|
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* A callback that implements a custom Sass function. This can be passed to
|
|
35
|
-
*
|
|
35
|
+
* {@link Options.functions}.
|
|
36
36
|
*
|
|
37
37
|
* ```js
|
|
38
38
|
* const result = sass.compile('style.scss', {
|
|
@@ -49,21 +49,21 @@ export type OutputStyle = 'expanded' | 'compressed';
|
|
|
49
49
|
* ```
|
|
50
50
|
*
|
|
51
51
|
* @typeParam sync - A `CustomFunction<'sync'>` must return synchronously, but
|
|
52
|
-
* in return it can be passed to
|
|
53
|
-
* to
|
|
52
|
+
* in return it can be passed to {@link compile} and {@link compileString} in
|
|
53
|
+
* addition to {@link compileAsync} and {@link compileStringAsync}.
|
|
54
54
|
*
|
|
55
55
|
* A `CustomFunction<'async'>` may either return synchronously or
|
|
56
|
-
* asynchronously, but it can only be used with
|
|
57
|
-
*
|
|
56
|
+
* asynchronously, but it can only be used with {@link compileAsync} and {@link
|
|
57
|
+
* compileStringAsync}.
|
|
58
58
|
*
|
|
59
59
|
* @param args - An array of arguments passed by the function's caller. If the
|
|
60
60
|
* function takes [arbitrary
|
|
61
61
|
* arguments](https://sass-lang.com/documentation/at-rules/function#taking-arbitrary-arguments),
|
|
62
|
-
* the last element will be a
|
|
62
|
+
* the last element will be a {@link SassArgumentList}.
|
|
63
63
|
*
|
|
64
64
|
* @returns The function's result. This may be in the form of a `Promise`, but
|
|
65
|
-
* if it is the function may only be passed to
|
|
66
|
-
*
|
|
65
|
+
* if it is the function may only be passed to {@link compileAsync} and {@link
|
|
66
|
+
* compileStringAsync}, not {@link compile} or {@link compileString}.
|
|
67
67
|
*
|
|
68
68
|
* @throws any - This function may throw an error, which the Sass compiler will
|
|
69
69
|
* treat as the function call failing. If the exception object has a `message`
|
|
@@ -78,12 +78,12 @@ export type CustomFunction<sync extends 'sync' | 'async'> = (
|
|
|
78
78
|
) => PromiseOr<Value, sync>;
|
|
79
79
|
|
|
80
80
|
/**
|
|
81
|
-
* Options that can be passed to
|
|
82
|
-
*
|
|
81
|
+
* Options that can be passed to {@link compile}, {@link compileAsync}, {@link
|
|
82
|
+
* compileString}, or {@link compileStringAsync}.
|
|
83
83
|
*
|
|
84
84
|
* @typeParam sync - This lets the TypeScript checker verify that asynchronous
|
|
85
|
-
*
|
|
86
|
-
*
|
|
85
|
+
* {@link Importer}s, {@link FileImporter}s, and {@link CustomFunction}s aren't
|
|
86
|
+
* passed to {@link compile} or {@link compileString}.
|
|
87
87
|
*
|
|
88
88
|
* @category Options
|
|
89
89
|
*/
|
|
@@ -127,7 +127,7 @@ export interface Options<sync extends 'sync' | 'async'> {
|
|
|
127
127
|
* This option takes an object whose keys are Sass function signatures like
|
|
128
128
|
* you'd write for the [`@function
|
|
129
129
|
* rule`](https://sass-lang.com/documentation/at-rules/function) and whose
|
|
130
|
-
* values are
|
|
130
|
+
* values are {@link CustomFunction}s.
|
|
131
131
|
*
|
|
132
132
|
* Functions are passed JavaScript representations of [Sass value
|
|
133
133
|
* types](https://sass-lang.com/documentation/js-api#value-types), and must
|
|
@@ -137,18 +137,18 @@ export interface Options<sync extends 'sync' | 'async'> {
|
|
|
137
137
|
* and as close to the standards set by Sass's core functions as possible. Some
|
|
138
138
|
* good guidelines to follow include:
|
|
139
139
|
*
|
|
140
|
-
* * Use `Value.assert*` methods, like
|
|
141
|
-
* `Value` objects to more specific types. For values that were
|
|
142
|
-
* directly as arguments, pass in the argument name as well. This
|
|
143
|
-
* that the user gets good error messages when they pass in the
|
|
144
|
-
* to your function.
|
|
140
|
+
* * Use `Value.assert*` methods, like {@link Value.assertString}, to cast
|
|
141
|
+
* untyped `Value` objects to more specific types. For values that were
|
|
142
|
+
* passed directly as arguments, pass in the argument name as well. This
|
|
143
|
+
* ensures that the user gets good error messages when they pass in the
|
|
144
|
+
* wrong type to your function.
|
|
145
145
|
*
|
|
146
|
-
* * Individual classes may have more specific `assert*` methods, like
|
|
147
|
-
*
|
|
146
|
+
* * Individual classes may have more specific `assert*` methods, like {@link
|
|
147
|
+
* SassNumber.assertInt}, which should be used when possible.
|
|
148
148
|
*
|
|
149
149
|
* * In Sass, every value counts as a list. Rather than trying to detect the
|
|
150
|
-
*
|
|
151
|
-
* lists.
|
|
150
|
+
* {@link SassList} type, you should use {@link Value.asList} to treat all
|
|
151
|
+
* values as lists.
|
|
152
152
|
*
|
|
153
153
|
* * When manipulating values like lists, strings, and numbers that have
|
|
154
154
|
* metadata (comma versus space separated, bracketed versus unbracketed,
|
|
@@ -160,9 +160,8 @@ export interface Options<sync extends 'sync' | 'async'> {
|
|
|
160
160
|
*
|
|
161
161
|
* * In Sass, lists and strings use one-based indexing and use negative
|
|
162
162
|
* indices to index from the end of value. Functions should follow these
|
|
163
|
-
* conventions.
|
|
164
|
-
*
|
|
165
|
-
* automatically.
|
|
163
|
+
* conventions. {@link Value.sassIndexToListIndex} and {@link
|
|
164
|
+
* SassString.sassIndexToStringIndex} can be used to do this automatically.
|
|
166
165
|
*
|
|
167
166
|
* * String indexes in Sass refer to Unicode code points while JavaScript
|
|
168
167
|
* string indices refer to UTF-16 code units. For example, the character
|
|
@@ -170,9 +169,9 @@ export interface Options<sync extends 'sync' | 'async'> {
|
|
|
170
169
|
* is represented in UTF-16 as two code units (`0xD83D` and `0xDE0A`). So in
|
|
171
170
|
* JavaScript, `"a😊b".charCodeAt(1)` returns `0xD83D`, whereas in Sass
|
|
172
171
|
* `str-slice("a😊b", 1, 1)` returns `"😊"`. Functions should follow Sass's
|
|
173
|
-
* convention.
|
|
174
|
-
* automatically, and the
|
|
175
|
-
* access a string's length in code points.
|
|
172
|
+
* convention. {@link SassString.sassIndexToStringIndex} can be used to do
|
|
173
|
+
* this automatically, and the {@link SassString.sassLength} getter can be
|
|
174
|
+
* used to access a string's length in code points.
|
|
176
175
|
*
|
|
177
176
|
* @example
|
|
178
177
|
*
|
|
@@ -209,9 +208,10 @@ export interface Options<sync extends 'sync' | 'async'> {
|
|
|
209
208
|
* - The importer that was used to load the current stylesheet, with the
|
|
210
209
|
* loaded URL resolved relative to the current stylesheet's canonical URL.
|
|
211
210
|
*
|
|
212
|
-
* - Each
|
|
211
|
+
* - Each {@link Importer} or {@link FileImporter} in {@link importers}, in
|
|
212
|
+
* order.
|
|
213
213
|
*
|
|
214
|
-
* - Each load path in
|
|
214
|
+
* - Each load path in {@link loadPaths}, in order.
|
|
215
215
|
*
|
|
216
216
|
* If none of these return a Sass file, the load fails and Sass throws an
|
|
217
217
|
* error.
|
|
@@ -225,7 +225,7 @@ export interface Options<sync extends 'sync' | 'async'> {
|
|
|
225
225
|
* [`@use`](https://sass-lang.com/documentation/at-rules/use) and
|
|
226
226
|
* [`@import`](https://sass-lang.com/documentation/at-rules/import).
|
|
227
227
|
*
|
|
228
|
-
* A load path `loadPath` is equivalent to the following
|
|
228
|
+
* A load path `loadPath` is equivalent to the following {@link FileImporter}:
|
|
229
229
|
*
|
|
230
230
|
* ```js
|
|
231
231
|
* {
|
|
@@ -245,10 +245,10 @@ export interface Options<sync extends 'sync' | 'async'> {
|
|
|
245
245
|
* An object to use to handle warnings and/or debug messages from Sass.
|
|
246
246
|
*
|
|
247
247
|
* By default, Sass emits warnings and debug messages to standard error, but
|
|
248
|
-
* if
|
|
249
|
-
* instead.
|
|
248
|
+
* if {@link Logger.warn} or {@link Logger.debug} is set, this will invoke
|
|
249
|
+
* them instead.
|
|
250
250
|
*
|
|
251
|
-
* The special value
|
|
251
|
+
* The special value {@link Logger.silent} can be used to easily silence all
|
|
252
252
|
* messages.
|
|
253
253
|
*
|
|
254
254
|
* @category Messages
|
|
@@ -258,18 +258,18 @@ export interface Options<sync extends 'sync' | 'async'> {
|
|
|
258
258
|
/**
|
|
259
259
|
* If this option is set to `true`, Sass won’t print warnings that are caused
|
|
260
260
|
* by dependencies. A “dependency” is defined as any file that’s loaded
|
|
261
|
-
* through
|
|
262
|
-
* relative to the entrypoint are not considered dependencies.
|
|
261
|
+
* through {@link loadPaths} or {@link importers}. Stylesheets that are
|
|
262
|
+
* imported relative to the entrypoint are not considered dependencies.
|
|
263
263
|
*
|
|
264
264
|
* This is useful for silencing deprecation warnings that you can’t fix on
|
|
265
265
|
* your own. However, please <em>also</em> notify your dependencies of the deprecations
|
|
266
266
|
* so that they can get fixed as soon as possible!
|
|
267
267
|
*
|
|
268
|
-
* **Heads up!** If
|
|
269
|
-
* without
|
|
270
|
-
* will be considered dependencies. Since it doesn’t have
|
|
271
|
-
* everything it loads is coming from a load path rather
|
|
272
|
-
* import.
|
|
268
|
+
* **Heads up!** If {@link compileString} or {@link compileStringAsync} is
|
|
269
|
+
* called without {@link StringOptionsWithoutImporter.url}, <em>all</em>
|
|
270
|
+
* stylesheets it loads will be considered dependencies. Since it doesn’t have
|
|
271
|
+
* a path of its own, everything it loads is coming from a load path rather
|
|
272
|
+
* than a relative import.
|
|
273
273
|
*
|
|
274
274
|
* @defaultValue `false`
|
|
275
275
|
* @category Messages
|
|
@@ -278,7 +278,7 @@ export interface Options<sync extends 'sync' | 'async'> {
|
|
|
278
278
|
|
|
279
279
|
/**
|
|
280
280
|
* Whether or not Sass should generate a source map. If it does, the source
|
|
281
|
-
* map will be available as
|
|
281
|
+
* map will be available as {@link CompileResult.sourceMap}.
|
|
282
282
|
*
|
|
283
283
|
* **Heads up!** Sass doesn't automatically add a `sourceMappingURL` comment
|
|
284
284
|
* to the generated CSS. It's up to callers to do that, since callers have
|
|
@@ -293,7 +293,7 @@ export interface Options<sync extends 'sync' | 'async'> {
|
|
|
293
293
|
/**
|
|
294
294
|
* Whether Sass should include the sources in the generated source map.
|
|
295
295
|
*
|
|
296
|
-
* This option has no effect if
|
|
296
|
+
* This option has no effect if {@link sourceMap} is `false`.
|
|
297
297
|
*
|
|
298
298
|
* @defaultValue `false`
|
|
299
299
|
* @category Output
|
|
@@ -301,7 +301,7 @@ export interface Options<sync extends 'sync' | 'async'> {
|
|
|
301
301
|
sourceMapIncludeSources?: boolean;
|
|
302
302
|
|
|
303
303
|
/**
|
|
304
|
-
* The
|
|
304
|
+
* The {@link OutputStyle} of the compiled CSS.
|
|
305
305
|
*
|
|
306
306
|
* @example
|
|
307
307
|
*
|
|
@@ -345,22 +345,23 @@ export interface Options<sync extends 'sync' | 'async'> {
|
|
|
345
345
|
}
|
|
346
346
|
|
|
347
347
|
/**
|
|
348
|
-
* Options that can be passed to
|
|
348
|
+
* Options that can be passed to {@link compileString} or {@link
|
|
349
|
+
* compileStringAsync}.
|
|
349
350
|
*
|
|
350
|
-
* If the
|
|
351
|
+
* If the {@link StringOptionsWithImporter.importer} field isn't passed, the
|
|
351
352
|
* entrypoint file can load files relative to itself if a `file://` URL is
|
|
352
|
-
* passed to the
|
|
353
|
+
* passed to the {@link url} field.
|
|
353
354
|
*
|
|
354
355
|
* @typeParam sync - This lets the TypeScript checker verify that asynchronous
|
|
355
|
-
*
|
|
356
|
-
*
|
|
356
|
+
* {@link Importer}s, {@link FileImporter}s, and {@link CustomFunction}s aren't
|
|
357
|
+
* passed to {@link compile} or {@link compileString}.
|
|
357
358
|
*
|
|
358
359
|
* @category Options
|
|
359
360
|
*/
|
|
360
361
|
export interface StringOptionsWithoutImporter<sync extends 'sync' | 'async'>
|
|
361
362
|
extends Options<sync> {
|
|
362
363
|
/**
|
|
363
|
-
* The
|
|
364
|
+
* The {@link Syntax} to use to parse the entrypoint stylesheet.
|
|
364
365
|
*
|
|
365
366
|
* @default `'scss'`
|
|
366
367
|
*
|
|
@@ -371,9 +372,10 @@ export interface StringOptionsWithoutImporter<sync extends 'sync' | 'async'>
|
|
|
371
372
|
/**
|
|
372
373
|
* The canonical URL of the entrypoint stylesheet.
|
|
373
374
|
*
|
|
374
|
-
* A relative load's URL is first resolved relative to
|
|
375
|
-
* to a file on disk if it's a `file://` URL. If it can't be resolved
|
|
376
|
-
* file on disk, it's then passed to
|
|
375
|
+
* A relative load's URL is first resolved relative to {@link url}, then
|
|
376
|
+
* resolved to a file on disk if it's a `file://` URL. If it can't be resolved
|
|
377
|
+
* to a file on disk, it's then passed to {@link importers} and {@link
|
|
378
|
+
* loadPaths}.
|
|
377
379
|
*
|
|
378
380
|
* @category Input
|
|
379
381
|
*/
|
|
@@ -381,15 +383,16 @@ export interface StringOptionsWithoutImporter<sync extends 'sync' | 'async'>
|
|
|
381
383
|
}
|
|
382
384
|
|
|
383
385
|
/**
|
|
384
|
-
* Options that can be passed to
|
|
386
|
+
* Options that can be passed to {@link compileString} or {@link
|
|
387
|
+
* compileStringAsync}.
|
|
385
388
|
*
|
|
386
|
-
* If the
|
|
387
|
-
* file uses it to load files relative to itself and the
|
|
388
|
-
* mandatory.
|
|
389
|
+
* If the {@link StringOptionsWithImporter.importer} field is passed, the
|
|
390
|
+
* entrypoint file uses it to load files relative to itself and the {@link url}
|
|
391
|
+
* field is mandatory.
|
|
389
392
|
*
|
|
390
393
|
* @typeParam sync - This lets the TypeScript checker verify that asynchronous
|
|
391
|
-
*
|
|
392
|
-
*
|
|
394
|
+
* {@link Importer}s, {@link FileImporter}s, and {@link CustomFunction}s aren't
|
|
395
|
+
* passed to {@link compile} or {@link compileString}.
|
|
393
396
|
*
|
|
394
397
|
* @category Options
|
|
395
398
|
*/
|
|
@@ -399,9 +402,9 @@ export interface StringOptionsWithImporter<sync extends 'sync' | 'async'>
|
|
|
399
402
|
* The importer to use to handle loads that are relative to the entrypoint
|
|
400
403
|
* stylesheet.
|
|
401
404
|
*
|
|
402
|
-
* A relative load's URL is first resolved relative to
|
|
403
|
-
*
|
|
404
|
-
*
|
|
405
|
+
* A relative load's URL is first resolved relative to {@link url}, then
|
|
406
|
+
* passed to {@link importer}. If the importer doesn't recognize it, it's then
|
|
407
|
+
* passed to {@link importers} and {@link loadPaths}.
|
|
405
408
|
*
|
|
406
409
|
* @category Input
|
|
407
410
|
*/
|
|
@@ -409,8 +412,8 @@ export interface StringOptionsWithImporter<sync extends 'sync' | 'async'>
|
|
|
409
412
|
|
|
410
413
|
/**
|
|
411
414
|
* The canonical URL of the entrypoint stylesheet. If this is passed along
|
|
412
|
-
* with
|
|
413
|
-
* stylesheet.
|
|
415
|
+
* with {@link importer}, it's used to resolve relative loads in the
|
|
416
|
+
* entrypoint stylesheet.
|
|
414
417
|
*
|
|
415
418
|
* @category Input
|
|
416
419
|
*/
|
|
@@ -418,15 +421,16 @@ export interface StringOptionsWithImporter<sync extends 'sync' | 'async'>
|
|
|
418
421
|
}
|
|
419
422
|
|
|
420
423
|
/**
|
|
421
|
-
* Options that can be passed to
|
|
424
|
+
* Options that can be passed to {@link compileString} or {@link
|
|
425
|
+
* compileStringAsync}.
|
|
422
426
|
*
|
|
423
|
-
* This is a
|
|
424
|
-
*
|
|
425
|
-
*
|
|
427
|
+
* This is a {@link StringOptionsWithImporter} if it has a {@link
|
|
428
|
+
* StringOptionsWithImporter.importer} field, and a {@link
|
|
429
|
+
* StringOptionsWithoutImporter} otherwise.
|
|
426
430
|
*
|
|
427
431
|
* @typeParam sync - This lets the TypeScript checker verify that asynchronous
|
|
428
|
-
*
|
|
429
|
-
*
|
|
432
|
+
* {@link Importer}s, {@link FileImporter}s, and {@link CustomFunction}s aren't
|
|
433
|
+
* passed to {@link compile} or {@link compileString}.
|
|
430
434
|
*
|
|
431
435
|
* @category Options
|
|
432
436
|
*/
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
* A utility type for choosing between synchronous and asynchronous return
|
|
3
3
|
* values.
|
|
4
4
|
*
|
|
5
|
-
* This is used as the return value for plugins like
|
|
6
|
-
*
|
|
7
|
-
* asynchronous plugins are only passed to
|
|
8
|
-
*
|
|
5
|
+
* This is used as the return value for plugins like {@link CustomFunction},
|
|
6
|
+
* {@link Importer}, and {@link FileImporter} so that TypeScript enforces that
|
|
7
|
+
* asynchronous plugins are only passed to {@link compileAsync} and {@link
|
|
8
|
+
* compileStringAsync}, not {@link compile} or {@link compileString}.
|
|
9
9
|
*
|
|
10
10
|
* @typeParam sync - If this is `'sync'`, this can only be a `T`. If it's
|
|
11
11
|
* `'async'`, this can be either a `T` or a `Promise<T>`.
|
|
@@ -8,8 +8,8 @@ import {SassList, ListSeparator} from './list';
|
|
|
8
8
|
* type](https://sass-lang.com/documentation/values/lists#argument-lists).
|
|
9
9
|
*
|
|
10
10
|
* An argument list comes from a rest argument. It's distinct from a normal
|
|
11
|
-
*
|
|
12
|
-
* arguments.
|
|
11
|
+
* {@link SassList} in that it may contain a keyword map as well as the
|
|
12
|
+
* positional arguments.
|
|
13
13
|
*
|
|
14
14
|
* @category Custom Function
|
|
15
15
|
*/
|
|
@@ -19,13 +19,13 @@ export class SassArgumentList extends SassList {
|
|
|
19
19
|
*
|
|
20
20
|
* @param contents - The positional arguments that make up the primary
|
|
21
21
|
* contents of the list. This may be either a plain JavaScript array or an
|
|
22
|
-
* immutable
|
|
22
|
+
* immutable {@link List} from the [`immutable`
|
|
23
23
|
* package](https://immutable-js.com/).
|
|
24
24
|
*
|
|
25
25
|
* @param keywords - The keyword arguments attached to this argument list,
|
|
26
26
|
* whose names should exclude `$`. This can be either a plain JavaScript
|
|
27
|
-
* object with argument names as fields, or an immutable
|
|
28
|
-
* the [`immutable` package](https://immutable-js.com/)
|
|
27
|
+
* object with argument names as fields, or an immutable {@link OrderedMap}
|
|
28
|
+
* from the [`immutable` package](https://immutable-js.com/)
|
|
29
29
|
*
|
|
30
30
|
* @param separator - The separator for this list. Defaults to `','`.
|
|
31
31
|
*/
|
|
@@ -40,7 +40,7 @@ export class SassArgumentList extends SassList {
|
|
|
40
40
|
*
|
|
41
41
|
* The argument names don't include `$`.
|
|
42
42
|
*
|
|
43
|
-
* @returns An immutable
|
|
43
|
+
* @returns An immutable {@link OrderedMap} from the [`immutable`
|
|
44
44
|
* package](https://immutable-js.com/).
|
|
45
45
|
*/
|
|
46
46
|
get keywords(): OrderedMap<string, Value>;
|
|
@@ -16,7 +16,7 @@ export class SassFunction extends Value {
|
|
|
16
16
|
* @param signature - The function signature, like you'd write for the
|
|
17
17
|
* [`@function rule`](https://sass-lang.com/documentation/at-rules/function).
|
|
18
18
|
* @param callback - The callback that's invoked when this function is called,
|
|
19
|
-
* just like for a
|
|
19
|
+
* just like for a {@link CustomFunction}.
|
|
20
20
|
*/
|
|
21
21
|
constructor(signature: string, callback: (args: Value[]) => Value);
|
|
22
22
|
}
|
package/types/value/index.d.ts
CHANGED
|
@@ -27,8 +27,8 @@ export const sassNull: Value;
|
|
|
27
27
|
/**
|
|
28
28
|
* The abstract base class of Sass's value types.
|
|
29
29
|
*
|
|
30
|
-
* This is passed to and returned by
|
|
31
|
-
* the Sass implementation using
|
|
30
|
+
* This is passed to and returned by {@link CustomFunction}s, which are passed
|
|
31
|
+
* into the Sass implementation using {@link Options.functions}.
|
|
32
32
|
*
|
|
33
33
|
* @category Custom Function
|
|
34
34
|
*/
|
|
@@ -41,7 +41,7 @@ export abstract class Value implements ValueObject {
|
|
|
41
41
|
* All SassScript values can be used as lists. Maps count as lists of pairs,
|
|
42
42
|
* and all other values count as single-value lists.
|
|
43
43
|
*
|
|
44
|
-
* @returns An immutable
|
|
44
|
+
* @returns An immutable {@link List} from the [`immutable`
|
|
45
45
|
* package](https://immutable-js.com/).
|
|
46
46
|
*/
|
|
47
47
|
get asList(): List<Value>;
|
|
@@ -61,7 +61,7 @@ export abstract class Value implements ValueObject {
|
|
|
61
61
|
get isTruthy(): boolean;
|
|
62
62
|
|
|
63
63
|
/**
|
|
64
|
-
* Returns JavaScript's `null` value if this is
|
|
64
|
+
* Returns JavaScript's `null` value if this is {@link sassNull}, and returns
|
|
65
65
|
* `this` otherwise.
|
|
66
66
|
*/
|
|
67
67
|
get realNull(): null | Value;
|
|
@@ -76,7 +76,7 @@ export abstract class Value implements ValueObject {
|
|
|
76
76
|
|
|
77
77
|
/**
|
|
78
78
|
* Converts `sassIndex` into a JavaScript-style index into the list returned
|
|
79
|
-
* by
|
|
79
|
+
* by {@link asList}.
|
|
80
80
|
*
|
|
81
81
|
* Sass indexes are one-based, while JavaScript indexes are zero-based. Sass
|
|
82
82
|
* indexes may also be negative in order to index from the end of the list.
|
|
@@ -85,7 +85,7 @@ export abstract class Value implements ValueObject {
|
|
|
85
85
|
* @param name - The name of the function argument `sassIndex` came from
|
|
86
86
|
* (without the `$`) if it came from an argument. Used for error reporting.
|
|
87
87
|
* @throws `Error` If `sassIndex` isn't a number, if that number isn't an
|
|
88
|
-
* integer, or if that integer isn't a valid index for
|
|
88
|
+
* integer, or if that integer isn't a valid index for {@link asList}.
|
|
89
89
|
*/
|
|
90
90
|
sassIndexToListIndex(sassIndex: Value, name?: string): number;
|
|
91
91
|
|
|
@@ -106,9 +106,9 @@ export abstract class Value implements ValueObject {
|
|
|
106
106
|
get(index: number): Value | undefined;
|
|
107
107
|
|
|
108
108
|
/**
|
|
109
|
-
* Throws if `this` isn't a
|
|
109
|
+
* Throws if `this` isn't a {@link SassBoolean}.
|
|
110
110
|
*
|
|
111
|
-
* **Heads up!** Functions should generally use
|
|
111
|
+
* **Heads up!** Functions should generally use {@link isTruthy} rather than
|
|
112
112
|
* requiring a literal boolean.
|
|
113
113
|
*
|
|
114
114
|
* @param name - The name of the function argument `this` came from (without
|
|
@@ -117,7 +117,7 @@ export abstract class Value implements ValueObject {
|
|
|
117
117
|
assertBoolean(name?: string): SassBoolean;
|
|
118
118
|
|
|
119
119
|
/**
|
|
120
|
-
* Throws if `this` isn't a
|
|
120
|
+
* Throws if `this` isn't a {@link SassColor}.
|
|
121
121
|
*
|
|
122
122
|
* @param name - The name of the function argument `this` came from (without
|
|
123
123
|
* the `$`) if it came from an argument. Used for error reporting.
|
|
@@ -125,7 +125,7 @@ export abstract class Value implements ValueObject {
|
|
|
125
125
|
assertColor(name?: string): SassColor;
|
|
126
126
|
|
|
127
127
|
/**
|
|
128
|
-
* Throws if `this` isn't a
|
|
128
|
+
* Throws if `this` isn't a {@link SassFunction}.
|
|
129
129
|
*
|
|
130
130
|
* @param name - The name of the function argument `this` came from (without
|
|
131
131
|
* the `$`) if it came from an argument. Used for error reporting.
|
|
@@ -133,7 +133,7 @@ export abstract class Value implements ValueObject {
|
|
|
133
133
|
assertFunction(name?: string): SassFunction;
|
|
134
134
|
|
|
135
135
|
/**
|
|
136
|
-
* Throws if `this` isn't a
|
|
136
|
+
* Throws if `this` isn't a {@link SassMap}.
|
|
137
137
|
*
|
|
138
138
|
* @param name - The name of the function argument `this` came from (without
|
|
139
139
|
* the `$`) if it came from an argument. Used for error reporting.
|
|
@@ -141,7 +141,7 @@ export abstract class Value implements ValueObject {
|
|
|
141
141
|
assertMap(name?: string): SassMap;
|
|
142
142
|
|
|
143
143
|
/**
|
|
144
|
-
* Throws if `this` isn't a
|
|
144
|
+
* Throws if `this` isn't a {@link SassNumber}.
|
|
145
145
|
*
|
|
146
146
|
* @param name - The name of the function argument `this` came from (without
|
|
147
147
|
* the `$`) if it came from an argument. Used for error reporting.
|
|
@@ -149,7 +149,7 @@ export abstract class Value implements ValueObject {
|
|
|
149
149
|
assertNumber(name?: string): SassNumber;
|
|
150
150
|
|
|
151
151
|
/**
|
|
152
|
-
* Throws if `this` isn't a
|
|
152
|
+
* Throws if `this` isn't a {@link SassString}.
|
|
153
153
|
*
|
|
154
154
|
* @param name - The name of the function argument `this` came from (without
|
|
155
155
|
* the `$`) if it came from an argument. Used for error reporting.
|
package/types/value/list.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ export class SassList extends Value {
|
|
|
21
21
|
* Creates a new list.
|
|
22
22
|
*
|
|
23
23
|
* @param contents - The contents of the list. This may be either a plain
|
|
24
|
-
* JavaScript array or an immutable
|
|
24
|
+
* JavaScript array or an immutable {@link List} from the [`immutable`
|
|
25
25
|
* package](https://immutable-js.com/).
|
|
26
26
|
*
|
|
27
27
|
* @param options.separator - The separator to use between elements of this
|
package/types/value/map.d.ts
CHANGED
|
@@ -13,13 +13,13 @@ export class SassMap extends Value {
|
|
|
13
13
|
* Creates a new map.
|
|
14
14
|
*
|
|
15
15
|
* @param contents - The contents of the map. This is an immutable
|
|
16
|
-
*
|
|
16
|
+
* `OrderedMap` from the [`immutable` package](https://immutable-js.com/).
|
|
17
17
|
* Defaults to an empty map.
|
|
18
18
|
*/
|
|
19
19
|
constructor(contents?: OrderedMap<Value, Value>);
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
|
-
* Returns the contents of this map as an immutable
|
|
22
|
+
* Returns the contents of this map as an immutable {@link OrderedMap} from the
|
|
23
23
|
* [`immutable` package](https://immutable-js.com/).
|
|
24
24
|
*/
|
|
25
25
|
get contents(): OrderedMap<Value, Value>;
|
|
@@ -33,7 +33,7 @@ export class SassMap extends Value {
|
|
|
33
33
|
*/
|
|
34
34
|
get(key: Value): Value | undefined;
|
|
35
35
|
|
|
36
|
-
/** Inherited from
|
|
36
|
+
/** Inherited from {@link Value.get}. */
|
|
37
37
|
get(index: number): SassList | undefined;
|
|
38
38
|
|
|
39
39
|
/** @hidden */
|