sass 1.74.1 → 1.75.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -42,7 +42,7 @@ export interface CanonicalizeContext {
42
42
  * Like all importers, this implements custom Sass loading logic for [`@use`
43
43
  * rules](https://sass-lang.com/documentation/at-rules/use) and [`@import`
44
44
  * rules](https://sass-lang.com/documentation/at-rules/import). It can be passed
45
- * to {@link Options.importers} or {@link StringOptionsWithImporter.importer}.
45
+ * to {@link Options.importers} or {@link StringOptions.importer}.
46
46
  *
47
47
  * @typeParam sync - A `FileImporter<'sync'>`'s {@link findFileUrl} must return
48
48
  * synchronously, but in return it can be passed to {@link compile} and {@link
@@ -122,7 +122,7 @@ export interface FileImporter<
122
122
  * An object that implements custom Sass loading logic for [`@use`
123
123
  * rules](https://sass-lang.com/documentation/at-rules/use) and [`@import`
124
124
  * rules](https://sass-lang.com/documentation/at-rules/import). It can be passed
125
- * to {@link Options.importers} or {@link StringOptionsWithImporter.importer}.
125
+ * to {@link Options.importers} or {@link StringOptions.importer}.
126
126
  *
127
127
  * Importers that simply redirect to files on disk are encouraged to use the
128
128
  * {@link FileImporter} interface instead.
@@ -292,10 +292,10 @@ export interface Options<sync extends 'sync' | 'async'> {
292
292
  * so that they can get fixed as soon as possible!
293
293
  *
294
294
  * **Heads up!** If {@link compileString} or {@link compileStringAsync} is
295
- * called without {@link StringOptionsWithoutImporter.url}, <em>all</em>
296
- * stylesheets it loads will be considered dependencies. Since it doesn’t have
297
- * a path of its own, everything it loads is coming from a load path rather
298
- * than a relative import.
295
+ * called without {@link StringOptions.url}, <em>all</em> stylesheets it loads
296
+ * will be considered dependencies. Since it doesn’t have a path of its own,
297
+ * everything it loads is coming from a load path rather than a relative
298
+ * import.
299
299
  *
300
300
  * @defaultValue `false`
301
301
  * @category Messages
@@ -388,9 +388,10 @@ export interface Options<sync extends 'sync' | 'async'> {
388
388
  * Options that can be passed to {@link compileString} or {@link
389
389
  * compileStringAsync}.
390
390
  *
391
- * If the {@link StringOptionsWithImporter.importer} field isn't passed, the
392
- * entrypoint file can load files relative to itself if a `file://` URL is
393
- * passed to the {@link url} field.
391
+ * If the {@link StringOptions.importer} field isn't passed, the entrypoint file
392
+ * can load files relative to itself if a `file://` URL is passed to the {@link
393
+ * url} field. If it is passed, the entrypoint file uses it to load files
394
+ * relative to itself.
394
395
  *
395
396
  * @typeParam sync - This lets the TypeScript checker verify that asynchronous
396
397
  * {@link Importer}s, {@link FileImporter}s, and {@link CustomFunction}s aren't
@@ -398,7 +399,7 @@ export interface Options<sync extends 'sync' | 'async'> {
398
399
  *
399
400
  * @category Options
400
401
  */
401
- export interface StringOptionsWithoutImporter<sync extends 'sync' | 'async'>
402
+ export interface StringOptions<sync extends 'sync' | 'async'>
402
403
  extends Options<sync> {
403
404
  /**
404
405
  * The {@link Syntax} to use to parse the entrypoint stylesheet.
@@ -409,6 +410,19 @@ export interface StringOptionsWithoutImporter<sync extends 'sync' | 'async'>
409
410
  */
410
411
  syntax?: Syntax;
411
412
 
413
+ /**
414
+ * The importer to use to handle loads that are relative to the entrypoint
415
+ * stylesheet.
416
+ *
417
+ * A relative load's URL is first resolved relative to {@link url}, then
418
+ * passed to {@link importer}. (It's passed as-is if {@link url} isn't
419
+ * passed.) If the importer doesn't recognize it, it's then passed to {@link
420
+ * importers} and {@link loadPaths}.
421
+ *
422
+ * @category Input
423
+ */
424
+ importer?: Importer<sync> | FileImporter<sync>;
425
+
412
426
  /**
413
427
  * The canonical URL of the entrypoint stylesheet.
414
428
  *
@@ -418,62 +432,24 @@ export interface StringOptionsWithoutImporter<sync extends 'sync' | 'async'>
418
432
  * loadPaths}.
419
433
  *
420
434
  * @category Input
435
+ * @compatibility feature: "Undefined URL with importer", dart: "1.75.0", node: false
436
+ *
437
+ * Earlier versions of Dart Sass required {@link url} to be defined when
438
+ * passing {@link StringOptions.importer}.
421
439
  */
422
440
  url?: URL;
423
441
  }
424
442
 
425
443
  /**
426
- * Options that can be passed to {@link compileString} or {@link
427
- * compileStringAsync}.
428
- *
429
- * If the {@link StringOptionsWithImporter.importer} field is passed, the
430
- * entrypoint file uses it to load files relative to itself and the {@link url}
431
- * field is mandatory.
432
- *
433
- * @typeParam sync - This lets the TypeScript checker verify that asynchronous
434
- * {@link Importer}s, {@link FileImporter}s, and {@link CustomFunction}s aren't
435
- * passed to {@link compile} or {@link compileString}.
436
- *
437
444
  * @category Options
445
+ * @deprecated Use {@link StringOptions} instead.
438
446
  */
439
- export interface StringOptionsWithImporter<sync extends 'sync' | 'async'>
440
- extends StringOptionsWithoutImporter<sync> {
441
- /**
442
- * The importer to use to handle loads that are relative to the entrypoint
443
- * stylesheet.
444
- *
445
- * A relative load's URL is first resolved relative to {@link url}, then
446
- * passed to {@link importer}. If the importer doesn't recognize it, it's then
447
- * passed to {@link importers} and {@link loadPaths}.
448
- *
449
- * @category Input
450
- */
451
- importer: Importer<sync> | FileImporter<sync>;
452
-
453
- /**
454
- * The canonical URL of the entrypoint stylesheet. If this is passed along
455
- * with {@link importer}, it's used to resolve relative loads in the
456
- * entrypoint stylesheet.
457
- *
458
- * @category Input
459
- */
460
- url: URL;
461
- }
447
+ type StringOptionsWithoutImporter<sync extends 'sync' | 'async'> =
448
+ StringOptions<sync>;
462
449
 
463
450
  /**
464
- * Options that can be passed to {@link compileString} or {@link
465
- * compileStringAsync}.
466
- *
467
- * This is a {@link StringOptionsWithImporter} if it has a {@link
468
- * StringOptionsWithImporter.importer} field, and a {@link
469
- * StringOptionsWithoutImporter} otherwise.
470
- *
471
- * @typeParam sync - This lets the TypeScript checker verify that asynchronous
472
- * {@link Importer}s, {@link FileImporter}s, and {@link CustomFunction}s aren't
473
- * passed to {@link compile} or {@link compileString}.
474
- *
475
451
  * @category Options
452
+ * @deprecated Use {@link StringOptions} instead.
476
453
  */
477
- export type StringOptions<sync extends 'sync' | 'async'> =
478
- | StringOptionsWithImporter<sync>
479
- | StringOptionsWithoutImporter<sync>;
454
+ type StringOptionsWithImporter<sync extends 'sync' | 'async'> =
455
+ StringOptions<sync>;