c65f192240a8e1f2c09a7d9240a6c5f7f29d95b8e7cf6a5494c7ff9ceb3099a26c90e33040eefc47a358798782726d4ae9f8ddacca124395f453bae25f797f 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  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. * Deprecation for passing a string directly to meta.call().
  12. *
  13. * This deprecation was active in the first version of Dart Sass.
  14. */
  15. 'call-string': Deprecation<'call-string'>;
  16. /**
  17. * Deprecation for @elseif.
  18. *
  19. * This deprecation became active in Dart Sass 1.3.2.
  20. */
  21. elseif: Deprecation<'elseif'>;
  22. /**
  23. * Deprecation for @-moz-document.
  24. *
  25. * This deprecation became active in Dart Sass 1.7.2.
  26. */
  27. 'moz-document': Deprecation<'moz-document'>;
  28. /**
  29. * Deprecation for imports using relative canonical URLs.
  30. *
  31. * This deprecation became active in Dart Sass 1.14.2.
  32. */
  33. 'relative-canonical': Deprecation<'relative-canonical'>;
  34. /**
  35. * Deprecation for declaring new variables with !global.
  36. *
  37. * This deprecation became active in Dart Sass 1.17.2.
  38. */
  39. 'new-global': Deprecation<'new-global'>;
  40. /**
  41. * Deprecation for using color module functions in place of plain CSS functions.
  42. *
  43. * This deprecation became active in Dart Sass 1.23.0.
  44. */
  45. 'color-module-compat': Deprecation<'color-module-compat'>;
  46. /**
  47. * Deprecation for / operator for division.
  48. *
  49. * This deprecation became active in Dart Sass 1.33.0.
  50. */
  51. 'slash-div': Deprecation<'slash-div'>;
  52. /**
  53. * Deprecation for leading, trailing, and repeated combinators.
  54. *
  55. * This deprecation became active in Dart Sass 1.54.0.
  56. */
  57. 'bogus-combinators': Deprecation<'bogus-combinators'>;
  58. /**
  59. * Deprecation for ambiguous + and - operators.
  60. *
  61. * This deprecation became active in Dart Sass 1.55.0.
  62. */
  63. 'strict-unary': Deprecation<'strict-unary'>;
  64. /**
  65. * Deprecation for passing invalid units to built-in functions.
  66. *
  67. * This deprecation became active in Dart Sass 1.56.0.
  68. */
  69. 'function-units': Deprecation<'function-units'>;
  70. /**
  71. * Deprecation for using !default or !global multiple times for one variable.
  72. *
  73. * This deprecation became active in Dart Sass 1.62.0.
  74. */
  75. 'duplicate-var-flags': Deprecation<'duplicate-var-flags'>;
  76. /**
  77. * Deprecation for passing null as alpha in the JS API.
  78. *
  79. * This deprecation became active in Dart Sass 1.62.3.
  80. */
  81. 'null-alpha': Deprecation<'null-alpha'>;
  82. /**
  83. * Deprecation for passing percentages to the Sass abs() function.
  84. *
  85. * This deprecation became active in Dart Sass 1.65.0.
  86. */
  87. 'abs-percent': Deprecation<'abs-percent'>;
  88. /**
  89. * Deprecation for using the current working directory as an implicit load path.
  90. *
  91. * This deprecation became active in Dart Sass 1.73.0.
  92. */
  93. 'fs-importer-cwd': Deprecation<'fs-importer-cwd'>;
  94. /**
  95. * Deprecation for function and mixin names beginning with --.
  96. *
  97. * This deprecation became active in Dart Sass 1.76.0.
  98. */
  99. 'css-function-mixin': Deprecation<'css-function-mixin'>;
  100. /**
  101. * Deprecation for declarations after or between nested rules.
  102. *
  103. * This deprecation became active in Dart Sass 1.77.7.
  104. * It became obsolete in Dart Sass 1.92.0.
  105. */
  106. 'mixed-decls': Deprecation<'mixed-decls'>;
  107. /**
  108. * Deprecation for meta.feature-exists
  109. *
  110. * This deprecation became active in Dart Sass 1.78.0.
  111. */
  112. 'feature-exists': Deprecation<'feature-exists'>;
  113. /**
  114. * Deprecation for certain uses of built-in sass:color functions.
  115. *
  116. * This deprecation became active in Dart Sass 1.79.0.
  117. */
  118. 'color-4-api': Deprecation<'color-4-api'>;
  119. /**
  120. * Deprecation for using global color functions instead of sass:color.
  121. *
  122. * This deprecation became active in Dart Sass 1.79.0.
  123. */
  124. 'color-functions': Deprecation<'color-functions'>;
  125. /**
  126. * Deprecation for legacy JS API.
  127. *
  128. * This deprecation became active in Dart Sass 1.79.0.
  129. */
  130. 'legacy-js-api': Deprecation<'legacy-js-api'>;
  131. /**
  132. * Deprecation for @import rules.
  133. *
  134. * This deprecation became active in Dart Sass 1.80.0.
  135. */
  136. import: Deprecation<'import'>;
  137. /**
  138. * Deprecation for global built-in functions that are available in sass: modules.
  139. *
  140. * This deprecation became active in Dart Sass 1.80.0.
  141. */
  142. 'global-builtin': Deprecation<'global-builtin'>;
  143. /**
  144. * Deprecation for functions named "type".
  145. *
  146. * This deprecation became active in Dart Sass 1.86.0.
  147. * It became obsolete in Dart Sass 1.92.0.
  148. */
  149. 'type-function': Deprecation<'type-function'>;
  150. /**
  151. * Deprecation for passing a relative url to compileString().
  152. *
  153. * This deprecation became active in Dart Sass 1.88.0.
  154. */
  155. 'compile-string-relative-url': Deprecation<'compile-string-relative-url'>;
  156. /**
  157. * Deprecation for a rest parameter before a positional or named parameter.
  158. *
  159. * This deprecation became active in Dart Sass 1.91.0.
  160. */
  161. 'misplaced-rest': Deprecation<'misplaced-rest'>;
  162. /**
  163. * Deprecation for configuring private variables in @use, @forward, or load-css().
  164. *
  165. * This deprecation became active in Dart Sass 1.92.0.
  166. */
  167. 'with-private': Deprecation<'with-private'>;
  168. // END AUTOGENERATED LIST
  169. /**
  170. * Used for any user-emitted deprecation warnings.
  171. */
  172. 'user-authored': Deprecation<'user-authored', 'user'>;
  173. }
  174. /**
  175. * Either a deprecation or its ID, either of which can be passed to any of
  176. * the relevant compiler options.
  177. *
  178. * @category Messages
  179. * @compatibility dart: "1.74.0", node: false
  180. */
  181. export type DeprecationOrId = Deprecation | keyof Deprecations;
  182. /**
  183. * The possible statuses that each deprecation can have.
  184. *
  185. * "active" deprecations are currently emitting deprecation warnings.
  186. * "future" deprecations are not yet active, but will be in the future.
  187. * "obsolete" deprecations were once active, but no longer are.
  188. *
  189. * The only "user" deprecation is "user-authored", which is used for deprecation
  190. * warnings coming from user code.
  191. *
  192. * @category Messages
  193. * @compatibility dart: "1.74.0", node: false
  194. */
  195. export type DeprecationStatus = 'active' | 'user' | 'future' | 'obsolete';
  196. /**
  197. * A deprecated feature in the language.
  198. *
  199. * @category Messages
  200. * @compatibility dart: "1.74.0", node: false
  201. */
  202. export interface Deprecation<
  203. id extends keyof Deprecations = keyof Deprecations,
  204. status extends DeprecationStatus = DeprecationStatus
  205. > {
  206. /** The unique ID of this deprecation. */
  207. id: id;
  208. /** The current status of this deprecation. */
  209. status: status;
  210. /** A human-readable description of this deprecation. */
  211. description?: string;
  212. /** The version this deprecation first became active in. */
  213. deprecatedIn: status extends 'future' | 'user' ? null : Version;
  214. /** The version this deprecation became obsolete in. */
  215. obsoleteIn: status extends 'obsolete' ? Version : null;
  216. }
  217. /**
  218. * A semantic version of the compiler.
  219. *
  220. * @category Messages
  221. * @compatibility dart: "1.74.0", node: false
  222. */
  223. export class Version {
  224. /**
  225. * Constructs a new version.
  226. *
  227. * All components must be non-negative integers.
  228. *
  229. * @param major - The major version.
  230. * @param minor - The minor version.
  231. * @param patch - The patch version.
  232. */
  233. constructor(major: number, minor: number, patch: number);
  234. readonly major: number;
  235. readonly minor: number;
  236. readonly patch: number;
  237. /**
  238. * Parses a version from a string.
  239. *
  240. * This throws an error if a valid version can't be parsed.
  241. *
  242. * @param version - A string in the form "major.minor.patch".
  243. */
  244. static parse(version: string): Version;
  245. }
  246. /**
  247. * An object containing all deprecation types.
  248. *
  249. * @category Messages
  250. * @compatibility dart: "1.74.0", node: false
  251. */
  252. export const deprecations: Deprecations;