#
whycq
2023-09-19 24b3bdf4cd46e85cdfa4470eef70b36262a51012
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import {List} from 'immutable';
 
import {Value} from './index';
 
/**
 * Possible separators used by Sass lists. The special separator `null` is only
 * used for lists with fewer than two elements, and indicates that the separator
 * has not yet been decided for this list.
 *
 * @category Custom Function
 */
export type ListSeparator = ',' | '/' | ' ' | null;
 
/**
 * Sass's [list type](https://sass-lang.com/documentation/values/lists).
 *
 * @category Custom Function
 */
export class SassList extends Value {
  /**
   * Creates a new list.
   *
   * @param contents - The contents of the list. This may be either a plain
   * JavaScript array or an immutable {@link List} from the [`immutable`
   * package](https://immutable-js.com/).
   *
   * @param options.separator - The separator to use between elements of this
   * list. Defaults to `','`.
   *
   * @param options.brackets - Whether the list has square brackets. Defaults to
   * `false`.
   */
  constructor(
    contents: Value[] | List<Value>,
    options?: {
      separator?: ListSeparator;
      brackets?: boolean;
    }
  );
 
  /**
   * Creates an empty list.
   *
   * @param options.separator - The separator to use between elements of this
   * list. Defaults to `','`.
   *
   * @param options.brackets - Whether the list has square brackets. Defaults to
   * `false`.
   */
  constructor(options?: {separator?: ListSeparator; brackets?: boolean});
 
  /** @hidden */
  get separator(): ListSeparator;
}