You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: types/index.d.ts
+43-14Lines changed: 43 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -78,7 +78,7 @@ declare namespace unified {
78
78
*
79
79
* `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`.
80
80
*/
81
-
Parser: ParserFunction|typeofParser
81
+
Parser: ParserConstructor|ParserFunction
82
82
83
83
/**
84
84
* Compile a syntax tree to text.
@@ -98,7 +98,7 @@ declare namespace unified {
98
98
* `Compiler` can also be a constructor function (a function with keys in its `prototype`) in which case it’s invoked with `new`.
99
99
* Instances must have a `compile` method which is invoked without arguments and must return a `string`.
100
100
*/
101
-
Compiler: CompilerFunction|typeofCompiler
101
+
Compiler: CompilerConstructor|CompilerFunction
102
102
103
103
/**
104
104
* Transform a syntax tree by applying plugins to it.
@@ -318,43 +318,72 @@ declare namespace unified {
318
318
/**
319
319
* Transform file contents into an AST
320
320
*/
321
-
classParser{
321
+
interfaceParser{
322
322
/**
323
323
* Transform file contents into an AST
324
324
*
325
-
* @param file File to transform into AST node(s)
325
+
* @returns Parsed AST node/tree
326
326
*/
327
-
parse(file: VFileCompatible): Node
327
+
parse(): Node
328
+
}
329
+
330
+
/**
331
+
* A constructor function (a function with keys in its `prototype`) or class that implements a
0 commit comments