File tree Expand file tree Collapse file tree 2 files changed +15
-6
lines changed
Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ export interface Processor<P = Settings> extends FrozenProcessor<P> {
1717 * @typeParam S Plugin settings
1818 * @returns The processor on which use is called
1919 */
20- use < S extends any [ ] = [ Settings ?] > (
20+ use < S extends any [ ] = [ ( Settings | boolean ) ?] > (
2121 plugin : Plugin < S , P > ,
2222 ...settings : S
2323 ) : Processor < P >
@@ -221,7 +221,10 @@ export interface FrozenProcessor<P = Settings> {
221221 * @typeParam P Processor settings
222222 * @returns Optional Transformer.
223223 */
224- export type Plugin < S extends any [ ] = [ Settings ?] , P = Settings > = Attacher < S , P >
224+ export type Plugin <
225+ S extends any [ ] = [ ( Settings | boolean ) ?] ,
226+ P = Settings
227+ > = Attacher < S , P >
225228
226229/**
227230 * Configuration passed to a Plugin or Processor
@@ -256,10 +259,10 @@ export interface ProcessorSettings<P = Settings> {
256259 * @typeParam S Plugin settings
257260 * @typeParam P Processor settings
258261 */
259- export type PluginTuple < S extends any [ ] = [ Settings ? ] , P = Settings > = [
260- Plugin < S , P > ,
261- ... S
262- ]
262+ export type PluginTuple <
263+ S extends any [ ] = [ ( Settings | boolean ) ? ] ,
264+ P = Settings
265+ > = [ Plugin < S , P > , ... S ]
263266
264267/**
265268 * A union of the different ways to add plugins to unified
Original file line number Diff line number Diff line change @@ -77,6 +77,12 @@ processor.use([
7777 [ plugin , settings ] ,
7878 [ plugin , settings ]
7979] )
80+ processor . use ( plugin , true )
81+ processor . use ( plugin , false )
82+ processor . use ( [
83+ [ plugin , true ] ,
84+ [ plugin , false ]
85+ ] )
8086
8187processor . use ( parserPlugin )
8288processor . use ( parserPlugin ) . use ( parserPlugin )
You can’t perform that action at this time.
0 commit comments