source: frontend/node_modules/postcss/lib/at-rule.d.ts

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 3.3 KB
RevLine 
[9af201e]1import Container, {
2 ContainerProps,
3 ContainerWithChildren
4} from './container.js'
5
6declare namespace AtRule {
7 export interface AtRuleRaws extends Record<string, unknown> {
8 /**
9 * The space symbols after the last child of the node to the end of the node.
10 */
11 after?: string
12
13 /**
14 * The space between the at-rule name and its parameters.
15 */
16 afterName?: string
17
18 /**
19 * The space symbols before the node. It also stores `*`
20 * and `_` symbols before the declaration (IE hack).
21 */
22 before?: string
23
24 /**
25 * The symbols between the last parameter and `{` for rules.
26 */
27 between?: string
28
29 /**
30 * The rule’s selector with comments.
31 */
32 params?: {
33 raw: string
34 value: string
35 }
36
37 /**
38 * Contains `true` if the last child has an (optional) semicolon.
39 */
40 semicolon?: boolean
41 }
42
43 export interface AtRuleProps extends ContainerProps {
44 /** Name of the at-rule. */
45 name: string
46 /** Parameters following the name of the at-rule. */
47 params?: number | string
48 /** Information used to generate byte-to-byte equal node string as it was in the origin input. */
49 raws?: AtRuleRaws
50 }
51
52 export { AtRule_ as default }
53}
54
55/**
56 * Represents an at-rule.
57 *
58 * ```js
59 * Once (root, { AtRule }) {
60 * let media = new AtRule({ name: 'media', params: 'print' })
61 * media.append(…)
62 * root.append(media)
63 * }
64 * ```
65 *
66 * If it’s followed in the CSS by a `{}` block, this node will have
67 * a nodes property representing its children.
68 *
69 * ```js
70 * const root = postcss.parse('@charset "UTF-8"; @media print {}')
71 *
72 * const charset = root.first
73 * charset.type //=> 'atrule'
74 * charset.nodes //=> undefined
75 *
76 * const media = root.last
77 * media.nodes //=> []
78 * ```
79 */
80declare class AtRule_ extends Container {
81 /**
82 * An array containing the layer’s children.
83 *
84 * ```js
85 * const root = postcss.parse('@layer example { a { color: black } }')
86 * const layer = root.first
87 * layer.nodes.length //=> 1
88 * layer.nodes[0].selector //=> 'a'
89 * ```
90 *
91 * Can be `undefinded` if the at-rule has no body.
92 *
93 * ```js
94 * const root = postcss.parse('@layer a, b, c;')
95 * const layer = root.first
96 * layer.nodes //=> undefined
97 * ```
98 */
99 nodes: Container['nodes'] | undefined
100 parent: ContainerWithChildren | undefined
101
102 raws: AtRule.AtRuleRaws
103 type: 'atrule'
104 /**
105 * The at-rule’s name immediately follows the `@`.
106 *
107 * ```js
108 * const root = postcss.parse('@media print {}')
109 * const media = root.first
110 * media.name //=> 'media'
111 * ```
112 */
113 get name(): string
114 set name(value: string)
115
116 /**
117 * The at-rule’s parameters, the values that follow the at-rule’s name
118 * but precede any `{}` block.
119 *
120 * ```js
121 * const root = postcss.parse('@media print, screen {}')
122 * const media = root.first
123 * media.params //=> 'print, screen'
124 * ```
125 */
126 get params(): string
127
128 set params(value: string)
129
130 constructor(defaults?: AtRule.AtRuleProps)
131 assign(overrides: AtRule.AtRuleProps | object): this
132 clone(overrides?: Partial<AtRule.AtRuleProps>): this
133 cloneAfter(overrides?: Partial<AtRule.AtRuleProps>): this
134 cloneBefore(overrides?: Partial<AtRule.AtRuleProps>): this
135}
136
137declare class AtRule extends AtRule_ {}
138
139export = AtRule
Note: See TracBrowser for help on using the repository browser.