postcss.d.ts 46 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312
  1. import * as mozilla from 'source-map';
  2. /**
  3. * @param plugins Can also be included with the Processor#use method.
  4. * @returns A processor that will apply plugins as CSS processors.
  5. */
  6. declare function postcss(plugins?: postcss.AcceptedPlugin[]): postcss.Processor;
  7. declare function postcss(...plugins: postcss.AcceptedPlugin[]): postcss.Processor;
  8. declare namespace postcss {
  9. type AcceptedPlugin = Plugin<any> | Transformer | {
  10. postcss: TransformCallback | Processor;
  11. } | Processor;
  12. /**
  13. * Creates a PostCSS plugin with a standard API.
  14. * @param name Plugin name. Same as in name property in package.json. It will
  15. * be saved in plugin.postcssPlugin property.
  16. * @param initializer Will receive plugin options and should return functions
  17. * to modify nodes in input CSS.
  18. */
  19. function plugin<T>(name: string, initializer: PluginInitializer<T>): Plugin<T>;
  20. interface Plugin<T> extends Transformer {
  21. (opts?: T): Transformer;
  22. postcss: Transformer;
  23. process: (css: string | {
  24. toString(): string;
  25. } | Result, opts?: any) => LazyResult;
  26. }
  27. interface Transformer extends TransformCallback {
  28. postcssPlugin?: string;
  29. postcssVersion?: string;
  30. }
  31. interface TransformCallback {
  32. /**
  33. * @returns A Promise that resolves when all work is complete. May return
  34. * synchronously, but that style of plugin is only meant for debugging and
  35. * development. In either case, the resolved or returned value is not used -
  36. * the "result" is the output.
  37. */
  38. (root: Root, result: Result): Promise<any> | any;
  39. }
  40. interface PluginInitializer<T> {
  41. (pluginOptions?: T): Transformer;
  42. }
  43. /**
  44. * Contains helpers for working with vendor prefixes.
  45. */
  46. export namespace vendor {
  47. /**
  48. * @returns The vendor prefix extracted from the input string.
  49. */
  50. function prefix(prop: string): string;
  51. /**
  52. * @returns The input string stripped of its vendor prefix.
  53. */
  54. function unprefixed(prop: string): string;
  55. }
  56. export class Stringifier {
  57. builder: Stringifier.Builder;
  58. constructor(builder?: Stringifier.Builder);
  59. stringify(node: Node, semicolon?: boolean): void;
  60. root(node: any): void;
  61. comment(node: any): void;
  62. decl(node: any, semicolon: any): void;
  63. rule(node: any): void;
  64. atrule(node: any, semicolon: any): void;
  65. body(node: any): void;
  66. block(node: any, start: any): void;
  67. raw(node: Node, own: string, detect?: string): any;
  68. rawSemicolon(root: any): any;
  69. rawEmptyBody(root: any): any;
  70. rawIndent(root: any): any;
  71. rawBeforeComment(root: any, node: any): any;
  72. rawBeforeDecl(root: any, node: any): any;
  73. rawBeforeRule(root: any): any;
  74. rawBeforeClose(root: any): any;
  75. rawBeforeOpen(root: any): any;
  76. rawColon(root: any): any;
  77. beforeAfter(node: any, detect: any): any;
  78. rawValue(node: any, prop: any): any;
  79. }
  80. export namespace Stringifier {
  81. interface Builder {
  82. (str: string, node?: Node, str2?: string): void;
  83. }
  84. }
  85. /**
  86. * Default function to convert a node tree into a CSS string.
  87. */
  88. function stringify(node: Node, builder: Stringifier.Builder): void;
  89. /**
  90. * Parses source CSS.
  91. * @param css The CSS to parse.
  92. * @param options
  93. * @returns {} A new Root node, which contains the source CSS nodes.
  94. */
  95. function parse(css: string | {
  96. toString(): string;
  97. } | LazyResult | Result, options?: {
  98. from?: string;
  99. map?: postcss.SourceMapOptions;
  100. }): Root;
  101. /**
  102. * Contains helpers for safely splitting lists of CSS values, preserving
  103. * parentheses and quotes.
  104. */
  105. export namespace list {
  106. /**
  107. * Safely splits space-separated values (such as those for background,
  108. * border-radius and other shorthand properties).
  109. */
  110. function space(str: string): string[];
  111. /**
  112. * Safely splits comma-separated values (such as those for transition-* and
  113. * background properties).
  114. */
  115. function comma(str: string): string[];
  116. }
  117. /**
  118. * Creates a new Comment node.
  119. * @param defaults Properties for the new Comment node.
  120. * @returns The new node.
  121. */
  122. function comment(defaults?: CommentNewProps): Comment;
  123. /**
  124. * Creates a new AtRule node.
  125. * @param defaults Properties for the new AtRule node.
  126. * @returns The new node.
  127. */
  128. function atRule(defaults?: AtRuleNewProps): AtRule;
  129. /**
  130. * Creates a new Declaration node.
  131. * @param defaults Properties for the new Declaration node.
  132. * @returns The new node.
  133. */
  134. function decl(defaults?: DeclarationNewProps): Declaration;
  135. /**
  136. * Creates a new Rule node.
  137. * @param defaults Properties for the new Rule node.
  138. * @returns The new node.
  139. */
  140. function rule(defaults?: RuleNewProps): Rule;
  141. /**
  142. * Creates a new Root node.
  143. * @param defaults Properties for the new Root node.
  144. * @returns The new node.
  145. */
  146. function root(defaults?: object): Root;
  147. interface SourceMapOptions {
  148. /**
  149. * Indicates that the source map should be embedded in the output CSS as a
  150. * Base64-encoded comment. By default, it is true. But if all previous maps
  151. * are external, not inline, PostCSS will not embed the map even if you do
  152. * not set this option.
  153. *
  154. * If you have an inline source map, the result.map property will be empty,
  155. * as the source map will be contained within the text of result.css.
  156. */
  157. inline?: boolean;
  158. /**
  159. * Source map content from a previous processing step (e.g., Sass compilation).
  160. * PostCSS will try to read the previous source map automatically (based on comments
  161. * within the source CSS), but you can use this option to identify it manually.
  162. * If desired, you can omit the previous map with prev: false.
  163. */
  164. prev?: any;
  165. /**
  166. * Indicates that PostCSS should set the origin content (e.g., Sass source)
  167. * of the source map. By default, it is true. But if all previous maps do not
  168. * contain sources content, PostCSS will also leave it out even if you do not set
  169. * this option.
  170. */
  171. sourcesContent?: boolean;
  172. /**
  173. * Indicates that PostCSS should add annotation comments to the CSS. By default,
  174. * PostCSS will always add a comment with a path to the source map. PostCSS will
  175. * not add annotations to CSS files that do not contain any comments.
  176. *
  177. * By default, PostCSS presumes that you want to save the source map as
  178. * opts.to + '.map' and will use this path in the annotation comment. A different
  179. * path can be set by providing a string value for annotation.
  180. *
  181. * If you have set inline: true, annotation cannot be disabled.
  182. */
  183. annotation?: string | false;
  184. /**
  185. * Override "from" in map's sources.
  186. */
  187. from?: string;
  188. }
  189. /**
  190. * A Processor instance contains plugins to process CSS. Create one
  191. * Processor instance, initialize its plugins, and then use that instance
  192. * on numerous CSS files.
  193. */
  194. interface Processor {
  195. /**
  196. * Adds a plugin to be used as a CSS processor. Plugins can also be
  197. * added by passing them as arguments when creating a postcss instance.
  198. */
  199. use(plugin: AcceptedPlugin): Processor;
  200. /**
  201. * Parses source CSS. Because some plugins can be asynchronous it doesn't
  202. * make any transformations. Transformations will be applied in LazyResult's
  203. * methods.
  204. * @param css Input CSS or any object with toString() method, like a file
  205. * stream. If a Result instance is passed the processor will take the
  206. * existing Root parser from it.
  207. */
  208. process(css: string | {
  209. toString(): string;
  210. } | Result, options?: ProcessOptions): LazyResult;
  211. /**
  212. * Contains plugins added to this processor.
  213. */
  214. plugins: Plugin<any>[];
  215. /**
  216. * Contains the current version of PostCSS (e.g., "4.0.5").
  217. */
  218. version: string;
  219. }
  220. interface ProcessOptions {
  221. /**
  222. * The path of the CSS source file. You should always set "from", because it is
  223. * used in source map generation and syntax error messages.
  224. */
  225. from?: string;
  226. /**
  227. * The path where you'll put the output CSS file. You should always set "to"
  228. * to generate correct source maps.
  229. */
  230. to?: string;
  231. /**
  232. * Function to generate AST by string.
  233. */
  234. parser?: Parser;
  235. /**
  236. * Class to generate string by AST.
  237. */
  238. stringifier?: Stringifier;
  239. /**
  240. * Object with parse and stringify.
  241. */
  242. syntax?: Syntax;
  243. /**
  244. * Source map options
  245. */
  246. map?: SourceMapOptions | true;
  247. }
  248. interface Syntax {
  249. /**
  250. * Function to generate AST by string.
  251. */
  252. parse?: Parser;
  253. /**
  254. * Class to generate string by AST.
  255. */
  256. stringify?: Stringifier;
  257. }
  258. interface Parser {
  259. (css: string, opts?: Pick<ProcessOptions, 'map' |'from'>): Root;
  260. }
  261. interface Stringifier {
  262. (node: Node, builder: Builder): void;
  263. }
  264. interface Builder {
  265. (part: string, node?: Node, type?: 'start' | 'end'): void;
  266. }
  267. /**
  268. * A promise proxy for the result of PostCSS transformations.
  269. */
  270. interface LazyResult {
  271. /**
  272. * Processes input CSS through synchronous and asynchronous plugins.
  273. * @param onRejected Called if any plugin throws an error.
  274. */
  275. then(onFulfilled: (result: Result) => void, onRejected?: (error: Error) => void): Function | any;
  276. /**
  277. * Processes input CSS through synchronous and asynchronous plugins.
  278. * @param onRejected Called if any plugin throws an error.
  279. */
  280. catch(onRejected: (error: Error) => void): Function | any;
  281. /**
  282. * Alias for css property.
  283. */
  284. toString(): string;
  285. /**
  286. * Processes input CSS through synchronous plugins and converts Root to
  287. * CSS string. This property will only work with synchronous plugins. If
  288. * the processor contains any asynchronous plugins it will throw an error.
  289. * In this case, you should use LazyResult#then() instead.
  290. * @returns Result#css.
  291. */
  292. css: string;
  293. /**
  294. * Alias for css property to use when syntaxes generate non-CSS output.
  295. */
  296. content: string;
  297. /**
  298. * Processes input CSS through synchronous plugins. This property will
  299. * work only with synchronous plugins. If processor contains any
  300. * asynchronous plugins it will throw an error. You should use
  301. * LazyResult#then() instead.
  302. */
  303. map: ResultMap;
  304. /**
  305. * Processes input CSS through synchronous plugins. This property will work
  306. * only with synchronous plugins. If processor contains any asynchronous
  307. * plugins it will throw an error. You should use LazyResult#then() instead.
  308. */
  309. root: Root;
  310. /**
  311. * Processes input CSS through synchronous plugins and calls Result#warnings().
  312. * This property will only work with synchronous plugins. If the processor
  313. * contains any asynchronous plugins it will throw an error. In this case,
  314. * you should use LazyResult#then() instead.
  315. */
  316. warnings(): ResultMessage[];
  317. /**
  318. * Processes input CSS through synchronous plugins. This property will work
  319. * only with synchronous plugins. If processor contains any asynchronous
  320. * plugins it will throw an error. You should use LazyResult#then() instead.
  321. */
  322. messages: ResultMessage[];
  323. /**
  324. * @returns A processor used for CSS transformations.
  325. */
  326. processor: Processor;
  327. /**
  328. * @returns Options from the Processor#process(css, opts) call that produced
  329. * this Result instance.
  330. */
  331. opts: ResultOptions;
  332. }
  333. /**
  334. * Provides the result of the PostCSS transformations.
  335. */
  336. interface Result {
  337. /**
  338. * Alias for css property.
  339. */
  340. toString(): string;
  341. /**
  342. * Creates an instance of Warning and adds it to messages.
  343. * @param message Used in the text property of the message object.
  344. * @param options Properties for Message object.
  345. */
  346. warn(message: string, options?: WarningOptions): void;
  347. /**
  348. * @returns Warnings from plugins, filtered from messages.
  349. */
  350. warnings(): ResultMessage[];
  351. /**
  352. * A CSS string representing this Result's Root instance.
  353. */
  354. css: string;
  355. /**
  356. * Alias for css property to use with syntaxes that generate non-CSS output.
  357. */
  358. content: string;
  359. /**
  360. * An instance of the SourceMapGenerator class from the source-map library,
  361. * representing changes to the Result's Root instance.
  362. * This property will have a value only if the user does not want an inline
  363. * source map. By default, PostCSS generates inline source maps, written
  364. * directly into the processed CSS. The map property will be empty by default.
  365. * An external source map will be generated — and assigned to map — only if
  366. * the user has set the map.inline option to false, or if PostCSS was passed
  367. * an external input source map.
  368. */
  369. map: ResultMap;
  370. /**
  371. * Contains the Root node after all transformations.
  372. */
  373. root?: Root;
  374. /**
  375. * Contains messages from plugins (e.g., warnings or custom messages).
  376. * Add a warning using Result#warn() and get all warnings
  377. * using the Result#warnings() method.
  378. */
  379. messages: ResultMessage[];
  380. /**
  381. * The Processor instance used for this transformation.
  382. */
  383. processor?: Processor;
  384. /**
  385. * Options from the Processor#process(css, opts) or Root#toResult(opts) call
  386. * that produced this Result instance.
  387. */
  388. opts?: ResultOptions;
  389. }
  390. interface ResultOptions extends ProcessOptions {
  391. /**
  392. * The CSS node that was the source of the warning.
  393. */
  394. node?: postcss.Node;
  395. /**
  396. * Name of plugin that created this warning. Result#warn() will fill it
  397. * automatically with plugin.postcssPlugin value.
  398. */
  399. plugin?: string;
  400. }
  401. interface ResultMap {
  402. /**
  403. * Add a single mapping from original source line and column to the generated
  404. * source's line and column for this source map being created. The mapping
  405. * object should have the following properties:
  406. * @param mapping
  407. * @returns {}
  408. */
  409. addMapping(mapping: mozilla.Mapping): void;
  410. /**
  411. * Set the source content for an original source file.
  412. * @param sourceFile The URL of the original source file.
  413. * @param sourceContent The content of the source file.
  414. */
  415. setSourceContent(sourceFile: string, sourceContent: string): void;
  416. /**
  417. * Applies a SourceMap for a source file to the SourceMap. Each mapping to
  418. * the supplied source file is rewritten using the supplied SourceMap.
  419. * Note: The resolution for the resulting mappings is the minimum of this
  420. * map and the supplied map.
  421. * @param sourceMapConsumer The SourceMap to be applied.
  422. * @param sourceFile The filename of the source file. If omitted, sourceMapConsumer
  423. * file will be used, if it exists. Otherwise an error will be thrown.
  424. * @param sourceMapPath The dirname of the path to the SourceMap to be applied.
  425. * If relative, it is relative to the SourceMap. This parameter is needed when
  426. * the two SourceMaps aren't in the same directory, and the SourceMap to be
  427. * applied contains relative source paths. If so, those relative source paths
  428. * need to be rewritten relative to the SourceMap.
  429. * If omitted, it is assumed that both SourceMaps are in the same directory;
  430. * thus, not needing any rewriting (Supplying '.' has the same effect).
  431. */
  432. applySourceMap(
  433. sourceMapConsumer: mozilla.SourceMapConsumer,
  434. sourceFile?: string,
  435. sourceMapPath?: string
  436. ): void;
  437. /**
  438. * Renders the source map being generated to JSON.
  439. */
  440. toJSON: () => mozilla.RawSourceMap;
  441. /**
  442. * Renders the source map being generated to a string.
  443. */
  444. toString: () => string;
  445. }
  446. interface ResultMessage {
  447. type: string;
  448. plugin: string;
  449. [others: string]: any;
  450. }
  451. /**
  452. * Represents a plugin warning. It can be created using Result#warn().
  453. */
  454. interface Warning {
  455. /**
  456. * @returns Error position, message.
  457. */
  458. toString(): string;
  459. /**
  460. * Contains the warning message.
  461. */
  462. text: string;
  463. /**
  464. * Contains the name of the plugin that created this warning. When you
  465. * call Result#warn(), it will fill this property automatically.
  466. */
  467. plugin: string;
  468. /**
  469. * The CSS node that caused the warning.
  470. */
  471. node: Node;
  472. /**
  473. * The line in the input file with this warning's source.
  474. */
  475. line: number;
  476. /**
  477. * Column in the input file with this warning's source.
  478. */
  479. column: number;
  480. }
  481. interface WarningOptions extends ResultOptions {
  482. /**
  483. * A word inside a node's string that should be highlighted as source
  484. * of warning.
  485. */
  486. word?: string;
  487. /**
  488. * The index inside a node's string that should be highlighted as
  489. * source of warning.
  490. */
  491. index?: number;
  492. }
  493. /**
  494. * The CSS parser throws this error for broken CSS.
  495. */
  496. interface CssSyntaxError extends InputOrigin {
  497. name: string;
  498. /**
  499. * @returns Error position, message and source code of broken part.
  500. */
  501. toString(): string;
  502. /**
  503. * @param color Whether arrow should be colored red by terminal color codes.
  504. * By default, PostCSS will use process.stdout.isTTY and
  505. * process.env.NODE_DISABLE_COLORS.
  506. * @returns A few lines of CSS source that caused the error. If CSS has
  507. * input source map without sourceContent this method will return an empty
  508. * string.
  509. */
  510. showSourceCode(color?: boolean): string;
  511. /**
  512. * Contains full error text in the GNU error format.
  513. */
  514. message: string;
  515. /**
  516. * Contains only the error description.
  517. */
  518. reason: string;
  519. /**
  520. * Contains the PostCSS plugin name if the error didn't come from the
  521. * CSS parser.
  522. */
  523. plugin?: string;
  524. input?: InputOrigin;
  525. }
  526. interface InputOrigin {
  527. /**
  528. * If parser's from option is set, contains the absolute path to the
  529. * broken file. PostCSS will use the input source map to detect the
  530. * original error location. If you wrote a Sass file, then compiled it
  531. * to CSS and parsed it with PostCSS, PostCSS will show the original
  532. * position in the Sass file. If you need the position in the PostCSS
  533. * input (e.g., to debug the previous compiler), use error.input.file.
  534. */
  535. file?: string;
  536. /**
  537. * Contains the source line of the error. PostCSS will use the input
  538. * source map to detect the original error location. If you wrote a Sass
  539. * file, then compiled it to CSS and parsed it with PostCSS, PostCSS
  540. * will show the original position in the Sass file. If you need the
  541. * position in the PostCSS input (e.g., to debug the previous
  542. * compiler), use error.input.line.
  543. */
  544. line?: number;
  545. /**
  546. * Contains the source column of the error. PostCSS will use input
  547. * source map to detect the original error location. If you wrote a
  548. * Sass file, then compiled it to CSS and parsed it with PostCSS,
  549. * PostCSS will show the original position in the Sass file. If you
  550. * need the position in the PostCSS input (e.g., to debug the
  551. * previous compiler), use error.input.column.
  552. */
  553. column?: number;
  554. /**
  555. * Contains the source code of the broken file. PostCSS will use the
  556. * input source map to detect the original error location. If you wrote
  557. * a Sass file, then compiled it to CSS and parsed it with PostCSS,
  558. * PostCSS will show the original position in the Sass file. If you need
  559. * the position in the PostCSS input (e.g., to debug the previous
  560. * compiler), use error.input.source.
  561. */
  562. source?: string;
  563. }
  564. export class PreviousMap {
  565. private inline;
  566. annotation: string;
  567. root: string;
  568. private consumerCache;
  569. text: string;
  570. file: string;
  571. constructor(css: any, opts: any);
  572. consumer(): mozilla.SourceMapConsumer;
  573. withContent(): boolean;
  574. startWith(string: string, start: string): boolean;
  575. loadAnnotation(css: string): void;
  576. decodeInline(text: string): string;
  577. loadMap(
  578. file: any,
  579. prev: string | Function | mozilla.SourceMapConsumer | mozilla.SourceMapGenerator | mozilla.RawSourceMap
  580. ): string;
  581. isMap(map: any): boolean;
  582. }
  583. /**
  584. * Represents the source CSS.
  585. */
  586. interface Input {
  587. /**
  588. * The absolute path to the CSS source file defined with the "from" option.
  589. * Either this property or the "id" property are always defined.
  590. */
  591. file?: string;
  592. /**
  593. * The unique ID of the CSS source. Used if "from" option is not provided
  594. * (because PostCSS does not know the file path). Either this property
  595. * or the "file" property are always defined.
  596. */
  597. id?: string;
  598. /**
  599. * The CSS source identifier. Contains input.file if the user set the
  600. * "from" option, or input.id if they did not.
  601. */
  602. from: string;
  603. /**
  604. * Represents the input source map passed from a compilation step before
  605. * PostCSS (e.g., from the Sass compiler).
  606. */
  607. map: PreviousMap;
  608. /**
  609. * The flag to indicate whether or not the source code has Unicode BOM.
  610. */
  611. hasBOM: boolean;
  612. /**
  613. * Reads the input source map.
  614. * @returns A symbol position in the input source (e.g., in a Sass file
  615. * that was compiled to CSS before being passed to PostCSS):
  616. */
  617. origin(line: number, column: number): InputOrigin;
  618. }
  619. type ChildNode = AtRule | Rule | Declaration | Comment;
  620. type Node = Root | ChildNode;
  621. interface NodeBase {
  622. /**
  623. * Returns the input source of the node. The property is used in source
  624. * map generation. If you create a node manually
  625. * (e.g., with postcss.decl() ), that node will not have a source
  626. * property and will be absent from the source map. For this reason, the
  627. * plugin developer should consider cloning nodes to create new ones
  628. * (in which case the new node's source will reference the original,
  629. * cloned node) or setting the source property manually.
  630. */
  631. source?: NodeSource;
  632. /**
  633. * Contains information to generate byte-to-byte equal node string as it
  634. * was in origin input.
  635. */
  636. raws: NodeRaws;
  637. /**
  638. * @returns A CSS string representing the node.
  639. */
  640. toString(): string;
  641. /**
  642. * This method produces very useful error messages. If present, an input
  643. * source map will be used to get the original position of the source, even
  644. * from a previous compilation step (e.g., from Sass compilation).
  645. * @returns The original position of the node in the source, showing line
  646. * and column numbers and also a small excerpt to facilitate debugging.
  647. */
  648. error(
  649. /**
  650. * Error description.
  651. */
  652. message: string, options?: NodeErrorOptions): CssSyntaxError;
  653. /**
  654. * Creates an instance of Warning and adds it to messages. This method is
  655. * provided as a convenience wrapper for Result#warn.
  656. * Note that `opts.node` is automatically passed to Result#warn for you.
  657. * @param result The result that will receive the warning.
  658. * @param text Warning message. It will be used in the `text` property of
  659. * the message object.
  660. * @param opts Properties to assign to the message object.
  661. */
  662. warn(result: Result, text: string, opts?: WarningOptions): void;
  663. /**
  664. * @returns The next child of the node's parent; or, returns undefined if
  665. * the current node is the last child.
  666. */
  667. next(): ChildNode | void;
  668. /**
  669. * @returns The previous child of the node's parent; or, returns undefined
  670. * if the current node is the first child.
  671. */
  672. prev(): ChildNode | void;
  673. /**
  674. * Insert new node before current node to current node’s parent.
  675. *
  676. * Just an alias for `node.parent.insertBefore(node, newNode)`.
  677. *
  678. * @returns this node for method chaining.
  679. *
  680. * @example
  681. * decl.before('content: ""');
  682. */
  683. before(newNode: Node | object | string | Node[]): this;
  684. /**
  685. * Insert new node after current node to current node’s parent.
  686. *
  687. * Just an alias for `node.parent.insertAfter(node, newNode)`.
  688. *
  689. * @returns this node for method chaining.
  690. *
  691. * @example
  692. * decl.after('color: black');
  693. */
  694. after(newNode: Node | object | string | Node[]): this;
  695. /**
  696. * @returns The Root instance of the node's tree.
  697. */
  698. root(): Root;
  699. /**
  700. * Removes the node from its parent and cleans the parent property in the
  701. * node and its children.
  702. * @returns This node for chaining.
  703. */
  704. remove(): this;
  705. /**
  706. * Inserts node(s) before the current node and removes the current node.
  707. * @returns This node for chaining.
  708. */
  709. replaceWith(...nodes: (Node | object)[]): this;
  710. /**
  711. * @param overrides New properties to override in the clone.
  712. * @returns A clone of this node. The node and its (cloned) children will
  713. * have a clean parent and code style properties.
  714. */
  715. clone(overrides?: object): this;
  716. /**
  717. * Shortcut to clone the node and insert the resulting cloned node before
  718. * the current node.
  719. * @param overrides New Properties to override in the clone.
  720. * @returns The cloned node.
  721. */
  722. cloneBefore(overrides?: object): this;
  723. /**
  724. * Shortcut to clone the node and insert the resulting cloned node after
  725. * the current node.
  726. * @param overrides New Properties to override in the clone.
  727. * @returns The cloned node.
  728. */
  729. cloneAfter(overrides?: object): this;
  730. /**
  731. * @param prop Name or code style property.
  732. * @param defaultType Name of default value. It can be easily missed if the
  733. * value is the same as prop.
  734. * @returns A code style property value. If the node is missing the code
  735. * style property (because the node was manually built or cloned), PostCSS
  736. * will try to autodetect the code style property by looking at other nodes
  737. * in the tree.
  738. */
  739. raw(prop: string, defaultType?: string): any;
  740. }
  741. interface NodeNewProps {
  742. source?: NodeSource;
  743. raws?: NodeRaws;
  744. }
  745. interface NodeRaws {
  746. /**
  747. * The space symbols before the node. It also stores `*` and `_`
  748. * symbols before the declaration (IE hack).
  749. */
  750. before?: string;
  751. /**
  752. * The space symbols after the last child of the node to the end of
  753. * the node.
  754. */
  755. after?: string;
  756. /**
  757. * The symbols between the property and value for declarations,
  758. * selector and "{" for rules, last parameter and "{" for at-rules.
  759. */
  760. between?: string;
  761. /**
  762. * True if last child has (optional) semicolon.
  763. */
  764. semicolon?: boolean;
  765. /**
  766. * The space between the at-rule's name and parameters.
  767. */
  768. afterName?: string;
  769. /**
  770. * The space symbols between "/*" and comment's text.
  771. */
  772. left?: string;
  773. /**
  774. * The space symbols between comment's text and "*\/".
  775. */
  776. right?: string;
  777. /**
  778. * The content of important statement, if it is not just "!important".
  779. */
  780. important?: string;
  781. }
  782. interface NodeSource {
  783. input: Input;
  784. /**
  785. * The starting position of the node's source.
  786. */
  787. start?: {
  788. column: number;
  789. line: number;
  790. };
  791. /**
  792. * The ending position of the node's source.
  793. */
  794. end?: {
  795. column: number;
  796. line: number;
  797. };
  798. }
  799. interface NodeErrorOptions {
  800. /**
  801. * Plugin name that created this error. PostCSS will set it automatically.
  802. */
  803. plugin?: string;
  804. /**
  805. * A word inside a node's string, that should be highlighted as source
  806. * of error.
  807. */
  808. word?: string;
  809. /**
  810. * An index inside a node's string that should be highlighted as source
  811. * of error.
  812. */
  813. index?: number;
  814. }
  815. interface JsonNode {
  816. /**
  817. * Returns a string representing the node's type. Possible values are
  818. * root, atrule, rule, decl or comment.
  819. */
  820. type?: string;
  821. /**
  822. * Returns the node's parent node.
  823. */
  824. parent?: JsonContainer;
  825. /**
  826. * Returns the input source of the node. The property is used in source
  827. * map generation. If you create a node manually (e.g., with
  828. * postcss.decl() ), that node will not have a source property and
  829. * will be absent from the source map. For this reason, the plugin
  830. * developer should consider cloning nodes to create new ones (in which
  831. * case the new node's source will reference the original, cloned node)
  832. * or setting the source property manually.
  833. */
  834. source?: NodeSource;
  835. /**
  836. * Contains information to generate byte-to-byte equal node string as it
  837. * was in origin input.
  838. */
  839. raws?: NodeRaws;
  840. }
  841. type Container = Root | AtRule | Rule;
  842. /**
  843. * Containers can store any content. If you write a rule inside a rule,
  844. * PostCSS will parse it.
  845. */
  846. interface ContainerBase extends NodeBase {
  847. /**
  848. * Contains the container's children.
  849. */
  850. nodes?: ChildNode[];
  851. /**
  852. * @returns The container's first child.
  853. */
  854. first?: ChildNode;
  855. /**
  856. * @returns The container's last child.
  857. */
  858. last?: ChildNode;
  859. /**
  860. * @param overrides New properties to override in the clone.
  861. * @returns A clone of this node. The node and its (cloned) children will
  862. * have a clean parent and code style properties.
  863. */
  864. clone(overrides?: object): this;
  865. /**
  866. * @param child Child of the current container.
  867. * @returns The child's index within the container's "nodes" array.
  868. */
  869. index(child: ChildNode | number): number;
  870. /**
  871. * Determines whether all child nodes satisfy the specified test.
  872. * @param callback A function that accepts up to three arguments. The
  873. * every method calls the callback function for each node until the
  874. * callback returns false, or until the end of the array.
  875. * @returns True if the callback returns true for all of the container's
  876. * children.
  877. */
  878. every(callback: (node: ChildNode, index: number, nodes: ChildNode[]) => any, thisArg?: any): boolean;
  879. /**
  880. * Determines whether the specified callback returns true for any child node.
  881. * @param callback A function that accepts up to three arguments. The some
  882. * method calls the callback for each node until the callback returns true,
  883. * or until the end of the array.
  884. * @param thisArg An object to which the this keyword can refer in the
  885. * callback function. If thisArg is omitted, undefined is used as the
  886. * this value.
  887. * @returns True if callback returns true for (at least) one of the
  888. * container's children.
  889. */
  890. some(callback: (node: ChildNode, index: number, nodes: ChildNode[]) => boolean, thisArg?: any): boolean;
  891. /**
  892. * Iterates through the container's immediate children, calling the
  893. * callback function for each child. If you need to recursively iterate
  894. * through all the container's descendant nodes, use container.walk().
  895. * Unlike the for {} -cycle or Array#forEach() this iterator is safe if
  896. * you are mutating the array of child nodes during iteration.
  897. * @param callback Iterator. Returning false will break iteration. Safe
  898. * if you are mutating the array of child nodes during iteration. PostCSS
  899. * will adjust the current index to match the mutations.
  900. * @returns False if the callback returns false during iteration.
  901. */
  902. each(callback: (node: ChildNode, index: number) => any): boolean | void;
  903. /**
  904. * Traverses the container's descendant nodes, calling `callback` for each
  905. * node. Like container.each(), this method is safe to use if you are
  906. * mutating arrays during iteration. If you only need to iterate through
  907. * the container's immediate children, use container.each().
  908. * @param callback Iterator.
  909. */
  910. walk(callback: (node: ChildNode, index: number) => any): boolean | void;
  911. /**
  912. * Traverses the container's descendant nodes, calling `callback` for each
  913. * declaration. Like container.each(), this method is safe to use if you
  914. * are mutating arrays during iteration.
  915. * @param propFilter Filters declarations by property name. Only those
  916. * declarations whose property matches propFilter will be iterated over.
  917. * @param callback Called for each declaration node within the container.
  918. */
  919. walkDecls(propFilter: string | RegExp, callback?: (decl: Declaration, index: number) => any): boolean | void;
  920. walkDecls(callback: (decl: Declaration, index: number) => any): boolean | void;
  921. /**
  922. * Traverses the container's descendant nodes, calling `callback` for each
  923. * at-rule. Like container.each(), this method is safe to use if you are
  924. * mutating arrays during iteration.
  925. * @param nameFilter Filters at-rules by name. If provided, iteration
  926. * will only happen over at-rules that have matching names.
  927. * @param callback Iterator called for each at-rule node within the
  928. * container.
  929. */
  930. walkAtRules(nameFilter: string | RegExp, callback: (atRule: AtRule, index: number) => any): boolean | void;
  931. walkAtRules(callback: (atRule: AtRule, index: number) => any): boolean | void;
  932. /**
  933. * Traverses the container's descendant nodes, calling `callback` for each
  934. * rule. Like container.each(), this method is safe to use if you are
  935. * mutating arrays during iteration.
  936. * @param selectorFilter Filters rules by selector. If provided,
  937. * iteration will only happen over rules that have matching names.
  938. * @param callback Iterator called for each rule node within the
  939. * container.
  940. */
  941. walkRules(selectorFilter: string | RegExp, callback: (atRule: Rule, index: number) => any): boolean | void;
  942. walkRules(callback: (atRule: Rule, index: number) => any): boolean | void;
  943. walkRules(selectorFilter: any, callback?: (atRule: Rule, index: number) => any): boolean | void;
  944. /**
  945. * Traverses the container's descendant nodes, calling `callback` for each
  946. * comment. Like container.each(), this method is safe to use if you are
  947. * mutating arrays during iteration.
  948. * @param callback Iterator called for each comment node within the container.
  949. */
  950. walkComments(callback: (comment: Comment, indexed: number) => any): void | boolean;
  951. /**
  952. * Passes all declaration values within the container that match pattern
  953. * through the callback, replacing those values with the returned result of
  954. * callback. This method is useful if you are using a custom unit or
  955. * function and need to iterate through all values.
  956. * @param pattern Pattern that we need to replace.
  957. * @param options Options to speed up the search.
  958. * @param callbackOrReplaceValue String to replace pattern or callback
  959. * that will return a new value. The callback will receive the same
  960. * arguments as those passed to a function parameter of String#replace.
  961. */
  962. replaceValues(pattern: string | RegExp, options: {
  963. /**
  964. * Property names. The method will only search for values that match
  965. * regexp within declarations of listed properties.
  966. */
  967. props?: string[];
  968. /**
  969. * Used to narrow down values and speed up the regexp search. Searching
  970. * every single value with a regexp can be slow. If you pass a fast
  971. * string, PostCSS will first check whether the value contains the fast
  972. * string; and only if it does will PostCSS check that value against
  973. * regexp. For example, instead of just checking for /\d+rem/ on all
  974. * values, set fast: 'rem' to first check whether a value has the rem
  975. * unit, and only if it does perform the regexp check.
  976. */
  977. fast?: string;
  978. }, callbackOrReplaceValue: string | {
  979. (substring: string, ...args: any[]): string;
  980. }): this;
  981. replaceValues(pattern: string | RegExp, callbackOrReplaceValue: string | {
  982. (substring: string, ...args: any[]): string;
  983. }): this;
  984. /**
  985. * Inserts new nodes to the beginning of the container.
  986. * Because each node class is identifiable by unique properties, use the
  987. * following shortcuts to create nodes in insert methods:
  988. * root.prepend({ name: '@charset', params: '"UTF-8"' }); // at-rule
  989. * root.prepend({ selector: 'a' }); // rule
  990. * rule.prepend({ prop: 'color', value: 'black' }); // declaration
  991. * rule.prepend({ text: 'Comment' }) // comment
  992. * A string containing the CSS of the new element can also be used. This
  993. * approach is slower than the above shortcuts.
  994. * root.prepend('a {}');
  995. * root.first.prepend('color: black; z-index: 1');
  996. * @param nodes New nodes.
  997. * @returns This container for chaining.
  998. */
  999. prepend(...nodes: (Node | object | string)[]): this;
  1000. /**
  1001. * Inserts new nodes to the end of the container.
  1002. * Because each node class is identifiable by unique properties, use the
  1003. * following shortcuts to create nodes in insert methods:
  1004. * root.append({ name: '@charset', params: '"UTF-8"' }); // at-rule
  1005. * root.append({ selector: 'a' }); // rule
  1006. * rule.append({ prop: 'color', value: 'black' }); // declaration
  1007. * rule.append({ text: 'Comment' }) // comment
  1008. * A string containing the CSS of the new element can also be used. This
  1009. * approach is slower than the above shortcuts.
  1010. * root.append('a {}');
  1011. * root.first.append('color: black; z-index: 1');
  1012. * @param nodes New nodes.
  1013. * @returns This container for chaining.
  1014. */
  1015. append(...nodes: (Node | object | string)[]): this;
  1016. /**
  1017. * Insert newNode before oldNode within the container.
  1018. * @param oldNode Child or child's index.
  1019. * @returns This container for chaining.
  1020. */
  1021. insertBefore(oldNode: ChildNode | number, newNode: ChildNode | object | string): this;
  1022. /**
  1023. * Insert newNode after oldNode within the container.
  1024. * @param oldNode Child or child's index.
  1025. * @returns This container for chaining.
  1026. */
  1027. insertAfter(oldNode: ChildNode | number, newNode: ChildNode | object | string): this;
  1028. /**
  1029. * Removes the container from its parent and cleans the parent property in the
  1030. * container and its children.
  1031. * @returns This container for chaining.
  1032. */
  1033. remove(): this;
  1034. /**
  1035. * Removes child from the container and cleans the parent properties
  1036. * from the node and its children.
  1037. * @param child Child or child's index.
  1038. * @returns This container for chaining.
  1039. */
  1040. removeChild(child: ChildNode | number): this;
  1041. /**
  1042. * Removes all children from the container and cleans their parent
  1043. * properties.
  1044. * @returns This container for chaining.
  1045. */
  1046. removeAll(): this;
  1047. }
  1048. interface ContainerNewProps extends NodeNewProps {
  1049. /**
  1050. * Contains the container's children.
  1051. */
  1052. nodes?: ChildNode[];
  1053. raws?: ContainerRaws;
  1054. }
  1055. interface ContainerRaws extends NodeRaws {
  1056. indent?: string;
  1057. }
  1058. interface JsonContainer extends JsonNode {
  1059. /**
  1060. * Contains the container's children.
  1061. */
  1062. nodes?: ChildNode[];
  1063. /**
  1064. * @returns The container's first child.
  1065. */
  1066. first?: ChildNode;
  1067. /**
  1068. * @returns The container's last child.
  1069. */
  1070. last?: ChildNode;
  1071. }
  1072. /**
  1073. * Represents a CSS file and contains all its parsed nodes.
  1074. */
  1075. interface Root extends ContainerBase {
  1076. type: 'root';
  1077. /**
  1078. * Inherited from Container. Should always be undefined for a Root node.
  1079. */
  1080. parent: void;
  1081. /**
  1082. * @param overrides New properties to override in the clone.
  1083. * @returns A clone of this node. The node and its (cloned) children will
  1084. * have a clean parent and code style properties.
  1085. */
  1086. clone(overrides?: object): this;
  1087. /**
  1088. * @returns A Result instance representing the root's CSS.
  1089. */
  1090. toResult(options?: {
  1091. /**
  1092. * The path where you'll put the output CSS file. You should always
  1093. * set "to" to generate correct source maps.
  1094. */
  1095. to?: string;
  1096. map?: SourceMapOptions;
  1097. }): Result;
  1098. /**
  1099. * Removes child from the root node, and the parent properties of node and
  1100. * its children.
  1101. * @param child Child or child's index.
  1102. * @returns This root node for chaining.
  1103. */
  1104. removeChild(child: ChildNode | number): this;
  1105. }
  1106. interface RootNewProps extends ContainerNewProps {
  1107. }
  1108. interface JsonRoot extends JsonContainer {
  1109. }
  1110. /**
  1111. * Represents an at-rule. If it's followed in the CSS by a {} block, this
  1112. * node will have a nodes property representing its children.
  1113. */
  1114. interface AtRule extends ContainerBase {
  1115. type: 'atrule';
  1116. /**
  1117. * Returns the atrule's parent node.
  1118. */
  1119. parent: Container;
  1120. /**
  1121. * The identifier that immediately follows the @.
  1122. */
  1123. name: string;
  1124. /**
  1125. * These are the values that follow the at-rule's name, but precede any {}
  1126. * block. The spec refers to this area as the at-rule's "prelude".
  1127. */
  1128. params: string;
  1129. /**
  1130. * @param overrides New properties to override in the clone.
  1131. * @returns A clone of this node. The node and its (cloned) children will
  1132. * have a clean parent and code style properties.
  1133. */
  1134. clone(overrides?: object): this;
  1135. }
  1136. interface AtRuleNewProps extends ContainerNewProps {
  1137. /**
  1138. * The identifier that immediately follows the @.
  1139. */
  1140. name?: string;
  1141. /**
  1142. * These are the values that follow the at-rule's name, but precede any {}
  1143. * block. The spec refers to this area as the at-rule's "prelude".
  1144. */
  1145. params?: string | number;
  1146. raws?: AtRuleRaws;
  1147. }
  1148. interface AtRuleRaws extends NodeRaws {
  1149. params?: string;
  1150. }
  1151. interface JsonAtRule extends JsonContainer {
  1152. /**
  1153. * The identifier that immediately follows the @.
  1154. */
  1155. name?: string;
  1156. /**
  1157. * These are the values that follow the at-rule's name, but precede any {}
  1158. * block. The spec refers to this area as the at-rule's "prelude".
  1159. */
  1160. params?: string;
  1161. }
  1162. /**
  1163. * Represents a CSS rule: a selector followed by a declaration block.
  1164. */
  1165. interface Rule extends ContainerBase {
  1166. type: 'rule';
  1167. /**
  1168. * Returns the rule's parent node.
  1169. */
  1170. parent: Container;
  1171. /**
  1172. * The rule's full selector. If there are multiple comma-separated selectors,
  1173. * the entire group will be included.
  1174. */
  1175. selector: string;
  1176. /**
  1177. * An array containing the rule's individual selectors.
  1178. * Groups of selectors are split at commas.
  1179. */
  1180. selectors?: string[];
  1181. /**
  1182. * @param overrides New properties to override in the clone.
  1183. * @returns A clone of this node. The node and its (cloned) children will
  1184. * have a clean parent and code style properties.
  1185. */
  1186. clone(overrides?: object): this;
  1187. }
  1188. interface RuleNewProps extends ContainerNewProps {
  1189. /**
  1190. * The rule's full selector. If there are multiple comma-separated selectors,
  1191. * the entire group will be included.
  1192. */
  1193. selector?: string;
  1194. /**
  1195. * An array containing the rule's individual selectors. Groups of selectors
  1196. * are split at commas.
  1197. */
  1198. selectors?: string[];
  1199. raws?: RuleRaws;
  1200. }
  1201. interface RuleRaws extends ContainerRaws {
  1202. /**
  1203. * The rule's full selector. If there are multiple comma-separated selectors,
  1204. * the entire group will be included.
  1205. */
  1206. selector?: string;
  1207. }
  1208. interface JsonRule extends JsonContainer {
  1209. /**
  1210. * The rule's full selector. If there are multiple comma-separated selectors,
  1211. * the entire group will be included.
  1212. */
  1213. selector?: string;
  1214. /**
  1215. * An array containing the rule's individual selectors.
  1216. * Groups of selectors are split at commas.
  1217. */
  1218. selectors?: string[];
  1219. }
  1220. /**
  1221. * Represents a CSS declaration.
  1222. */
  1223. interface Declaration extends NodeBase {
  1224. type: 'decl';
  1225. /**
  1226. * Returns the declaration's parent node.
  1227. */
  1228. parent: Container;
  1229. /**
  1230. * The declaration's property name.
  1231. */
  1232. prop: string;
  1233. /**
  1234. * The declaration's value. This value will be cleaned of comments. If the
  1235. * source value contained comments, those comments will be available in the
  1236. * _value.raws property. If you have not changed the value, the result of
  1237. * decl.toString() will include the original raws value (comments and all).
  1238. */
  1239. value: string;
  1240. /**
  1241. * True if the declaration has an !important annotation.
  1242. */
  1243. important: boolean;
  1244. /**
  1245. * @param overrides New properties to override in the clone.
  1246. * @returns A clone of this node. The node and its (cloned) children will
  1247. * have a clean parent and code style properties.
  1248. */
  1249. clone(overrides?: object): this;
  1250. }
  1251. interface DeclarationNewProps {
  1252. /**
  1253. * The declaration's property name.
  1254. */
  1255. prop?: string;
  1256. /**
  1257. * The declaration's value. This value will be cleaned of comments. If the
  1258. * source value contained comments, those comments will be available in the
  1259. * _value.raws property. If you have not changed the value, the result of
  1260. * decl.toString() will include the original raws value (comments and all).
  1261. */
  1262. value?: string;
  1263. raws?: DeclarationRaws;
  1264. }
  1265. interface DeclarationRaws extends NodeRaws {
  1266. /**
  1267. * The declaration's value. This value will be cleaned of comments.
  1268. * If the source value contained comments, those comments will be
  1269. * available in the _value.raws property. If you have not changed the value, the result of
  1270. * decl.toString() will include the original raws value (comments and all).
  1271. */
  1272. value?: string;
  1273. }
  1274. interface JsonDeclaration extends JsonNode {
  1275. /**
  1276. * True if the declaration has an !important annotation.
  1277. */
  1278. important?: boolean;
  1279. }
  1280. /**
  1281. * Represents a comment between declarations or statements (rule and at-rules).
  1282. * Comments inside selectors, at-rule parameters, or declaration values will
  1283. * be stored in the Node#raws properties.
  1284. */
  1285. interface Comment extends NodeBase {
  1286. type: 'comment';
  1287. /**
  1288. * Returns the comment's parent node.
  1289. */
  1290. parent: Container;
  1291. /**
  1292. * The comment's text.
  1293. */
  1294. text: string;
  1295. /**
  1296. * @param overrides New properties to override in the clone.
  1297. * @returns A clone of this node. The node and its (cloned) children will
  1298. * have a clean parent and code style properties.
  1299. */
  1300. clone(overrides?: object): this;
  1301. }
  1302. interface CommentNewProps {
  1303. /**
  1304. * The comment's text.
  1305. */
  1306. text?: string;
  1307. }
  1308. interface JsonComment extends JsonNode {
  1309. }
  1310. }
  1311. export = postcss;