UNPKG

1.58 kBTypeScriptView Raw
1import {List, OrderedMap} from 'immutable';
2
3import {Value} from './index';
4import {SassList, ListSeparator} from './list';
5
6/**
7 * Sass's [argument list
8 * type](https://sass-lang.com/documentation/values/lists#argument-lists).
9 *
10 * An argument list comes from a rest argument. It's distinct from a normal
11 * [[SassList]] in that it may contain a keyword map as well as the positional
12 * arguments.
13 *
14 * @category Custom Function
15 */
16export class SassArgumentList extends SassList {
17 /**
18 * Creates a new argument list.
19 *
20 * @param contents - The positional arguments that make up the primary
21 * contents of the list. This may be either a plain JavaScript array or an
22 * immutable [[List]] from the [`immutable`
23 * package](https://immutable-js.com/).
24 *
25 * @param keywords - The keyword arguments attached to this argument list,
26 * whose names should exclude `$`. This can be either a plain JavaScript
27 * object with argument names as fields, or an immutable [[OrderedMap]] from
28 * the [`immutable` package](https://immutable-js.com/)
29 *
30 * @param separator - The separator for this list. Defaults to `','`.
31 */
32 constructor(
33 contents: Value[] | List<Value>,
34 keywords: Record<string, Value> | OrderedMap<string, Value>,
35 separator?: ListSeparator
36 );
37
38 /**
39 * The keyword arguments attached to this argument list.
40 *
41 * The argument names don't include `$`.
42 *
43 * @returns An immutable [[OrderedMap]] from the [`immutable`
44 * package](https://immutable-js.com/).
45 */
46 get keywords(): OrderedMap<string, Value>;
47}
48
\No newline at end of file