@storybook/addon-docs
Version:
Document component usage and properties in Markdown
1,468 lines (1,465 loc) • 184 kB
TypeScript
import { transformAsync } from '@babel/core';
import * as unist from 'unist';
import { Node as Node$2, Point as Point$2, Position as Position$2, Data as Data$6 } from 'unist';
import * as hast from 'hast';
import { ElementContent as ElementContent$1, Properties, Literal, Data as Data$4, Parent as Parent$1 } from 'hast';
import * as mdast from 'mdast';
import { Parent, BlockContent, DefinitionContent, Data as Data$5, PhrasingContent, Literal as Literal$1 } from 'mdast';
import { Program } from 'estree-jsx';
/**
* Message.
*/
declare class VFileMessage extends Error {
constructor(reason: string, options?: Options$5 | null | undefined)
constructor(
reason: string,
parent: Node$1 | NodeLike$1 | null | undefined,
origin?: string | null | undefined
)
constructor(
reason: string,
place: Point$1 | Position$1 | null | undefined,
origin?: string | null | undefined
)
constructor(reason: string, origin?: string | null | undefined)
constructor(
cause: Error | VFileMessage,
parent: Node$1 | NodeLike$1 | null | undefined,
origin?: string | null | undefined
)
constructor(
cause: Error | VFileMessage,
place: Point$1 | Position$1 | null | undefined,
origin?: string | null | undefined
)
constructor(cause: Error | VFileMessage, origin?: string | null | undefined)
/**
* Stack of ancestor nodes surrounding the message.
*
* @type {Array<Node> | undefined}
*/
ancestors: Array<Node$1> | undefined
/**
* Starting column of message.
*
* @type {number | undefined}
*/
column: number | undefined
/**
* State of problem.
*
* * `true` — error, file not usable
* * `false` — warning, change may be needed
* * `undefined` — change likely not needed
*
* @type {boolean | null | undefined}
*/
fatal: boolean | null | undefined
/**
* Path of a file (used throughout the `VFile` ecosystem).
*
* @type {string | undefined}
*/
file: string | undefined
/**
* Starting line of error.
*
* @type {number | undefined}
*/
line: number | undefined
/**
* Place of message.
*
* @type {Point | Position | undefined}
*/
place: Point$1 | Position$1 | undefined
/**
* Reason for message, should use markdown.
*
* @type {string}
*/
reason: string
/**
* Category of message (example: `'my-rule'`).
*
* @type {string | undefined}
*/
ruleId: string | undefined
/**
* Namespace of message (example: `'my-package'`).
*
* @type {string | undefined}
*/
source: string | undefined
/**
* Specify the source value that’s being reported, which is deemed
* incorrect.
*
* @type {string | undefined}
*/
actual: string | undefined
/**
* Suggest acceptable values that can be used instead of `actual`.
*
* @type {Array<string> | undefined}
*/
expected: Array<string> | undefined
/**
* Long form description of the message (you should use markdown).
*
* @type {string | undefined}
*/
note: string | undefined
/**
* Link to docs for the message.
*
* > 👉 **Note**: this must be an absolute URL that can be passed as `x`
* > to `new URL(x)`.
*
* @type {string | undefined}
*/
url: string | undefined
}
type Node$1 = unist.Node
type Point$1 = unist.Point
type Position$1 = unist.Position
type NodeLike$1 = object & {
type: string
position?: Position$1 | undefined
}
/**
* Configuration.
*/
type Options$5 = {
/**
* Stack of (inclusive) ancestor nodes surrounding the message (optional).
*/
ancestors?: Array<Node$1> | null | undefined
/**
* Original error cause of the message (optional).
*/
cause?: Error | null | undefined
/**
* Place of message (optional).
*/
place?: Point$1 | Position$1 | null | undefined
/**
* Category of message (optional, example: `'my-rule'`).
*/
ruleId?: string | null | undefined
/**
* Namespace of who sent the message (optional, example: `'my-package'`).
*/
source?: string | null | undefined
}
type Options$4 = Options$5
declare class VFile$1 {
/**
* Create a new virtual file.
*
* `options` is treated as:
*
* * `string` or `Uint8Array` — `{value: options}`
* * `URL` — `{path: options}`
* * `VFile` — shallow copies its data over to the new file
* * `object` — all fields are shallow copied over to the new file
*
* Path related fields are set in the following order (least specific to
* most specific): `history`, `path`, `basename`, `stem`, `extname`,
* `dirname`.
*
* You cannot set `dirname` or `extname` without setting either `history`,
* `path`, `basename`, or `stem` too.
*
* @param {Compatible | null | undefined} [value]
* File value.
* @returns
* New instance.
*/
constructor(value?: Compatible$2 | null | undefined);
/**
* Base of `path` (default: `process.cwd()` or `'/'` in browsers).
*
* @type {string}
*/
cwd: string;
/**
* Place to store custom info (default: `{}`).
*
* It’s OK to store custom data directly on the file but moving it to
* `data` is recommended.
*
* @type {Data}
*/
data: Data$3;
/**
* List of file paths the file moved between.
*
* The first is the original path and the last is the current path.
*
* @type {Array<string>}
*/
history: Array<string>;
/**
* List of messages associated with the file.
*
* @type {Array<VFileMessage>}
*/
messages: Array<VFileMessage>;
/**
* Raw value.
*
* @type {Value}
*/
value: Value$1;
/**
* Source map.
*
* This type is equivalent to the `RawSourceMap` type from the `source-map`
* module.
*
* @type {Map | null | undefined}
*/
map: Map$1 | null | undefined;
/**
* Custom, non-string, compiled, representation.
*
* This is used by unified to store non-string results.
* One example is when turning markdown into React nodes.
*
* @type {unknown}
*/
result: unknown;
/**
* Whether a file was saved to disk.
*
* This is used by vfile reporters.
*
* @type {boolean}
*/
stored: boolean;
/**
* Set basename (including extname) (`'index.min.js'`).
*
* Cannot contain path separators (`'/'` on unix, macOS, and browsers, `'\'`
* on windows).
* Cannot be nullified (use `file.path = file.dirname` instead).
*
* @param {string} basename
* Basename.
* @returns {undefined}
* Nothing.
*/
set basename(basename: string);
/**
* Get the basename (including extname) (example: `'index.min.js'`).
*
* @returns {string | undefined}
* Basename.
*/
get basename(): string | undefined;
/**
* Set the full path (example: `'~/index.min.js'`).
*
* Cannot be nullified.
* You can set a file URL (a `URL` object with a `file:` protocol) which will
* be turned into a path with `url.fileURLToPath`.
*
* @param {URL | string} path
* Path.
* @returns {undefined}
* Nothing.
*/
set path(path: string | URL);
/**
* Get the full path (example: `'~/index.min.js'`).
*
* @returns {string}
* Path.
*/
get path(): string;
/**
* Set the parent path (example: `'~'`).
*
* Cannot be set if there’s no `path` yet.
*
* @param {string | undefined} dirname
* Dirname.
* @returns {undefined}
* Nothing.
*/
set dirname(dirname: string | undefined);
/**
* Get the parent path (example: `'~'`).
*
* @returns {string | undefined}
* Dirname.
*/
get dirname(): string | undefined;
/**
* Set the extname (including dot) (example: `'.js'`).
*
* Cannot contain path separators (`'/'` on unix, macOS, and browsers, `'\'`
* on windows).
* Cannot be set if there’s no `path` yet.
*
* @param {string | undefined} extname
* Extname.
* @returns {undefined}
* Nothing.
*/
set extname(extname: string | undefined);
/**
* Get the extname (including dot) (example: `'.js'`).
*
* @returns {string | undefined}
* Extname.
*/
get extname(): string | undefined;
/**
* Set the stem (basename w/o extname) (example: `'index.min'`).
*
* Cannot contain path separators (`'/'` on unix, macOS, and browsers, `'\'`
* on windows).
* Cannot be nullified (use `file.path = file.dirname` instead).
*
* @param {string} stem
* Stem.
* @returns {undefined}
* Nothing.
*/
set stem(stem: string);
/**
* Get the stem (basename w/o extname) (example: `'index.min'`).
*
* @returns {string | undefined}
* Stem.
*/
get stem(): string | undefined;
/**
* Create a fatal message for `reason` associated with the file.
*
* The `fatal` field of the message is set to `true` (error; file not usable)
* and the `file` field is set to the current file path.
* The message is added to the `messages` field on `file`.
*
* > 🪦 **Note**: also has obsolete signatures.
*
* @overload
* @param {string} reason
* @param {MessageOptions | null | undefined} [options]
* @returns {never}
*
* @overload
* @param {string} reason
* @param {Node | NodeLike | null | undefined} parent
* @param {string | null | undefined} [origin]
* @returns {never}
*
* @overload
* @param {string} reason
* @param {Point | Position | null | undefined} place
* @param {string | null | undefined} [origin]
* @returns {never}
*
* @overload
* @param {string} reason
* @param {string | null | undefined} [origin]
* @returns {never}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {Node | NodeLike | null | undefined} parent
* @param {string | null | undefined} [origin]
* @returns {never}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {Point | Position | null | undefined} place
* @param {string | null | undefined} [origin]
* @returns {never}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {string | null | undefined} [origin]
* @returns {never}
*
* @param {Error | VFileMessage | string} causeOrReason
* Reason for message, should use markdown.
* @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]
* Configuration (optional).
* @param {string | null | undefined} [origin]
* Place in code where the message originates (example:
* `'my-package:my-rule'` or `'my-rule'`).
* @returns {never}
* Never.
* @throws {VFileMessage}
* Message.
*/
fail(reason: string, options?: Options$4 | null | undefined): never;
/**
* Create a fatal message for `reason` associated with the file.
*
* The `fatal` field of the message is set to `true` (error; file not usable)
* and the `file` field is set to the current file path.
* The message is added to the `messages` field on `file`.
*
* > 🪦 **Note**: also has obsolete signatures.
*
* @overload
* @param {string} reason
* @param {MessageOptions | null | undefined} [options]
* @returns {never}
*
* @overload
* @param {string} reason
* @param {Node | NodeLike | null | undefined} parent
* @param {string | null | undefined} [origin]
* @returns {never}
*
* @overload
* @param {string} reason
* @param {Point | Position | null | undefined} place
* @param {string | null | undefined} [origin]
* @returns {never}
*
* @overload
* @param {string} reason
* @param {string | null | undefined} [origin]
* @returns {never}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {Node | NodeLike | null | undefined} parent
* @param {string | null | undefined} [origin]
* @returns {never}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {Point | Position | null | undefined} place
* @param {string | null | undefined} [origin]
* @returns {never}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {string | null | undefined} [origin]
* @returns {never}
*
* @param {Error | VFileMessage | string} causeOrReason
* Reason for message, should use markdown.
* @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]
* Configuration (optional).
* @param {string | null | undefined} [origin]
* Place in code where the message originates (example:
* `'my-package:my-rule'` or `'my-rule'`).
* @returns {never}
* Never.
* @throws {VFileMessage}
* Message.
*/
fail(reason: string, parent: Node$2 | NodeLike | null | undefined, origin?: string | null | undefined): never;
/**
* Create a fatal message for `reason` associated with the file.
*
* The `fatal` field of the message is set to `true` (error; file not usable)
* and the `file` field is set to the current file path.
* The message is added to the `messages` field on `file`.
*
* > 🪦 **Note**: also has obsolete signatures.
*
* @overload
* @param {string} reason
* @param {MessageOptions | null | undefined} [options]
* @returns {never}
*
* @overload
* @param {string} reason
* @param {Node | NodeLike | null | undefined} parent
* @param {string | null | undefined} [origin]
* @returns {never}
*
* @overload
* @param {string} reason
* @param {Point | Position | null | undefined} place
* @param {string | null | undefined} [origin]
* @returns {never}
*
* @overload
* @param {string} reason
* @param {string | null | undefined} [origin]
* @returns {never}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {Node | NodeLike | null | undefined} parent
* @param {string | null | undefined} [origin]
* @returns {never}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {Point | Position | null | undefined} place
* @param {string | null | undefined} [origin]
* @returns {never}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {string | null | undefined} [origin]
* @returns {never}
*
* @param {Error | VFileMessage | string} causeOrReason
* Reason for message, should use markdown.
* @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]
* Configuration (optional).
* @param {string | null | undefined} [origin]
* Place in code where the message originates (example:
* `'my-package:my-rule'` or `'my-rule'`).
* @returns {never}
* Never.
* @throws {VFileMessage}
* Message.
*/
fail(reason: string, place: Point$2 | Position$2 | null | undefined, origin?: string | null | undefined): never;
/**
* Create a fatal message for `reason` associated with the file.
*
* The `fatal` field of the message is set to `true` (error; file not usable)
* and the `file` field is set to the current file path.
* The message is added to the `messages` field on `file`.
*
* > 🪦 **Note**: also has obsolete signatures.
*
* @overload
* @param {string} reason
* @param {MessageOptions | null | undefined} [options]
* @returns {never}
*
* @overload
* @param {string} reason
* @param {Node | NodeLike | null | undefined} parent
* @param {string | null | undefined} [origin]
* @returns {never}
*
* @overload
* @param {string} reason
* @param {Point | Position | null | undefined} place
* @param {string | null | undefined} [origin]
* @returns {never}
*
* @overload
* @param {string} reason
* @param {string | null | undefined} [origin]
* @returns {never}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {Node | NodeLike | null | undefined} parent
* @param {string | null | undefined} [origin]
* @returns {never}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {Point | Position | null | undefined} place
* @param {string | null | undefined} [origin]
* @returns {never}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {string | null | undefined} [origin]
* @returns {never}
*
* @param {Error | VFileMessage | string} causeOrReason
* Reason for message, should use markdown.
* @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]
* Configuration (optional).
* @param {string | null | undefined} [origin]
* Place in code where the message originates (example:
* `'my-package:my-rule'` or `'my-rule'`).
* @returns {never}
* Never.
* @throws {VFileMessage}
* Message.
*/
fail(reason: string, origin?: string | null | undefined): never;
/**
* Create a fatal message for `reason` associated with the file.
*
* The `fatal` field of the message is set to `true` (error; file not usable)
* and the `file` field is set to the current file path.
* The message is added to the `messages` field on `file`.
*
* > 🪦 **Note**: also has obsolete signatures.
*
* @overload
* @param {string} reason
* @param {MessageOptions | null | undefined} [options]
* @returns {never}
*
* @overload
* @param {string} reason
* @param {Node | NodeLike | null | undefined} parent
* @param {string | null | undefined} [origin]
* @returns {never}
*
* @overload
* @param {string} reason
* @param {Point | Position | null | undefined} place
* @param {string | null | undefined} [origin]
* @returns {never}
*
* @overload
* @param {string} reason
* @param {string | null | undefined} [origin]
* @returns {never}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {Node | NodeLike | null | undefined} parent
* @param {string | null | undefined} [origin]
* @returns {never}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {Point | Position | null | undefined} place
* @param {string | null | undefined} [origin]
* @returns {never}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {string | null | undefined} [origin]
* @returns {never}
*
* @param {Error | VFileMessage | string} causeOrReason
* Reason for message, should use markdown.
* @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]
* Configuration (optional).
* @param {string | null | undefined} [origin]
* Place in code where the message originates (example:
* `'my-package:my-rule'` or `'my-rule'`).
* @returns {never}
* Never.
* @throws {VFileMessage}
* Message.
*/
fail(cause: Error | VFileMessage, parent: Node$2 | NodeLike | null | undefined, origin?: string | null | undefined): never;
/**
* Create a fatal message for `reason` associated with the file.
*
* The `fatal` field of the message is set to `true` (error; file not usable)
* and the `file` field is set to the current file path.
* The message is added to the `messages` field on `file`.
*
* > 🪦 **Note**: also has obsolete signatures.
*
* @overload
* @param {string} reason
* @param {MessageOptions | null | undefined} [options]
* @returns {never}
*
* @overload
* @param {string} reason
* @param {Node | NodeLike | null | undefined} parent
* @param {string | null | undefined} [origin]
* @returns {never}
*
* @overload
* @param {string} reason
* @param {Point | Position | null | undefined} place
* @param {string | null | undefined} [origin]
* @returns {never}
*
* @overload
* @param {string} reason
* @param {string | null | undefined} [origin]
* @returns {never}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {Node | NodeLike | null | undefined} parent
* @param {string | null | undefined} [origin]
* @returns {never}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {Point | Position | null | undefined} place
* @param {string | null | undefined} [origin]
* @returns {never}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {string | null | undefined} [origin]
* @returns {never}
*
* @param {Error | VFileMessage | string} causeOrReason
* Reason for message, should use markdown.
* @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]
* Configuration (optional).
* @param {string | null | undefined} [origin]
* Place in code where the message originates (example:
* `'my-package:my-rule'` or `'my-rule'`).
* @returns {never}
* Never.
* @throws {VFileMessage}
* Message.
*/
fail(cause: Error | VFileMessage, place: Point$2 | Position$2 | null | undefined, origin?: string | null | undefined): never;
/**
* Create a fatal message for `reason` associated with the file.
*
* The `fatal` field of the message is set to `true` (error; file not usable)
* and the `file` field is set to the current file path.
* The message is added to the `messages` field on `file`.
*
* > 🪦 **Note**: also has obsolete signatures.
*
* @overload
* @param {string} reason
* @param {MessageOptions | null | undefined} [options]
* @returns {never}
*
* @overload
* @param {string} reason
* @param {Node | NodeLike | null | undefined} parent
* @param {string | null | undefined} [origin]
* @returns {never}
*
* @overload
* @param {string} reason
* @param {Point | Position | null | undefined} place
* @param {string | null | undefined} [origin]
* @returns {never}
*
* @overload
* @param {string} reason
* @param {string | null | undefined} [origin]
* @returns {never}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {Node | NodeLike | null | undefined} parent
* @param {string | null | undefined} [origin]
* @returns {never}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {Point | Position | null | undefined} place
* @param {string | null | undefined} [origin]
* @returns {never}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {string | null | undefined} [origin]
* @returns {never}
*
* @param {Error | VFileMessage | string} causeOrReason
* Reason for message, should use markdown.
* @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]
* Configuration (optional).
* @param {string | null | undefined} [origin]
* Place in code where the message originates (example:
* `'my-package:my-rule'` or `'my-rule'`).
* @returns {never}
* Never.
* @throws {VFileMessage}
* Message.
*/
fail(cause: Error | VFileMessage, origin?: string | null | undefined): never;
/**
* Create an info message for `reason` associated with the file.
*
* The `fatal` field of the message is set to `undefined` (info; change
* likely not needed) and the `file` field is set to the current file path.
* The message is added to the `messages` field on `file`.
*
* > 🪦 **Note**: also has obsolete signatures.
*
* @overload
* @param {string} reason
* @param {MessageOptions | null | undefined} [options]
* @returns {VFileMessage}
*
* @overload
* @param {string} reason
* @param {Node | NodeLike | null | undefined} parent
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {string} reason
* @param {Point | Position | null | undefined} place
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {string} reason
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {Node | NodeLike | null | undefined} parent
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {Point | Position | null | undefined} place
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @param {Error | VFileMessage | string} causeOrReason
* Reason for message, should use markdown.
* @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]
* Configuration (optional).
* @param {string | null | undefined} [origin]
* Place in code where the message originates (example:
* `'my-package:my-rule'` or `'my-rule'`).
* @returns {VFileMessage}
* Message.
*/
info(reason: string, options?: Options$4 | null | undefined): VFileMessage;
/**
* Create an info message for `reason` associated with the file.
*
* The `fatal` field of the message is set to `undefined` (info; change
* likely not needed) and the `file` field is set to the current file path.
* The message is added to the `messages` field on `file`.
*
* > 🪦 **Note**: also has obsolete signatures.
*
* @overload
* @param {string} reason
* @param {MessageOptions | null | undefined} [options]
* @returns {VFileMessage}
*
* @overload
* @param {string} reason
* @param {Node | NodeLike | null | undefined} parent
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {string} reason
* @param {Point | Position | null | undefined} place
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {string} reason
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {Node | NodeLike | null | undefined} parent
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {Point | Position | null | undefined} place
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @param {Error | VFileMessage | string} causeOrReason
* Reason for message, should use markdown.
* @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]
* Configuration (optional).
* @param {string | null | undefined} [origin]
* Place in code where the message originates (example:
* `'my-package:my-rule'` or `'my-rule'`).
* @returns {VFileMessage}
* Message.
*/
info(reason: string, parent: Node$2 | NodeLike | null | undefined, origin?: string | null | undefined): VFileMessage;
/**
* Create an info message for `reason` associated with the file.
*
* The `fatal` field of the message is set to `undefined` (info; change
* likely not needed) and the `file` field is set to the current file path.
* The message is added to the `messages` field on `file`.
*
* > 🪦 **Note**: also has obsolete signatures.
*
* @overload
* @param {string} reason
* @param {MessageOptions | null | undefined} [options]
* @returns {VFileMessage}
*
* @overload
* @param {string} reason
* @param {Node | NodeLike | null | undefined} parent
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {string} reason
* @param {Point | Position | null | undefined} place
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {string} reason
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {Node | NodeLike | null | undefined} parent
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {Point | Position | null | undefined} place
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @param {Error | VFileMessage | string} causeOrReason
* Reason for message, should use markdown.
* @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]
* Configuration (optional).
* @param {string | null | undefined} [origin]
* Place in code where the message originates (example:
* `'my-package:my-rule'` or `'my-rule'`).
* @returns {VFileMessage}
* Message.
*/
info(reason: string, place: Point$2 | Position$2 | null | undefined, origin?: string | null | undefined): VFileMessage;
/**
* Create an info message for `reason` associated with the file.
*
* The `fatal` field of the message is set to `undefined` (info; change
* likely not needed) and the `file` field is set to the current file path.
* The message is added to the `messages` field on `file`.
*
* > 🪦 **Note**: also has obsolete signatures.
*
* @overload
* @param {string} reason
* @param {MessageOptions | null | undefined} [options]
* @returns {VFileMessage}
*
* @overload
* @param {string} reason
* @param {Node | NodeLike | null | undefined} parent
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {string} reason
* @param {Point | Position | null | undefined} place
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {string} reason
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {Node | NodeLike | null | undefined} parent
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {Point | Position | null | undefined} place
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @param {Error | VFileMessage | string} causeOrReason
* Reason for message, should use markdown.
* @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]
* Configuration (optional).
* @param {string | null | undefined} [origin]
* Place in code where the message originates (example:
* `'my-package:my-rule'` or `'my-rule'`).
* @returns {VFileMessage}
* Message.
*/
info(reason: string, origin?: string | null | undefined): VFileMessage;
/**
* Create an info message for `reason` associated with the file.
*
* The `fatal` field of the message is set to `undefined` (info; change
* likely not needed) and the `file` field is set to the current file path.
* The message is added to the `messages` field on `file`.
*
* > 🪦 **Note**: also has obsolete signatures.
*
* @overload
* @param {string} reason
* @param {MessageOptions | null | undefined} [options]
* @returns {VFileMessage}
*
* @overload
* @param {string} reason
* @param {Node | NodeLike | null | undefined} parent
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {string} reason
* @param {Point | Position | null | undefined} place
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {string} reason
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {Node | NodeLike | null | undefined} parent
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {Point | Position | null | undefined} place
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @param {Error | VFileMessage | string} causeOrReason
* Reason for message, should use markdown.
* @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]
* Configuration (optional).
* @param {string | null | undefined} [origin]
* Place in code where the message originates (example:
* `'my-package:my-rule'` or `'my-rule'`).
* @returns {VFileMessage}
* Message.
*/
info(cause: Error | VFileMessage, parent: Node$2 | NodeLike | null | undefined, origin?: string | null | undefined): VFileMessage;
/**
* Create an info message for `reason` associated with the file.
*
* The `fatal` field of the message is set to `undefined` (info; change
* likely not needed) and the `file` field is set to the current file path.
* The message is added to the `messages` field on `file`.
*
* > 🪦 **Note**: also has obsolete signatures.
*
* @overload
* @param {string} reason
* @param {MessageOptions | null | undefined} [options]
* @returns {VFileMessage}
*
* @overload
* @param {string} reason
* @param {Node | NodeLike | null | undefined} parent
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {string} reason
* @param {Point | Position | null | undefined} place
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {string} reason
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {Node | NodeLike | null | undefined} parent
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {Point | Position | null | undefined} place
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @param {Error | VFileMessage | string} causeOrReason
* Reason for message, should use markdown.
* @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]
* Configuration (optional).
* @param {string | null | undefined} [origin]
* Place in code where the message originates (example:
* `'my-package:my-rule'` or `'my-rule'`).
* @returns {VFileMessage}
* Message.
*/
info(cause: Error | VFileMessage, place: Point$2 | Position$2 | null | undefined, origin?: string | null | undefined): VFileMessage;
/**
* Create an info message for `reason` associated with the file.
*
* The `fatal` field of the message is set to `undefined` (info; change
* likely not needed) and the `file` field is set to the current file path.
* The message is added to the `messages` field on `file`.
*
* > 🪦 **Note**: also has obsolete signatures.
*
* @overload
* @param {string} reason
* @param {MessageOptions | null | undefined} [options]
* @returns {VFileMessage}
*
* @overload
* @param {string} reason
* @param {Node | NodeLike | null | undefined} parent
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {string} reason
* @param {Point | Position | null | undefined} place
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {string} reason
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {Node | NodeLike | null | undefined} parent
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {Point | Position | null | undefined} place
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @param {Error | VFileMessage | string} causeOrReason
* Reason for message, should use markdown.
* @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]
* Configuration (optional).
* @param {string | null | undefined} [origin]
* Place in code where the message originates (example:
* `'my-package:my-rule'` or `'my-rule'`).
* @returns {VFileMessage}
* Message.
*/
info(cause: Error | VFileMessage, origin?: string | null | undefined): VFileMessage;
/**
* Create a message for `reason` associated with the file.
*
* The `fatal` field of the message is set to `false` (warning; change may be
* needed) and the `file` field is set to the current file path.
* The message is added to the `messages` field on `file`.
*
* > 🪦 **Note**: also has obsolete signatures.
*
* @overload
* @param {string} reason
* @param {MessageOptions | null | undefined} [options]
* @returns {VFileMessage}
*
* @overload
* @param {string} reason
* @param {Node | NodeLike | null | undefined} parent
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {string} reason
* @param {Point | Position | null | undefined} place
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {string} reason
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {Node | NodeLike | null | undefined} parent
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {Point | Position | null | undefined} place
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @param {Error | VFileMessage | string} causeOrReason
* Reason for message, should use markdown.
* @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]
* Configuration (optional).
* @param {string | null | undefined} [origin]
* Place in code where the message originates (example:
* `'my-package:my-rule'` or `'my-rule'`).
* @returns {VFileMessage}
* Message.
*/
message(reason: string, options?: Options$4 | null | undefined): VFileMessage;
/**
* Create a message for `reason` associated with the file.
*
* The `fatal` field of the message is set to `false` (warning; change may be
* needed) and the `file` field is set to the current file path.
* The message is added to the `messages` field on `file`.
*
* > 🪦 **Note**: also has obsolete signatures.
*
* @overload
* @param {string} reason
* @param {MessageOptions | null | undefined} [options]
* @returns {VFileMessage}
*
* @overload
* @param {string} reason
* @param {Node | NodeLike | null | undefined} parent
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {string} reason
* @param {Point | Position | null | undefined} place
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {string} reason
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {Node | NodeLike | null | undefined} parent
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {Point | Position | null | undefined} place
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @param {Error | VFileMessage | string} causeOrReason
* Reason for message, should use markdown.
* @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]
* Configuration (optional).
* @param {string | null | undefined} [origin]
* Place in code where the message originates (example:
* `'my-package:my-rule'` or `'my-rule'`).
* @returns {VFileMessage}
* Message.
*/
message(reason: string, parent: Node$2 | NodeLike | null | undefined, origin?: string | null | undefined): VFileMessage;
/**
* Create a message for `reason` associated with the file.
*
* The `fatal` field of the message is set to `false` (warning; change may be
* needed) and the `file` field is set to the current file path.
* The message is added to the `messages` field on `file`.
*
* > 🪦 **Note**: also has obsolete signatures.
*
* @overload
* @param {string} reason
* @param {MessageOptions | null | undefined} [options]
* @returns {VFileMessage}
*
* @overload
* @param {string} reason
* @param {Node | NodeLike | null | undefined} parent
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {string} reason
* @param {Point | Position | null | undefined} place
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {string} reason
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {Node | NodeLike | null | undefined} parent
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {Point | Position | null | undefined} place
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @param {Error | VFileMessage | string} causeOrReason
* Reason for message, should use markdown.
* @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]
* Configuration (optional).
* @param {string | null | undefined} [origin]
* Place in code where the message originates (example:
* `'my-package:my-rule'` or `'my-rule'`).
* @returns {VFileMessage}
* Message.
*/
message(reason: string, place: Point$2 | Position$2 | null | undefined, origin?: string | null | undefined): VFileMessage;
/**
* Create a message for `reason` associated with the file.
*
* The `fatal` field of the message is set to `false` (warning; change may be
* needed) and the `file` field is set to the current file path.
* The message is added to the `messages` field on `file`.
*
* > 🪦 **Note**: also has obsolete signatures.
*
* @overload
* @param {string} reason
* @param {MessageOptions | null | undefined} [options]
* @returns {VFileMessage}
*
* @overload
* @param {string} reason
* @param {Node | NodeLike | null | undefined} parent
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {string} reason
* @param {Point | Position | null | undefined} place
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {string} reason
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {Node | NodeLike | null | undefined} parent
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {Point | Position | null | undefined} place
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @param {Error | VFileMessage | string} causeOrReason
* Reason for message, should use markdown.
* @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]
* Configuration (optional).
* @param {string | null | undefined} [origin]
* Place in code where the message originates (example:
* `'my-package:my-rule'` or `'my-rule'`).
* @returns {VFileMessage}
* Message.
*/
message(reason: string, origin?: string | null | undefined): VFileMessage;
/**
* Create a message for `reason` associated with the file.
*
* The `fatal` field of the message is set to `false` (warning; change may be
* needed) and the `file` field is set to the current file path.
* The message is added to the `messages` field on `file`.
*
* > 🪦 **Note**: also has obsolete signatures.
*
* @overload
* @param {string} reason
* @param {MessageOptions | null | undefined} [options]
* @returns {VFileMessage}
*
* @overload
* @param {string} reason
* @param {Node | NodeLike | null | undefined} parent
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {string} reason
* @param {Point | Position | null | undefined} place
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {string} reason
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {Node | NodeLike | null | undefined} parent
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {Point | Position | null | undefined} place
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @overload
* @param {Error | VFileMessage} cause
* @param {string | null | undefined} [origin]
* @returns {VFileMessage}
*
* @param {Error | VFileMessage | string} causeOrReason
* Reason for message, should use markdown.
* @param {Node | NodeLike | MessageOptions | Point | Position | string