33cf46c345d3cfb6d317a668359627bf4e45170a1e94ecb969b9d91d95b53ee04fe1c1189efe9ec18a6584938b59314b3fe7583458edc9d58d740a7c1e140e 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import {OrderedMap} from 'immutable';
  2. import {SassList} from './list';
  3. import {Value} from './index';
  4. /**
  5. * Sass's [map type](https://sass-lang.com/documentation/values/maps).
  6. *
  7. * @category Custom Function
  8. */
  9. export class SassMap extends Value {
  10. /**
  11. * Creates a new map.
  12. *
  13. * @param contents - The contents of the map. This is an immutable
  14. * `OrderedMap` from the [`immutable` package](https://immutable-js.com/).
  15. * Defaults to an empty map.
  16. */
  17. constructor(contents?: OrderedMap<Value, Value>);
  18. /**
  19. * Returns the contents of this map as an immutable {@link OrderedMap} from the
  20. * [`immutable` package](https://immutable-js.com/).
  21. */
  22. get contents(): OrderedMap<Value, Value>;
  23. /**
  24. * Returns the value associated with `key` in this map, or `undefined` if
  25. * `key` isn't in the map.
  26. *
  27. * This is a shorthand for `this.contents.get(key)`, although it may be more
  28. * efficient in some cases.
  29. */
  30. get(key: Value): Value | undefined;
  31. /** Inherited from {@link Value.get}. */
  32. get(index: number): SassList | undefined;
  33. /** @hidden */
  34. tryMap(): SassMap;
  35. }