Skip to content

Commit

Permalink
Fix types to support booleans
Browse files Browse the repository at this point in the history
Related to GH-145.
Closes GH-147.

Reviewed-by: Titus Wormer <tituswormer@gmail.com>
  • Loading branch information
ChristianMurphy committed Jul 6, 2021
1 parent 5167c49 commit b8fe5ec
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ export interface Processor<P = Settings> extends FrozenProcessor<P> {
* @typeParam S Plugin settings
* @returns The processor on which use is called
*/
use<S extends any[] = [(Settings | boolean)?]>(
use<S extends any[] = [Settings?]>(
plugin: Plugin<S, P>,
...settings: S
...settings: S | [boolean]
): Processor<P>

/**
Expand Down Expand Up @@ -222,7 +222,7 @@ export interface FrozenProcessor<P = Settings> {
* @returns Optional Transformer.
*/
export type Plugin<
S extends any[] = [(Settings | boolean)?],
S extends any[] = [Settings?],
P = Settings
> = Attacher<S, P>

Expand Down Expand Up @@ -260,7 +260,7 @@ export interface ProcessorSettings<P = Settings> {
* @typeParam P Processor settings
*/
export type PluginTuple<
S extends any[] = [(Settings | boolean)?],
S extends any[] = [Settings?],
P = Settings
> = [Plugin<S, P>, ...S]

Expand Down

0 comments on commit b8fe5ec

Please sign in to comment.