Comparing version 8.2.0 to 8.3.0
{ | ||
"name": "unified", | ||
"version": "8.2.0", | ||
"version": "8.3.0", | ||
"description": "Interface for processing text using syntax trees", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -1,2 +0,2 @@ | ||
// TypeScript Version: 3.0 | ||
// TypeScript Version: 3.4 | ||
@@ -26,11 +26,8 @@ import {Node} from 'unist' | ||
* @param settings Configuration for plugin | ||
* @param extraSettings Additional configuration for plugin | ||
* @typeParam S Plugin settings | ||
* @typeParam S2 Extra plugin settings | ||
* @returns The processor on which use is invoked | ||
*/ | ||
use<S = Settings, S2 = undefined>( | ||
plugin: Plugin<S, S2, P>, | ||
settings?: S, | ||
extraSettings?: S2 | ||
use<S extends any[] = [Settings?]>( | ||
plugin: Plugin<S, P>, | ||
...settings: S | ||
): Processor<P> | ||
@@ -43,3 +40,3 @@ | ||
*/ | ||
use(preset: Preset<P>): Processor<P> | ||
use<S extends any[] = [Settings?]>(preset: Preset<S, P>): Processor<P> | ||
@@ -51,6 +48,5 @@ /** | ||
* @typeParam S Plugin settings | ||
* @typeParam S2 Extra plugin settings | ||
*/ | ||
use<S = Settings, S2 = Settings>( | ||
pluginTuple: PluginTuple<S, S2, P> | ||
use<S extends any[] = [Settings?]>( | ||
pluginTuple: PluginTuple<S, P> | ||
): Processor<P> | ||
@@ -220,9 +216,7 @@ | ||
* @param settings Configuration | ||
* @param extraSettings Secondary configuration | ||
* @typeParam S Plugin settings | ||
* @typeParam S2 Extra plugin settings | ||
* @typeParam P Processor settings | ||
* @returns Optional Transformer. | ||
*/ | ||
type Plugin<S = Settings, S2 = undefined, P = Settings> = Attacher<S, S2, P> | ||
type Plugin<S extends any[] = [Settings?], P = Settings> = Attacher<S, P> | ||
@@ -242,3 +236,3 @@ /** | ||
*/ | ||
interface Preset<P = Settings> { | ||
interface Preset<S = Settings, P = Settings> { | ||
plugins: PluggableList<P> | ||
@@ -261,8 +255,13 @@ settings?: Settings | ||
* @typeParam S Plugin settings | ||
* @typeParam S2 Extra plugin settings | ||
* @typeParam P Processor settings | ||
*/ | ||
type PluginTuple<S = Settings, S2 = undefined, P = Settings> = | ||
| [Plugin<S, undefined, P>, S] | ||
| [Plugin<S, S2, P>, S, S2] | ||
type PluginTuple<S extends any[] = [Settings?], P = Settings> = [ | ||
Plugin<S, P>, | ||
/** | ||
* NOTE: ideally this would be S instead of any[] | ||
* As of TypeScript 3.5.2 generic tuples cannot be spread | ||
* See: https://github.com/microsoft/TypeScript/issues/26113 | ||
*/ | ||
...any[] | ||
] | ||
@@ -273,9 +272,8 @@ /** | ||
* @typeParam S Plugin settings | ||
* @typeParam S2 Extra plugin settings | ||
* @typeParam P Processor settings | ||
*/ | ||
type Pluggable<S = Settings, S2 = undefined, P = Settings> = | ||
| Plugin<S, S2, P> | ||
| Preset<P> | ||
| PluginTuple<S, S2, P> | ||
type Pluggable<S extends any[] = [Settings?], P = Settings> = | ||
| Plugin<S, P> | ||
| Preset<S, P> | ||
| PluginTuple<S, P> | ||
@@ -287,3 +285,3 @@ /** | ||
*/ | ||
type PluggableList<P = Settings> = Array<Pluggable<any, any, P>> | ||
type PluggableList<P = Settings> = Array<Pluggable<[any?], P>> | ||
@@ -298,10 +296,8 @@ /** | ||
* @param settings Configuration | ||
* @param extraSettings Secondary configuration | ||
* @typeParam S Plugin settings | ||
* @typeParam S2 Extra plugin settings | ||
* @typeParam P Processor settings | ||
* @returns Optional Transformer. | ||
*/ | ||
interface Attacher<S = Settings, S2 = undefined, P = Settings> { | ||
(this: Processor<P>, settings?: S, extraSettings?: S2): Transformer | void | ||
interface Attacher<S extends any[] = [Settings?], P = Settings> { | ||
(this: Processor<P>, ...settings: S): Transformer | void | ||
} | ||
@@ -308,0 +304,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
64664
722