@sass/types 1.106.1 → 1.107.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sass/types",
3
- "version": "1.106.1",
3
+ "version": "1.107.0",
4
4
  "description": "A standalone types package for the Sass JS API",
5
5
  "repository": "sass/dart-sass",
6
6
  "author": "Google Inc.",
@@ -3,10 +3,12 @@
3
3
  *
4
4
  * Any of these IDs or the deprecation objects they point to can be passed to
5
5
  * `fatalDeprecations`, `futureDeprecations`, or `silenceDeprecations`.
6
+ *
7
+ * @category Messages
6
8
  */
7
9
  export interface Deprecations {
8
10
  // START AUTOGENERATED LIST
9
- // Checksum: 1e05e728d95255e2e9fadbe9696baf751fc7ef66
11
+ // Checksum: 2c5800a683ec3b36c9e8d7f6eb427466b7439461
10
12
 
11
13
  /**
12
14
  * Deprecation for passing a string directly to meta.call().
@@ -214,6 +216,13 @@ export interface Deprecations {
214
216
  */
215
217
  'adjacent-compounds': Deprecation<'adjacent-compounds'>;
216
218
 
219
+ /**
220
+ * Deprecation for selecting versions beyond the current one for `fatalDeprecations`.
221
+ *
222
+ * This deprecation became active in Dart Sass 1.107.0.
223
+ */
224
+ 'deprecation-version': Deprecation<'deprecation-version'>;
225
+
217
226
  // END AUTOGENERATED LIST
218
227
 
219
228
  /**
@@ -222,6 +231,26 @@ export interface Deprecations {
222
231
  'user-authored': Deprecation<'user-authored', 'user'>;
223
232
  }
224
233
 
234
+ /**
235
+ * A value that selects a set of {@link Deprecation}s.
236
+ *
237
+ * * {@link DeprecationOrId} selects a single deprecation.
238
+ * * `Version` selects all deprecations that were present in that version of the
239
+ * current Sass implementation. The version must be less than or equal to the
240
+ * version of the library being used.
241
+ * * `DeprecationSelector[]` selects all deprecations selected by any of the
242
+ * listed selectors.
243
+ * * {@link DeprecationSelectorDifference} selects all deprecations matched by a
244
+ * `DeprecationSelector` *other than* a list of specific deprecations.
245
+ *
246
+ * @category Messages
247
+ */
248
+ export type DeprecationSelector =
249
+ | DeprecationOrId
250
+ | Version
251
+ | DeprecationSelectorDifference
252
+ | DeprecationSelector[];
253
+
225
254
  /**
226
255
  * Either a deprecation or its ID, either of which can be passed to any of
227
256
  * the relevant compiler options.
@@ -231,12 +260,32 @@ export interface Deprecations {
231
260
  */
232
261
  export type DeprecationOrId = Deprecation | keyof Deprecations;
233
262
 
263
+ /**
264
+ * An object that selects all deprecations selected by a
265
+ * {@link DeprecationSelector} other than a specific list of excluded
266
+ * deprecations.
267
+ *
268
+ * @category Messages
269
+ * @compatibility dart: "1.106.0", node: false
270
+ */
271
+ export interface DeprecationSelectorDifference {
272
+ /** The selected deprecations this, unless excluded by {@link exclude}. */
273
+ include: DeprecationSelector;
274
+
275
+ /**
276
+ * Deprecations that are *not* selected.
277
+ *
278
+ * These deprecations must be selected by {@link include}.
279
+ */
280
+ exclude: DeprecationOrId | DeprecationOrId[];
281
+ }
282
+
234
283
  /**
235
284
  * The possible statuses that each deprecation can have.
236
285
  *
237
- * "active" deprecations are currently emitting deprecation warnings.
238
- * "future" deprecations are not yet active, but will be in the future.
239
- * "obsolete" deprecations were once active, but no longer are.
286
+ * * "active" deprecations are currently emitting deprecation warnings.
287
+ * * "future" deprecations are not yet active, but will be in the future.
288
+ * * "obsolete" deprecations were once active, but no longer are.
240
289
  *
241
290
  * The only "user" deprecation is "user-authored", which is used for deprecation
242
291
  * warnings coming from user code.
@@ -303,10 +352,26 @@ export class Version {
303
352
  static parse(version: string): Version;
304
353
  }
305
354
 
355
+ /**
356
+ * Additional, non-deprecation properties available on the {@link deprecations}
357
+ * property.
358
+ *
359
+ * Due to TypeScript constraints, these must be declared separately to avoid
360
+ * violating the `Record` type. All of these fields are non-enumerable so it's
361
+ * still safe to iterate over all deprecations.
362
+ *
363
+ * @category Messages
364
+ * @compatibility dart: "1.106.0", node: false
365
+ */
366
+ export interface DeprecationsUtil {
367
+ /** Selects all deprecations that will become errors in Dart Sass 2.0.0. */
368
+ dartSass2: DeprecationSelector;
369
+ }
370
+
306
371
  /**
307
372
  * An object containing all deprecation types.
308
373
  *
309
374
  * @category Messages
310
375
  * @compatibility dart: "1.74.0", node: false
311
376
  */
312
- export const deprecations: Deprecations;
377
+ export const deprecations: Deprecations & DeprecationsUtil;
package/types/index.d.ts CHANGED
@@ -17,7 +17,10 @@ export {
17
17
  deprecations,
18
18
  Deprecation,
19
19
  Deprecations,
20
+ DeprecationsUtil,
20
21
  DeprecationOrId,
22
+ DeprecationSelector,
23
+ DeprecationSelectorDifference,
21
24
  DeprecationStatus,
22
25
  Version,
23
26
  } from './deprecations';
@@ -1,4 +1,4 @@
1
- import {DeprecationOrId, Version} from './deprecations';
1
+ import {DeprecationOrId, DeprecationSelector} from './deprecations';
2
2
  import {FileImporter, Importer, NodePackageImporter} from './importer';
3
3
  import {Logger} from './logger';
4
4
  import {Value} from './value';
@@ -126,16 +126,13 @@ export interface Options<sync extends 'sync' | 'async'> {
126
126
  /**
127
127
  * A set of deprecations to treat as fatal.
128
128
  *
129
- * If a deprecation warning of any provided type is encountered during
129
+ * If a deprecation warning of any selected type is encountered during
130
130
  * compilation, the compiler will error instead.
131
131
  *
132
- * If a `Version` is provided, then all deprecations that were active in that
133
- * compiler version will be treated as fatal.
134
- *
135
132
  * @category Messages
136
133
  * @compatiblity dart: "1.74.0", node: false
137
134
  */
138
- fatalDeprecations?: (DeprecationOrId | Version)[];
135
+ fatalDeprecations?: DeprecationSelector;
139
136
 
140
137
  /**
141
138
  * Additional built-in Sass functions that are available in all stylesheets.
@@ -221,8 +218,12 @@ export interface Options<sync extends 'sync' | 'async'> {
221
218
  *
222
219
  * @category Messages
223
220
  * @compatiblity dart: "1.74.0", node: false
221
+ * @compatiblity dart: feature: "single value", "1.106.0", node: false
222
+ *
223
+ * Prior to Dart Sass 1.106.0, this field could only take a list, not an
224
+ * individual {@link DeprecationOrId}.
224
225
  */
225
- futureDeprecations?: DeprecationOrId[];
226
+ futureDeprecations?: DeprecationOrId | DeprecationOrId[];
226
227
 
227
228
  /**
228
229
  * Custom importers that control how Sass resolves loads from rules like
@@ -330,8 +331,12 @@ export interface Options<sync extends 'sync' | 'async'> {
330
331
  *
331
332
  * @category Messages
332
333
  * @compatiblity dart: "1.74.0", node: false
334
+ * @compatiblity dart: feature: "single value", "1.106.0", node: false
335
+ *
336
+ * Prior to Dart Sass 1.106.0, this field could only take a list, not an
337
+ * individual {@link DeprecationOrId}.
333
338
  */
334
- silenceDeprecations?: DeprecationOrId[];
339
+ silenceDeprecations?: DeprecationOrId | DeprecationOrId[];
335
340
 
336
341
  /**
337
342
  * Whether or not Sass should generate a source map. If it does, the source