Comparing version 8.0.1 to 8.1.0
{ | ||
"name": "unified", | ||
"version": "8.0.1", | ||
"version": "8.1.0", | ||
"description": "Interface for processing text using syntax trees", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -18,6 +18,12 @@ // TypeScript Version: 3.0 | ||
* @param plugin unified plugin | ||
* @param options Configuration for plugin] | ||
* @param options Configuration for plugin | ||
* @param extraOptions Additional configuration for plugin | ||
* @returns The processor on which use is invoked | ||
*/ | ||
use(plugin: Plugin, options?: unknown): Processor | ||
use<T = Settings, S = undefined>( | ||
plugin: Plugin<T, S>, | ||
options?: T, | ||
extraOptions?: S | ||
): Processor | ||
/** | ||
@@ -27,7 +33,16 @@ * @param preset `Object` with an optional plugins (set to list), and/or an optional settings object | ||
use(preset: Preset): Processor | ||
/** | ||
* @param pluginTuple pairs, plugin and options in an array | ||
*/ | ||
use(pluginTuple: PluginTuple): Processor | ||
use<T = Settings>(pluginTuple: PluginTuple<T>): Processor | ||
/** | ||
* @param pluginTriple plugin, options, and extraOptions in an array | ||
*/ | ||
use<T = Settings, S = undefined>( | ||
pluginTriple: PluginTriple<T, S> | ||
): Processor | ||
/** | ||
* @param list List of plugins, presets, and pairs | ||
@@ -150,3 +165,3 @@ */ | ||
type Plugin = Attacher | ||
type Plugin<T = Settings, S = undefined> = Attacher<T, S> | ||
type Settings = { | ||
@@ -163,5 +178,10 @@ [key: string]: unknown | ||
} | ||
type PluginTuple = [Plugin, Settings] | ||
type Pluggable = Plugin | Preset | PluginTuple | ||
type PluggableList = Pluggable[] | ||
type PluginTuple<T = Settings> = [Plugin<T>, T] | ||
type PluginTriple<T = Settings, S = undefined> = [Plugin<T, S>, T, S] | ||
type Pluggable<T = Settings, S = undefined> = | ||
| Plugin<T> | ||
| Preset | ||
| PluginTuple<T> | ||
| PluginTriple<T, S> | ||
type PluggableList = Array<Pluggable<any, any>> | ||
@@ -176,6 +196,7 @@ /** | ||
* @param options Configuration | ||
* @param extraOptions Secondary configuration | ||
* @returns Optional. | ||
*/ | ||
interface Attacher { | ||
(this: Processor, options?: unknown): Transformer | void | ||
interface Attacher<T = Settings, S = undefined> { | ||
(this: Processor, options?: T, extraOptions?: S): Transformer | void | ||
} | ||
@@ -182,0 +203,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
60294
589