Skip to content

Commit

Permalink
doc: Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Oct 4, 2021
1 parent 9861586 commit 877e23c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,15 @@ const htmlStr = rehype()

```ts
import { Plugin } from 'unified';
import { Root, Element, ElementContent } from 'hast';
import { Root, Element, RootContent } from 'hast';
export declare type RehypeRewriteOptions = {
/**
* Select an element to be wrapped. Expects a string selector that can be passed to hast-util-select ([supported selectors](https://github.com/syntax-tree/hast-util-select/blob/master/readme.md#support)).
* If `selector` is not set then wrap will check for a body all elements.
*/
selector?: string;
rewrite(node: ElementContent, index: number | null, parent: Root | Element | null): void;
/** Rewrite Element. */
rewrite(node: Root | RootContent, index: number | null, parent: Root | Element | null): void;
};
declare const remarkRewrite: Plugin<[RehypeRewriteOptions?], Root>;
export default remarkRewrite;
Expand Down

0 comments on commit 877e23c

Please sign in to comment.