Comparing version 1.52.3 to 1.69.5
@@ -1,1 +0,1 @@ | ||
{"name":"sass","description":"A pure JavaScript implementation of Sass.","license":"MIT","bugs":"https://github.com/sass/dart-sass/issues","homepage":"https://github.com/sass/dart-sass","repository":{"type":"git","url":"https://github.com/sass/dart-sass"},"author":{"name":"Natalie Weizenbaum","email":"nweiz@google.com","url":"https://github.com/nex3"},"engines":{"node":">=12.0.0"},"dependencies":{"chokidar":">=3.0.0 <4.0.0","immutable":"^4.0.0","source-map-js":">=0.6.2 <2.0.0"},"keywords":["style","scss","sass","preprocessor","css"],"types":"types/index.d.ts","version":"1.52.3","bin":{"sass":"sass.js"},"main":"sass.default.dart.js","exports":{"default":"./sass.default.dart.js"}} | ||
{"name":"sass","description":"A pure JavaScript implementation of Sass.","license":"MIT","bugs":"https://github.com/sass/dart-sass/issues","homepage":"https://github.com/sass/dart-sass","repository":{"type":"git","url":"https://github.com/sass/dart-sass"},"author":{"name":"Natalie Weizenbaum","email":"nweiz@google.com","url":"https://github.com/nex3"},"engines":{"node":">=14.0.0"},"dependencies":{"chokidar":">=3.0.0 <4.0.0","immutable":"^4.0.0","source-map-js":">=0.6.2 <2.0.0"},"keywords":["style","scss","sass","preprocessor","css"],"types":"types/index.d.ts","exports":{"types":"./types/index.d.ts","node":{"require":"./sass.node.js","default":"./sass.node.mjs"},"default":{"require":"./sass.default.cjs","default":"./sass.default.js"}},"version":"1.69.5","bin":{"sass":"sass.js"},"main":"sass.node.js"} |
@@ -63,4 +63,4 @@ A pure JavaScript implementation of [Sass][sass]. **Sass makes CSS fun again**. | ||
[Node Sass]: https://github.com/sass/node-sass | ||
[`render()`]: https://sass-lang.com/documentation/js-api/modules#render | ||
[`renderSync()`]: https://sass-lang.com/documentation/js-api/modules#renderSync | ||
[`render()`]: https://sass-lang.com/documentation/js-api/functions/render | ||
[`renderSync()`]: https://sass-lang.com/documentation/js-api/functions/renderSync | ||
@@ -67,0 +67,0 @@ Sass's support for the legacy JavaScript API has the following limitations: |
#!/usr/bin/env node | ||
var library = require('./sass.dart.js'); | ||
require('./sass.dart.js'); | ||
var library = globalThis._cliPkgExports.pop(); | ||
if (globalThis._cliPkgExports.length === 0) delete globalThis._cliPkgExports; | ||
library.load({ | ||
readline: require("readline"), | ||
chokidar: require("chokidar"), | ||
util: require("util"), | ||
stream: require("stream"), | ||
fs: require("fs"), | ||
immutable: require("immutable"), | ||
}); | ||
library.cli_pkg_main_0_(process.argv.slice(2)); |
@@ -6,4 +6,4 @@ import {RawSourceMap} from 'source-map-js'; | ||
/** | ||
* The result of compiling Sass to CSS. Returned by [[compile]], | ||
* [[compileAsync]], [[compileString]], and [[compileStringAsync]]. | ||
* The result of compiling Sass to CSS. Returned by {@link compile}, {@link | ||
* compileAsync}, {@link compileString}, and {@link compileStringAsync}. | ||
* | ||
@@ -33,6 +33,6 @@ * @category Compile | ||
* This typically uses absolute `file:` URLs to refer to Sass files, although | ||
* this can be controlled by having a custom [[Importer]] return | ||
* [[ImporterResult.sourceMapUrl]]. | ||
* this can be controlled by having a custom {@link Importer} return {@link | ||
* ImporterResult.sourceMapUrl}. | ||
* | ||
* This is set if and only if [[Options.sourceMap]] is `true`. | ||
* This is set if and only if {@link Options.sourceMap} is `true`. | ||
*/ | ||
@@ -44,6 +44,12 @@ sourceMap?: RawSourceMap; | ||
* Synchronously compiles the Sass file at `path` to CSS. If it succeeds it | ||
* returns a [[CompileResult]], and if it fails it throws an [[Exception]]. | ||
* returns a {@link CompileResult}, and if it fails it throws an {@link | ||
* Exception}. | ||
* | ||
* This only allows synchronous [[Importer]]s and [[CustomFunction]]s. | ||
* This only allows synchronous {@link Importer}s and {@link CustomFunction}s. | ||
* | ||
* **Heads up!** When using the `sass-embedded` npm package, | ||
* **{@link compileAsync} is almost always faster than {@link compile}**, due to | ||
* the overhead of emulating synchronous messaging with worker threads and | ||
* concurrent compilations being blocked on main thread. | ||
* | ||
* @example | ||
@@ -65,11 +71,11 @@ * | ||
* Asynchronously compiles the Sass file at `path` to CSS. Returns a promise | ||
* that resolves with a [[CompileResult]] if it succeeds and rejects with an | ||
* [[Exception]] if it fails. | ||
* that resolves with a {@link CompileResult} if it succeeds and rejects with an | ||
* {@link Exception} if it fails. | ||
* | ||
* This only allows synchronous or asynchronous [[Importer]]s and | ||
* [[CustomFunction]]s. | ||
* This only allows synchronous or asynchronous {@link Importer}s and | ||
* {@link CustomFunction}s. | ||
* | ||
* **Heads up!** When using Dart Sass, **[[compile]] is almost twice as fast as | ||
* [[compileAsync]]**, due to the overhead of making the entire evaluation | ||
* process asynchronous. | ||
* **Heads up!** When using the `sass` npm package, **{@link compile} is almost | ||
* twice as fast as {@link compileAsync}**, due to the overhead of making the | ||
* entire evaluation process asynchronous. | ||
* | ||
@@ -95,7 +101,13 @@ * @example | ||
* Synchronously compiles a stylesheet whose contents is `source` to CSS. If it | ||
* succeeds it returns a [[CompileResult]], and if it fails it throws an | ||
* [[Exception]]. | ||
* succeeds it returns a {@link CompileResult}, and if it fails it throws an | ||
* {@link Exception}. | ||
* | ||
* This only allows synchronous [[Importer]]s and [[CustomFunction]]s. | ||
* This only allows synchronous {@link Importer}s and {@link CustomFunction}s. | ||
* | ||
* **Heads up!** When using the `sass-embedded` npm package, | ||
* **{@link compileStringAsync} is almost always faster than | ||
* {@link compileString}**, due to the overhead of emulating synchronous | ||
* messaging with worker threads and concurrent compilations being blocked on | ||
* main thread. | ||
* | ||
* @example | ||
@@ -126,11 +138,11 @@ * | ||
* Asynchronously compiles a stylesheet whose contents is `source` to CSS. | ||
* Returns a promise that resolves with a [[CompileResult]] if it succeeds and | ||
* rejects with an [[Exception]] if it fails. | ||
* Returns a promise that resolves with a {@link CompileResult} if it succeeds | ||
* and rejects with an {@link Exception} if it fails. | ||
* | ||
* This only allows synchronous or asynchronous [[Importer]]s and | ||
* [[CustomFunction]]s. | ||
* This only allows synchronous or asynchronous {@link Importer}s and {@link | ||
* CustomFunction}s. | ||
* | ||
* **Heads up!** When using Dart Sass, **[[compile]] is almost twice as fast as | ||
* [[compileAsync]]**, due to the overhead of making the entire evaluation | ||
* process asynchronous. | ||
* **Heads up!** When using the `sass` npm package, **{@link compileString} is | ||
* almost twice as fast as {@link compileStringAsync}**, due to the overhead | ||
* of making the entire evaluation process asynchronous. | ||
* | ||
@@ -137,0 +149,0 @@ * @example |
@@ -15,6 +15,6 @@ import {SourceSpan} from './logger'; | ||
* Because many tools simply print `Error.message` directly, this includes not | ||
* only the textual description of what went wrong (the [[sassMessage]]) but | ||
* also an indication of where in the Sass stylesheet the error occurred (the | ||
* [[span]]) and the Sass stack trace at the point of error (the | ||
* [[sassStack]]). | ||
* only the textual description of what went wrong (the {@link sassMessage}) | ||
* but also an indication of where in the Sass stylesheet the error occurred | ||
* (the {@link span}) and the Sass stack trace at the point of error (the | ||
* {@link sassStack}). | ||
*/ | ||
@@ -26,4 +26,4 @@ message: string; | ||
* | ||
* Unlike [[message]], this does *not* include representations of [[span]] or | ||
* [[sassStack]]. | ||
* Unlike {@link message}, this does *not* include representations of {@link | ||
* span} or {@link sassStack}. | ||
*/ | ||
@@ -41,4 +41,4 @@ readonly sassMessage: string; | ||
/** Returns the same string as [[message]]. */ | ||
/** Returns the same string as {@link message}. */ | ||
toString(): string; | ||
} |
@@ -5,4 +5,36 @@ import {Syntax} from './options'; | ||
/** | ||
* Contextual information passed to {@link Importer.canonicalize} and {@link | ||
* FileImporter.findFileUrl}. Not all importers will need this information to | ||
* resolve loads, but some may find it useful. | ||
*/ | ||
export interface CanonicalizeContext { | ||
/** | ||
* Whether this is being invoked because of a Sass | ||
* `@import` rule, as opposed to a `@use` or `@forward` rule. | ||
* | ||
* This should *only* be used for determining whether or not to load | ||
* [import-only files](https://sass-lang.com/documentation/at-rules/import#import-only-files). | ||
*/ | ||
fromImport: boolean; | ||
/** | ||
* The canonical URL of the file that contains the load, if that information | ||
* is available. | ||
* | ||
* For an {@link Importer}, this is only passed when the `url` parameter is a | ||
* relative URL _or_ when its [URL scheme] is included in {@link | ||
* Importer.nonCanonicalScheme}. This ensures that canonical URLs are always | ||
* resolved the same way regardless of context. | ||
* | ||
* [URL scheme]: https://developer.mozilla.org/en-US/docs/Learn/Common_questions/Web_mechanics/What_is_a_URL#scheme | ||
* | ||
* For a {@link FileImporter}, this is always available as long as Sass knows | ||
* the canonical URL of the containing file. | ||
*/ | ||
containingUrl: URL | null; | ||
} | ||
/** | ||
* A special type of importer that redirects all loads to existing files on | ||
* disk. Although this is less powerful than a full [[Importer]], it | ||
* disk. Although this is less powerful than a full {@link Importer}, it | ||
* automatically takes care of Sass features like resolving partials and file | ||
@@ -14,11 +46,12 @@ * extensions and of loading the file from disk. | ||
* rules](https://sass-lang.com/documentation/at-rules/import). It can be passed | ||
* to [[Options.importers]] or [[StringOptionsWithImporter.importer]]. | ||
* to {@link Options.importers} or {@link StringOptionsWithImporter.importer}. | ||
* | ||
* @typeParam sync - A `FileImporter<'sync'>`'s [[findFileUrl]] must return | ||
* synchronously, but in return it can be passed to [[compile]] and | ||
* [[compileString]] in addition to [[compileAsync]] and [[compileStringAsync]]. | ||
* @typeParam sync - A `FileImporter<'sync'>`'s {@link findFileUrl} must return | ||
* synchronously, but in return it can be passed to {@link compile} and {@link | ||
* compileString} in addition to {@link compileAsync} and {@link | ||
* compileStringAsync}. | ||
* | ||
* A `FileImporter<'async'>`'s [[findFileUrl]] may either return synchronously | ||
* or asynchronously, but it can only be used with [[compileAsync]] and | ||
* [[compileStringAsync]]. | ||
* A `FileImporter<'async'>`'s {@link findFileUrl} may either return | ||
* synchronously or asynchronously, but it can only be used with {@link | ||
* compileAsync} and {@link compileStringAsync}. | ||
* | ||
@@ -53,15 +86,9 @@ * @example | ||
* | ||
* Unlike an [[Importer]], the compiler will automatically handle relative | ||
* loads for a [[FileImporter]]. See [[Options.importers]] for more details on | ||
* the way loads are resolved. | ||
* Unlike an {@link Importer}, the compiler will automatically handle relative | ||
* loads for a {@link FileImporter}. See {@link Options.importers} for more | ||
* details on the way loads are resolved. | ||
* | ||
* @param url - The loaded URL. Since this might be relative, it's represented | ||
* as a string rather than a [[URL]] object. | ||
* as a string rather than a {@link URL} object. | ||
* | ||
* @param options.fromImport - Whether this is being invoked because of a Sass | ||
* `@import` rule, as opposed to a `@use` or `@forward` rule. | ||
* | ||
* This should *only* be used for determining whether or not to load | ||
* [import-only files](https://sass-lang.com/documentation/at-rules/import#import-only-files). | ||
* | ||
* @returns An absolute `file:` URL if this importer recognizes the `url`. | ||
@@ -79,4 +106,4 @@ * This may be only partially resolved: the compiler will automatically look | ||
* This may also return a `Promise`, but if it does the importer may only be | ||
* passed to [[compileAsync]] and [[compileStringAsync]], not [[compile]] or | ||
* [[compileString]]. | ||
* passed to {@link compileAsync} and {@link compileStringAsync}, not {@link | ||
* compile} or {@link compileString}. | ||
* | ||
@@ -91,3 +118,3 @@ * @throws any - If this importer recognizes `url` but determines that it's | ||
url: string, | ||
options: {fromImport: boolean} | ||
context: CanonicalizeContext | ||
): PromiseOr<URL | null, sync>; | ||
@@ -103,32 +130,35 @@ | ||
* rules](https://sass-lang.com/documentation/at-rules/import). It can be passed | ||
* to [[Options.importers]] or [[StringOptionsWithImporter.importer]]. | ||
* to {@link Options.importers} or {@link StringOptionsWithImporter.importer}. | ||
* | ||
* Importers that simply redirect to files on disk are encouraged to use the | ||
* [[FileImporter]] interface instead. | ||
* {@link FileImporter} interface instead. | ||
* | ||
* See [[Options.importers]] for more details on the way loads are resolved. | ||
* ### Resolving a Load | ||
* | ||
* @typeParam sync - An `Importer<'sync'>`'s [[canonicalize]] and [[load]] must | ||
* return synchronously, but in return it can be passed to [[compile]] and | ||
* [[compileString]] in addition to [[compileAsync]] and [[compileStringAsync]]. | ||
* | ||
* An `Importer<'async'>`'s [[canonicalize]] and [[load]] may either return | ||
* synchronously or asynchronously, but it can only be used with | ||
* [[compileAsync]] and [[compileStringAsync]]. | ||
* | ||
* @example Resolving a Load | ||
* | ||
* This is the process of resolving a load using a custom importer: | ||
* | ||
* - The compiler encounters `@use "db:foo/bar/baz"`. | ||
* - It calls [[canonicalize]] with `"db:foo/bar/baz"`. | ||
* - [[canonicalize]] returns `new URL("db:foo/bar/baz/_index.scss")`. | ||
* - It calls {@link canonicalize} with `"db:foo/bar/baz"`. | ||
* - {@link canonicalize} returns `new URL("db:foo/bar/baz/_index.scss")`. | ||
* - If the compiler has already loaded a stylesheet with this canonical URL, it | ||
* re-uses the existing module. | ||
* - Otherwise, it calls [[load]] with `new URL("db:foo/bar/baz/_index.scss")`. | ||
* - [[load]] returns an [[ImporterResult]] that the compiler uses as the | ||
* contents of the module. | ||
* - Otherwise, it calls {@link load} with `new | ||
* URL("db:foo/bar/baz/_index.scss")`. | ||
* - {@link load} returns an {@link ImporterResult} that the compiler uses as | ||
* the contents of the module. | ||
* | ||
* @example Code Sample | ||
* See {@link Options.importers} for more details on the way loads are resolved | ||
* using multiple importers and load paths. | ||
* | ||
* @typeParam sync - An `Importer<'sync'>`'s {@link canonicalize} and {@link | ||
* load} must return synchronously, but in return it can be passed to {@link | ||
* compile} and {@link compileString} in addition to {@link compileAsync} and | ||
* {@link compileStringAsync}. | ||
* | ||
* An `Importer<'async'>`'s {@link canonicalize} and {@link load} may either | ||
* return synchronously or asynchronously, but it can only be used with {@link | ||
* compileAsync} and {@link compileStringAsync}. | ||
* | ||
* @example | ||
* | ||
* ```js | ||
@@ -201,12 +231,12 @@ * sass.compile('style.scss', { | ||
* | ||
* Calling [[canonicalize]] multiple times with the same URL must return the | ||
* same result. Calling [[canonicalize]] with a URL returned by a previous | ||
* call to [[canonicalize]] must return that URL. | ||
* Calling {@link canonicalize} multiple times with the same URL must return | ||
* the same result. Calling {@link canonicalize} with a URL returned by a | ||
* previous call to {@link canonicalize} must return that URL. | ||
* | ||
* Relative loads in stylesheets loaded from an importer are handled by | ||
* resolving the loaded URL relative to the canonical URL of the stylesheet | ||
* that contains it, and passing that URL back to the importer's | ||
* [[canonicalize]] method. For example, suppose the "Resolving a Load" | ||
* example {@link Importer | above} returned a stylesheet that contained | ||
* `@use "mixins"`: | ||
* that contains it, and passing that URL back to the importer's {@link | ||
* canonicalize} method. For example, suppose the "Resolving a Load" example | ||
* {@link Importer | above} returned a stylesheet that contained `@use | ||
* "mixins"`: | ||
* | ||
@@ -216,18 +246,12 @@ * - The compiler resolves the URL `mixins` relative to the current | ||
* `db:foo/bar/baz/mixins`. | ||
* - It calls [[canonicalize]] with `"db:foo/bar/baz/mixins"`. | ||
* - [[canonicalize]] returns `new URL("db:foo/bar/baz/_mixins.scss")`. | ||
* - It calls {@link canonicalize} with `"db:foo/bar/baz/mixins"`. | ||
* - {@link canonicalize} returns `new URL("db:foo/bar/baz/_mixins.scss")`. | ||
* | ||
* Because of this, [[canonicalize]] must return a meaningful result when | ||
* called with a URL relative to one returned by an earlier call to | ||
* [[canonicalize]]. | ||
* Because of this, {@link canonicalize} must return a meaningful result when | ||
* called with a URL relative to one returned by an earlier call to {@link | ||
* canonicalize}. | ||
* | ||
* @param url - The loaded URL. Since this might be relative, it's represented | ||
* as a string rather than a [[URL]] object. | ||
* as a string rather than a {@link URL} object. | ||
* | ||
* @param options.fromImport - Whether this is being invoked because of a Sass | ||
* `@import` rule, as opposed to a `@use` or `@forward` rule. | ||
* | ||
* This should *only* be used for determining whether or not to load | ||
* [import-only files](https://sass-lang.com/documentation/at-rules/import#import-only-files). | ||
* | ||
* @returns An absolute URL if this importer recognizes the `url`, or `null` | ||
@@ -238,4 +262,4 @@ * if it doesn't. If this returns `null`, other importers or {@link | ||
* This may also return a `Promise`, but if it does the importer may only be | ||
* passed to [[compileAsync]] and [[compileStringAsync]], not [[compile]] or | ||
* [[compileString]]. | ||
* passed to {@link compileAsync} and {@link compileStringAsync}, not {@link | ||
* compile} or {@link compileString}. | ||
* | ||
@@ -250,3 +274,3 @@ * @throws any - If this importer recognizes `url` but determines that it's | ||
url: string, | ||
options: {fromImport: boolean} | ||
context: CanonicalizeContext | ||
): PromiseOr<URL | null, sync>; | ||
@@ -259,4 +283,4 @@ | ||
* @param canonicalUrl - The canonical URL of the stylesheet to load. This is | ||
* guaranteed to come from a call to [[canonicalize]], although not every call | ||
* to [[canonicalize]] will result in a call to [[load]]. | ||
* guaranteed to come from a call to {@link canonicalize}, although not every | ||
* call to {@link canonicalize} will result in a call to {@link load}. | ||
* | ||
@@ -267,4 +291,4 @@ * @returns The contents of the stylesheet at `canonicalUrl` if it can be | ||
* This may also return a `Promise`, but if it does the importer may only be | ||
* passed to [[compileAsync]] and [[compileStringAsync]], not [[compile]] or | ||
* [[compileString]]. | ||
* passed to {@link compileAsync} and {@link compileStringAsync}, not {@link | ||
* compile} or {@link compileString}. | ||
* | ||
@@ -283,6 +307,20 @@ * @throws any - If this importer finds a stylesheet at `url` but it fails to | ||
findFileUrl?: never; | ||
/** | ||
* A URL scheme or set of schemes (without the `:`) that this importer | ||
* promises never to use for URLs returned by {@link canonicalize}. If it does | ||
* return a URL with one of these schemes, that's an error. | ||
* | ||
* If this is set, any call to canonicalize for a URL with a non-canonical | ||
* scheme will be passed {@link CanonicalizeContext.containingUrl} if it's | ||
* known. | ||
* | ||
* These schemes may only contain lowercase ASCII letters, ASCII numerals, | ||
* `+`, `-`, and `.`. They may not be empty. | ||
*/ | ||
nonCanonicalScheme?: string | string[]; | ||
} | ||
/** | ||
* The result of successfully loading a stylesheet with an [[Importer]]. | ||
* The result of successfully loading a stylesheet with an {@link Importer}. | ||
* | ||
@@ -295,3 +333,3 @@ * @category Importer | ||
/** The syntax with which to parse [[contents]]. */ | ||
/** The syntax with which to parse {@link contents}. */ | ||
syntax: Syntax; | ||
@@ -298,0 +336,0 @@ |
@@ -13,3 +13,8 @@ // This is a mirror of the JS API definitions in `spec/js-api`, but with comments | ||
export {Exception} from './exception'; | ||
export {FileImporter, Importer, ImporterResult} from './importer'; | ||
export { | ||
CanonicalizeContext, | ||
FileImporter, | ||
Importer, | ||
ImporterResult, | ||
} from './importer'; | ||
export {Logger, SourceSpan, SourceLocation} from './logger'; | ||
@@ -27,5 +32,10 @@ export { | ||
export { | ||
CalculationInterpolation, | ||
CalculationOperation, | ||
CalculationOperator, | ||
CalculationValue, | ||
ListSeparator, | ||
SassArgumentList, | ||
SassBoolean, | ||
SassCalculation, | ||
SassColor, | ||
@@ -35,2 +45,3 @@ SassFunction, | ||
SassMap, | ||
SassMixin, | ||
SassNumber, | ||
@@ -37,0 +48,0 @@ SassString, |
/** | ||
* The exception type thrown by [[renderSync]] and passed as the error to | ||
* [[render]]'s callback. | ||
* The exception type thrown by {@link renderSync} and passed as the error to | ||
* {@link render}'s callback. | ||
* | ||
* @category Legacy | ||
* @deprecated This is only thrown by the legacy [[render]] and [[renderSync]] | ||
* APIs. Use [[compile]], [[compileString]], [[compileAsync]], and | ||
* [[compileStringAsync]] instead. | ||
* @deprecated This is only thrown by the legacy {@link render} and {@link | ||
* renderSync} APIs. Use {@link compile}, {@link compileString}, {@link | ||
* compileAsync}, and {@link compileStringAsync} instead. | ||
*/ | ||
@@ -20,4 +20,4 @@ export interface LegacyException extends Error { | ||
* The error message. For Dart Sass, this is the same as the result of calling | ||
* [[toString]], which is itself the same as [[message]] but with the prefix | ||
* "Error:". | ||
* {@link toString}, which is itself the same as {@link message} but with the | ||
* prefix "Error:". | ||
*/ | ||
@@ -33,4 +33,5 @@ formatted: string; | ||
/** | ||
* The (1-based) column number within [[line]] at which the error occurred, if | ||
* this exception is associated with a specific Sass file location. | ||
* The (1-based) column number within {@link line} at which the error | ||
* occurred, if this exception is associated with a specific Sass file | ||
* location. | ||
*/ | ||
@@ -51,7 +52,7 @@ column?: number; | ||
* * If the Sass file was generated by an importer, this is its canonical URL. | ||
* * If the Sass file was passed as [[LegacyStringOptions.data]] without a | ||
* corresponding [[LegacyStringOptions.file]], this is the special string | ||
* `"stdin"`. | ||
* * If the Sass file was passed as {@link LegacyStringOptions.data} without a | ||
* corresponding {@link LegacyStringOptions.file}, this is the special | ||
* string `"stdin"`. | ||
*/ | ||
file?: string; | ||
} |
@@ -5,4 +5,4 @@ import {LegacyPluginThis} from './plugin_this'; | ||
* A synchronous callback that implements a custom Sass function. This can be | ||
* passed to [[LegacySharedOptions.functions]] for either [[render]] or | ||
* [[renderSync]]. | ||
* passed to {@link LegacySharedOptions.functions} for either {@link render} or | ||
* {@link renderSync}. | ||
* | ||
@@ -29,10 +29,11 @@ * If this throws an error, Sass will treat that as the function failing with | ||
* @param args - One argument for each argument that's declared in the signature | ||
* that's passed to [[LegacySharedOptions.functions]]. If the signature [takes | ||
* arbitrary arguments](https://sass-lang.com/documentation/at-rules/function#taking-arbitrary-arguments), | ||
* that's passed to {@link LegacySharedOptions.functions}. If the signature | ||
* [takes arbitrary | ||
* arguments](https://sass-lang.com/documentation/at-rules/function#taking-arbitrary-arguments), | ||
* they're passed as a single argument list in the last argument. | ||
* | ||
* @category Legacy | ||
* @deprecated This only works with the legacy [[render]] and [[renderSync]] | ||
* APIs. Use [[CustomFunction]] with [[compile]], [[compileString]], | ||
* [[compileAsync]], and [[compileStringAsync]] instead. | ||
* @deprecated This only works with the legacy {@link render} and {@link | ||
* renderSync} APIs. Use {@link CustomFunction} with {@link compile}, {@link | ||
* compileString}, {@link compileAsync}, and {@link compileStringAsync} instead. | ||
*/ | ||
@@ -46,3 +47,3 @@ export type LegacySyncFunction = ( | ||
* An asynchronous callback that implements a custom Sass function. This can be | ||
* passed to [[LegacySharedOptions.functions]], but only for [[render]]. | ||
* passed to {@link LegacySharedOptions.functions}, but only for {@link render}. | ||
* | ||
@@ -75,3 +76,3 @@ * An asynchronous function must return `undefined`. Its final argument will | ||
* This is passed one argument for each argument that's declared in the | ||
* signature that's passed to [[LegacySharedOptions.functions]]. If the | ||
* signature that's passed to {@link LegacySharedOptions.functions}. If the | ||
* signature [takes arbitrary | ||
@@ -83,5 +84,5 @@ * arguments](https://sass-lang.com/documentation/at-rules/function#taking-arbitrary-arguments), | ||
* @category Legacy | ||
* @deprecated This only works with the legacy [[render]] and [[renderSync]] | ||
* APIs. Use [[CustomFunction]] with [[compile]], [[compileString]], | ||
* [[compileAsync]], and [[compileStringAsync]] instead. | ||
* @deprecated This only works with the legacy {@link render} and {@link | ||
* renderSync} APIs. Use {@link CustomFunction} with {@link compile}, {@link | ||
* compileString}, {@link compileAsync}, and {@link compileStringAsync} instead. | ||
*/ | ||
@@ -141,13 +142,13 @@ export type LegacyAsyncFunction = | ||
/** | ||
* The function called by a [[LegacyAsyncFunction]] to indicate that it's | ||
* The function called by a {@link LegacyAsyncFunction} to indicate that it's | ||
* finished. | ||
* | ||
* @param result - If this is a [[LegacyValue]], that indicates that the | ||
* function call completed successfully. If it's a [[types.Error]], that | ||
* @param result - If this is a {@link LegacyValue}, that indicates that the | ||
* function call completed successfully. If it's a {@link types.Error}, that | ||
* indicates that the function call failed. | ||
* | ||
* @category Legacy | ||
* @deprecated This only works with the legacy [[render]] and [[renderSync]] | ||
* APIs. Use [[CustomFunction]] with [[compile]], [[compileString]], | ||
* [[compileAsync]], and [[compileStringAsync]] instead. | ||
* @deprecated This only works with the legacy {@link render} and {@link | ||
* renderSync} APIs. Use {@link CustomFunction} with {@link compile}, {@link | ||
* compileString}, {@link compileAsync}, and {@link compileStringAsync} instead. | ||
*/ | ||
@@ -159,13 +160,13 @@ export type LegacyAsyncFunctionDone = ( | ||
/** | ||
* A callback that implements a custom Sass function. For [[renderSync]], this | ||
* must be a [[LegacySyncFunction]] which returns its result directly; for | ||
* [[render]], it may be either a [[LegacySyncFunction]] or a | ||
* [[LegacyAsyncFunction]] which calls a callback with its result. | ||
* A callback that implements a custom Sass function. For {@link renderSync}, | ||
* this must be a {@link LegacySyncFunction} which returns its result directly; | ||
* for {@link render}, it may be either a {@link LegacySyncFunction} or a {@link | ||
* LegacyAsyncFunction} which calls a callback with its result. | ||
* | ||
* See [[LegacySharedOptions.functions]] for more details. | ||
* See {@link LegacySharedOptions.functions} for more details. | ||
* | ||
* @category Legacy | ||
* @deprecated This only works with the legacy [[render]] and [[renderSync]] | ||
* APIs. Use [[CustomFunction]] with [[compile]], [[compileString]], | ||
* [[compileAsync]], and [[compileStringAsync]] instead. | ||
* @deprecated This only works with the legacy {@link render} and {@link | ||
* renderSync} APIs. Use {@link CustomFunction} with {@link compile}, {@link | ||
* compileString}, {@link compileAsync}, and {@link compileStringAsync} instead. | ||
*/ | ||
@@ -178,8 +179,8 @@ export type LegacyFunction<sync extends 'sync' | 'async'> = sync extends 'async' | ||
* A type representing all the possible values that may be passed to or returned | ||
* from a [[LegacyFunction]]. | ||
* from a {@link LegacyFunction}. | ||
* | ||
* @category Legacy | ||
* @deprecated This only works with the legacy [[render]] and [[renderSync]] | ||
* APIs. Use [[Value]] with [[compile]], [[compileString]], [[compileAsync]], | ||
* and [[compileStringAsync]] instead. | ||
* @deprecated This only works with the legacy {@link render} and {@link | ||
* renderSync} APIs. Use {@link Value} with {@link compile}, {@link | ||
* compileString}, {@link compileAsync}, and {@link compileStringAsync} instead. | ||
*/ | ||
@@ -199,5 +200,5 @@ export type LegacyValue = | ||
* @category Legacy | ||
* @deprecated This only works with the legacy [[render]] and [[renderSync]] | ||
* APIs. Use [[sassTrue]] with [[compile]], [[compileString]], [[compileAsync]], | ||
* and [[compileStringAsync]] instead. | ||
* @deprecated This only works with the legacy {@link render} and {@link | ||
* renderSync} APIs. Use {@link sassTrue} with {@link compile}, {@link | ||
* compileString}, {@link compileAsync}, and {@link compileStringAsync} instead. | ||
*/ | ||
@@ -210,5 +211,5 @@ export const TRUE: types.Boolean<true>; | ||
* @category Legacy | ||
* @deprecated This only works with the legacy [[render]] and [[renderSync]] | ||
* APIs. Use [[sassFalse]] with [[compile]], [[compileString]], [[compileAsync]], | ||
* and [[compileStringAsync]] instead. | ||
* @deprecated This only works with the legacy {@link render} and {@link | ||
* renderSync} APIs. Use {@link sassFalse} with {@link compile}, {@link | ||
* compileString}, {@link compileAsync}, and {@link compileStringAsync} instead. | ||
*/ | ||
@@ -221,5 +222,5 @@ export const FALSE: types.Boolean<false>; | ||
* @category Legacy | ||
* @deprecated This only works with the legacy [[render]] and [[renderSync]] | ||
* APIs. Use [[sassNull]] with [[compile]], [[compileString]], [[compileAsync]], | ||
* and [[compileStringAsync]] instead. | ||
* @deprecated This only works with the legacy {@link render} and {@link | ||
* renderSync} APIs. Use {@link sassNull} with {@link compile}, {@link | ||
* compileString}, {@link compileAsync}, and {@link compileStringAsync} instead. | ||
*/ | ||
@@ -232,5 +233,5 @@ export const NULL: types.Null; | ||
* @category Legacy | ||
* @deprecated This only works with the legacy [[render]] and [[renderSync]] | ||
* APIs. Use [[Value]] with [[compile]], [[compileString]], [[compileAsync]], | ||
* and [[compileStringAsync]] instead. | ||
* @deprecated This only works with the legacy {@link render} and {@link | ||
* renderSync} APIs. Use {@link Value} with {@link compile}, {@link | ||
* compileString}, {@link compileAsync}, and {@link compileStringAsync} instead. | ||
*/ | ||
@@ -241,3 +242,3 @@ export namespace types { | ||
* value](https://sass-lang.com/documentation/values/null). The value itself | ||
* can be accessed through the [[NULL]] field. | ||
* can be accessed through the {@link NULL} field. | ||
*/ | ||
@@ -296,3 +297,3 @@ export class Null { | ||
* | ||
* @deprecated Use [[constructor]] instead. | ||
* @deprecated Use {@link constructor} instead. | ||
*/ | ||
@@ -303,3 +304,3 @@ setValue(value: number): void; | ||
* Returns a string representation of this number's units. Complex units are | ||
* returned in the same format that [[constructor]] accepts them. | ||
* returned in the same format that {@link constructor} accepts them. | ||
* | ||
@@ -321,5 +322,5 @@ * @example | ||
* independent of its numeric value. Complex units are specified in the same | ||
* format as [[constructor]]. | ||
* format as {@link constructor}. | ||
* | ||
* @deprecated Use [[constructor]] instead. | ||
* @deprecated Use {@link constructor} instead. | ||
*/ | ||
@@ -379,3 +380,3 @@ setUnit(unit: string): void; | ||
* | ||
* @deprecated Use [[constructor]] instead. | ||
* @deprecated Use {@link constructor} instead. | ||
*/ | ||
@@ -393,3 +394,3 @@ setValue(value: string): void; | ||
* **Heads up!** Boolean values can't be constructed, they can only be | ||
* accessed through the [[TRUE]] and [[FALSE]] constants. | ||
* accessed through the {@link TRUE} and {@link FALSE} constants. | ||
*/ | ||
@@ -472,3 +473,3 @@ export class Boolean<T extends boolean = boolean> { | ||
* | ||
* @deprecated Use [[constructor]] instead. | ||
* @deprecated Use {@link constructor} instead. | ||
*/ | ||
@@ -496,3 +497,3 @@ setR(value: number): void; | ||
* | ||
* @deprecated Use [[constructor]] instead. | ||
* @deprecated Use {@link constructor} instead. | ||
*/ | ||
@@ -520,3 +521,3 @@ setG(value: number): void; | ||
* | ||
* @deprecated Use [[constructor]] instead. | ||
* @deprecated Use {@link constructor} instead. | ||
*/ | ||
@@ -544,3 +545,3 @@ setB(value: number): void; | ||
* | ||
* @deprecated Use [[constructor]] instead. | ||
* @deprecated Use {@link constructor} instead. | ||
*/ | ||
@@ -562,4 +563,4 @@ setA(value: number): void; | ||
* **Heads up!** The initial values of the list elements are undefined. | ||
* These elements must be set using [[setValue]] before accessing them or | ||
* passing the list back to Sass. | ||
* These elements must be set using {@link setValue} before accessing them | ||
* or passing the list back to Sass. | ||
* | ||
@@ -669,4 +670,4 @@ * @example | ||
* **Heads up!** The initial keys and values of the map are undefined. They | ||
* must be set using [[setKey]] and [[setValue]] before accessing them or | ||
* passing the map back to Sass. | ||
* must be set using {@link setKey} and {@link setValue} before accessing | ||
* them or passing the map back to Sass. | ||
* | ||
@@ -775,3 +776,3 @@ * @example | ||
* encountered an error. This is the only way to signal an error | ||
* asynchronously from a [[LegacyAsyncFunction]]. | ||
* asynchronously from a {@link LegacyAsyncFunction}. | ||
*/ | ||
@@ -778,0 +779,0 @@ export class Error { |
import {LegacyPluginThis} from './plugin_this'; | ||
/** | ||
* The value of `this` in the context of a [[LegacyImporter]] function. | ||
* The value of `this` in the context of a {@link LegacyImporter} function. | ||
* | ||
* @category Legacy | ||
* @deprecated This is only used by the legacy [[render]] and [[renderSync]] | ||
* APIs. Use [[Importer]] with [[compile]], [[compileString]], [[compileAsync]], | ||
* and [[compileStringAsync]] instead. | ||
* @deprecated This is only used by the legacy {@link render} and {@link | ||
* renderSync} APIs. Use {@link Importer} with {@link compile}, {@link | ||
* compileString}, {@link compileAsync}, and {@link compileStringAsync} instead. | ||
*/ | ||
@@ -25,4 +25,4 @@ interface LegacyImporterThis extends LegacyPluginThis { | ||
/** | ||
* The result of running a [[LegacyImporter]]. It must be one of the following | ||
* types: | ||
* The result of running a {@link LegacyImporter}. It must be one of the | ||
* following types: | ||
* | ||
@@ -42,5 +42,5 @@ * * An object with the key `contents` whose value is the contents of a stylesheet | ||
* @category Legacy | ||
* @deprecated This only works with the legacy [[render]] and [[renderSync]] | ||
* APIs. Use [[ImporterResult]] with [[compile]], [[compileString]], | ||
* [[compileAsync]], and [[compileStringAsync]] instead. | ||
* @deprecated This only works with the legacy {@link render} and {@link | ||
* renderSync} APIs. Use {@link ImporterResult} with {@link compile}, {@link | ||
* compileString}, {@link compileAsync}, and {@link compileStringAsync} instead. | ||
*/ | ||
@@ -57,6 +57,6 @@ export type LegacyImporterResult = | ||
* [`@use` rules](https://sass-lang.com/documentation/at-rules/use). This can be | ||
* passed to [[LegacySharedOptions.importer]] for either [[render]] or | ||
* [[renderSync]]. | ||
* passed to {@link LegacySharedOptions.importer} for either {@link render} or | ||
* {@link renderSync}. | ||
* | ||
* See [[LegacySharedOptions.importer]] for more detailed documentation. | ||
* See {@link LegacySharedOptions.importer} for more detailed documentation. | ||
* | ||
@@ -91,5 +91,5 @@ * ```js | ||
* @category Legacy | ||
* @deprecated This only works with the legacy [[render]] and [[renderSync]] | ||
* APIs. Use [[Importer]] with [[compile]], [[compileString]], [[compileAsync]], | ||
* and [[compileStringAsync]] instead. | ||
* @deprecated This only works with the legacy {@link render} and {@link | ||
* renderSync} APIs. Use {@link Importer} with {@link compile}, {@link | ||
* compileString}, {@link compileAsync}, and {@link compileStringAsync} instead. | ||
*/ | ||
@@ -106,9 +106,9 @@ type LegacySyncImporter = ( | ||
* [`@use` rules](https://sass-lang.com/documentation/at-rules/use). This can be | ||
* passed to [[LegacySharedOptions.importer]] for either [[render]] or | ||
* [[renderSync]]. | ||
* passed to {@link LegacySharedOptions.importer} for either {@link render} or | ||
* {@link renderSync}. | ||
* | ||
* An asynchronous importer must return `undefined`, and then call `done` with | ||
* the result of its [[LegacyImporterResult]] once it's done running. | ||
* the result of its {@link LegacyImporterResult} once it's done running. | ||
* | ||
* See [[LegacySharedOptions.importer]] for more detailed documentation. | ||
* See {@link LegacySharedOptions.importer} for more detailed documentation. | ||
* | ||
@@ -145,5 +145,5 @@ * ```js | ||
* @category Legacy | ||
* @deprecated This only works with the legacy [[render]] and [[renderSync]] | ||
* APIs. Use [[Importer]] with [[compile]], [[compileString]], [[compileAsync]], | ||
* and [[compileStringAsync]] instead. | ||
* @deprecated This only works with the legacy {@link render} and {@link | ||
* renderSync} APIs. Use {@link Importer} with {@link compile}, {@link | ||
* compileString}, {@link compileAsync}, and {@link compileStringAsync} instead. | ||
*/ | ||
@@ -160,13 +160,14 @@ type LegacyAsyncImporter = ( | ||
* rules](https://sass-lang.com/documentation/at-rules/import) and [`@use` | ||
* rules](https://sass-lang.com/documentation/at-rules/use). For [[renderSync]], | ||
* this must be a [[LegacySyncImporter]] which returns its result directly; for | ||
* [[render]], it may be either a [[LegacySyncImporter]] or a | ||
* [[LegacyAsyncImporter]] which calls a callback with its result. | ||
* rules](https://sass-lang.com/documentation/at-rules/use). For {@link | ||
* renderSync}, this must be a {@link LegacySyncImporter} which returns its | ||
* result directly; for {@link render}, it may be either a {@link | ||
* LegacySyncImporter} or a {@link LegacyAsyncImporter} which calls a callback | ||
* with its result. | ||
* | ||
* See [[LegacySharedOptions.importer]] for more details. | ||
* See {@link LegacySharedOptions.importer} for more details. | ||
* | ||
* @category Legacy | ||
* @deprecated This only works with the legacy [[render]] and [[renderSync]] | ||
* APIs. Use [[Importer]] with [[compile]], [[compileString]], [[compileAsync]], | ||
* and [[compileStringAsync]] instead. | ||
* @deprecated This only works with the legacy {@link render} and {@link | ||
* renderSync} APIs. Use {@link Importer} with {@link compile}, {@link | ||
* compileString}, {@link compileAsync}, and {@link compileStringAsync} instead. | ||
*/ | ||
@@ -173,0 +174,0 @@ export type LegacyImporter<sync = 'sync' | 'async'> = sync extends 'async' |
@@ -6,13 +6,13 @@ import {Logger} from '../logger'; | ||
/** | ||
* Options for [[render]] and [[renderSync]] that are shared between | ||
* [[LegacyFileOptions]] and [[LegacyStringOptions]]. | ||
* Options for {@link render} and {@link renderSync} that are shared between | ||
* {@link LegacyFileOptions} and {@link LegacyStringOptions}. | ||
* | ||
* @typeParam sync - This lets the TypeScript checker verify that | ||
* [[LegacyAsyncImporter]]s and [[LegacyAsyncFunction]]s aren't passed to | ||
* [[renderSync]]. | ||
* @typeParam sync - This lets the TypeScript checker verify that {@link | ||
* LegacyAsyncImporter}s and {@link LegacyAsyncFunction}s aren't passed to | ||
* {@link renderSync}. | ||
* | ||
* @category Legacy | ||
* @deprecated This only works with the legacy [[render]] and [[renderSync]] | ||
* APIs. Use [[Options]] with [[compile]], [[compileString]], [[compileAsync]], | ||
* and [[compileStringAsync]] instead. | ||
* @deprecated This only works with the legacy {@link render} and {@link | ||
* renderSync} APIs. Use {@link Options} with {@link compile}, {@link | ||
* compileString}, {@link compileAsync}, and {@link compileStringAsync} instead. | ||
*/ | ||
@@ -71,4 +71,4 @@ export interface LegacySharedOptions<sync extends 'sync' | 'async'> { | ||
/** | ||
* How many spaces or tabs (depending on [[indentType]]) should be used per | ||
* indentation level in the generated CSS. It must be between 0 and 10 | ||
* How many spaces or tabs (depending on {@link indentType}) should be used | ||
* per indentation level in the generated CSS. It must be between 0 and 10 | ||
* (inclusive). | ||
@@ -211,4 +211,4 @@ * | ||
* Whether or not Sass should generate a source map. If it does, the source | ||
* map will be available as [[LegacyResult.map]] (unless [[sourceMapEmbed]] is | ||
* `true`). | ||
* map will be available as {@link LegacyResult.map} (unless {@link | ||
* sourceMapEmbed} is `true`). | ||
* | ||
@@ -218,9 +218,9 @@ * If this option is a string, it’s the path that the source map is expected | ||
* generated CSS and to link *from* the source map to the Sass source files. | ||
* Note that if `sourceMap` is a string and [[outFile]] isn’t passed, Sass | ||
* Note that if `sourceMap` is a string and {@link outFile} isn’t passed, Sass | ||
* assumes that the CSS will be written to the same directory as the file | ||
* option if it’s passed. | ||
* | ||
* If this option is `true`, the path is assumed to be [[outFile]] with `.map` | ||
* added to the end. If it’s `true` and [[outFile]] isn’t passed, it has no | ||
* effect. | ||
* If this option is `true`, the path is assumed to be {@link outFile} with | ||
* `.map` added to the end. If it’s `true` and {@link outFile} isn’t passed, | ||
* it has no effect. | ||
* | ||
@@ -309,8 +309,8 @@ * @example | ||
* rule](https://sass-lang.com/documentation/at-rules/import) is encountered. | ||
* It can either be a single [[LegacyImporter]] function, or an array of | ||
* [[LegacyImporter]]s. | ||
* It can either be a single {@link LegacyImporter} function, or an array of | ||
* {@link LegacyImporter}s. | ||
* | ||
* Importers take the URL of the `@import` or `@use` rule and return a | ||
* [[LegacyImporterResult]] indicating how to handle that rule. For more | ||
* details, see [[LegacySyncImporter]] and [[LegacyAsyncImporter]]. | ||
* Importers take the URL of the `@import` or `@use` rule and return a {@link | ||
* LegacyImporterResult} indicating how to handle that rule. For more details, | ||
* see {@link LegacySyncImporter} and {@link LegacyAsyncImporter}. | ||
* | ||
@@ -326,3 +326,3 @@ * Loads are resolved by trying, in order: | ||
* | ||
* * Each load path in [[includePaths]]. | ||
* * Each load path in {@link includePaths}. | ||
* | ||
@@ -380,3 +380,3 @@ * * Each load path specified in the `SASS_PATH` environment variable, which | ||
* Versions of Dart Sass before 1.20.2 preferred resolving imports using | ||
* [[includePaths]] before resolving them using custom importers. | ||
* {@link includePaths} before resolving them using custom importers. | ||
* | ||
@@ -397,8 +397,7 @@ * All versions of Node Sass currently pass imports to importers before | ||
* This option takes an object whose keys are Sass function signatures and | ||
* whose values are [[LegacyFunction]]s. Each function should take the same | ||
* arguments as its signature. | ||
* whose values are {@link LegacyFunction}s. Each function should take the | ||
* same arguments as its signature. | ||
* | ||
* Functions are passed JavaScript representations of [Sass value | ||
* types](https://sass-lang.com/documentation/js-api#value-types), and must | ||
* return the same. | ||
* Functions are passed subclasses of {@link LegacyValue}, and must return the | ||
* same. | ||
* | ||
@@ -475,4 +474,4 @@ * **Heads up!** When writing custom functions, it’s important to ensure that | ||
* by dependencies. A “dependency” is defined as any file that’s loaded | ||
* through [[loadPaths]] or [[importer]]. Stylesheets that are imported | ||
* relative to the entrypoint are not considered dependencies. | ||
* through {@link includePaths} or {@link importer}. Stylesheets that are | ||
* imported relative to the entrypoint are not considered dependencies. | ||
* | ||
@@ -483,7 +482,7 @@ * This is useful for silencing deprecation warnings that you can’t fix on | ||
* | ||
* **Heads up!** If [[render]] or [[renderSync]] is called without | ||
* [[LegacyFileOptions.file]] or [[LegacyStringOptions.file]], <em>all</em> | ||
* stylesheets it loads will be considered dependencies. Since it doesn’t have | ||
* a path of its own, everything it loads is coming from a load path rather | ||
* than a relative import. | ||
* **Heads up!** If {@link render} or {@link renderSync} is called without | ||
* {@link LegacyFileOptions.file} or {@link LegacyStringOptions.file}, | ||
* <em>all</em> stylesheets it loads will be considered dependencies. Since it | ||
* doesn’t have a path of its own, everything it loads is coming from a load | ||
* path rather than a relative import. | ||
* | ||
@@ -512,6 +511,6 @@ * @defaultValue `false` | ||
* By default, Sass emits warnings and debug messages to standard error, but | ||
* if [[Logger.warn]] or [[Logger.debug]] is set, this will invoke them | ||
* instead. | ||
* if {@link Logger.warn} or {@link Logger.debug} is set, this will invoke | ||
* them instead. | ||
* | ||
* The special value [[Logger.silent]] can be used to easily silence all | ||
* The special value {@link Logger.silent} can be used to easily silence all | ||
* messages. | ||
@@ -526,8 +525,8 @@ * | ||
/** | ||
* If [[file]] is passed without [[data]], Sass will load the stylesheet at | ||
* [[file]] and compile it to CSS. | ||
* If {@link file} is passed without {@link data}, Sass will load the stylesheet | ||
* at {@link file} and compile it to CSS. | ||
* | ||
* @typeParam sync - This lets the TypeScript checker verify that | ||
* [[LegacyAsyncImporter]]s and [[LegacyAsyncFunction]]s aren't passed to | ||
* [[renderSync]]. | ||
* @typeParam sync - This lets the TypeScript checker verify that {@link | ||
* LegacyAsyncImporter}s and {@link LegacyAsyncFunction}s aren't passed to | ||
* {@link renderSync}. | ||
*/ | ||
@@ -563,4 +562,4 @@ export interface LegacyFileOptions<sync extends 'sync' | 'async'> | ||
/** | ||
* See [[LegacyStringOptions.file]] for documentation of passing [[file]] along | ||
* with [[data]]. | ||
* See {@link LegacyStringOptions.file} for documentation of passing {@link | ||
* file} along with {@link data}. | ||
* | ||
@@ -573,13 +572,13 @@ * @category Input | ||
/** | ||
* If [[data]] is passed, Sass will use it as the contents of the stylesheet to | ||
* compile. | ||
* If {@link data} is passed, Sass will use it as the contents of the stylesheet | ||
* to compile. | ||
* | ||
* @typeParam sync - This lets the TypeScript checker verify that | ||
* [[LegacyAsyncImporter]]s and [[LegacyAsyncFunction]]s aren't passed to | ||
* [[renderSync]]. | ||
* @typeParam sync - This lets the TypeScript checker verify that {@link | ||
* LegacyAsyncImporter}s and {@link LegacyAsyncFunction}s aren't passed to | ||
* {@link renderSync}. | ||
* | ||
* @category Legacy | ||
* @deprecated This only works with the legacy [[render]] and [[renderSync]] | ||
* APIs. Use [[StringOptions]] with [[compile]], [[compileString]], | ||
* [[compileAsync]], and [[compileStringAsync]] instead. | ||
* @deprecated This only works with the legacy {@link render} and {@link | ||
* renderSync} APIs. Use {@link StringOptions} with {@link compile}, {@link | ||
* compileString}, {@link compileAsync}, and {@link compileStringAsync} instead. | ||
*/ | ||
@@ -589,7 +588,7 @@ export interface LegacyStringOptions<sync extends 'sync' | 'async'> | ||
/** | ||
* The contents of the stylesheet to compile. Unless [[file]] is passed as | ||
* The contents of the stylesheet to compile. Unless {@link file} is passed as | ||
* well, the stylesheet’s URL is set to `"stdin"`. | ||
* | ||
* By default, this stylesheet is parsed as SCSS. This can be controlled using | ||
* [[indentedSyntax]]. | ||
* {@link indentedSyntax}. | ||
* | ||
@@ -612,6 +611,6 @@ * @example | ||
/** | ||
* If `file` and [[data]] are both passed, `file` is used as the path of the | ||
* stylesheet for error reporting, but [[data]] is used as the contents of the | ||
* stylesheet. In this case, `file`’s extension is not used to determine the | ||
* syntax of the stylesheet. | ||
* If `file` and {@link data} are both passed, `file` is used as the path of | ||
* the stylesheet for error reporting, but {@link data} is used as the | ||
* contents of the stylesheet. In this case, `file`’s extension is not used to | ||
* determine the syntax of the stylesheet. | ||
* | ||
@@ -623,3 +622,3 @@ * @category Input | ||
/** | ||
* This flag controls whether [[data]] is parsed as the indented syntax or | ||
* This flag controls whether {@link data} is parsed as the indented syntax or | ||
* not. | ||
@@ -645,13 +644,13 @@ * | ||
/** | ||
* Options for [[render]] and [[renderSync]]. This can either be | ||
* [[LegacyFileOptions]] to load a file from disk, or [[LegacyStringOptions]] to | ||
* compile a string of Sass code. | ||
* Options for {@link render} and {@link renderSync}. This can either be {@link | ||
* LegacyFileOptions} to load a file from disk, or {@link LegacyStringOptions} | ||
* to compile a string of Sass code. | ||
* | ||
* See [[LegacySharedOptions]] for options that are shared across both file and | ||
* string inputs. | ||
* See {@link LegacySharedOptions} for options that are shared across both file | ||
* and string inputs. | ||
* | ||
* @category Legacy | ||
* @deprecated This only works with the legacy [[render]] and [[renderSync]] | ||
* APIs. Use [[Options]] with [[compile]], [[compileString]], [[compileAsync]], | ||
* and [[compileStringAsync]] instead. | ||
* @deprecated This only works with the legacy {@link render} and {@link | ||
* renderSync} APIs. Use {@link Options} with {@link compile}, {@link | ||
* compileString}, {@link compileAsync}, and {@link compileStringAsync} instead. | ||
*/ | ||
@@ -658,0 +657,0 @@ export type LegacyOptions<sync extends 'sync' | 'async'> = |
/** | ||
* The value of `this` in the context of a [[LegacyImporter]] or | ||
* [[LegacyFunction]] callback. | ||
* The value of `this` in the context of a {@link LegacyImporter} or {@link | ||
* LegacyFunction} callback. | ||
* | ||
* @category Legacy | ||
* @deprecated This is only used by the legacy [[render]] and [[renderSync]] | ||
* APIs. Use [[compile]], [[compileString]], [[compileAsync]], and | ||
* [[compileStringAsync]] instead. | ||
* @deprecated This is only used by the legacy {@link render} and {@link | ||
* renderSync} APIs. Use {@link compile}, {@link compileString}, {@link | ||
* compileAsync}, and {@link compileStringAsync} instead. | ||
*/ | ||
export interface LegacyPluginThis { | ||
/** | ||
* A partial representation of the options passed to [[render]] or | ||
* [[renderSync]]. | ||
* A partial representation of the options passed to {@link render} or {@link | ||
* renderSync}. | ||
*/ | ||
options: { | ||
/** The same [[LegacyPluginThis]] instance that contains this object. */ | ||
/** The same {@link LegacyPluginThis} instance that contains this object. */ | ||
context: LegacyPluginThis; | ||
/** | ||
* The value passed to [[LegacyFileOptions.file]] or | ||
* [[LegacyStringOptions.file]]. | ||
* The value passed to {@link LegacyFileOptions.file} or {@link | ||
* LegacyStringOptions.file}. | ||
*/ | ||
file?: string; | ||
/** The value passed to [[LegacyStringOptions.data]]. */ | ||
/** The value passed to {@link LegacyStringOptions.data}. */ | ||
data?: string; | ||
/** | ||
* The value passed to [[LegacySharedOptions.includePaths]] separated by | ||
* The value passed to {@link LegacySharedOptions.includePaths} separated by | ||
* `";"` on Windows or `":"` on other operating systems. This always | ||
@@ -41,7 +41,8 @@ * includes the current working directory as the first entry. | ||
/** 1 if [[LegacySharedOptions.indentType]] was `"tab"`, 0 otherwise. */ | ||
/** 1 if {@link LegacySharedOptions.indentType} was `"tab"`, 0 otherwise. */ | ||
indentType: 1 | 0; | ||
/** | ||
* The value passed to [[LegacySharedOptions.indentWidth]], or `2` otherwise. | ||
* The value passed to {@link LegacySharedOptions.indentWidth}, or `2` | ||
* otherwise. | ||
*/ | ||
@@ -51,3 +52,3 @@ indentWidth: number; | ||
/** | ||
* The value passed to [[LegacySharedOptions.linefeed]], or `"\n"` | ||
* The value passed to {@link LegacySharedOptions.linefeed}, or `"\n"` | ||
* otherwise. | ||
@@ -57,3 +58,3 @@ */ | ||
/** A partially-constructed [[LegacyResult]] object. */ | ||
/** A partially-constructed {@link LegacyResult} object. */ | ||
result: { | ||
@@ -69,3 +70,3 @@ /** Partial information about the compilation in progress. */ | ||
/** | ||
* [[LegacyFileOptions.file]] if it was passed, otherwise the string | ||
* {@link LegacyFileOptions.file} if it was passed, otherwise the string | ||
* `"data"`. | ||
@@ -72,0 +73,0 @@ */ |
@@ -5,9 +5,9 @@ import {LegacyException} from './exception'; | ||
/** | ||
* The object returned by [[render]] and [[renderSync]] after a successful | ||
* compilation. | ||
* The object returned by {@link render} and {@link renderSync} after a | ||
* successful compilation. | ||
* | ||
* @category Legacy | ||
* @deprecated This is only used by the legacy [[render]] and [[renderSync]] | ||
* APIs. Use [[compile]], [[compileString]], [[compileAsync]], and | ||
* [[compileStringAsync]] instead. | ||
* @deprecated This is only used by the legacy {@link render} and {@link | ||
* renderSync} APIs. Use {@link compile}, {@link compileString}, {@link | ||
* compileAsync}, and {@link compileStringAsync} instead. | ||
*/ | ||
@@ -36,10 +36,10 @@ export interface LegacyResult { | ||
* | ||
* * [[LegacySharedOptions.sourceMap]] is a string; or | ||
* * [[LegacySharedOptions.sourceMap]] is `true` and | ||
* [[LegacySharedOptions.outFile]] is set. | ||
* * {@link LegacySharedOptions.sourceMap} is a string; or | ||
* * {@link LegacySharedOptions.sourceMap} is `true` and | ||
* {@link LegacySharedOptions.outFile} is set. | ||
* | ||
* The source map uses absolute [`file:` | ||
* URLs](https://en.wikipedia.org/wiki/File_URI_scheme) to link to the Sass | ||
* source files, except if the source file comes from | ||
* [[LegacyStringOptions.data]] in which case it lists its URL as `"stdin"`. | ||
* source files, except if the source file comes from {@link | ||
* LegacyStringOptions.data} in which case it lists its URL as `"stdin"`. | ||
* | ||
@@ -63,5 +63,5 @@ * @example | ||
/** | ||
* The absolute path of [[LegacyFileOptions.file]] or | ||
* [[LegacyStringOptions.file]], or `"data"` if [[LegacyStringOptions.file]] | ||
* wasn't set. | ||
* The absolute path of {@link LegacyFileOptions.file} or {@link | ||
* LegacyStringOptions.file}, or `"data"` if {@link | ||
* LegacyStringOptions.file} wasn't set. | ||
*/ | ||
@@ -90,4 +90,4 @@ entry: string; | ||
* An array of the absolute paths of all Sass files loaded during | ||
* compilation. If a stylesheet was loaded from a [[LegacyImporter]] that | ||
* returned the stylesheet’s contents, the raw string of the `@use` or | ||
* compilation. If a stylesheet was loaded from a {@link LegacyImporter} | ||
* that returned the stylesheet’s contents, the raw string of the `@use` or | ||
* `@import` that loaded that stylesheet included in this array. | ||
@@ -103,2 +103,7 @@ */ | ||
* | ||
* **Heads up!** When using the `sass-embedded` npm package, **{@link render} | ||
* is almost always faster than {@link renderSync}**, due to the overhead of | ||
* emulating synchronous messaging with worker threads and concurrent | ||
* compilations being blocked on main thread. | ||
* | ||
* @example | ||
@@ -114,3 +119,3 @@ * | ||
* @category Legacy | ||
* @deprecated Use [[compile]] or [[compileString]] instead. | ||
* @deprecated Use {@link compile} or {@link compileString} instead. | ||
*/ | ||
@@ -122,8 +127,8 @@ export function renderSync(options: LegacyOptions<'sync'>): LegacyResult; | ||
* This function asynchronously compiles a Sass file to CSS, and calls | ||
* `callback` with a [[LegacyResult]] if compilation succeeds or | ||
* [[LegacyException]] if it fails. | ||
* `callback` with a {@link LegacyResult} if compilation succeeds or {@link | ||
* LegacyException} if it fails. | ||
* | ||
* **Heads up!** When using Dart Sass, **[[renderSync]] is almost twice as fast | ||
* as [[render]]** by default, due to the overhead of making the entire | ||
* evaluation process asynchronous. | ||
* **Heads up!** When using the `sass` npm package, **{@link renderSync} is | ||
* almost twice as fast as {@link render}** by default, due to the overhead of | ||
* making the entire evaluation process asynchronous. | ||
* | ||
@@ -141,3 +146,3 @@ * ```js | ||
* @category Legacy | ||
* @deprecated Use [[compileAsync]] or [[compileStringAsync]] instead. | ||
* @deprecated Use {@link compileAsync} or {@link compileStringAsync} instead. | ||
*/ | ||
@@ -144,0 +149,0 @@ export function render( |
@@ -7,4 +7,4 @@ import {SourceSpan} from './source_span'; | ||
/** | ||
* An object that can be passed to [[LegacySharedOptions.logger]] to control how | ||
* Sass emits warnings and debug messages. | ||
* An object that can be passed to {@link LegacySharedOptions.logger} to control | ||
* how Sass emits warnings and debug messages. | ||
* | ||
@@ -74,3 +74,3 @@ * @example | ||
/** | ||
* A namespace for built-in [[Logger]]s. | ||
* A namespace for built-in {@link Logger}s. | ||
* | ||
@@ -82,3 +82,3 @@ * @category Logger | ||
/** | ||
* A [[Logger]] that silently ignores all warnings and debug messages. | ||
* A {@link Logger} that silently ignores all warnings and debug messages. | ||
* | ||
@@ -85,0 +85,0 @@ * @example |
/** | ||
* A specific location within a source file. | ||
* | ||
* This is always associated with a [[SourceSpan]] which indicates *which* file | ||
* it refers to. | ||
* This is always associated with a {@link SourceSpan} which indicates *which* | ||
* file it refers to. | ||
* | ||
@@ -7,0 +7,0 @@ * @category Logger |
@@ -15,5 +15,5 @@ import {SourceLocation} from './source_location'; | ||
* | ||
* If [[start]] and [[end]] refer to the same location, the span has zero | ||
* length and refers to the point immediately after [[start]] and before the | ||
* next character. | ||
* If {@link start} and {@link end} refer to the same location, the span has | ||
* zero length and refers to the point immediately after {@link start} and | ||
* before the next character. | ||
*/ | ||
@@ -20,0 +20,0 @@ end: SourceLocation; |
@@ -35,3 +35,3 @@ import {FileImporter, Importer} from './importer'; | ||
* A callback that implements a custom Sass function. This can be passed to | ||
* [[Options.functions]]. | ||
* {@link Options.functions}. | ||
* | ||
@@ -53,8 +53,8 @@ * ```js | ||
* @typeParam sync - A `CustomFunction<'sync'>` must return synchronously, but | ||
* in return it can be passed to [[compile]] and [[compileString]] in addition | ||
* to [[compileAsync]] and [[compileStringAsync]]. | ||
* in return it can be passed to {@link compile} and {@link compileString} in | ||
* addition to {@link compileAsync} and {@link compileStringAsync}. | ||
* | ||
* A `CustomFunction<'async'>` may either return synchronously or | ||
* asynchronously, but it can only be used with [[compileAsync]] and | ||
* [[compileStringAsync]]. | ||
* asynchronously, but it can only be used with {@link compileAsync} and {@link | ||
* compileStringAsync}. | ||
* | ||
@@ -64,7 +64,7 @@ * @param args - An array of arguments passed by the function's caller. If the | ||
* arguments](https://sass-lang.com/documentation/at-rules/function#taking-arbitrary-arguments), | ||
* the last element will be a [[SassArgumentList]]. | ||
* the last element will be a {@link SassArgumentList}. | ||
* | ||
* @returns The function's result. This may be in the form of a `Promise`, but | ||
* if it is the function may only be passed to [[compileAsync]] and | ||
* [[compileStringAsync]], not [[compile]] or [[compileString]]. | ||
* if it is the function may only be passed to {@link compileAsync} and {@link | ||
* compileStringAsync}, not {@link compile} or {@link compileString}. | ||
* | ||
@@ -84,8 +84,8 @@ * @throws any - This function may throw an error, which the Sass compiler will | ||
/** | ||
* Options that can be passed to [[compile]], [[compileAsync]], | ||
* [[compileString]], or [[compileStringAsync]]. | ||
* Options that can be passed to {@link compile}, {@link compileAsync}, {@link | ||
* compileString}, or {@link compileStringAsync}. | ||
* | ||
* @typeParam sync - This lets the TypeScript checker verify that asynchronous | ||
* [[Importer]]s, [[FileImporter]]s, and [[CustomFunction]]s aren't passed to | ||
* [[compile]] or [[compileString]]. | ||
* {@link Importer}s, {@link FileImporter}s, and {@link CustomFunction}s aren't | ||
* passed to {@link compile} or {@link compileString}. | ||
* | ||
@@ -116,2 +116,16 @@ * @category Options | ||
/** | ||
* If `true`, the compiler may prepend `@charset "UTF-8";` or U+FEFF | ||
* (byte-order marker) if it outputs non-ASCII CSS. | ||
* | ||
* If `false`, the compiler never emits these byte sequences. This is ideal | ||
* when concatenating or embedding in HTML `<style>` tags. (The output will | ||
* still be UTF-8.) | ||
* | ||
* @defaultValue `true` | ||
* @category Output | ||
* @compatibility dart: "1.54.0", node: false | ||
*/ | ||
charset?: boolean; | ||
/** | ||
* Additional built-in Sass functions that are available in all stylesheets. | ||
@@ -121,7 +135,7 @@ * This option takes an object whose keys are Sass function signatures like | ||
* rule`](https://sass-lang.com/documentation/at-rules/function) and whose | ||
* values are [[CustomFunction]]s. | ||
* values are {@link CustomFunction}s. | ||
* | ||
* Functions are passed JavaScript representations of [Sass value | ||
* types](https://sass-lang.com/documentation/js-api#value-types), and must | ||
* return the same. | ||
* Functions are passed subclasses of {@link Value}, and must return the same. | ||
* If the return value includes {@link SassCalculation}s they will be | ||
* simplified before being returned. | ||
* | ||
@@ -132,14 +146,14 @@ * When writing custom functions, it's important to make them as user-friendly | ||
* | ||
* * Use `Value.assert*` methods, like [[Value.assertString]], to cast untyped | ||
* `Value` objects to more specific types. For values that were passed | ||
* directly as arguments, pass in the argument name as well. This ensures | ||
* that the user gets good error messages when they pass in the wrong type | ||
* to your function. | ||
* * Use `Value.assert*` methods, like {@link Value.assertString}, to cast | ||
* untyped `Value` objects to more specific types. For values that were | ||
* passed directly as arguments, pass in the argument name as well. This | ||
* ensures that the user gets good error messages when they pass in the | ||
* wrong type to your function. | ||
* | ||
* * Individual classes may have more specific `assert*` methods, like | ||
* [[SassNumber.assertInt]], which should be used when possible. | ||
* * Individual classes may have more specific `assert*` methods, like {@link | ||
* SassNumber.assertInt}, which should be used when possible. | ||
* | ||
* * In Sass, every value counts as a list. Rather than trying to detect the | ||
* [[SassList]] type, you should use [[Value.asList]] to treat all values as | ||
* lists. | ||
* {@link SassList} type, you should use {@link Value.asList} to treat all | ||
* values as lists. | ||
* | ||
@@ -156,5 +170,4 @@ * * When manipulating values like lists, strings, and numbers that have | ||
* indices to index from the end of value. Functions should follow these | ||
* conventions. [[Value.sassIndexToListIndex]] and | ||
* [[SassString.sassIndexToStringIndex]] can be used to do this | ||
* automatically. | ||
* conventions. {@link Value.sassIndexToListIndex} and {@link | ||
* SassString.sassIndexToStringIndex} can be used to do this automatically. | ||
* | ||
@@ -167,5 +180,5 @@ * * String indexes in Sass refer to Unicode code points while JavaScript | ||
* `str-slice("a😊b", 1, 1)` returns `"😊"`. Functions should follow Sass's | ||
* convention. [[SassString.sassIndexToStringIndex]] can be used to do this | ||
* automatically, and the [[SassString.sassLength]] getter can be used to | ||
* access a string's length in code points. | ||
* convention. {@link SassString.sassIndexToStringIndex} can be used to do | ||
* this automatically, and the {@link SassString.sassLength} getter can be | ||
* used to access a string's length in code points. | ||
* | ||
@@ -207,5 +220,6 @@ * @example | ||
* | ||
* - Each [[Importer]] or [[FileImporter]] in [[importers]], in order. | ||
* - Each {@link Importer} or {@link FileImporter} in {@link importers}, in | ||
* order. | ||
* | ||
* - Each load path in [[loadPaths]], in order. | ||
* - Each load path in {@link loadPaths}, in order. | ||
* | ||
@@ -224,3 +238,3 @@ * If none of these return a Sass file, the load fails and Sass throws an | ||
* | ||
* A load path `loadPath` is equivalent to the following [[FileImporter]]: | ||
* A load path `loadPath` is equivalent to the following {@link FileImporter}: | ||
* | ||
@@ -245,6 +259,6 @@ * ```js | ||
* By default, Sass emits warnings and debug messages to standard error, but | ||
* if [[Logger.warn]] or [[Logger.debug]] is set, this will invoke them | ||
* instead. | ||
* if {@link Logger.warn} or {@link Logger.debug} is set, this will invoke | ||
* them instead. | ||
* | ||
* The special value [[Logger.silent]] can be used to easily silence all | ||
* The special value {@link Logger.silent} can be used to easily silence all | ||
* messages. | ||
@@ -259,4 +273,4 @@ * | ||
* by dependencies. A “dependency” is defined as any file that’s loaded | ||
* through [[loadPaths]] or [[importer]]. Stylesheets that are imported | ||
* relative to the entrypoint are not considered dependencies. | ||
* through {@link loadPaths} or {@link importers}. Stylesheets that are | ||
* imported relative to the entrypoint are not considered dependencies. | ||
* | ||
@@ -267,7 +281,7 @@ * This is useful for silencing deprecation warnings that you can’t fix on | ||
* | ||
* **Heads up!** If [[compileString]] or [[compileStringAsync]] is called | ||
* without [[StringWithoutImporter.url]], <em>all</em> stylesheets it loads | ||
* will be considered dependencies. Since it doesn’t have a path of its own, | ||
* everything it loads is coming from a load path rather than a relative | ||
* import. | ||
* **Heads up!** If {@link compileString} or {@link compileStringAsync} is | ||
* called without {@link StringOptionsWithoutImporter.url}, <em>all</em> | ||
* stylesheets it loads will be considered dependencies. Since it doesn’t have | ||
* a path of its own, everything it loads is coming from a load path rather | ||
* than a relative import. | ||
* | ||
@@ -281,3 +295,3 @@ * @defaultValue `false` | ||
* Whether or not Sass should generate a source map. If it does, the source | ||
* map will be available as [[CompileResult.sourceMap]]. | ||
* map will be available as {@link CompileResult.sourceMap}. | ||
* | ||
@@ -297,3 +311,3 @@ * **Heads up!** Sass doesn't automatically add a `sourceMappingURL` comment | ||
* | ||
* This option has no effect if [[sourceMap]] is `false`. | ||
* This option has no effect if {@link sourceMap} is `false`. | ||
* | ||
@@ -306,3 +320,3 @@ * @defaultValue `false` | ||
/** | ||
* The [[OutputStyle]] of the compiled CSS. | ||
* The {@link OutputStyle} of the compiled CSS. | ||
* | ||
@@ -351,11 +365,12 @@ * @example | ||
/** | ||
* Options that can be passed to [[compileString]] or [[compileStringAsync]]. | ||
* Options that can be passed to {@link compileString} or {@link | ||
* compileStringAsync}. | ||
* | ||
* If the [[StringOptionsWithImporter.importer]] field isn't passed, the | ||
* If the {@link StringOptionsWithImporter.importer} field isn't passed, the | ||
* entrypoint file can load files relative to itself if a `file://` URL is | ||
* passed to the [[url]] field. | ||
* passed to the {@link url} field. | ||
* | ||
* @typeParam sync - This lets the TypeScript checker verify that asynchronous | ||
* [[Importer]]s, [[FileImporter]]s, and [[CustomFunction]]s aren't passed to | ||
* [[compile]] or [[compileString]]. | ||
* {@link Importer}s, {@link FileImporter}s, and {@link CustomFunction}s aren't | ||
* passed to {@link compile} or {@link compileString}. | ||
* | ||
@@ -367,3 +382,3 @@ * @category Options | ||
/** | ||
* The [[Syntax]] to use to parse the entrypoint stylesheet. | ||
* The {@link Syntax} to use to parse the entrypoint stylesheet. | ||
* | ||
@@ -379,5 +394,6 @@ * @default `'scss'` | ||
* | ||
* A relative load's URL is first resolved relative to [[url]], then resolved | ||
* to a file on disk if it's a `file://` URL. If it can't be resolved to a | ||
* file on disk, it's then passed to [[importers]] and [[loadPaths]]. | ||
* A relative load's URL is first resolved relative to {@link url}, then | ||
* resolved to a file on disk if it's a `file://` URL. If it can't be resolved | ||
* to a file on disk, it's then passed to {@link importers} and {@link | ||
* loadPaths}. | ||
* | ||
@@ -390,11 +406,12 @@ * @category Input | ||
/** | ||
* Options that can be passed to [[compileString]] or [[compileStringAsync]]. | ||
* Options that can be passed to {@link compileString} or {@link | ||
* compileStringAsync}. | ||
* | ||
* If the [[StringOptionsWithImporter.importer]] field is passed, the entrypoint | ||
* file uses it to load files relative to itself and the [[url]] field is | ||
* mandatory. | ||
* If the {@link StringOptionsWithImporter.importer} field is passed, the | ||
* entrypoint file uses it to load files relative to itself and the {@link url} | ||
* field is mandatory. | ||
* | ||
* @typeParam sync - This lets the TypeScript checker verify that asynchronous | ||
* [[Importer]]s, [[FileImporter]]s, and [[CustomFunction]]s aren't passed to | ||
* [[compile]] or [[compileString]]. | ||
* {@link Importer}s, {@link FileImporter}s, and {@link CustomFunction}s aren't | ||
* passed to {@link compile} or {@link compileString}. | ||
* | ||
@@ -409,5 +426,5 @@ * @category Options | ||
* | ||
* A relative load's URL is first resolved relative to [[url]], then passed to | ||
* [[importer]]. If the importer doesn't recognize it, it's then passed to | ||
* [[importers]] and [[loadPaths]]. | ||
* A relative load's URL is first resolved relative to {@link url}, then | ||
* passed to {@link importer}. If the importer doesn't recognize it, it's then | ||
* passed to {@link importers} and {@link loadPaths}. | ||
* | ||
@@ -420,4 +437,4 @@ * @category Input | ||
* The canonical URL of the entrypoint stylesheet. If this is passed along | ||
* with [[importer]], it's used to resolve relative loads in the entrypoint | ||
* stylesheet. | ||
* with {@link importer}, it's used to resolve relative loads in the | ||
* entrypoint stylesheet. | ||
* | ||
@@ -430,11 +447,12 @@ * @category Input | ||
/** | ||
* Options that can be passed to [[compileString]] or [[compileStringAsync]]. | ||
* Options that can be passed to {@link compileString} or {@link | ||
* compileStringAsync}. | ||
* | ||
* This is a [[StringOptionsWithImporter]] if it has a | ||
* [[StringOptionsWithImporter.importer]] field, and a | ||
* [[StringOptionsWithoutImporter]] otherwise. | ||
* This is a {@link StringOptionsWithImporter} if it has a {@link | ||
* StringOptionsWithImporter.importer} field, and a {@link | ||
* StringOptionsWithoutImporter} otherwise. | ||
* | ||
* @typeParam sync - This lets the TypeScript checker verify that asynchronous | ||
* [[Importer]]s, [[FileImporter]]s, and [[CustomFunction]]s aren't passed to | ||
* [[compile]] or [[compileString]]. | ||
* {@link Importer}s, {@link FileImporter}s, and {@link CustomFunction}s aren't | ||
* passed to {@link compile} or {@link compileString}. | ||
* | ||
@@ -441,0 +459,0 @@ * @category Options |
@@ -5,6 +5,6 @@ /** | ||
* | ||
* This is used as the return value for plugins like [[CustomFunction]], | ||
* [[Importer]], and [[FileImporter]] so that TypeScript enforces that | ||
* asynchronous plugins are only passed to [[compileAsync]] and | ||
* [[compileStringAsync]], not [[compile]] or [[compileString]]. | ||
* This is used as the return value for plugins like {@link CustomFunction}, | ||
* {@link Importer}, and {@link FileImporter} so that TypeScript enforces that | ||
* asynchronous plugins are only passed to {@link compileAsync} and {@link | ||
* compileStringAsync}, not {@link compile} or {@link compileString}. | ||
* | ||
@@ -11,0 +11,0 @@ * @typeParam sync - If this is `'sync'`, this can only be a `T`. If it's |
@@ -11,4 +11,4 @@ import {List, OrderedMap} from 'immutable'; | ||
* An argument list comes from a rest argument. It's distinct from a normal | ||
* [[SassList]] in that it may contain a keyword map as well as the positional | ||
* arguments. | ||
* {@link SassList} in that it may contain a keyword map as well as the | ||
* positional arguments. | ||
* | ||
@@ -23,3 +23,3 @@ * @category Custom Function | ||
* contents of the list. This may be either a plain JavaScript array or an | ||
* immutable [[List]] from the [`immutable` | ||
* immutable {@link List} from the [`immutable` | ||
* package](https://immutable-js.com/). | ||
@@ -29,4 +29,4 @@ * | ||
* whose names should exclude `$`. This can be either a plain JavaScript | ||
* object with argument names as fields, or an immutable [[OrderedMap]] from | ||
* the [`immutable` package](https://immutable-js.com/) | ||
* object with argument names as fields, or an immutable {@link OrderedMap} | ||
* from the [`immutable` package](https://immutable-js.com/) | ||
* | ||
@@ -46,3 +46,3 @@ * @param separator - The separator for this list. Defaults to `','`. | ||
* | ||
* @returns An immutable [[OrderedMap]] from the [`immutable` | ||
* @returns An immutable {@link OrderedMap} from the [`immutable` | ||
* package](https://immutable-js.com/). | ||
@@ -49,0 +49,0 @@ */ |
@@ -15,2 +15,9 @@ import {Value} from './index'; | ||
* | ||
* **Only** `undefined` should be passed to indicate a missing `alpha`. If | ||
* `null` is passed instead, it will be treated as a [missing component] in | ||
* future versions of Dart Sass. See [breaking changes] for details. | ||
* | ||
* [missing component]: https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#missing_color_components | ||
* [breaking changes]: /documentation/breaking-changes/null-alpha | ||
* | ||
* @throws `Error` if `red`, `green`, and `blue` aren't between `0` and | ||
@@ -29,2 +36,9 @@ * `255`, or if `alpha` isn't between `0` and `1`. | ||
* | ||
* **Only** `undefined` should be passed to indicate a missing `alpha`. If | ||
* `null` is passed instead, it will be treated as a [missing component] in | ||
* future versions of Dart Sass. See [breaking changes] for details. | ||
* | ||
* [missing component]: https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#missing_color_components | ||
* [breaking changes]: /documentation/breaking-changes/null-alpha | ||
* | ||
* @throws `Error` if `saturation` or `lightness` aren't between `0` and | ||
@@ -43,2 +57,9 @@ * `100`, or if `alpha` isn't between `0` and `1`. | ||
* | ||
* **Only** `undefined` should be passed to indicate a missing `alpha`. If | ||
* `null` is passed instead, it will be treated as a [missing component] in | ||
* future versions of Dart Sass. See [breaking changes] for details. | ||
* | ||
* [missing component]: https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#missing_color_components | ||
* [breaking changes]: /documentation/breaking-changes/null-alpha | ||
* | ||
* @throws `Error` if `whiteness` or `blackness` aren't between `0` and `100`, | ||
@@ -45,0 +66,0 @@ * or if `alpha` isn't between `0` and `1`. |
@@ -19,5 +19,5 @@ import {Value} from './index'; | ||
* @param callback - The callback that's invoked when this function is called, | ||
* just like for a [[CustomFunction]]. | ||
* just like for a {@link CustomFunction}. | ||
*/ | ||
constructor(signature: string, callback: (args: Value[]) => Value); | ||
} |
import {List, ValueObject} from 'immutable'; | ||
import {SassBoolean} from './boolean'; | ||
import {SassCalculation} from './calculation'; | ||
import {SassColor} from './color'; | ||
@@ -8,2 +9,3 @@ import {SassFunction} from './function'; | ||
import {SassMap} from './map'; | ||
import {SassMixin} from './mixin'; | ||
import {SassNumber} from './number'; | ||
@@ -14,2 +16,9 @@ import {SassString} from './string'; | ||
export {SassBoolean, sassTrue, sassFalse} from './boolean'; | ||
export { | ||
SassCalculation, | ||
CalculationValue, | ||
CalculationOperator, | ||
CalculationOperation, | ||
CalculationInterpolation, | ||
} from './calculation'; | ||
export {SassColor} from './color'; | ||
@@ -19,2 +28,3 @@ export {SassFunction} from './function'; | ||
export {SassMap} from './map'; | ||
export {SassMixin} from './mixin'; | ||
export {SassNumber} from './number'; | ||
@@ -33,4 +43,4 @@ export {SassString} from './string'; | ||
* | ||
* This is passed to and returned by [[CustomFunction]]s, which are passed into | ||
* the Sass implementation using [[Options.functions]]. | ||
* This is passed to and returned by {@link CustomFunction}s, which are passed | ||
* into the Sass implementation using {@link Options.functions}. | ||
* | ||
@@ -48,3 +58,3 @@ * @category Custom Function | ||
* | ||
* @returns An immutable [[List]] from the [`immutable` | ||
* @returns An immutable {@link List} from the [`immutable` | ||
* package](https://immutable-js.com/). | ||
@@ -69,3 +79,3 @@ */ | ||
/** | ||
* Returns JavaScript's `null` value if this is [[sassNull]], and returns | ||
* Returns JavaScript's `null` value if this is {@link sassNull}, and returns | ||
* `this` otherwise. | ||
@@ -85,3 +95,3 @@ */ | ||
* Converts `sassIndex` into a JavaScript-style index into the list returned | ||
* by [[asList]]. | ||
* by {@link asList}. | ||
* | ||
@@ -95,3 +105,3 @@ * Sass indexes are one-based, while JavaScript indexes are zero-based. Sass | ||
* @throws `Error` If `sassIndex` isn't a number, if that number isn't an | ||
* integer, or if that integer isn't a valid index for [[asList]]. | ||
* integer, or if that integer isn't a valid index for {@link asList}. | ||
*/ | ||
@@ -117,5 +127,5 @@ sassIndexToListIndex(sassIndex: Value, name?: string): number; | ||
/** | ||
* Throws if `this` isn't a [[SassBoolean]]. | ||
* Throws if `this` isn't a {@link SassBoolean}. | ||
* | ||
* **Heads up!** Functions should generally use [[isTruthy]] rather than | ||
* **Heads up!** Functions should generally use {@link isTruthy} rather than | ||
* requiring a literal boolean. | ||
@@ -129,3 +139,3 @@ * | ||
/** | ||
* Throws if `this` isn't a [[SassColor]]. | ||
* Throws if `this` isn't a {@link SassCalculation}. | ||
* | ||
@@ -135,6 +145,14 @@ * @param name - The name of the function argument `this` came from (without | ||
*/ | ||
assertCalculation(name?: string): SassCalculation; | ||
/** | ||
* Throws if `this` isn't a {@link SassColor}. | ||
* | ||
* @param name - The name of the function argument `this` came from (without | ||
* the `$`) if it came from an argument. Used for error reporting. | ||
*/ | ||
assertColor(name?: string): SassColor; | ||
/** | ||
* Throws if `this` isn't a [[SassFunction]]. | ||
* Throws if `this` isn't a {@link SassFunction}. | ||
* | ||
@@ -147,3 +165,3 @@ * @param name - The name of the function argument `this` came from (without | ||
/** | ||
* Throws if `this` isn't a [[SassMap]]. | ||
* Throws if `this` isn't a {@link SassMap}. | ||
* | ||
@@ -156,3 +174,3 @@ * @param name - The name of the function argument `this` came from (without | ||
/** | ||
* Throws if `this` isn't a [[SassNumber]]. | ||
* Throws if `this` isn't a {@link SassMixin}. | ||
* | ||
@@ -162,6 +180,14 @@ * @param name - The name of the function argument `this` came from (without | ||
*/ | ||
assertMixin(name?: string): SassMixin; | ||
/** | ||
* Throws if `this` isn't a {@link SassNumber}. | ||
* | ||
* @param name - The name of the function argument `this` came from (without | ||
* the `$`) if it came from an argument. Used for error reporting. | ||
*/ | ||
assertNumber(name?: string): SassNumber; | ||
/** | ||
* Throws if `this` isn't a [[SassString]]. | ||
* Throws if `this` isn't a {@link SassString}. | ||
* | ||
@@ -168,0 +194,0 @@ * @param name - The name of the function argument `this` came from (without |
@@ -24,3 +24,3 @@ import {List} from 'immutable'; | ||
* @param contents - The contents of the list. This may be either a plain | ||
* JavaScript array or an immutable [[List]] from the [`immutable` | ||
* JavaScript array or an immutable {@link List} from the [`immutable` | ||
* package](https://immutable-js.com/). | ||
@@ -27,0 +27,0 @@ * |
@@ -16,3 +16,3 @@ import {OrderedMap} from 'immutable'; | ||
* @param contents - The contents of the map. This is an immutable | ||
* [[OrderedMap]] from the [`immutable` package](https://immutable-js.com/). | ||
* `OrderedMap` from the [`immutable` package](https://immutable-js.com/). | ||
* Defaults to an empty map. | ||
@@ -23,3 +23,3 @@ */ | ||
/** | ||
* Returns the contents of this map as an immutable [[OrderedMap]] from the | ||
* Returns the contents of this map as an immutable {@link OrderedMap} from the | ||
* [`immutable` package](https://immutable-js.com/). | ||
@@ -38,3 +38,3 @@ */ | ||
/** Inherited from [[Value.get]]. */ | ||
/** Inherited from {@link Value.get}. */ | ||
get(index: number): SassList | undefined; | ||
@@ -41,0 +41,0 @@ |
@@ -24,3 +24,3 @@ import {List} from 'immutable'; | ||
* use for the number. This may be either a plain JavaScript array or an | ||
* immutable [[List]] from the [`immutable` | ||
* immutable {@link List} from the [`immutable` | ||
* package](https://immutable-js.com/). | ||
@@ -30,3 +30,3 @@ * | ||
* to use for the number. This may be either a plain JavaScript array or an | ||
* immutable [[List]] from the [`immutable` | ||
* immutable {@link List} from the [`immutable` | ||
* package](https://immutable-js.com/). | ||
@@ -47,8 +47,8 @@ */ | ||
/** Whether [[value]] is an integer according to Sass's equality logic. */ | ||
/** Whether {@link value} is an integer according to Sass's equality logic. */ | ||
get isInt(): boolean; | ||
/** | ||
* If [[value]] is an integer according to [[isInt]], returns [[value]] | ||
* rounded to that integer. If it's not an integer, returns `null`. | ||
* If {@link value} is an integer according to {@link isInt}, returns {@link | ||
* value} rounded to that integer. If it's not an integer, returns `null`. | ||
*/ | ||
@@ -58,3 +58,3 @@ get asInt(): number | null; | ||
/** | ||
* This number's numerator units as an immutable [[List]] from the | ||
* This number's numerator units as an immutable {@link List} from the | ||
* [`immutable` package](https://immutable-js.com/). | ||
@@ -65,3 +65,3 @@ */ | ||
/** | ||
* This number's denominator units as an immutable [[List]] from the | ||
* This number's denominator units as an immutable {@link List} from the | ||
* [`immutable` package](https://immutable-js.com/). | ||
@@ -75,4 +75,4 @@ */ | ||
/** | ||
* If [[value]] is an integer according to [[isInt]], returns it rounded to | ||
* that integer. Otherwise, throws an error. | ||
* If {@link value} is an integer according to {@link isInt}, returns it | ||
* rounded to that integer. Otherwise, throws an error. | ||
* | ||
@@ -85,5 +85,5 @@ * @param name - The name of the function argument `this` came from (without | ||
/** | ||
* Returns [[value]] if it's within `min` and `max`. If [[value]] is equal to | ||
* `min` or `max` according to Sass's equality, returns `min` or `max` | ||
* respectively. Otherwise, throws an error. | ||
* Returns {@link value} if it's within `min` and `max`. If {@link value} is | ||
* equal to `min` or `max` according to Sass's equality, returns `min` or | ||
* `max` respectively. Otherwise, throws an error. | ||
* | ||
@@ -130,8 +130,8 @@ * @param name - The name of the function argument `this` came from (without | ||
* @param newNumerators - The numerator units to convert this number to. This | ||
* may be either a plain JavaScript array or an immutable [[List]] from the | ||
* [`immutable` package](https://immutable-js.com/). | ||
* may be either a plain JavaScript array or an immutable {@link List} from | ||
* the [`immutable` package](https://immutable-js.com/). | ||
* | ||
* @param newDenominators - The denominator units to convert this number to. | ||
* This may be either a plain JavaScript array or an immutable [[List]] from | ||
* the [`immutable` package](https://immutable-js.com/). | ||
* This may be either a plain JavaScript array or an immutable {@link List} | ||
* from the [`immutable` package](https://immutable-js.com/). | ||
* | ||
@@ -166,4 +166,4 @@ * @param name - The name of the function argument `this` came from (without | ||
/** | ||
* Returns [[value]], converted to the units represented by `newNumerators` | ||
* and `newDenominators`. | ||
* Returns {@link value}, converted to the units represented by | ||
* `newNumerators` and `newDenominators`. | ||
* | ||
@@ -174,9 +174,9 @@ * @throws `Error` if this number's units are incompatible with | ||
* | ||
* @param newNumerators - The numerator units to convert [[value]] to. This | ||
* may be either a plain JavaScript array or an immutable [[List]] from the | ||
* [`immutable` package](https://immutable-js.com/). | ||
* @param newNumerators - The numerator units to convert {@link value} to. | ||
* This may be either a plain JavaScript array or an immutable {@link List} | ||
* from the [`immutable` package](https://immutable-js.com/). | ||
* | ||
* @param newDenominators - The denominator units to convert [[value]] to. | ||
* This may be either a plain JavaScript array or an immutable [[List]] from | ||
* the [`immutable` package](https://immutable-js.com/). | ||
* @param newDenominators - The denominator units to convert {@link value} to. | ||
* This may be either a plain JavaScript array or an immutable {@link List} | ||
* from the [`immutable` package](https://immutable-js.com/). | ||
* | ||
@@ -193,3 +193,3 @@ * @param name - The name of the function argument `this` came from (without | ||
/** | ||
* Returns [[value]], converted to the same units as `other`. | ||
* Returns {@link value}, converted to the same units as `other`. | ||
* | ||
@@ -215,3 +215,3 @@ * @throws `Error` if this number's units are incompatible with `other`'s | ||
* | ||
* Unlike [[convert]] this does *not* throw an error if this number is | ||
* Unlike {@link convert} this does *not* throw an error if this number is | ||
* unitless and either `newNumerators` or `newDenominators` are not empty, or | ||
@@ -225,8 +225,8 @@ * vice-versa. Instead, it treats all unitless numbers as convertible to and | ||
* @param newNumerators - The numerator units to convert this number to. This | ||
* may be either a plain JavaScript array or an immutable [[List]] from the | ||
* [`immutable` package](https://immutable-js.com/). | ||
* may be either a plain JavaScript array or an immutable {@link List} from | ||
* the [`immutable` package](https://immutable-js.com/). | ||
* | ||
* @param newDenominators - The denominator units to convert this number to. | ||
* This may be either a plain JavaScript array or an immutable [[List]] from | ||
* the [`immutable` package](https://immutable-js.com/). | ||
* This may be either a plain JavaScript array or an immutable {@link List} | ||
* from the [`immutable` package](https://immutable-js.com/). | ||
* | ||
@@ -246,6 +246,6 @@ * @param name - The name of the function argument `this` came from (without | ||
* | ||
* Unlike [[convertToMatch]] this does *not* throw an error if this number is | ||
* unitless and either `newNumerators` or `newDenominators` are not empty, or | ||
* vice-versa. Instead, it treats all unitless numbers as convertible to and | ||
* from all units without changing the value. | ||
* Unlike {@link convertToMatch} this does *not* throw an error if this number | ||
* is unitless and either `newNumerators` or `newDenominators` are not empty, | ||
* or vice-versa. Instead, it treats all unitless numbers as convertible to | ||
* and from all units without changing the value. | ||
* | ||
@@ -268,9 +268,9 @@ * @throws `Error` if this number's units are incompatible with `other`'s | ||
/** | ||
* Returns [[value]], converted to the units represented by `newNumerators` and | ||
* `newDenominators`. | ||
* Returns {@link value}, converted to the units represented by | ||
* `newNumerators` and `newDenominators`. | ||
* | ||
* Unlike [[convertValue]] this does *not* throw an error if this number is | ||
* unitless and either `newNumerators` or `newDenominators` are not empty, or | ||
* vice-versa. Instead, it treats all unitless numbers as convertible to and | ||
* from all units without changing the value. | ||
* Unlike {@link convertValue} this does *not* throw an error if this number | ||
* is unitless and either `newNumerators` or `newDenominators` are not empty, | ||
* or vice-versa. Instead, it treats all unitless numbers as convertible to | ||
* and from all units without changing the value. | ||
* | ||
@@ -280,9 +280,9 @@ * @throws `Error` if this number's units are incompatible with | ||
* | ||
* @param newNumerators - The numerator units to convert [[value]] to. This | ||
* may be either a plain JavaScript array or an immutable [[List]] from the | ||
* [`immutable` package](https://immutable-js.com/). | ||
* @param newNumerators - The numerator units to convert {@link value} to. | ||
* This may be either a plain JavaScript array or an immutable {@link List} | ||
* from the [`immutable` package](https://immutable-js.com/). | ||
* | ||
* @param newDenominators - The denominator units to convert [[value]] to. | ||
* This may be either a plain JavaScript array or an immutable [[List]] from | ||
* the [`immutable` package](https://immutable-js.com/). | ||
* @param newDenominators - The denominator units to convert {@link value} to. | ||
* This may be either a plain JavaScript array or an immutable {@link List} | ||
* from the [`immutable` package](https://immutable-js.com/). | ||
* | ||
@@ -299,6 +299,6 @@ * @param name - The name of the function argument `this` came from (without | ||
/** | ||
* Returns [[value]], converted to the units represented by `newNumerators` | ||
* and `newDenominators`. | ||
* Returns {@link value}, converted to the units represented by | ||
* `newNumerators` and `newDenominators`. | ||
* | ||
* Unlike [[convertValueToMatch]] this does *not* throw an error if this | ||
* Unlike {@link convertValueToMatch} this does *not* throw an error if this | ||
* number is unitless and either `newNumerators` or `newDenominators` are not | ||
@@ -305,0 +305,0 @@ * empty, or vice-versa. Instead, it treats all unitless numbers as |
@@ -65,3 +65,3 @@ import {Value} from './index'; | ||
/** | ||
* Converts `sassIndex` to a JavaScript index into [[text]]. | ||
* Converts `sassIndex` to a JavaScript index into {@link text}. | ||
* | ||
@@ -68,0 +68,0 @@ * Sass indices are one-based, while JavaScript indices are zero-based. Sass |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5163358
35
5113
2