d3e308bad66fca67213218dbbde3bdd7d9cf47812f91e43a92ab9feffb22f359b046c30581dfde525dce9d49fe9c78057f3943007e51983e560f6205620ed1 1.6 KB

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