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\Delimiter;
16
17use League\CommonMark\Inline\Element\AbstractStringContainer;
18
19interface DelimiterInterface
20{
21    public function canClose(): bool;
22
23    public function canOpen(): bool;
24
25    public function isActive(): bool;
26
27    /**
28     * @param bool $active
29     *
30     * @return void
31     */
32    public function setActive(bool $active);
33
34    /**
35     * @return string
36     */
37    public function getChar(): string;
38
39    public function getIndex(): ?int;
40
41    public function getNext(): ?DelimiterInterface;
42
43    /**
44     * @param DelimiterInterface|null $next
45     *
46     * @return void
47     */
48    public function setNext(?DelimiterInterface $next);
49
50    public function getLength(): int;
51
52    /**
53     * @param int $length
54     *
55     * @return void
56     */
57    public function setLength(int $length);
58
59    public function getOriginalLength(): int;
60
61    public function getInlineNode(): AbstractStringContainer;
62
63    public function getPrevious(): ?DelimiterInterface;
64
65    /**
66     * @param DelimiterInterface|null $previous
67     *
68     * @return mixed|void
69     */
70    public function setPrevious(?DelimiterInterface $previous);
71}
72