Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add raw nodes to hast node type registry
When using this utility, the raw type will automatically be added to hast in the correct places. See DefinitelyTyped/DefinitelyTyped#55187 for more information. This also improves the types by allowing an overload of omitted vfile.
- Loading branch information
Showing
8 changed files
with
724 additions
and
679 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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
.DS_Store | ||
*.d.ts | ||
*.log | ||
coverage/ | ||
node_modules/ | ||
.DS_Store | ||
*.log | ||
index.d.ts | ||
test.d.ts | ||
yarn.lock |
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,15 @@ | ||
import type {Literal} from 'hast' | ||
|
||
export interface Raw extends Literal { | ||
type: 'raw' | ||
} | ||
|
||
declare module 'hast' { | ||
interface RootContentMap { | ||
raw: Raw | ||
} | ||
|
||
interface ElementContentMap { | ||
raw: Raw | ||
} | ||
} |
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,5 +1,6 @@ | ||
/** | ||
* @typedef {import('./lib/index.js').Options} Options | ||
* @typedef {import('./complex-types').Raw} Raw | ||
*/ | ||
|
||
export {raw} from './lib/index.js' |
Oops, something went wrong.