Subversion-Projekte lars-tiefland.laravel_shop

Revision

Zur aktuellen Revision | Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
declare(strict_types=1);
4
 
5
/*
6
 * This file is part of the league/commonmark package.
7
 *
8
 * (c) Colin O'Dell <colinodell@gmail.com>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
 
14
namespace League\CommonMark\Environment;
15
 
16
use League\CommonMark\Delimiter\Processor\DelimiterProcessorInterface;
17
use League\CommonMark\Extension\ExtensionInterface;
18
use League\CommonMark\Node\Node;
19
use League\CommonMark\Parser\Block\BlockStartParserInterface;
20
use League\CommonMark\Parser\Inline\InlineParserInterface;
21
use League\CommonMark\Renderer\NodeRendererInterface;
22
use League\Config\ConfigurationProviderInterface;
23
 
24
/**
25
 * Interface for building the Environment with any extensions, parsers, listeners, etc. that it may need
26
 */
27
interface EnvironmentBuilderInterface extends ConfigurationProviderInterface
28
{
29
    /**
30
     * Registers the given extension with the Environment
31
     */
32
    public function addExtension(ExtensionInterface $extension): EnvironmentBuilderInterface;
33
 
34
    /**
35
     * Registers the given block start parser with the Environment
36
     *
37
     * @param BlockStartParserInterface $parser   Block parser instance
38
     * @param int                       $priority Priority (a higher number will be executed earlier)
39
     *
40
     * @return $this
41
     */
42
    public function addBlockStartParser(BlockStartParserInterface $parser, int $priority = 0): EnvironmentBuilderInterface;
43
 
44
    /**
45
     * Registers the given inline parser with the Environment
46
     *
47
     * @param InlineParserInterface $parser   Inline parser instance
48
     * @param int                   $priority Priority (a higher number will be executed earlier)
49
     *
50
     * @return $this
51
     */
52
    public function addInlineParser(InlineParserInterface $parser, int $priority = 0): EnvironmentBuilderInterface;
53
 
54
    /**
55
     * Registers the given delimiter processor with the Environment
56
     *
57
     * @param DelimiterProcessorInterface $processor Delimiter processors instance
58
     */
59
    public function addDelimiterProcessor(DelimiterProcessorInterface $processor): EnvironmentBuilderInterface;
60
 
61
    /**
62
     * Registers the given node renderer with the Environment
63
     *
64
     * @param string                $nodeClass The fully-qualified node element class name the renderer below should handle
65
     * @param NodeRendererInterface $renderer  The renderer responsible for rendering the type of element given above
66
     * @param int                   $priority  Priority (a higher number will be executed earlier)
67
     *
68
     * @psalm-param class-string<Node> $nodeClass
69
     *
70
     * @return $this
71
     */
72
    public function addRenderer(string $nodeClass, NodeRendererInterface $renderer, int $priority = 0): EnvironmentBuilderInterface;
73
 
74
    /**
75
     * Registers the given event listener
76
     *
77
     * @param class-string $eventClass Fully-qualified class name of the event this listener should respond to
78
     * @param callable     $listener   Listener to be executed
79
     * @param int          $priority   Priority (a higher number will be executed earlier)
80
     *
81
     * @return $this
82
     */
83
    public function addEventListener(string $eventClass, callable $listener, int $priority = 0): EnvironmentBuilderInterface;
84
}