@sass/types 1.93.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2016, Google Inc.
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,6 @@
1
+ # @sass/types
2
+
3
+ This package is a dual-publish of the [Sass JS API](https://sass-lang.com/documentation/js-api/)
4
+ types. The `sass` and `sass-embedded` packages **still contain types**. This package is for
5
+ users who _only_ need the Sass JS types (such as for `@types/gulp-sass`). It is published
6
+ alongside every release of `sass` and `sass-embedded`, so you can always use the same version.
package/package.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "@sass/types",
3
+ "version": "1.93.2",
4
+ "description": "A standalone types package for the Sass JS API",
5
+ "repository": "sass/sass",
6
+ "author": "Google Inc.",
7
+ "license": "MIT",
8
+ "exports": {
9
+ "types": "./types/index.d.ts"
10
+ },
11
+ "types": "types/index.d.ts",
12
+ "files": [
13
+ "types/**/*.d.ts"
14
+ ],
15
+ "publishConfig": {
16
+ "access": "public"
17
+ }
18
+ }
@@ -0,0 +1,342 @@
1
+ import {RawSourceMap} from 'source-map-js';
2
+
3
+ import {Options, StringOptions} from './options';
4
+
5
+ /**
6
+ * The result of compiling Sass to CSS. Returned by {@link compile}, {@link
7
+ * compileAsync}, {@link compileString}, and {@link compileStringAsync}.
8
+ *
9
+ * @category Compile
10
+ */
11
+ export interface CompileResult {
12
+ /**
13
+ * The generated CSS.
14
+ *
15
+ * Note that this *never* includes a `sourceMapUrl` comment—it's up to the
16
+ * caller to determine where to save the source map and how to link to it from
17
+ * the stylesheet.
18
+ */
19
+ css: string;
20
+
21
+ /**
22
+ * The canonical URLs of all the stylesheets that were loaded during the
23
+ * Sass compilation. The order of these URLs is not guaranteed.
24
+ */
25
+ loadedUrls: URL[];
26
+
27
+ /**
28
+ * The object representation of the source map that maps locations in the
29
+ * generated CSS back to locations in the Sass source code.
30
+ *
31
+ * This typically uses absolute `file:` URLs to refer to Sass files, although
32
+ * this can be controlled by having a custom {@link Importer} return {@link
33
+ * ImporterResult.sourceMapUrl}.
34
+ *
35
+ * This is set if and only if {@link Options.sourceMap} is `true`.
36
+ */
37
+ sourceMap?: RawSourceMap;
38
+ }
39
+
40
+ /**
41
+ * The result of creating a synchronous compiler. Returned by
42
+ * {@link initCompiler}.
43
+ *
44
+ * @category Compile
45
+ */
46
+ export class Compiler {
47
+ /**
48
+ * Throws an error if constructed directly, instead of via
49
+ * {@link initCompiler}.
50
+ */
51
+ private constructor();
52
+
53
+ /**
54
+ * The {@link compile} method exposed through a Compiler instance while it is
55
+ * active. If this is called after {@link dispose} on the Compiler
56
+ * instance, an error will be thrown.
57
+ *
58
+ * During the Compiler instance's lifespan, given the same input, this will
59
+ * return an identical result to the {@link compile} method exposed at the
60
+ * module root.
61
+ */
62
+ compile(path: string, options?: Options<'sync'>): CompileResult;
63
+
64
+ /**
65
+ * The {@link compileString} method exposed through a Compiler instance while
66
+ * it is active. If this is called after {@link dispose} on the Compiler
67
+ * instance, an error will be thrown.
68
+ *
69
+ * During the Compiler instance's lifespan, given the same input, this will
70
+ * return an identical result to the {@link compileString} method exposed at
71
+ * the module root.
72
+ */
73
+ compileString(source: string, options?: StringOptions<'sync'>): CompileResult;
74
+
75
+ /**
76
+ * Ends the lifespan of this Compiler instance. After this is invoked, all
77
+ * calls to the Compiler instance's {@link compile} or {@link compileString}
78
+ * methods will result in an error.
79
+ */
80
+ dispose(): void;
81
+ }
82
+
83
+ /**
84
+ * The result of creating an asynchronous compiler. Returned by
85
+ * {@link initAsyncCompiler}.
86
+ *
87
+ * @category Compile
88
+ */
89
+ export class AsyncCompiler {
90
+ /**
91
+ * Throws an error if constructed directly, instead of via
92
+ * {@link initAsyncCompiler}.
93
+ */
94
+ private constructor();
95
+
96
+ /**
97
+ * The {@link compileAsync} method exposed through an Async Compiler instance
98
+ * while it is active. If this is called after {@link dispose} on the Async
99
+ * Compiler instance, an error will be thrown.
100
+ *
101
+ * During the Async Compiler instance's lifespan, given the same input, this
102
+ * will return an identical result to the {@link compileAsync} method exposed
103
+ * at the module root.
104
+ */
105
+ compileAsync(
106
+ path: string,
107
+ options?: Options<'async'>
108
+ ): Promise<CompileResult>;
109
+
110
+ /**
111
+ * The {@link compileStringAsync} method exposed through an Async Compiler
112
+ * instance while it is active. If this is called after {@link dispose} on the
113
+ * Async Compiler instance, an error will be thrown.
114
+ *
115
+ * During the Async Compiler instance's lifespan, given the same input, this
116
+ * will return an identical result to the {@link compileStringAsync} method
117
+ * exposed at the module root.
118
+ */
119
+ compileStringAsync(
120
+ source: string,
121
+ options?: StringOptions<'async'>
122
+ ): Promise<CompileResult>;
123
+
124
+ /**
125
+ * Ends the lifespan of this Async Compiler instance. After this is invoked,
126
+ * all subsequent calls to the Compiler instance's `compileAsync` or
127
+ * `compileStringAsync` methods will result in an error.
128
+ *
129
+ * Any compilations that are submitted before `dispose` will not be cancelled,
130
+ * and will be allowed to settle.
131
+ *
132
+ * After all compilations have been settled and Sass completes any internal
133
+ * task cleanup, `dispose` will resolve its promise.
134
+ */
135
+ dispose(): Promise<void>;
136
+ }
137
+
138
+ /**
139
+ * Synchronously compiles the Sass file at `path` to CSS. If it succeeds it
140
+ * returns a {@link CompileResult}, and if it fails it throws an {@link
141
+ * Exception}.
142
+ *
143
+ * This only allows synchronous {@link Importer}s and {@link CustomFunction}s.
144
+ *
145
+ * **Heads up!** When using the [sass-embedded] npm package for single
146
+ * compilations, **{@link compileAsync} is almost always faster than
147
+ * {@link compile}**, due to the overhead of emulating synchronous messaging
148
+ * with worker threads and concurrent compilations being blocked on main thread.
149
+ *
150
+ * If you are running multiple compilations with the [sass-embedded] npm
151
+ * package, using a {@link Compiler} will provide some speed improvements over
152
+ * the module-level methods, and an {@link AsyncCompiler} will be much faster.
153
+ *
154
+ * [sass-embedded]: https://www.npmjs.com/package/sass-embedded
155
+ *
156
+ * @example
157
+ *
158
+ * ```js
159
+ * const sass = require('sass');
160
+ *
161
+ * const result = sass.compile("style.scss");
162
+ * console.log(result.css);
163
+ * ```
164
+ *
165
+ * @category Compile
166
+ * @compatibility dart: "1.45.0", node: false
167
+ */
168
+ export function compile(path: string, options?: Options<'sync'>): CompileResult;
169
+
170
+ /**
171
+ * Asynchronously compiles the Sass file at `path` to CSS. Returns a promise
172
+ * that resolves with a {@link CompileResult} if it succeeds and rejects with an
173
+ * {@link Exception} if it fails.
174
+ *
175
+ * This only allows synchronous or asynchronous {@link Importer}s and
176
+ * {@link CustomFunction}s.
177
+ *
178
+ * **Heads up!** When using the `sass` npm package, **{@link compile} is almost
179
+ * twice as fast as {@link compileAsync}**, due to the overhead of making the
180
+ * entire evaluation process asynchronous.
181
+ *
182
+ * @example
183
+ *
184
+ * ```js
185
+ * const sass = require('sass');
186
+ *
187
+ * const result = await sass.compileAsync("style.scss");
188
+ * console.log(result.css);
189
+ * ```
190
+ *
191
+ * @category Compile
192
+ * @compatibility dart: "1.45.0", node: false
193
+ */
194
+ export function compileAsync(
195
+ path: string,
196
+ options?: Options<'async'>
197
+ ): Promise<CompileResult>;
198
+
199
+ /**
200
+ * Synchronously compiles a stylesheet whose contents is `source` to CSS. If it
201
+ * succeeds it returns a {@link CompileResult}, and if it fails it throws an
202
+ * {@link Exception}.
203
+ *
204
+ * This only allows synchronous {@link Importer}s and {@link CustomFunction}s.
205
+ *
206
+ * **Heads up!** When using the [sass-embedded] npm package for single
207
+ * compilations, **{@link compileStringAsync} is almost always faster than
208
+ * {@link compileString}**, due to the overhead of emulating synchronous
209
+ * messaging with worker threads and concurrent compilations being blocked on
210
+ * main thread.
211
+ *
212
+ * If you are running multiple compilations with the [sass-embedded] npm
213
+ * package, using a {@link Compiler} will provide some speed improvements over
214
+ * the module-level methods, and an {@link AsyncCompiler} will be much faster.
215
+ *
216
+ * [sass-embedded]: https://www.npmjs.com/package/sass-embedded
217
+ *
218
+ * @example
219
+ *
220
+ * ```js
221
+ * const sass = require('sass');
222
+ *
223
+ * const result = sass.compileString(`
224
+ * h1 {
225
+ * font-size: 40px;
226
+ * code {
227
+ * font-face: Roboto Mono;
228
+ * }
229
+ * }`);
230
+ * console.log(result.css);
231
+ * ```
232
+ *
233
+ * @category Compile
234
+ * @compatibility dart: "1.45.0", node: false
235
+ */
236
+ export function compileString(
237
+ source: string,
238
+ options?: StringOptions<'sync'>
239
+ ): CompileResult;
240
+
241
+ /**
242
+ * Asynchronously compiles a stylesheet whose contents is `source` to CSS.
243
+ * Returns a promise that resolves with a {@link CompileResult} if it succeeds
244
+ * and rejects with an {@link Exception} if it fails.
245
+ *
246
+ * This only allows synchronous or asynchronous {@link Importer}s and {@link
247
+ * CustomFunction}s.
248
+ *
249
+ * **Heads up!** When using the `sass` npm package, **{@link compileString} is
250
+ * almost twice as fast as {@link compileStringAsync}**, due to the overhead
251
+ * of making the entire evaluation process asynchronous.
252
+ *
253
+ * @example
254
+ *
255
+ * ```js
256
+ * const sass = require('sass');
257
+ *
258
+ * const result = await sass.compileStringAsync(`
259
+ * h1 {
260
+ * font-size: 40px;
261
+ * code {
262
+ * font-face: Roboto Mono;
263
+ * }
264
+ * }`);
265
+ * console.log(result.css);
266
+ * ```
267
+ *
268
+ * @category Compile
269
+ * @compatibility dart: "1.45.0", node: false
270
+ */
271
+ export function compileStringAsync(
272
+ source: string,
273
+ options?: StringOptions<'async'>
274
+ ): Promise<CompileResult>;
275
+
276
+ /**
277
+ * Creates a synchronous {@link Compiler}. Each compiler instance exposes the
278
+ * {@link compile} and {@link compileString} methods within the lifespan of the
279
+ * Compiler. Given identical input, these methods will return results identical
280
+ * to their counterparts exposed at the module root. To use asynchronous
281
+ * compilation, use {@link initAsyncCompiler}.
282
+ *
283
+ * When calling the compile functions multiple times, using a compiler instance
284
+ * with the [sass-embedded] npm package is much faster than using the top-level
285
+ * compilation methods or the [sass] npm package.
286
+ *
287
+ * [sass-embedded]: https://www.npmjs.com/package/sass-embedded
288
+ *
289
+ * [sass]: https://www.npmjs.com/package/sass
290
+ *
291
+ * @example
292
+ *
293
+ * ```js
294
+ * const sass = require('sass');
295
+ * function setup() {
296
+ * const compiler = sass.initCompiler();
297
+ * const result1 = compiler.compileString('a {b: c}').css;
298
+ * const result2 = compiler.compileString('a {b: c}').css;
299
+ * compiler.dispose();
300
+ *
301
+ * // throws error
302
+ * const result3 = sass.compileString('a {b: c}').css;
303
+ * }
304
+ * ```
305
+ * @category Compile
306
+ * @compatibility dart: "1.70.0", node: false
307
+ */
308
+ export function initCompiler(): Compiler;
309
+
310
+ /**
311
+ * Creates an asynchronous {@link AsyncCompiler}. Each compiler
312
+ * instance exposes the {@link compileAsync} and {@link compileStringAsync}
313
+ * methods within the lifespan of the Compiler. Given identical input, these
314
+ * methods will return results identical to their counterparts exposed at the
315
+ * module root. To use synchronous compilation, use {@link initCompiler};
316
+ *
317
+ * When calling the compile functions multiple times, using a compiler instance
318
+ * with the [sass-embedded] npm package is much faster than using the top-level
319
+ * compilation methods or the [sass] npm package.
320
+ *
321
+ * [sass-embedded]: https://www.npmjs.com/package/sass-embedded
322
+ *
323
+ * [sass]: https://www.npmjs.com/package/sass
324
+ *
325
+ * @example
326
+ *
327
+ * ```js
328
+ * const sass = require('sass');
329
+ * async function setup() {
330
+ * const compiler = await sass.initAsyncCompiler();
331
+ * const result1 = await compiler.compileStringAsync('a {b: c}').css;
332
+ * const result2 = await compiler.compileStringAsync('a {b: c}').css;
333
+ * await compiler.dispose();
334
+ *
335
+ * // throws error
336
+ * const result3 = await sass.compileStringAsync('a {b: c}').css;
337
+ * }
338
+ * ```
339
+ * @category Compile
340
+ * @compatibility dart: "1.70.0", node: false
341
+ */
342
+ export function initAsyncCompiler(): Promise<AsyncCompiler>;
@@ -0,0 +1,290 @@
1
+ /**
2
+ * All of the deprecation types currently used by Sass.
3
+ *
4
+ * Any of these IDs or the deprecation objects they point to can be passed to
5
+ * `fatalDeprecations`, `futureDeprecations`, or `silenceDeprecations`.
6
+ */
7
+ export interface Deprecations {
8
+ // START AUTOGENERATED LIST
9
+ // Checksum: 0d3df25297a4e76b865aee1e908baf355e26d665
10
+
11
+ /**
12
+ * Deprecation for passing a string directly to meta.call().
13
+ *
14
+ * This deprecation was active in the first version of Dart Sass.
15
+ */
16
+ 'call-string': Deprecation<'call-string'>;
17
+
18
+ /**
19
+ * Deprecation for @elseif.
20
+ *
21
+ * This deprecation became active in Dart Sass 1.3.2.
22
+ */
23
+ elseif: Deprecation<'elseif'>;
24
+
25
+ /**
26
+ * Deprecation for @-moz-document.
27
+ *
28
+ * This deprecation became active in Dart Sass 1.7.2.
29
+ */
30
+ 'moz-document': Deprecation<'moz-document'>;
31
+
32
+ /**
33
+ * Deprecation for imports using relative canonical URLs.
34
+ *
35
+ * This deprecation became active in Dart Sass 1.14.2.
36
+ */
37
+ 'relative-canonical': Deprecation<'relative-canonical'>;
38
+
39
+ /**
40
+ * Deprecation for declaring new variables with !global.
41
+ *
42
+ * This deprecation became active in Dart Sass 1.17.2.
43
+ */
44
+ 'new-global': Deprecation<'new-global'>;
45
+
46
+ /**
47
+ * Deprecation for using color module functions in place of plain CSS functions.
48
+ *
49
+ * This deprecation became active in Dart Sass 1.23.0.
50
+ */
51
+ 'color-module-compat': Deprecation<'color-module-compat'>;
52
+
53
+ /**
54
+ * Deprecation for / operator for division.
55
+ *
56
+ * This deprecation became active in Dart Sass 1.33.0.
57
+ */
58
+ 'slash-div': Deprecation<'slash-div'>;
59
+
60
+ /**
61
+ * Deprecation for leading, trailing, and repeated combinators.
62
+ *
63
+ * This deprecation became active in Dart Sass 1.54.0.
64
+ */
65
+ 'bogus-combinators': Deprecation<'bogus-combinators'>;
66
+
67
+ /**
68
+ * Deprecation for ambiguous + and - operators.
69
+ *
70
+ * This deprecation became active in Dart Sass 1.55.0.
71
+ */
72
+ 'strict-unary': Deprecation<'strict-unary'>;
73
+
74
+ /**
75
+ * Deprecation for passing invalid units to built-in functions.
76
+ *
77
+ * This deprecation became active in Dart Sass 1.56.0.
78
+ */
79
+ 'function-units': Deprecation<'function-units'>;
80
+
81
+ /**
82
+ * Deprecation for using !default or !global multiple times for one variable.
83
+ *
84
+ * This deprecation became active in Dart Sass 1.62.0.
85
+ */
86
+ 'duplicate-var-flags': Deprecation<'duplicate-var-flags'>;
87
+
88
+ /**
89
+ * Deprecation for passing null as alpha in the JS API.
90
+ *
91
+ * This deprecation became active in Dart Sass 1.62.3.
92
+ */
93
+ 'null-alpha': Deprecation<'null-alpha'>;
94
+
95
+ /**
96
+ * Deprecation for passing percentages to the Sass abs() function.
97
+ *
98
+ * This deprecation became active in Dart Sass 1.65.0.
99
+ */
100
+ 'abs-percent': Deprecation<'abs-percent'>;
101
+
102
+ /**
103
+ * Deprecation for using the current working directory as an implicit load path.
104
+ *
105
+ * This deprecation became active in Dart Sass 1.73.0.
106
+ */
107
+ 'fs-importer-cwd': Deprecation<'fs-importer-cwd'>;
108
+
109
+ /**
110
+ * Deprecation for function and mixin names beginning with --.
111
+ *
112
+ * This deprecation became active in Dart Sass 1.76.0.
113
+ */
114
+ 'css-function-mixin': Deprecation<'css-function-mixin'>;
115
+
116
+ /**
117
+ * Deprecation for declarations after or between nested rules.
118
+ *
119
+ * This deprecation became active in Dart Sass 1.77.7.
120
+ * It became obsolete in Dart Sass 1.92.0.
121
+ */
122
+ 'mixed-decls': Deprecation<'mixed-decls'>;
123
+
124
+ /**
125
+ * Deprecation for meta.feature-exists
126
+ *
127
+ * This deprecation became active in Dart Sass 1.78.0.
128
+ */
129
+ 'feature-exists': Deprecation<'feature-exists'>;
130
+
131
+ /**
132
+ * Deprecation for certain uses of built-in sass:color functions.
133
+ *
134
+ * This deprecation became active in Dart Sass 1.79.0.
135
+ */
136
+ 'color-4-api': Deprecation<'color-4-api'>;
137
+
138
+ /**
139
+ * Deprecation for using global color functions instead of sass:color.
140
+ *
141
+ * This deprecation became active in Dart Sass 1.79.0.
142
+ */
143
+ 'color-functions': Deprecation<'color-functions'>;
144
+
145
+ /**
146
+ * Deprecation for legacy JS API.
147
+ *
148
+ * This deprecation became active in Dart Sass 1.79.0.
149
+ */
150
+ 'legacy-js-api': Deprecation<'legacy-js-api'>;
151
+
152
+ /**
153
+ * Deprecation for @import rules.
154
+ *
155
+ * This deprecation became active in Dart Sass 1.80.0.
156
+ */
157
+ import: Deprecation<'import'>;
158
+
159
+ /**
160
+ * Deprecation for global built-in functions that are available in sass: modules.
161
+ *
162
+ * This deprecation became active in Dart Sass 1.80.0.
163
+ */
164
+ 'global-builtin': Deprecation<'global-builtin'>;
165
+
166
+ /**
167
+ * Deprecation for functions named "type".
168
+ *
169
+ * This deprecation became active in Dart Sass 1.86.0.
170
+ * It became obsolete in Dart Sass 1.92.0.
171
+ */
172
+ 'type-function': Deprecation<'type-function'>;
173
+
174
+ /**
175
+ * Deprecation for passing a relative url to compileString().
176
+ *
177
+ * This deprecation became active in Dart Sass 1.88.0.
178
+ */
179
+ 'compile-string-relative-url': Deprecation<'compile-string-relative-url'>;
180
+
181
+ /**
182
+ * Deprecation for a rest parameter before a positional or named parameter.
183
+ *
184
+ * This deprecation became active in Dart Sass 1.91.0.
185
+ */
186
+ 'misplaced-rest': Deprecation<'misplaced-rest'>;
187
+
188
+ /**
189
+ * Deprecation for configuring private variables in @use, @forward, or load-css().
190
+ *
191
+ * This deprecation became active in Dart Sass 1.92.0.
192
+ */
193
+ 'with-private': Deprecation<'with-private'>;
194
+
195
+ // END AUTOGENERATED LIST
196
+
197
+ /**
198
+ * Used for any user-emitted deprecation warnings.
199
+ */
200
+ 'user-authored': Deprecation<'user-authored', 'user'>;
201
+ }
202
+
203
+ /**
204
+ * Either a deprecation or its ID, either of which can be passed to any of
205
+ * the relevant compiler options.
206
+ *
207
+ * @category Messages
208
+ * @compatibility dart: "1.74.0", node: false
209
+ */
210
+ export type DeprecationOrId = Deprecation | keyof Deprecations;
211
+
212
+ /**
213
+ * The possible statuses that each deprecation can have.
214
+ *
215
+ * "active" deprecations are currently emitting deprecation warnings.
216
+ * "future" deprecations are not yet active, but will be in the future.
217
+ * "obsolete" deprecations were once active, but no longer are.
218
+ *
219
+ * The only "user" deprecation is "user-authored", which is used for deprecation
220
+ * warnings coming from user code.
221
+ *
222
+ * @category Messages
223
+ * @compatibility dart: "1.74.0", node: false
224
+ */
225
+ export type DeprecationStatus = 'active' | 'user' | 'future' | 'obsolete';
226
+
227
+ /**
228
+ * A deprecated feature in the language.
229
+ *
230
+ * @category Messages
231
+ * @compatibility dart: "1.74.0", node: false
232
+ */
233
+ export interface Deprecation<
234
+ id extends keyof Deprecations = keyof Deprecations,
235
+ status extends DeprecationStatus = DeprecationStatus
236
+ > {
237
+ /** The unique ID of this deprecation. */
238
+ id: id;
239
+
240
+ /** The current status of this deprecation. */
241
+ status: status;
242
+
243
+ /** A human-readable description of this deprecation. */
244
+ description?: string;
245
+
246
+ /** The version this deprecation first became active in. */
247
+ deprecatedIn: status extends 'future' | 'user' ? null : Version;
248
+
249
+ /** The version this deprecation became obsolete in. */
250
+ obsoleteIn: status extends 'obsolete' ? Version : null;
251
+ }
252
+
253
+ /**
254
+ * A semantic version of the compiler.
255
+ *
256
+ * @category Messages
257
+ * @compatibility dart: "1.74.0", node: false
258
+ */
259
+ export class Version {
260
+ /**
261
+ * Constructs a new version.
262
+ *
263
+ * All components must be non-negative integers.
264
+ *
265
+ * @param major - The major version.
266
+ * @param minor - The minor version.
267
+ * @param patch - The patch version.
268
+ */
269
+ constructor(major: number, minor: number, patch: number);
270
+ readonly major: number;
271
+ readonly minor: number;
272
+ readonly patch: number;
273
+
274
+ /**
275
+ * Parses a version from a string.
276
+ *
277
+ * This throws an error if a valid version can't be parsed.
278
+ *
279
+ * @param version - A string in the form "major.minor.patch".
280
+ */
281
+ static parse(version: string): Version;
282
+ }
283
+
284
+ /**
285
+ * An object containing all deprecation types.
286
+ *
287
+ * @category Messages
288
+ * @compatibility dart: "1.74.0", node: false
289
+ */
290
+ export const deprecations: Deprecations;