Skip to content

Commit debec9e

Browse files
committed
Update the onComplete callback type to include file, tree, and error
1 parent 747c23a commit debec9e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
* Configuration specifically for {@linkcode MarkdownHooks}.
8383
* @property {ReactNode | null | undefined} [fallback]
8484
* Content to render while the processor processing the markdown (optional).
85-
* @property {function(Root | undefined, Error | undefined): void | null | undefined} [onComplete]
85+
* @property {(file: VFile, hast: Root | undefined, error: Error | undefined) => unknown} [onComplete]
8686
* Callback when the processor is done processing.
8787
*/
8888

@@ -234,7 +234,7 @@ export function MarkdownHooks(options) {
234234
if (!cancelled) {
235235
setError(error)
236236
setTree(tree)
237-
options.onComplete?.(tree, error)
237+
options.onComplete?.(file, tree, error)
238238
}
239239
})
240240

0 commit comments

Comments
 (0)