File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -316,7 +316,7 @@ export interface FrozenProcessor<
316316 * Promise that resolves to the resulting tree.
317317 */
318318 run (
319- node : Specific < Node , CompileTree > ,
319+ node : Specific < Node , ParseTree > ,
320320 file ?: VFileCompatible | undefined
321321 ) : Promise < Specific < Node , CompileTree > >
322322
Original file line number Diff line number Diff line change @@ -360,13 +360,19 @@ expectType<VFile & {result: ReactNode}>(
360360)
361361
362362// A parser plugin defines the input of `.run`:
363+ expectType < Promise < MdastRoot > > ( unified ( ) . use ( remarkParse ) . run ( someMdast ) )
363364expectType < MdastRoot > ( unified ( ) . use ( remarkParse ) . runSync ( someMdast ) )
365+ expectError ( unified ( ) . use ( remarkParse ) . run ( someHast ) )
364366expectError ( unified ( ) . use ( remarkParse ) . runSync ( someHast ) )
365367
366368// A compiler plugin defines the input/output of `.run`:
369+ expectError ( unified ( ) . use ( rehypeStringify ) . run ( someMdast ) )
367370expectError ( unified ( ) . use ( rehypeStringify ) . runSync ( someMdast ) )
368371// As a parser and a compiler are set, it can be assumed that the input of `run`
369372// is the result of the parser, and the output is the input of the compiler.
373+ expectType < Promise < HastRoot > > (
374+ unified ( ) . use ( remarkParse ) . use ( rehypeStringify ) . run ( someMdast )
375+ )
370376expectType < HastRoot > (
371377 unified ( ) . use ( remarkParse ) . use ( rehypeStringify ) . runSync ( someMdast )
372378)
You can’t perform that action at this time.
0 commit comments