1<?php
2
3/*
4 * This file is part of the league/commonmark package.
5 *
6 * (c) Colin O'Dell <colinodell@gmail.com>
7 *
8 * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js)
9 *  - (c) John MacFarlane
10 *
11 * For the full copyright and license information, please view the LICENSE
12 * file that was distributed with this source code.
13 */
14
15namespace League\CommonMark\Reference;
16
17/**
18 * A collection of references
19 */
20interface ReferenceMapInterface
21{
22    /**
23     * @param ReferenceInterface $reference
24     *
25     * @return void
26     */
27    public function addReference(ReferenceInterface $reference): void;
28
29    /**
30     * @param string $label
31     *
32     * @return bool
33     */
34    public function contains(string $label): bool;
35
36    /**
37     * @param string $label
38     *
39     * @return ReferenceInterface|null
40     */
41    public function getReference(string $label): ?ReferenceInterface;
42
43    /**
44     * Lists all registered references.
45     *
46     * @return ReferenceInterface[]
47     */
48    public function listReferences(): iterable;
49}
50