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