-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
60 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ | |
coverage/ | ||
node_modules/ | ||
yarn.lock | ||
!/index.d.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import type {Position} from 'unist' | ||
|
||
export type {Options, Space} from './lib/index.js' | ||
|
||
export {fromParse5} from './lib/index.js' | ||
|
||
// Register data on hast. | ||
declare module 'hast' { | ||
interface ElementData { | ||
position: { | ||
/** | ||
* Positional info of the start tag of an element. | ||
* | ||
* Field added by `hast-util-from-parse5` (a utility used inside | ||
* `rehype-parse` responsible for parsing HTML), when passing | ||
* `verbose: true`. | ||
*/ | ||
opening?: Position | undefined | ||
|
||
/** | ||
* Positional info of the end tag of an element. | ||
* | ||
* Field added by `hast-util-from-parse5` (a utility used inside | ||
* `rehype-parse` responsible for parsing HTML), when passing | ||
* `verbose: true`. | ||
*/ | ||
closing?: Position | undefined | ||
|
||
/** | ||
* Positional info of the properties of an element. | ||
* | ||
* Field added by `hast-util-from-parse5` (a utility used inside | ||
* `rehype-parse` responsible for parsing HTML), when passing | ||
* `verbose: true`. | ||
*/ | ||
properties?: Record<string, Position | undefined> | undefined | ||
} | ||
} | ||
|
||
interface RootData { | ||
/** | ||
* Whether the document was using quirksmode. | ||
* | ||
* Field added by `hast-util-from-parse5` (a utility used inside | ||
* `rehype-parse` responsible for parsing HTML). | ||
*/ | ||
quirksMode?: boolean | undefined | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,2 @@ | ||
/** | ||
* @typedef {import('./lib/index.js').Options} Options | ||
* @typedef {import('./lib/index.js').Space} Space | ||
*/ | ||
|
||
// Note: extra types exposed from `index.d.ts`. | ||
export {fromParse5} from './lib/index.js' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters