Merge pull request #31072 from Rokt33r/update-unist

Update unist
This commit is contained in:
Andrew Casey
2018-12-05 10:58:02 -08:00
committed by GitHub
3 changed files with 7 additions and 8 deletions
+3
View File
@@ -4,6 +4,7 @@
// Jun Lu <https://github.com/lujun2>
// Hernan Rajchert <https://github.com/hrajchert>
// Titus Wormer <https://github.com/wooorm>
// Junyoung Choi <https://github.com/rokt33r>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.0
@@ -26,6 +27,8 @@ export interface Node {
* Must not be present if a node is generated.
*/
position?: Position;
[key: string]: unknown;
}
/**
+1 -5
View File
@@ -9,10 +9,6 @@
import * as Unist from 'unist';
declare namespace vfileMessage {
interface AnyNode extends Unist.Node {
[key: string]: unknown;
}
/**
* Create a virtual message.
*/
@@ -25,7 +21,7 @@ declare namespace vfileMessage {
* @param position Place at which the message occurred in a file (`Node`, `Position`, or `Point`, optional).
* @param origin Place in code the message originates from (`string`, optional).
*/
(reason: string | Error, position?: AnyNode | Unist.Position | Unist.Point, origin?: string): VFileMessage;
(reason: string | Error, position?: Unist.Node | Unist.Position | Unist.Point, origin?: string): VFileMessage;
/**
* Category of message.
*/
+3 -3
View File
@@ -98,7 +98,7 @@ declare namespace vfile {
* @param position Place at which the message occurred in `vfile`.
* @param ruleId Category of message.
*/
message: (reason: string, position?: Unist.Point | Unist.Position | vfileMessage.AnyNode, ruleId?: string) => vfileMessage.VFileMessage;
message: (reason: string, position?: Unist.Point | Unist.Position | Unist.Node, ruleId?: string) => vfileMessage.VFileMessage;
/**
* Associates a fatal message with the file, then immediately throws it.
* Note: fatal errors mean a file is no longer processable.
@@ -107,7 +107,7 @@ declare namespace vfile {
* @param position Place at which the message occurred in `vfile`.
* @param ruleId Category of message.
*/
fail: (reason: string, position?: Unist.Point | Unist.Position | vfileMessage.AnyNode, ruleId?: string) => never;
fail: (reason: string, position?: Unist.Point | Unist.Position | Unist.Node, ruleId?: string) => never;
/**
* Associates an informational message with the file, where `fatal` is set to `null`.
* Calls `message()` internally.
@@ -115,7 +115,7 @@ declare namespace vfile {
* @param position Place at which the message occurred in `vfile`.
* @param ruleId Category of message.
*/
info: (reason: string, position?: Unist.Point | Unist.Position | vfileMessage.AnyNode, ruleId?: string) => vfileMessage.VFileMessage;
info: (reason: string, position?: Unist.Point | Unist.Position | Unist.Node, ruleId?: string) => vfileMessage.VFileMessage;
}
}