sass 1.62.0 → 1.63.0
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 +3103 -2489
- 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/sass.default.cjs
ADDED
package/sass.default.js
CHANGED
|
@@ -1,8 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
util: require("util"),
|
|
4
|
-
immutable: require("immutable"),
|
|
5
|
-
fs: require("fs"),
|
|
6
|
-
});
|
|
1
|
+
import * as immutable from "immutable"
|
|
2
|
+
import "./sass.dart.js";
|
|
7
3
|
|
|
8
|
-
|
|
4
|
+
const _cliPkgLibrary = globalThis._cliPkgExports.pop();
|
|
5
|
+
if (globalThis._cliPkgExports.length === 0) delete globalThis._cliPkgExports;
|
|
6
|
+
const _cliPkgExports = {};
|
|
7
|
+
_cliPkgLibrary.load({immutable}, _cliPkgExports);
|
|
8
|
+
|
|
9
|
+
export const compile = _cliPkgExports.compile;
|
|
10
|
+
export const compileAsync = _cliPkgExports.compileAsync;
|
|
11
|
+
export const compileString = _cliPkgExports.compileString;
|
|
12
|
+
export const compileStringAsync = _cliPkgExports.compileStringAsync;
|
|
13
|
+
export const Logger = _cliPkgExports.Logger;
|
|
14
|
+
export const SassArgumentList = _cliPkgExports.SassArgumentList;
|
|
15
|
+
export const SassBoolean = _cliPkgExports.SassBoolean;
|
|
16
|
+
export const SassColor = _cliPkgExports.SassColor;
|
|
17
|
+
export const SassFunction = _cliPkgExports.SassFunction;
|
|
18
|
+
export const SassList = _cliPkgExports.SassList;
|
|
19
|
+
export const SassMap = _cliPkgExports.SassMap;
|
|
20
|
+
export const SassNumber = _cliPkgExports.SassNumber;
|
|
21
|
+
export const SassString = _cliPkgExports.SassString;
|
|
22
|
+
export const Value = _cliPkgExports.Value;
|
|
23
|
+
export const CustomFunction = _cliPkgExports.CustomFunction;
|
|
24
|
+
export const ListSeparator = _cliPkgExports.ListSeparator;
|
|
25
|
+
export const sassFalse = _cliPkgExports.sassFalse;
|
|
26
|
+
export const sassNull = _cliPkgExports.sassNull;
|
|
27
|
+
export const sassTrue = _cliPkgExports.sassTrue;
|
|
28
|
+
export const Exception = _cliPkgExports.Exception;
|
|
29
|
+
export const PromiseOr = _cliPkgExports.PromiseOr;
|
|
30
|
+
export const info = _cliPkgExports.info;
|
|
31
|
+
export const render = _cliPkgExports.render;
|
|
32
|
+
export const renderSync = _cliPkgExports.renderSync;
|
package/sass.js
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
require('./sass.dart.js');
|
|
4
|
+
var library = globalThis._cliPkgExports.pop();
|
|
5
|
+
if (globalThis._cliPkgExports.length === 0) delete globalThis._cliPkgExports;
|
|
6
|
+
|
|
4
7
|
library.load({
|
|
5
8
|
readline: require("readline"),
|
|
6
9
|
chokidar: require("chokidar"),
|
|
7
10
|
util: require("util"),
|
|
8
|
-
|
|
11
|
+
stream: require("stream"),
|
|
9
12
|
fs: require("fs"),
|
|
13
|
+
immutable: require("immutable"),
|
|
10
14
|
});
|
|
11
15
|
|
|
12
16
|
library.cli_pkg_main_0_(process.argv.slice(2));
|
package/sass.node.cjs
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
require('./sass.dart.js');
|
|
2
|
+
const library = globalThis._cliPkgExports.pop();
|
|
3
|
+
if (globalThis._cliPkgExports.length === 0) delete globalThis._cliPkgExports;
|
|
4
|
+
library.load({
|
|
5
|
+
util: require("util"),
|
|
6
|
+
stream: require("stream"),
|
|
7
|
+
fs: require("fs"),
|
|
8
|
+
immutable: require("immutable"),
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
module.exports = library;
|
package/sass.node.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as util from "util"
|
|
2
|
+
import * as stream from "stream"
|
|
3
|
+
import * as fs from "fs"
|
|
4
|
+
import * as immutable from "immutable"
|
|
5
|
+
import "./sass.dart.js";
|
|
6
|
+
|
|
7
|
+
const _cliPkgLibrary = globalThis._cliPkgExports.pop();
|
|
8
|
+
if (globalThis._cliPkgExports.length === 0) delete globalThis._cliPkgExports;
|
|
9
|
+
const _cliPkgExports = {};
|
|
10
|
+
_cliPkgLibrary.load({util, stream, fs, immutable}, _cliPkgExports);
|
|
11
|
+
|
|
12
|
+
export const compile = _cliPkgExports.compile;
|
|
13
|
+
export const compileAsync = _cliPkgExports.compileAsync;
|
|
14
|
+
export const compileString = _cliPkgExports.compileString;
|
|
15
|
+
export const compileStringAsync = _cliPkgExports.compileStringAsync;
|
|
16
|
+
export const Logger = _cliPkgExports.Logger;
|
|
17
|
+
export const SassArgumentList = _cliPkgExports.SassArgumentList;
|
|
18
|
+
export const SassBoolean = _cliPkgExports.SassBoolean;
|
|
19
|
+
export const SassColor = _cliPkgExports.SassColor;
|
|
20
|
+
export const SassFunction = _cliPkgExports.SassFunction;
|
|
21
|
+
export const SassList = _cliPkgExports.SassList;
|
|
22
|
+
export const SassMap = _cliPkgExports.SassMap;
|
|
23
|
+
export const SassNumber = _cliPkgExports.SassNumber;
|
|
24
|
+
export const SassString = _cliPkgExports.SassString;
|
|
25
|
+
export const Value = _cliPkgExports.Value;
|
|
26
|
+
export const CustomFunction = _cliPkgExports.CustomFunction;
|
|
27
|
+
export const ListSeparator = _cliPkgExports.ListSeparator;
|
|
28
|
+
export const sassFalse = _cliPkgExports.sassFalse;
|
|
29
|
+
export const sassNull = _cliPkgExports.sassNull;
|
|
30
|
+
export const sassTrue = _cliPkgExports.sassTrue;
|
|
31
|
+
export const Exception = _cliPkgExports.Exception;
|
|
32
|
+
export const PromiseOr = _cliPkgExports.PromiseOr;
|
|
33
|
+
export const info = _cliPkgExports.info;
|
|
34
|
+
export const render = _cliPkgExports.render;
|
|
35
|
+
export const renderSync = _cliPkgExports.renderSync;
|
package/types/compile.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ import {RawSourceMap} from 'source-map-js';
|
|
|
3
3
|
import {Options, StringOptions} from './options';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* The result of compiling Sass to CSS. Returned by
|
|
7
|
-
*
|
|
6
|
+
* The result of compiling Sass to CSS. Returned by {@link compile}, {@link
|
|
7
|
+
* compileAsync}, {@link compileString}, and {@link compileStringAsync}.
|
|
8
8
|
*
|
|
9
9
|
* @category Compile
|
|
10
10
|
*/
|
|
@@ -29,19 +29,20 @@ export interface CompileResult {
|
|
|
29
29
|
* generated CSS back to locations in the Sass source code.
|
|
30
30
|
*
|
|
31
31
|
* This typically uses absolute `file:` URLs to refer to Sass files, although
|
|
32
|
-
* this can be controlled by having a custom
|
|
33
|
-
*
|
|
32
|
+
* this can be controlled by having a custom {@link Importer} return {@link
|
|
33
|
+
* ImporterResult.sourceMapUrl}.
|
|
34
34
|
*
|
|
35
|
-
* This is set if and only if
|
|
35
|
+
* This is set if and only if {@link Options.sourceMap} is `true`.
|
|
36
36
|
*/
|
|
37
37
|
sourceMap?: RawSourceMap;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
41
|
* Synchronously compiles the Sass file at `path` to CSS. If it succeeds it
|
|
42
|
-
* returns a
|
|
42
|
+
* returns a {@link CompileResult}, and if it fails it throws an {@link
|
|
43
|
+
* Exception}.
|
|
43
44
|
*
|
|
44
|
-
* This only allows synchronous
|
|
45
|
+
* This only allows synchronous {@link Importer}s and {@link CustomFunction}s.
|
|
45
46
|
*
|
|
46
47
|
* @example
|
|
47
48
|
*
|
|
@@ -59,15 +60,15 @@ export function compile(path: string, options?: Options<'sync'>): CompileResult;
|
|
|
59
60
|
|
|
60
61
|
/**
|
|
61
62
|
* Asynchronously compiles the Sass file at `path` to CSS. Returns a promise
|
|
62
|
-
* that resolves with a
|
|
63
|
-
*
|
|
63
|
+
* that resolves with a {@link CompileResult} if it succeeds and rejects with an
|
|
64
|
+
* {@link Exception} if it fails.
|
|
64
65
|
*
|
|
65
|
-
* This only allows synchronous or asynchronous
|
|
66
|
-
*
|
|
66
|
+
* This only allows synchronous or asynchronous {@link Importer}s and
|
|
67
|
+
* {@link CustomFunction}s.
|
|
67
68
|
*
|
|
68
|
-
* **Heads up!** When using Dart Sass, **
|
|
69
|
-
*
|
|
70
|
-
* process asynchronous.
|
|
69
|
+
* **Heads up!** When using Dart Sass, **{@link compile} is almost twice as fast
|
|
70
|
+
* as {@link compileAsync}**, due to the overhead of making the entire
|
|
71
|
+
* evaluation process asynchronous.
|
|
71
72
|
*
|
|
72
73
|
* @example
|
|
73
74
|
*
|
|
@@ -88,10 +89,10 @@ export function compileAsync(
|
|
|
88
89
|
|
|
89
90
|
/**
|
|
90
91
|
* Synchronously compiles a stylesheet whose contents is `source` to CSS. If it
|
|
91
|
-
* succeeds it returns a
|
|
92
|
-
*
|
|
92
|
+
* succeeds it returns a {@link CompileResult}, and if it fails it throws an
|
|
93
|
+
* {@link Exception}.
|
|
93
94
|
*
|
|
94
|
-
* This only allows synchronous
|
|
95
|
+
* This only allows synchronous {@link Importer}s and {@link CustomFunction}s.
|
|
95
96
|
*
|
|
96
97
|
* @example
|
|
97
98
|
*
|
|
@@ -118,15 +119,15 @@ export function compileString(
|
|
|
118
119
|
|
|
119
120
|
/**
|
|
120
121
|
* Asynchronously compiles a stylesheet whose contents is `source` to CSS.
|
|
121
|
-
* Returns a promise that resolves with a
|
|
122
|
-
* rejects with an
|
|
122
|
+
* Returns a promise that resolves with a {@link CompileResult} if it succeeds
|
|
123
|
+
* and rejects with an {@link Exception} if it fails.
|
|
123
124
|
*
|
|
124
|
-
* This only allows synchronous or asynchronous
|
|
125
|
-
*
|
|
125
|
+
* This only allows synchronous or asynchronous {@link Importer}s and {@link
|
|
126
|
+
* CustomFunction}s.
|
|
126
127
|
*
|
|
127
|
-
* **Heads up!** When using Dart Sass, **
|
|
128
|
-
*
|
|
129
|
-
* process asynchronous.
|
|
128
|
+
* **Heads up!** When using Dart Sass, **{@link compile} is almost twice as fast
|
|
129
|
+
* as {@link compileAsync}**, due to the overhead of making the entire
|
|
130
|
+
* evaluation process asynchronous.
|
|
130
131
|
*
|
|
131
132
|
* @example
|
|
132
133
|
*
|
package/types/exception.d.ts
CHANGED
|
@@ -12,18 +12,18 @@ export class Exception extends Error {
|
|
|
12
12
|
* A human-friendly representation of the exception.
|
|
13
13
|
*
|
|
14
14
|
* Because many tools simply print `Error.message` directly, this includes not
|
|
15
|
-
* only the textual description of what went wrong (the
|
|
16
|
-
* also an indication of where in the Sass stylesheet the error occurred
|
|
17
|
-
*
|
|
18
|
-
*
|
|
15
|
+
* only the textual description of what went wrong (the {@link sassMessage})
|
|
16
|
+
* but also an indication of where in the Sass stylesheet the error occurred
|
|
17
|
+
* (the {@link span}) and the Sass stack trace at the point of error (the
|
|
18
|
+
* {@link sassStack}).
|
|
19
19
|
*/
|
|
20
20
|
message: string;
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* A textual description of what went wrong.
|
|
24
24
|
*
|
|
25
|
-
* Unlike
|
|
26
|
-
*
|
|
25
|
+
* Unlike {@link message}, this does *not* include representations of {@link
|
|
26
|
+
* span} or {@link sassStack}.
|
|
27
27
|
*/
|
|
28
28
|
readonly sassMessage: string;
|
|
29
29
|
|
|
@@ -36,6 +36,6 @@ export class Exception extends Error {
|
|
|
36
36
|
/** The location the error occurred in the Sass file that triggered it. */
|
|
37
37
|
readonly span: SourceSpan;
|
|
38
38
|
|
|
39
|
-
/** Returns the same string as
|
|
39
|
+
/** Returns the same string as {@link message}. */
|
|
40
40
|
toString(): string;
|
|
41
41
|
}
|
package/types/importer.d.ts
CHANGED
|
@@ -3,22 +3,23 @@ import {PromiseOr} from './util/promise_or';
|
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* A special type of importer that redirects all loads to existing files on
|
|
6
|
-
* disk. Although this is less powerful than a full
|
|
6
|
+
* disk. Although this is less powerful than a full {@link Importer}, it
|
|
7
7
|
* automatically takes care of Sass features like resolving partials and file
|
|
8
8
|
* extensions and of loading the file from disk.
|
|
9
9
|
*
|
|
10
10
|
* Like all importers, this implements custom Sass loading logic for [`@use`
|
|
11
11
|
* rules](https://sass-lang.com/documentation/at-rules/use) and [`@import`
|
|
12
12
|
* rules](https://sass-lang.com/documentation/at-rules/import). It can be passed
|
|
13
|
-
* to
|
|
13
|
+
* to {@link Options.importers} or {@link StringOptionsWithImporter.importer}.
|
|
14
14
|
*
|
|
15
|
-
* @typeParam sync - A `FileImporter<'sync'>`'s
|
|
16
|
-
* synchronously, but in return it can be passed to
|
|
17
|
-
*
|
|
15
|
+
* @typeParam sync - A `FileImporter<'sync'>`'s {@link findFileUrl} must return
|
|
16
|
+
* synchronously, but in return it can be passed to {@link compile} and {@link
|
|
17
|
+
* compileString} in addition to {@link compileAsync} and {@link
|
|
18
|
+
* compileStringAsync}.
|
|
18
19
|
*
|
|
19
|
-
* A `FileImporter<'async'>`'s
|
|
20
|
-
* or asynchronously, but it can only be used with
|
|
21
|
-
*
|
|
20
|
+
* A `FileImporter<'async'>`'s {@link findFileUrl} may either return
|
|
21
|
+
* synchronously or asynchronously, but it can only be used with {@link
|
|
22
|
+
* compileAsync} and {@link compileStringAsync}.
|
|
22
23
|
*
|
|
23
24
|
* @example
|
|
24
25
|
*
|
|
@@ -48,12 +49,12 @@ export interface FileImporter<
|
|
|
48
49
|
* [`@import`](https://sass-lang.com/documentation/at-rules/import)) to a file
|
|
49
50
|
* on disk.
|
|
50
51
|
*
|
|
51
|
-
* Unlike an
|
|
52
|
-
* loads for a
|
|
53
|
-
* the way loads are resolved.
|
|
52
|
+
* Unlike an {@link Importer}, the compiler will automatically handle relative
|
|
53
|
+
* loads for a {@link FileImporter}. See {@link Options.importers} for more
|
|
54
|
+
* details on the way loads are resolved.
|
|
54
55
|
*
|
|
55
56
|
* @param url - The loaded URL. Since this might be relative, it's represented
|
|
56
|
-
* as a string rather than a
|
|
57
|
+
* as a string rather than a {@link URL} object.
|
|
57
58
|
*
|
|
58
59
|
* @param options.fromImport - Whether this is being invoked because of a Sass
|
|
59
60
|
* `@import` rule, as opposed to a `@use` or `@forward` rule.
|
|
@@ -73,8 +74,8 @@ export interface FileImporter<
|
|
|
73
74
|
* handle it.
|
|
74
75
|
*
|
|
75
76
|
* This may also return a `Promise`, but if it does the importer may only be
|
|
76
|
-
* passed to
|
|
77
|
-
*
|
|
77
|
+
* passed to {@link compileAsync} and {@link compileStringAsync}, not {@link
|
|
78
|
+
* compile} or {@link compileString}.
|
|
78
79
|
*
|
|
79
80
|
* @throws any - If this importer recognizes `url` but determines that it's
|
|
80
81
|
* invalid, it may throw an exception that will be wrapped by Sass. If the
|
|
@@ -95,35 +96,38 @@ export interface FileImporter<
|
|
|
95
96
|
* An object that implements custom Sass loading logic for [`@use`
|
|
96
97
|
* rules](https://sass-lang.com/documentation/at-rules/use) and [`@import`
|
|
97
98
|
* rules](https://sass-lang.com/documentation/at-rules/import). It can be passed
|
|
98
|
-
* to
|
|
99
|
+
* to {@link Options.importers} or {@link StringOptionsWithImporter.importer}.
|
|
99
100
|
*
|
|
100
101
|
* Importers that simply redirect to files on disk are encouraged to use the
|
|
101
|
-
*
|
|
102
|
+
* {@link FileImporter} interface instead.
|
|
102
103
|
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
* @typeParam sync - An `Importer<'sync'>`'s [[canonicalize]] and [[load]] must
|
|
106
|
-
* return synchronously, but in return it can be passed to [[compile]] and
|
|
107
|
-
* [[compileString]] in addition to [[compileAsync]] and [[compileStringAsync]].
|
|
108
|
-
*
|
|
109
|
-
* An `Importer<'async'>`'s [[canonicalize]] and [[load]] may either return
|
|
110
|
-
* synchronously or asynchronously, but it can only be used with
|
|
111
|
-
* [[compileAsync]] and [[compileStringAsync]].
|
|
112
|
-
*
|
|
113
|
-
* @example Resolving a Load
|
|
104
|
+
* ### Resolving a Load
|
|
114
105
|
*
|
|
115
106
|
* This is the process of resolving a load using a custom importer:
|
|
116
107
|
*
|
|
117
108
|
* - The compiler encounters `@use "db:foo/bar/baz"`.
|
|
118
|
-
* - It calls
|
|
119
|
-
* -
|
|
109
|
+
* - It calls {@link canonicalize} with `"db:foo/bar/baz"`.
|
|
110
|
+
* - {@link canonicalize} returns `new URL("db:foo/bar/baz/_index.scss")`.
|
|
120
111
|
* - If the compiler has already loaded a stylesheet with this canonical URL, it
|
|
121
112
|
* re-uses the existing module.
|
|
122
|
-
* - Otherwise, it calls
|
|
123
|
-
*
|
|
124
|
-
*
|
|
113
|
+
* - Otherwise, it calls {@link load} with `new
|
|
114
|
+
* URL("db:foo/bar/baz/_index.scss")`.
|
|
115
|
+
* - {@link load} returns an {@link ImporterResult} that the compiler uses as
|
|
116
|
+
* the contents of the module.
|
|
117
|
+
*
|
|
118
|
+
* See {@link Options.importers} for more details on the way loads are resolved
|
|
119
|
+
* using multiple importers and load paths.
|
|
125
120
|
*
|
|
126
|
-
* @
|
|
121
|
+
* @typeParam sync - An `Importer<'sync'>`'s {@link canonicalize} and {@link
|
|
122
|
+
* load} must return synchronously, but in return it can be passed to {@link
|
|
123
|
+
* compile} and {@link compileString} in addition to {@link compileAsync} and
|
|
124
|
+
* {@link compileStringAsync}.
|
|
125
|
+
*
|
|
126
|
+
* An `Importer<'async'>`'s {@link canonicalize} and {@link load} may either
|
|
127
|
+
* return synchronously or asynchronously, but it can only be used with {@link
|
|
128
|
+
* compileAsync} and {@link compileStringAsync}.
|
|
129
|
+
*
|
|
130
|
+
* @example
|
|
127
131
|
*
|
|
128
132
|
* ```js
|
|
129
133
|
* sass.compile('style.scss', {
|
|
@@ -192,29 +196,29 @@ export interface Importer<sync extends 'sync' | 'async' = 'sync' | 'async'> {
|
|
|
192
196
|
*
|
|
193
197
|
* If no stylesheets are found, the importer should return `null`.
|
|
194
198
|
*
|
|
195
|
-
* Calling
|
|
196
|
-
* same result. Calling
|
|
197
|
-
* call to
|
|
199
|
+
* Calling {@link canonicalize} multiple times with the same URL must return
|
|
200
|
+
* the same result. Calling {@link canonicalize} with a URL returned by a
|
|
201
|
+
* previous call to {@link canonicalize} must return that URL.
|
|
198
202
|
*
|
|
199
203
|
* Relative loads in stylesheets loaded from an importer are handled by
|
|
200
204
|
* resolving the loaded URL relative to the canonical URL of the stylesheet
|
|
201
|
-
* that contains it, and passing that URL back to the importer's
|
|
202
|
-
*
|
|
203
|
-
*
|
|
204
|
-
*
|
|
205
|
+
* that contains it, and passing that URL back to the importer's {@link
|
|
206
|
+
* canonicalize} method. For example, suppose the "Resolving a Load" example
|
|
207
|
+
* {@link Importer | above} returned a stylesheet that contained `@use
|
|
208
|
+
* "mixins"`:
|
|
205
209
|
*
|
|
206
210
|
* - The compiler resolves the URL `mixins` relative to the current
|
|
207
211
|
* stylesheet's canonical URL `db:foo/bar/baz/_index.scss` to get
|
|
208
212
|
* `db:foo/bar/baz/mixins`.
|
|
209
|
-
* - It calls
|
|
210
|
-
* -
|
|
213
|
+
* - It calls {@link canonicalize} with `"db:foo/bar/baz/mixins"`.
|
|
214
|
+
* - {@link canonicalize} returns `new URL("db:foo/bar/baz/_mixins.scss")`.
|
|
211
215
|
*
|
|
212
|
-
* Because of this,
|
|
213
|
-
* called with a URL relative to one returned by an earlier call to
|
|
214
|
-
*
|
|
216
|
+
* Because of this, {@link canonicalize} must return a meaningful result when
|
|
217
|
+
* called with a URL relative to one returned by an earlier call to {@link
|
|
218
|
+
* canonicalize}.
|
|
215
219
|
*
|
|
216
220
|
* @param url - The loaded URL. Since this might be relative, it's represented
|
|
217
|
-
* as a string rather than a
|
|
221
|
+
* as a string rather than a {@link URL} object.
|
|
218
222
|
*
|
|
219
223
|
* @param options.fromImport - Whether this is being invoked because of a Sass
|
|
220
224
|
* `@import` rule, as opposed to a `@use` or `@forward` rule.
|
|
@@ -227,8 +231,8 @@ export interface Importer<sync extends 'sync' | 'async' = 'sync' | 'async'> {
|
|
|
227
231
|
* Options.loadPaths | load paths} may handle the load.
|
|
228
232
|
*
|
|
229
233
|
* This may also return a `Promise`, but if it does the importer may only be
|
|
230
|
-
* passed to
|
|
231
|
-
*
|
|
234
|
+
* passed to {@link compileAsync} and {@link compileStringAsync}, not {@link
|
|
235
|
+
* compile} or {@link compileString}.
|
|
232
236
|
*
|
|
233
237
|
* @throws any - If this importer recognizes `url` but determines that it's
|
|
234
238
|
* invalid, it may throw an exception that will be wrapped by Sass. If the
|
|
@@ -246,15 +250,15 @@ export interface Importer<sync extends 'sync' | 'async' = 'sync' | 'async'> {
|
|
|
246
250
|
* importer can't find the stylesheet it refers to.
|
|
247
251
|
*
|
|
248
252
|
* @param canonicalUrl - The canonical URL of the stylesheet to load. This is
|
|
249
|
-
* guaranteed to come from a call to
|
|
250
|
-
* to
|
|
253
|
+
* guaranteed to come from a call to {@link canonicalize}, although not every
|
|
254
|
+
* call to {@link canonicalize} will result in a call to {@link load}.
|
|
251
255
|
*
|
|
252
256
|
* @returns The contents of the stylesheet at `canonicalUrl` if it can be
|
|
253
257
|
* loaded, or `null` if it can't.
|
|
254
258
|
*
|
|
255
259
|
* This may also return a `Promise`, but if it does the importer may only be
|
|
256
|
-
* passed to
|
|
257
|
-
*
|
|
260
|
+
* passed to {@link compileAsync} and {@link compileStringAsync}, not {@link
|
|
261
|
+
* compile} or {@link compileString}.
|
|
258
262
|
*
|
|
259
263
|
* @throws any - If this importer finds a stylesheet at `url` but it fails to
|
|
260
264
|
* load for some reason, or if `url` is uniquely associated with this importer
|
|
@@ -271,7 +275,7 @@ export interface Importer<sync extends 'sync' | 'async' = 'sync' | 'async'> {
|
|
|
271
275
|
}
|
|
272
276
|
|
|
273
277
|
/**
|
|
274
|
-
* The result of successfully loading a stylesheet with an
|
|
278
|
+
* The result of successfully loading a stylesheet with an {@link Importer}.
|
|
275
279
|
*
|
|
276
280
|
* @category Importer
|
|
277
281
|
*/
|
|
@@ -279,7 +283,7 @@ export interface ImporterResult {
|
|
|
279
283
|
/** The contents of the stylesheet. */
|
|
280
284
|
contents: string;
|
|
281
285
|
|
|
282
|
-
/** The syntax with which to parse
|
|
286
|
+
/** The syntax with which to parse {@link contents}. */
|
|
283
287
|
syntax: Syntax;
|
|
284
288
|
|
|
285
289
|
/**
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The exception type thrown by
|
|
3
|
-
*
|
|
2
|
+
* The exception type thrown by {@link renderSync} and passed as the error to
|
|
3
|
+
* {@link render}'s callback.
|
|
4
4
|
*
|
|
5
5
|
* @category Legacy
|
|
6
|
-
* @deprecated This is only thrown by the legacy
|
|
7
|
-
* APIs. Use
|
|
8
|
-
*
|
|
6
|
+
* @deprecated This is only thrown by the legacy {@link render} and {@link
|
|
7
|
+
* renderSync} APIs. Use {@link compile}, {@link compileString}, {@link
|
|
8
|
+
* compileAsync}, and {@link compileStringAsync} instead.
|
|
9
9
|
*/
|
|
10
10
|
export interface LegacyException extends Error {
|
|
11
11
|
/**
|
|
@@ -17,8 +17,8 @@ export interface LegacyException extends Error {
|
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* The error message. For Dart Sass, this is the same as the result of calling
|
|
20
|
-
*
|
|
21
|
-
* "Error:".
|
|
20
|
+
* {@link toString}, which is itself the same as {@link message} but with the
|
|
21
|
+
* prefix "Error:".
|
|
22
22
|
*/
|
|
23
23
|
formatted: string;
|
|
24
24
|
|
|
@@ -29,8 +29,9 @@ export interface LegacyException extends Error {
|
|
|
29
29
|
line?: number;
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
|
-
* The (1-based) column number within
|
|
33
|
-
* this exception is associated with a specific Sass file
|
|
32
|
+
* The (1-based) column number within {@link line} at which the error
|
|
33
|
+
* occurred, if this exception is associated with a specific Sass file
|
|
34
|
+
* location.
|
|
34
35
|
*/
|
|
35
36
|
column?: number;
|
|
36
37
|
|
|
@@ -46,9 +47,9 @@ export interface LegacyException extends Error {
|
|
|
46
47
|
*
|
|
47
48
|
* * If the Sass file was loaded from disk, this is the path to that file.
|
|
48
49
|
* * If the Sass file was generated by an importer, this is its canonical URL.
|
|
49
|
-
* * If the Sass file was passed as
|
|
50
|
-
* corresponding
|
|
51
|
-
* `"stdin"`.
|
|
50
|
+
* * If the Sass file was passed as {@link LegacyStringOptions.data} without a
|
|
51
|
+
* corresponding {@link LegacyStringOptions.file}, this is the special
|
|
52
|
+
* string `"stdin"`.
|
|
52
53
|
*/
|
|
53
54
|
file?: string;
|
|
54
55
|
}
|