@@ -9,15 +9,7 @@ declare namespace unified {
99 *
1010 * @typeParam P Processor settings. Useful when packaging unified with a preset parser and compiler.
1111 */
12- interface Processor < P = Settings > {
13- /**
14- * Clone current processor
15- *
16- * @returns New unfrozen processor which is configured to function the same as its ancestor.
17- * But when the descendant processor is configured in the future it does not affect the ancestral processor.
18- */
19- ( ) : Processor < P >
20-
12+ interface Processor < P = Settings > extends FrozenProcessor < P > {
2113 /**
2214 * Configure the processor to use a plugin and optionally configure that plugin with options.
2315 *
@@ -61,6 +53,22 @@ declare namespace unified {
6153 * @param processorSettings Settings passed to processor
6254 */
6355 use ( processorSettings : ProcessorSettings < P > ) : Processor < P >
56+ }
57+
58+ /**
59+ * A frozen processor is just like a regular processor, except no additional plugins can be added.
60+ * A frozen processor can be created by calling `.freeze()` on a processor.
61+ *
62+ * @see Processor
63+ */
64+ interface FrozenProcessor < P = Settings > {
65+ /**
66+ * Clone current processor
67+ *
68+ * @returns New unfrozen processor which is configured to function the same as its ancestor.
69+ * But when the descendant processor is configured in the future it does not affect the ancestral processor.
70+ */
71+ ( ) : Processor < P >
6472
6573 /**
6674 * Parse text to a syntax tree.
@@ -200,7 +208,7 @@ declare namespace unified {
200208 *
201209 * @returns The processor on which freeze is invoked.
202210 */
203- freeze ( ) : Processor < P >
211+ freeze ( ) : FrozenProcessor < P >
204212 }
205213
206214 /**
0 commit comments