Skip to content

Commit

Permalink
Fix declaration merging
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Sep 1, 2023
1 parent f1cff52 commit b3b7d85
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
37 changes: 18 additions & 19 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,25 @@ export type {Options} from './lib/index.js'

export {default} from './lib/index.js'

interface DocumentFields {
/**
* Title of the document (optional, example: `'The New York City Subway Map
* as You’ve Never Seen It Before'`).
*
* Inferred by `rehype-infer-title-meta` from HTML or `vfile-matter` from
* frontmatter.
* Used by `rehype-document` and `rehype-meta`.
*/
title?: string | null | undefined
}

// Add custom data supported when `rehype-document` is added.
declare module 'vfile' {
interface DataMap {
matter: {
/**
* Title of this document.
*
* Populated by `vfile-matter` from frontmatter; used by
* `rehype-document` and `rehype-meta`.
*/
title?: string
}
interface DataMapMatter extends DocumentFields {}
interface DataMapMeta extends DocumentFields {}

meta: {
/**
* Title of this document.
*
* Populated by `rehype-infer-title-meta` from the HTML; used by
* `rehype-document` and `rehype-meta`.
*/
title?: string
}
interface DataMap {
matter: DataMapMeta
meta: DataMapMatter
}
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
"*.ts"
],
"rules": {
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/consistent-type-definitions": "off"
}
}
Expand Down

0 comments on commit b3b7d85

Please sign in to comment.