diff --git a/types/unist/index.d.ts b/types/unist/index.d.ts index ee61686f93..2d7d37e17f 100644 --- a/types/unist/index.d.ts +++ b/types/unist/index.d.ts @@ -4,6 +4,7 @@ // Jun Lu // Hernan Rajchert // Titus Wormer +// Junyoung Choi // 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; } /** diff --git a/types/vfile-message/index.d.ts b/types/vfile-message/index.d.ts index 908f72027b..5f4467e007 100644 --- a/types/vfile-message/index.d.ts +++ b/types/vfile-message/index.d.ts @@ -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. */ diff --git a/types/vfile/index.d.ts b/types/vfile/index.d.ts index efb07e288d..aec7ca88f9 100644 --- a/types/vfile/index.d.ts +++ b/types/vfile/index.d.ts @@ -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; } }