added all files to project

This commit is contained in:
2022-03-10 10:36:59 +01:00
parent 09dd957b33
commit 46a936d7de
25351 changed files with 3883356 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
# Changelog
See [GitHub Releases][releases] for the changelog.
[releases]: https://github.com/unifiedjs/unified/releases
+456
View File
@@ -0,0 +1,456 @@
'use strict'
var bail = require('bail')
var buffer = require('is-buffer')
var extend = require('extend')
var plain = require('is-plain-obj')
var trough = require('trough')
var vfile = require('vfile')
// Expose a frozen processor.
module.exports = unified().freeze()
var slice = [].slice
var own = {}.hasOwnProperty
// Process pipeline.
var pipeline = trough()
.use(pipelineParse)
.use(pipelineRun)
.use(pipelineStringify)
function pipelineParse(p, ctx) {
ctx.tree = p.parse(ctx.file)
}
function pipelineRun(p, ctx, next) {
p.run(ctx.tree, ctx.file, done)
function done(error, tree, file) {
if (error) {
next(error)
} else {
ctx.tree = tree
ctx.file = file
next()
}
}
}
function pipelineStringify(p, ctx) {
var result = p.stringify(ctx.tree, ctx.file)
if (result === undefined || result === null) {
// Empty.
} else if (typeof result === 'string' || buffer(result)) {
ctx.file.contents = result
} else {
ctx.file.result = result
}
}
// Function to create the first processor.
function unified() {
var attachers = []
var transformers = trough()
var namespace = {}
var freezeIndex = -1
var frozen
// Data management.
processor.data = data
// Lock.
processor.freeze = freeze
// Plugins.
processor.attachers = attachers
processor.use = use
// API.
processor.parse = parse
processor.stringify = stringify
processor.run = run
processor.runSync = runSync
processor.process = process
processor.processSync = processSync
// Expose.
return processor
// Create a new processor based on the processor in the current scope.
function processor() {
var destination = unified()
var index = -1
while (++index < attachers.length) {
destination.use.apply(null, attachers[index])
}
destination.data(extend(true, {}, namespace))
return destination
}
// Freeze: used to signal a processor that has finished configuration.
//
// For example, take unified itself: it’s frozen.
// Plugins should not be added to it.
// Rather, it should be extended, by invoking it, before modifying it.
//
// In essence, always invoke this when exporting a processor.
function freeze() {
var values
var transformer
if (frozen) {
return processor
}
while (++freezeIndex < attachers.length) {
values = attachers[freezeIndex]
if (values[1] === false) {
continue
}
if (values[1] === true) {
values[1] = undefined
}
transformer = values[0].apply(processor, values.slice(1))
if (typeof transformer === 'function') {
transformers.use(transformer)
}
}
frozen = true
freezeIndex = Infinity
return processor
}
// Data management.
// Getter / setter for processor-specific informtion.
function data(key, value) {
if (typeof key === 'string') {
// Set `key`.
if (arguments.length === 2) {
assertUnfrozen('data', frozen)
namespace[key] = value
return processor
}
// Get `key`.
return (own.call(namespace, key) && namespace[key]) || null
}
// Set space.
if (key) {
assertUnfrozen('data', frozen)
namespace = key
return processor
}
// Get space.
return namespace
}
// Plugin management.
//
// Pass it:
// * an attacher and options,
// * a preset,
// * a list of presets, attachers, and arguments (list of attachers and
// options).
function use(value) {
var settings
assertUnfrozen('use', frozen)
if (value === null || value === undefined) {
// Empty.
} else if (typeof value === 'function') {
addPlugin.apply(null, arguments)
} else if (typeof value === 'object') {
if ('length' in value) {
addList(value)
} else {
addPreset(value)
}
} else {
throw new Error('Expected usable value, not `' + value + '`')
}
if (settings) {
namespace.settings = extend(namespace.settings || {}, settings)
}
return processor
function addPreset(result) {
addList(result.plugins)
if (result.settings) {
settings = extend(settings || {}, result.settings)
}
}
function add(value) {
if (typeof value === 'function') {
addPlugin(value)
} else if (typeof value === 'object') {
if ('length' in value) {
addPlugin.apply(null, value)
} else {
addPreset(value)
}
} else {
throw new Error('Expected usable value, not `' + value + '`')
}
}
function addList(plugins) {
var index = -1
if (plugins === null || plugins === undefined) {
// Empty.
} else if (typeof plugins === 'object' && 'length' in plugins) {
while (++index < plugins.length) {
add(plugins[index])
}
} else {
throw new Error('Expected a list of plugins, not `' + plugins + '`')
}
}
function addPlugin(plugin, value) {
var entry = find(plugin)
if (entry) {
if (plain(entry[1]) && plain(value)) {
value = extend(true, entry[1], value)
}
entry[1] = value
} else {
attachers.push(slice.call(arguments))
}
}
}
function find(plugin) {
var index = -1
while (++index < attachers.length) {
if (attachers[index][0] === plugin) {
return attachers[index]
}
}
}
// Parse a file (in string or vfile representation) into a unist node using
// the `Parser` on the processor.
function parse(doc) {
var file = vfile(doc)
var Parser
freeze()
Parser = processor.Parser
assertParser('parse', Parser)
if (newable(Parser, 'parse')) {
return new Parser(String(file), file).parse()
}
return Parser(String(file), file) // eslint-disable-line new-cap
}
// Run transforms on a unist node representation of a file (in string or
// vfile representation), async.
function run(node, file, cb) {
assertNode(node)
freeze()
if (!cb && typeof file === 'function') {
cb = file
file = null
}
if (!cb) {
return new Promise(executor)
}
executor(null, cb)
function executor(resolve, reject) {
transformers.run(node, vfile(file), done)
function done(error, tree, file) {
tree = tree || node
if (error) {
reject(error)
} else if (resolve) {
resolve(tree)
} else {
cb(null, tree, file)
}
}
}
}
// Run transforms on a unist node representation of a file (in string or
// vfile representation), sync.
function runSync(node, file) {
var result
var complete
run(node, file, done)
assertDone('runSync', 'run', complete)
return result
function done(error, tree) {
complete = true
result = tree
bail(error)
}
}
// Stringify a unist node representation of a file (in string or vfile
// representation) into a string using the `Compiler` on the processor.
function stringify(node, doc) {
var file = vfile(doc)
var Compiler
freeze()
Compiler = processor.Compiler
assertCompiler('stringify', Compiler)
assertNode(node)
if (newable(Compiler, 'compile')) {
return new Compiler(node, file).compile()
}
return Compiler(node, file) // eslint-disable-line new-cap
}
// Parse a file (in string or vfile representation) into a unist node using
// the `Parser` on the processor, then run transforms on that node, and
// compile the resulting node using the `Compiler` on the processor, and
// store that result on the vfile.
function process(doc, cb) {
freeze()
assertParser('process', processor.Parser)
assertCompiler('process', processor.Compiler)
if (!cb) {
return new Promise(executor)
}
executor(null, cb)
function executor(resolve, reject) {
var file = vfile(doc)
pipeline.run(processor, {file: file}, done)
function done(error) {
if (error) {
reject(error)
} else if (resolve) {
resolve(file)
} else {
cb(null, file)
}
}
}
}
// Process the given document (in string or vfile representation), sync.
function processSync(doc) {
var file
var complete
freeze()
assertParser('processSync', processor.Parser)
assertCompiler('processSync', processor.Compiler)
file = vfile(doc)
process(file, done)
assertDone('processSync', 'process', complete)
return file
function done(error) {
complete = true
bail(error)
}
}
}
// Check if `value` is a constructor.
function newable(value, name) {
return (
typeof value === 'function' &&
value.prototype &&
// A function with keys in its prototype is probably a constructor.
// Classes’ prototype methods are not enumerable, so we check if some value
// exists in the prototype.
(keys(value.prototype) || name in value.prototype)
)
}
// Check if `value` is an object with keys.
function keys(value) {
var key
for (key in value) {
return true
}
return false
}
// Assert a parser is available.
function assertParser(name, Parser) {
if (typeof Parser !== 'function') {
throw new Error('Cannot `' + name + '` without `Parser`')
}
}
// Assert a compiler is available.
function assertCompiler(name, Compiler) {
if (typeof Compiler !== 'function') {
throw new Error('Cannot `' + name + '` without `Compiler`')
}
}
// Assert the processor is not frozen.
function assertUnfrozen(name, frozen) {
if (frozen) {
throw new Error(
'Cannot invoke `' +
name +
'` on a frozen processor.\nCreate a new processor first, by invoking it: use `processor()` instead of `processor`.'
)
}
}
// Assert `node` is a unist node.
function assertNode(node) {
if (!node || typeof node.type !== 'string') {
throw new Error('Expected node, got `' + node + '`')
}
}
// Assert that `complete` is `true`.
function assertDone(name, asyncName, complete) {
if (!complete) {
throw new Error(
'`' + name + '` finished async. Use `' + asyncName + '` instead'
)
}
}
+21
View File
@@ -0,0 +1,21 @@
(The MIT License)
Copyright (c) 2015 Titus Wormer <tituswormer@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
+21
View File
@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) Feross Aboukhadijeh
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
+54
View File
@@ -0,0 +1,54 @@
# is-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url]
[travis-image]: https://img.shields.io/travis/feross/is-buffer/master.svg
[travis-url]: https://travis-ci.org/feross/is-buffer
[npm-image]: https://img.shields.io/npm/v/is-buffer.svg
[npm-url]: https://npmjs.org/package/is-buffer
[downloads-image]: https://img.shields.io/npm/dm/is-buffer.svg
[downloads-url]: https://npmjs.org/package/is-buffer
[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg
[standard-url]: https://standardjs.com
#### Determine if an object is a [`Buffer`](http://nodejs.org/api/buffer.html) (including the [browserify Buffer](https://github.com/feross/buffer))
[![saucelabs][saucelabs-image]][saucelabs-url]
[saucelabs-image]: https://saucelabs.com/browser-matrix/is-buffer.svg
[saucelabs-url]: https://saucelabs.com/u/is-buffer
## Why not use `Buffer.isBuffer`?
This module lets you check if an object is a `Buffer` without using `Buffer.isBuffer` (which includes the whole [buffer](https://github.com/feross/buffer) module in [browserify](http://browserify.org/)).
It's future-proof and works in node too!
## install
```bash
npm install is-buffer
```
## usage
```js
var isBuffer = require('is-buffer')
isBuffer(new Buffer(4)) // true
isBuffer(Buffer.alloc(4)) //true
isBuffer(undefined) // false
isBuffer(null) // false
isBuffer('') // false
isBuffer(true) // false
isBuffer(false) // false
isBuffer(0) // false
isBuffer(1) // false
isBuffer(1.0) // false
isBuffer('string') // false
isBuffer({}) // false
isBuffer(function foo () {}) // false
```
## license
MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org).
+2
View File
@@ -0,0 +1,2 @@
declare function isBuffer(obj: any): boolean
export = isBuffer
+11
View File
@@ -0,0 +1,11 @@
/*!
* Determine if an object is a Buffer
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/
module.exports = function isBuffer (obj) {
return obj != null && obj.constructor != null &&
typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
}
+95
View File
@@ -0,0 +1,95 @@
{
"_args": [
[
"is-buffer@2.0.5",
"/home/pi/Desktop/smartMirrorTestEnvironment/MagicMirror"
]
],
"_development": true,
"_from": "is-buffer@2.0.5",
"_id": "is-buffer@2.0.5",
"_inBundle": false,
"_integrity": "sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==",
"_location": "/unified/is-buffer",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "is-buffer@2.0.5",
"name": "is-buffer",
"escapedName": "is-buffer",
"rawSpec": "2.0.5",
"saveSpec": null,
"fetchSpec": "2.0.5"
},
"_requiredBy": [
"/unified"
],
"_resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz",
"_spec": "2.0.5",
"_where": "/home/pi/Desktop/smartMirrorTestEnvironment/MagicMirror",
"author": {
"name": "Feross Aboukhadijeh",
"email": "feross@feross.org",
"url": "https://feross.org"
},
"bugs": {
"url": "https://github.com/feross/is-buffer/issues"
},
"dependencies": {},
"description": "Determine if an object is a Buffer",
"devDependencies": {
"airtap": "^3.0.0",
"standard": "*",
"tape": "^5.0.1"
},
"engines": {
"node": ">=4"
},
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/feross"
},
{
"type": "patreon",
"url": "https://www.patreon.com/feross"
},
{
"type": "consulting",
"url": "https://feross.org/support"
}
],
"homepage": "https://github.com/feross/is-buffer#readme",
"keywords": [
"arraybuffer",
"browser",
"browser buffer",
"browserify",
"buffer",
"buffers",
"core buffer",
"dataview",
"float32array",
"float64array",
"int16array",
"int32array",
"type",
"typed array",
"uint32array"
],
"license": "MIT",
"main": "index.js",
"name": "is-buffer",
"repository": {
"type": "git",
"url": "git://github.com/feross/is-buffer.git"
},
"scripts": {
"test": "standard && npm run test-node && npm run test-browser",
"test-browser": "airtap -- test/*.js",
"test-browser-local": "airtap --local -- test/*.js",
"test-node": "tape test/*.js"
},
"version": "2.0.5"
}
+29
View File
@@ -0,0 +1,29 @@
/**
Check if a value is a plain object.
An object is plain if it's created by either `{}`, `new Object()`, or `Object.create(null)`.
@example
```
import isPlainObject = require('is-plain-obj');
isPlainObject({foo: 'bar'});
//=> true
isPlainObject(new Object());
//=> true
isPlainObject(Object.create(null));
//=> true
isPlainObject([1, 2, 3]);
//=> false
class Unicorn {}
isPlainObject(new Unicorn());
//=> false
```
*/
declare function isPlainObj(value: unknown): value is object;
export = isPlainObj;
+10
View File
@@ -0,0 +1,10 @@
'use strict';
module.exports = value => {
if (Object.prototype.toString.call(value) !== '[object Object]') {
return false;
}
const prototype = Object.getPrototypeOf(value);
return prototype === null || prototype === Object.prototype;
};
+9
View File
@@ -0,0 +1,9 @@
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+74
View File
@@ -0,0 +1,74 @@
{
"_args": [
[
"is-plain-obj@2.1.0",
"/home/pi/Desktop/smartMirrorTestEnvironment/MagicMirror"
]
],
"_development": true,
"_from": "is-plain-obj@2.1.0",
"_id": "is-plain-obj@2.1.0",
"_inBundle": false,
"_integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==",
"_location": "/unified/is-plain-obj",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "is-plain-obj@2.1.0",
"name": "is-plain-obj",
"escapedName": "is-plain-obj",
"rawSpec": "2.1.0",
"saveSpec": null,
"fetchSpec": "2.1.0"
},
"_requiredBy": [
"/unified"
],
"_resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz",
"_spec": "2.1.0",
"_where": "/home/pi/Desktop/smartMirrorTestEnvironment/MagicMirror",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"bugs": {
"url": "https://github.com/sindresorhus/is-plain-obj/issues"
},
"description": "Check if a value is a plain object",
"devDependencies": {
"ava": "^1.4.1",
"tsd": "^0.7.2",
"xo": "^0.24.0"
},
"engines": {
"node": ">=8"
},
"files": [
"index.js",
"index.d.ts"
],
"homepage": "https://github.com/sindresorhus/is-plain-obj#readme",
"keywords": [
"object",
"is",
"check",
"test",
"type",
"plain",
"vanilla",
"pure",
"simple"
],
"license": "MIT",
"name": "is-plain-obj",
"repository": {
"type": "git",
"url": "git+https://github.com/sindresorhus/is-plain-obj.git"
},
"scripts": {
"test": "xo && ava && tsd"
},
"version": "2.1.0"
}
+54
View File
@@ -0,0 +1,54 @@
# is-plain-obj [![Build Status](https://travis-ci.org/sindresorhus/is-plain-obj.svg?branch=master)](https://travis-ci.org/sindresorhus/is-plain-obj)
> Check if a value is a plain object
An object is plain if it's created by either `{}`, `new Object()`, or `Object.create(null)`.
## Install
```
$ npm install is-plain-obj
```
## Usage
```js
const isPlainObject = require('is-plain-obj');
isPlainObject({foo: 'bar'});
//=> true
isPlainObject(new Object());
//=> true
isPlainObject(Object.create(null));
//=> true
isPlainObject([1, 2, 3]);
//=> false
class Unicorn {}
isPlainObject(new Unicorn());
//=> false
```
## Related
- [is-obj](https://github.com/sindresorhus/is-obj) - Check if a value is an object
- [is](https://github.com/sindresorhus/is) - Type check values
---
<div align="center">
<b>
<a href="https://tidelift.com/subscription/pkg/npm-is-plain-obj?utm_source=npm-is-plain-obj&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
</b>
<br>
<sub>
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
</sub>
</div>
+170
View File
@@ -0,0 +1,170 @@
{
"_args": [
[
"unified@9.2.1",
"/home/pi/Desktop/smartMirrorTestEnvironment/MagicMirror"
]
],
"_development": true,
"_from": "unified@9.2.1",
"_id": "unified@9.2.1",
"_inBundle": false,
"_integrity": "sha512-juWjuI8Z4xFg8pJbnEZ41b5xjGUWGHqXALmBZ3FC3WX0PIx1CZBIIJ6mXbYMcf6Yw4Fi0rFUTA1cdz/BglbOhA==",
"_location": "/unified",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "unified@9.2.1",
"name": "unified",
"escapedName": "unified",
"rawSpec": "9.2.1",
"saveSpec": null,
"fetchSpec": "9.2.1"
},
"_requiredBy": [
"/remark"
],
"_resolved": "https://registry.npmjs.org/unified/-/unified-9.2.1.tgz",
"_spec": "9.2.1",
"_where": "/home/pi/Desktop/smartMirrorTestEnvironment/MagicMirror",
"author": {
"name": "Titus Wormer",
"email": "tituswormer@gmail.com",
"url": "https://wooorm.com"
},
"bugs": {
"url": "https://github.com/unifiedjs/unified/issues"
},
"contributors": [
{
"name": "Titus Wormer",
"email": "tituswormer@gmail.com",
"url": "https://wooorm.com"
},
{
"name": "Junyoung Choi",
"email": "fluke8259@gmail.com"
},
{
"name": "Hernan Rajchert",
"email": "hrajchert@gmail.com"
},
{
"name": "Christian Murphy",
"email": "christian.murphy.42@gmail.com"
},
{
"name": "Vse Mozhet Byt",
"email": "vsemozhetbyt@gmail.com"
},
{
"name": "Richard Littauer",
"email": "richard.littauer@gmail.com"
}
],
"dependencies": {
"bail": "^1.0.0",
"extend": "^3.0.0",
"is-buffer": "^2.0.0",
"is-plain-obj": "^2.0.0",
"trough": "^1.0.0",
"vfile": "^4.0.0"
},
"description": "Interface for parsing, inspecting, transforming, and serializing content through syntax trees",
"devDependencies": {
"browserify": "^17.0.0",
"c8": "^7.0.0",
"dtslint": "^4.0.0",
"prettier": "^2.0.0",
"remark-cli": "^9.0.0",
"remark-preset-wooorm": "^8.0.0",
"tape": "^5.0.0",
"tinyify": "^3.0.0",
"xo": "^0.38.0"
},
"files": [
"types/ts3.4/index.d.ts",
"types/ts4.0/index.d.ts",
"index.js",
"lib"
],
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
},
"homepage": "https://unifiedjs.com",
"keywords": [
"unified",
"process",
"parse",
"transform",
"compile",
"stringify",
"serialize",
"ast",
"cst",
"syntax",
"tree",
"content",
"rehype",
"retext",
"remark"
],
"license": "MIT",
"name": "unified",
"prettier": {
"tabWidth": 2,
"useTabs": false,
"singleQuote": true,
"bracketSpacing": false,
"semi": false,
"trailingComma": "none"
},
"remarkConfig": {
"plugins": [
"preset-wooorm"
]
},
"repository": {
"type": "git",
"url": "git+https://github.com/unifiedjs/unified.git"
},
"scripts": {
"build": "npm run build-bundle && npm run build-mangle",
"build-bundle": "browserify index.js -s unified -o unified.js",
"build-mangle": "browserify index.js -s unified -p tinyify -o unified.min.js",
"format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix",
"test": "npm run format && npm run build && npm run test-coverage && npm run test-types",
"test-api": "node test",
"test-coverage": "c8 --check-coverage --lines 100 --functions 100 --branches 100 --reporter lcov tape test",
"test-types": "npm run test-types-3.4 && npm run test-types-4.0",
"test-types-3.4": "dtslint types/ts3.4",
"test-types-4.0": "dtslint types/ts4.0"
},
"types": "types/ts3.4/index.d.ts",
"typesVersions": {
">=4.0": {
"types/ts3.4/*": [
"types/ts4.0/*"
]
}
},
"version": "9.2.1",
"xo": {
"prettier": true,
"esnext": false,
"rules": {
"guard-for-in": "off",
"no-unreachable-loop": "off",
"unicorn/prefer-number-properties": "off",
"unicorn/prefer-optional-catch-binding": "off",
"unicorn/prefer-reflect-apply": "off",
"unicorn/prefer-type-error": "off"
},
"ignores": [
"types",
"unified.js"
]
}
}
+1386
View File
File diff suppressed because it is too large Load Diff
+407
View File
@@ -0,0 +1,407 @@
// TypeScript Version: 3.4
import {Node} from 'unist'
import {VFile, VFileCompatible} from 'vfile'
declare namespace unified {
/**
* Processor allows plugins, parsers, and compilers to be chained together to transform content.
*
* @typeParam P Processor settings. Useful when packaging unified with a preset parser and compiler.
*/
interface Processor<P = Settings> extends FrozenProcessor<P> {
/**
* Configure the processor to use a plugin and optionally configure that plugin with options.
*
* @param plugin unified plugin
* @param settings Configuration for plugin
* @typeParam S Plugin settings
* @returns The processor on which use is invoked
*/
use<S extends any[] = [Settings?]>(
plugin: Plugin<S, P>,
...settings: S
): Processor<P>
/**
* Configure the processor with a preset to use
*
* @param preset `Object` with an plugins (set to list), and/or an optional settings object
*/
use<S extends any[] = [Settings?]>(preset: Preset<S, P>): Processor<P>
/**
* Configure using a tuple of plugin and setting(s)
*
* @param pluginTuple pairs, plugin and settings in an array
* @typeParam S Plugin settings
*/
use<S extends any[] = [Settings?]>(
pluginTuple: PluginTuple<S, P>
): Processor<P>
/**
* A list of plugins and presets to be applied to processor
*
* @param list List of plugins, presets, and pairs
*/
use(list: PluggableList<P>): Processor<P>
/**
* Configuration passed to a frozen processor
*
* @param processorSettings Settings passed to processor
*/
use(processorSettings: ProcessorSettings<P>): Processor<P>
}
/**
* A frozen processor is just like a regular processor, except no additional plugins can be added.
* A frozen processor can be created by calling `.freeze()` on a processor.
*
* See `Processor`.
*/
interface FrozenProcessor<P = Settings> {
/**
* Clone current processor
*
* @returns New unfrozen processor which is configured to function the same as its ancestor.
* But when the descendant processor is configured in the future it does not affect the ancestral processor.
*/
(): Processor<P>
/**
* Parse text to a syntax tree.
*
* @param file VFile or anything which can be given to vfile()
* @returns Syntax tree representation of input.
*/
parse(file: VFileCompatible): Node
/**
* Function handling the parsing of text to a syntax tree.
* Used in the parse phase in the process and invoked with a `string` and `VFile` representation of the document to parse.
*
* `Parser` can be a normal function in which case it must return a `Node`: the syntax tree representation of the given file.
*
* `Parser` can also be a constructor function (a function with keys in its `prototype`) in which case it’s invoked with `new`.
* Instances must have a parse method which is invoked without arguments and must return a `Node`.
*/
Parser: ParserConstructor | ParserFunction
/**
* Compile a syntax tree to text.
*
* @param node unist node
* @param file `VFile` or anything which can be given to `vfile()`
* @returns String representation of the syntax tree file
*/
stringify(node: Node, file?: VFileCompatible): string
/**
* Function handling the compilation of syntax tree to a text.
* Used in the stringify phase in the process and invoked with a `Node` and `VFile` representation of the document to stringify.
*
* `Compiler` can be a normal function in which case it must return a `string`: the text representation of the given syntax tree.
*
* `Compiler` can also be a constructor function (a function with keys in its `prototype`) in which case it’s invoked with `new`.
* Instances must have a `compile` method which is invoked without arguments and must return a `string`.
*/
Compiler: CompilerConstructor | CompilerFunction
/**
* Transform a syntax tree by applying plugins to it.
*
* @param node Node to transform
* @returns `Promise` if `done` is not given. Rejected with an error, or resolved with the resulting syntax tree.
*/
run(node: Node): Promise<Node>
/**
* Transform a syntax tree by applying plugins to it.
*
* @param node Node to transform
* @param file `VFile` or anything which can be given to `vfile()`
* @returns `Promise` if `done` is not given. Rejected with an error, or resolved with the resulting syntax tree.
*/
run(node: Node, file: VFileCompatible): Promise<Node>
/**
* Transform a syntax tree by applying plugins to it.
*
* @param node Node to transform
* @param done Invoked when transformation is complete.
*/
run(node: Node, done: RunCallback): void
/**
* Transform a syntax tree by applying plugins to it.
*
* @param node Node to transform
* @param file `VFile` or anything which can be given to `vfile()`
* @param done Invoked when transformation is complete.
*/
run(node: Node, file: VFileCompatible, done: RunCallback): void
/**
* Transform a syntax tree by applying plugins to it.
*
* If asynchronous plugins are configured an error is thrown.
*
* @param node Node to transform
* @param file `VFile` or anything which can be given to `vfile()`
* @returns The given syntax tree.
*/
runSync(node: Node, file?: VFileCompatible): Node
/**
* Process the given representation of a file as configured on the processor. The process invokes `parse`, `run`, and `stringify` internally.
* @param file `VFile` or anything which can be given to `vfile()`
* @returns `Promise` if `done` is not given.
* Rejected with an error or resolved with the resulting file.
*/
process(file: VFileCompatible): Promise<VFile>
/**
* Process the given representation of a file as configured on the processor. The process invokes `parse`, `run`, and `stringify` internally.
* @param file `VFile` or anything which can be given to `vfile()`
* @param done Invoked when the process is complete. Invoked with a fatal error, if any, and the VFile.
*/
process(file: VFileCompatible, done: ProcessCallback): void
/**
* Process the given representation of a file as configured on the processor. The process invokes `parse`, `run`, and `stringify` internally.
*
* If asynchronous plugins are configured an error is thrown.
*
* @param file `VFile` or anything which can be given to `vfile()`
* @returns Virtual file with modified contents.
*/
processSync(file: VFileCompatible): VFile
/**
* Get or set information in an in-memory key-value store accessible to all phases of the process.
* An example is a list of HTML elements which are self-closing, which is needed when parsing, transforming, and compiling HTML.
*
* @returns key-value store object
*/
data(): {[key: string]: unknown}
/**
* @param key Identifier
* @returns If getting, the value at key
*/
data(key: string): unknown
/**
* @param value Value to set. Omit if getting key
* @returns If setting, the processor on which data is invoked
*/
data(key: string, value: any): Processor<P>
/**
* Freeze a processor. Frozen processors are meant to be extended and not to be configured or processed directly.
*
* Once a processor is frozen it cannot be unfrozen. New processors functioning just like it can be created by invoking the processor.
*
* It’s possible to freeze processors explicitly, by calling `.freeze()`, but `.parse()`, `.run()`, `.stringify()`, and `.process()` call `.freeze()` to freeze a processor too.
*
* @returns The processor on which freeze is invoked.
*/
freeze(): FrozenProcessor<P>
}
/**
* A Plugin (Attacher) is the thing passed to `use`.
* It configures the processor and in turn can receive options.
*
* Attachers can configure processors, such as by interacting with parsers and compilers, linking them to other processors, or by specifying how the syntax tree is handled.
*
* @param settings Configuration
* @typeParam S Plugin settings
* @typeParam P Processor settings
* @returns Optional Transformer.
*/
type Plugin<S extends any[] = [Settings?], P = Settings> = Attacher<S, P>
/**
* Configuration passed to a Plugin or Processor
*/
interface Settings {
[key: string]: unknown
}
/**
* Presets provide a potentially sharable way to configure processors.
* They can contain multiple plugins and optionally settings as well.
*
* @typeParam P Processor settings
*/
interface Preset<S = Settings, P = Settings> {
plugins: PluggableList<P>
settings?: Settings
}
/**
* Settings can be passed directly to the processor
*
* @typeParam P Settings applied to a processor. Useful when packaging unified with a preset parser and compiler.
*/
interface ProcessorSettings<P = Settings> {
settings: P
}
/**
* A pairing of a plugin with its settings
*
* @typeParam S Plugin settings
* @typeParam P Processor settings
*/
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[]
]
/**
* A union of the different ways to add plugins to unified
*
* @typeParam S Plugin settings
* @typeParam P Processor settings
*/
type Pluggable<S extends any[] = [Settings?], P = Settings> =
| Plugin<S, P>
| Preset<S, P>
| PluginTuple<S, P>
/**
* A list of plugins and presets
*
* @typeParam P Processor settings
*/
type PluggableList<P = Settings> = Array<Pluggable<[any?], P>>
/**
* An attacher is the thing passed to `use`.
* It configures the processor and in turn can receive options.
*
* Attachers can configure processors, such as by interacting with parsers and compilers, linking them to other processors, or by specifying how the syntax tree is handled.
*
* @param settings Configuration
* @typeParam S Plugin settings
* @typeParam P Processor settings
* @returns Optional Transformer.
*/
type Attacher<S extends any[] = [Settings?], P = Settings> = (
this: Processor<P>,
...settings: S
) => Transformer | void
/**
* Transformers modify the syntax tree or metadata of a file. A transformer is a function which is invoked each time a file is passed through the transform phase.
* If an error occurs (either because it’s thrown, returned, rejected, or passed to `next`), the process stops.
*
* The transformation process in unified is handled by `trough`, see it’s documentation for the exact semantics of transformers.
*
* @param node Node or tree to be transformed
* @param file File associated with node or tree
* @param next If the signature of a transformer includes `next` (third argument), the function may finish asynchronous, and must invoke `next()`.
* @returns
* - `void` — If nothing is returned, the next transformer keeps using same tree.
* - `Error` — Can be returned to stop the process
* - `Node` — Can be returned and results in further transformations and `stringify`s to be performed on the new tree
* - `Promise` — If a promise is returned, the function is asynchronous, and must be resolved (optionally with a `Node`) or rejected (optionally with an `Error`)
*/
type Transformer = (
node: Node,
file: VFile,
next?: (
error: Error | null,
tree: Node,
file: VFile
) => Record<string, unknown>
) => Error | Node | Promise<Node> | void | Promise<void>
/**
* Transform file contents into an AST
*/
interface Parser {
/**
* Transform file contents into an AST
*
* @returns Parsed AST node/tree
*/
parse(): Node
}
/**
* A constructor function (a function with keys in its `prototype`) or class that implements a
* `parse` method.
*/
type ParserConstructor = new (text: string, file: VFile) => Parser
/**
* Transform file contents into an AST
*
* @param text Text to transform into AST node(s)
* @param file File associated with text
* @returns Parsed AST node/tree
*/
type ParserFunction = (text: string, file: VFile) => Node
/**
* Transform an AST node/tree into text
*/
interface Compiler {
/**
* Transform an AST node/tree into text
*
* @returns Compiled text
*/
compile(): string
}
/**
* A constructor function (a function with keys in its `prototype`) or class that implements a
* `compile` method.
*/
type CompilerConstructor = new (node: Node, file: VFile) => Compiler
/**
* Transform an AST node/tree into text
*
* @param node Node/tree to be stringified
* @param file File associated with node
* @returns Compiled text
*/
type CompilerFunction = (node: Node, file: VFile) => string
/**
* Access results from transforms
*
* @param error Error if any occurred
* @param node Transformed AST tree/node
* @param vfile File associated with node
*/
type RunCallback = (error: Error | null, node: Node, file: VFile) => void
/**
* Access results from transforms
*
* @param error Error if any occurred
* @param vfile File with updated content
*/
type ProcessCallback = (error: Error | null, file: VFile) => void
}
/**
* Unified processor allows plugins, parsers, and compilers to be chained together to transform content.
*
* @typeParam P Processor settings. Useful when packaging unified with a preset parser and compiler.
*/
declare function unified<P = unified.Settings>(): unified.Processor<P>
export = unified
+402
View File
@@ -0,0 +1,402 @@
// TypeScript Version: 4.0
import {Node} from 'unist'
import {VFile, VFileCompatible} from 'vfile'
declare namespace unified {
/**
* Processor allows plugins, parsers, and compilers to be chained together to transform content.
*
* @typeParam P Processor settings. Useful when packaging unified with a preset parser and compiler.
*/
interface Processor<P = Settings> extends FrozenProcessor<P> {
/**
* Configure the processor to use a plugin and optionally configure that plugin with options.
*
* @param plugin unified plugin
* @param settings Configuration for plugin
* @typeParam S Plugin settings
* @returns The processor on which use is invoked
*/
use<S extends any[] = [Settings?]>(
plugin: Plugin<S, P>,
...settings: S
): Processor<P>
/**
* Configure the processor with a preset to use
*
* @param preset `Object` with an plugins (set to list), and/or an optional settings object
*/
use<S extends any[] = [Settings?]>(preset: Preset<S, P>): Processor<P>
/**
* Configure using a tuple of plugin and setting(s)
*
* @param pluginTuple pairs, plugin and settings in an array
* @typeParam S Plugin settings
*/
use<S extends any[] = [Settings?]>(
pluginTuple: PluginTuple<S, P>
): Processor<P>
/**
* A list of plugins and presets to be applied to processor
*
* @param list List of plugins, presets, and pairs
*/
use(list: PluggableList<P>): Processor<P>
/**
* Configuration passed to a frozen processor
*
* @param processorSettings Settings passed to processor
*/
use(processorSettings: ProcessorSettings<P>): Processor<P>
}
/**
* A frozen processor is just like a regular processor, except no additional plugins can be added.
* A frozen processor can be created by calling `.freeze()` on a processor.
*
* See `Processor`.
*/
interface FrozenProcessor<P = Settings> {
/**
* Clone current processor
*
* @returns New unfrozen processor which is configured to function the same as its ancestor.
* But when the descendant processor is configured in the future it does not affect the ancestral processor.
*/
(): Processor<P>
/**
* Parse text to a syntax tree.
*
* @param file VFile or anything which can be given to vfile()
* @returns Syntax tree representation of input.
*/
parse(file: VFileCompatible): Node
/**
* Function handling the parsing of text to a syntax tree.
* Used in the parse phase in the process and invoked with a `string` and `VFile` representation of the document to parse.
*
* `Parser` can be a normal function in which case it must return a `Node`: the syntax tree representation of the given file.
*
* `Parser` can also be a constructor function (a function with keys in its `prototype`) in which case it’s invoked with `new`.
* Instances must have a parse method which is invoked without arguments and must return a `Node`.
*/
Parser: ParserConstructor | ParserFunction
/**
* Compile a syntax tree to text.
*
* @param node unist node
* @param file `VFile` or anything which can be given to `vfile()`
* @returns String representation of the syntax tree file
*/
stringify(node: Node, file?: VFileCompatible): string
/**
* Function handling the compilation of syntax tree to a text.
* Used in the stringify phase in the process and invoked with a `Node` and `VFile` representation of the document to stringify.
*
* `Compiler` can be a normal function in which case it must return a `string`: the text representation of the given syntax tree.
*
* `Compiler` can also be a constructor function (a function with keys in its `prototype`) in which case it’s invoked with `new`.
* Instances must have a `compile` method which is invoked without arguments and must return a `string`.
*/
Compiler: CompilerConstructor | CompilerFunction
/**
* Transform a syntax tree by applying plugins to it.
*
* @param node Node to transform
* @returns `Promise` if `done` is not given. Rejected with an error, or resolved with the resulting syntax tree.
*/
run(node: Node): Promise<Node>
/**
* Transform a syntax tree by applying plugins to it.
*
* @param node Node to transform
* @param file `VFile` or anything which can be given to `vfile()`
* @returns `Promise` if `done` is not given. Rejected with an error, or resolved with the resulting syntax tree.
*/
run(node: Node, file: VFileCompatible): Promise<Node>
/**
* Transform a syntax tree by applying plugins to it.
*
* @param node Node to transform
* @param done Invoked when transformation is complete.
*/
run(node: Node, done: RunCallback): void
/**
* Transform a syntax tree by applying plugins to it.
*
* @param node Node to transform
* @param file `VFile` or anything which can be given to `vfile()`
* @param done Invoked when transformation is complete.
*/
run(node: Node, file: VFileCompatible, done: RunCallback): void
/**
* Transform a syntax tree by applying plugins to it.
*
* If asynchronous plugins are configured an error is thrown.
*
* @param node Node to transform
* @param file `VFile` or anything which can be given to `vfile()`
* @returns The given syntax tree.
*/
runSync(node: Node, file?: VFileCompatible): Node
/**
* Process the given representation of a file as configured on the processor. The process invokes `parse`, `run`, and `stringify` internally.
* @param file `VFile` or anything which can be given to `vfile()`
* @returns `Promise` if `done` is not given.
* Rejected with an error or resolved with the resulting file.
*/
process(file: VFileCompatible): Promise<VFile>
/**
* Process the given representation of a file as configured on the processor. The process invokes `parse`, `run`, and `stringify` internally.
* @param file `VFile` or anything which can be given to `vfile()`
* @param done Invoked when the process is complete. Invoked with a fatal error, if any, and the VFile.
*/
process(file: VFileCompatible, done: ProcessCallback): void
/**
* Process the given representation of a file as configured on the processor. The process invokes `parse`, `run`, and `stringify` internally.
*
* If asynchronous plugins are configured an error is thrown.
*
* @param file `VFile` or anything which can be given to `vfile()`
* @returns Virtual file with modified contents.
*/
processSync(file: VFileCompatible): VFile
/**
* Get or set information in an in-memory key-value store accessible to all phases of the process.
* An example is a list of HTML elements which are self-closing, which is needed when parsing, transforming, and compiling HTML.
*
* @returns key-value store object
*/
data(): {[key: string]: unknown}
/**
* @param key Identifier
* @returns If getting, the value at key
*/
data(key: string): unknown
/**
* @param value Value to set. Omit if getting key
* @returns If setting, the processor on which data is invoked
*/
data(key: string, value: any): Processor<P>
/**
* Freeze a processor. Frozen processors are meant to be extended and not to be configured or processed directly.
*
* Once a processor is frozen it cannot be unfrozen. New processors functioning just like it can be created by invoking the processor.
*
* It’s possible to freeze processors explicitly, by calling `.freeze()`, but `.parse()`, `.run()`, `.stringify()`, and `.process()` call `.freeze()` to freeze a processor too.
*
* @returns The processor on which freeze is invoked.
*/
freeze(): FrozenProcessor<P>
}
/**
* A Plugin (Attacher) is the thing passed to `use`.
* It configures the processor and in turn can receive options.
*
* Attachers can configure processors, such as by interacting with parsers and compilers, linking them to other processors, or by specifying how the syntax tree is handled.
*
* @param settings Configuration
* @typeParam S Plugin settings
* @typeParam P Processor settings
* @returns Optional Transformer.
*/
type Plugin<S extends any[] = [Settings?], P = Settings> = Attacher<S, P>
/**
* Configuration passed to a Plugin or Processor
*/
interface Settings {
[key: string]: unknown
}
/**
* Presets provide a potentially sharable way to configure processors.
* They can contain multiple plugins and optionally settings as well.
*
* @typeParam P Processor settings
*/
interface Preset<S = Settings, P = Settings> {
plugins: PluggableList<P>
settings?: Settings
}
/**
* Settings can be passed directly to the processor
*
* @typeParam P Settings applied to a processor. Useful when packaging unified with a preset parser and compiler.
*/
interface ProcessorSettings<P = Settings> {
settings: P
}
/**
* A pairing of a plugin with its settings
*
* @typeParam S Plugin settings
* @typeParam P Processor settings
*/
type PluginTuple<S extends any[] = [Settings?], P = Settings> = [
Plugin<S, P>,
...S
]
/**
* A union of the different ways to add plugins to unified
*
* @typeParam S Plugin settings
* @typeParam P Processor settings
*/
type Pluggable<S extends any[] = [Settings?], P = Settings> =
| Plugin<S, P>
| Preset<S, P>
| PluginTuple<S, P>
/**
* A list of plugins and presets
*
* @typeParam P Processor settings
*/
type PluggableList<P = Settings> = Array<Pluggable<any[], P>>
/**
* An attacher is the thing passed to `use`.
* It configures the processor and in turn can receive options.
*
* Attachers can configure processors, such as by interacting with parsers and compilers, linking them to other processors, or by specifying how the syntax tree is handled.
*
* @param settings Configuration
* @typeParam S Plugin settings
* @typeParam P Processor settings
* @returns Optional Transformer.
*/
type Attacher<S extends any[] = [Settings?], P = Settings> = (
this: Processor<P>,
...settings: S
) => Transformer | void
/**
* Transformers modify the syntax tree or metadata of a file. A transformer is a function which is invoked each time a file is passed through the transform phase.
* If an error occurs (either because it’s thrown, returned, rejected, or passed to `next`), the process stops.
*
* The transformation process in unified is handled by `trough`, see it’s documentation for the exact semantics of transformers.
*
* @param node Node or tree to be transformed
* @param file File associated with node or tree
* @param next If the signature of a transformer includes `next` (third argument), the function may finish asynchronous, and must invoke `next()`.
* @returns
* - `void` — If nothing is returned, the next transformer keeps using same tree.
* - `Error` — Can be returned to stop the process
* - `Node` — Can be returned and results in further transformations and `stringify`s to be performed on the new tree
* - `Promise` — If a promise is returned, the function is asynchronous, and must be resolved (optionally with a `Node`) or rejected (optionally with an `Error`)
*/
type Transformer = (
node: Node,
file: VFile,
next?: (
error: Error | null,
tree: Node,
file: VFile
) => Record<string, unknown>
) => Error | Node | Promise<Node> | void | Promise<void>
/**
* Transform file contents into an AST
*/
interface Parser {
/**
* Transform file contents into an AST
*
* @returns Parsed AST node/tree
*/
parse(): Node
}
/**
* A constructor function (a function with keys in its `prototype`) or class that implements a
* `parse` method.
*/
type ParserConstructor = new (text: string, file: VFile) => Parser
/**
* Transform file contents into an AST
*
* @param text Text to transform into AST node(s)
* @param file File associated with text
* @returns Parsed AST node/tree
*/
type ParserFunction = (text: string, file: VFile) => Node
/**
* Transform an AST node/tree into text
*/
interface Compiler {
/**
* Transform an AST node/tree into text
*
* @returns Compiled text
*/
compile(): string
}
/**
* A constructor function (a function with keys in its `prototype`) or class that implements a
* `compile` method.
*/
type CompilerConstructor = new (node: Node, file: VFile) => Compiler
/**
* Transform an AST node/tree into text
*
* @param node Node/tree to be stringified
* @param file File associated with node
* @returns Compiled text
*/
type CompilerFunction = (node: Node, file: VFile) => string
/**
* Access results from transforms
*
* @param error Error if any occurred
* @param node Transformed AST tree/node
* @param vfile File associated with node
*/
type RunCallback = (error: Error | null, node: Node, file: VFile) => void
/**
* Access results from transforms
*
* @param error Error if any occurred
* @param vfile File with updated content
*/
type ProcessCallback = (error: Error | null, file: VFile) => void
}
/**
* Unified processor allows plugins, parsers, and compilers to be chained together to transform content.
*
* @typeParam P Processor settings. Useful when packaging unified with a preset parser and compiler.
*/
declare function unified<P = unified.Settings>(): unified.Processor<P>
export = unified