Skip to content

Commit

Permalink
Replace complex-types.d.ts with index.d.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Jan 16, 2023
1 parent 8e7f703 commit 409ad69
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -2,6 +2,6 @@ coverage/
node_modules/
.DS_Store
*.log
index.d.ts
lib/**/*.d.ts
test.d.ts
yarn.lock
4 changes: 4 additions & 0 deletions complex-types.d.ts → index.d.ts
@@ -1,11 +1,15 @@
import type {Literal} from 'hast'

export type {Options} from './lib/index.js'
export {raw} from './lib/index.js'

/* eslint-disable @typescript-eslint/consistent-type-definitions */

export interface Raw extends Literal {
type: 'raw'
}

// Add `Raw` nodes to roots and elements.
declare module 'hast' {
interface RootContentMap {
raw: Raw
Expand Down
6 changes: 1 addition & 5 deletions index.js
@@ -1,6 +1,2 @@
/**
* @typedef {import('./lib/index.js').Options} Options
* @typedef {import('./complex-types.js').Raw} Raw
*/

// Note: see `index.d.ts` for exposed types.
export {raw} from './lib/index.js'
2 changes: 1 addition & 1 deletion lib/index.js
Expand Up @@ -18,7 +18,7 @@
* @typedef {import('hast').Comment} Comment
* @typedef {import('hast').Content} Content
*
* @typedef {import('../complex-types.js').Raw} Raw
* @typedef {import('../index.js').Raw} Raw
*/

/**
Expand Down
1 change: 0 additions & 1 deletion package.json
Expand Up @@ -30,7 +30,6 @@
"types": "index.d.ts",
"files": [
"lib/",
"complex-types.d.ts",
"index.d.ts",
"index.js"
],
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
@@ -1,5 +1,5 @@
{
"include": ["**/**.js", "complex-types.d.ts", "test-types.d.ts"],
"include": ["**/**.js", "index.d.ts"],
"exclude": ["coverage/", "node_modules/"],
"compilerOptions": {
"checkJs": true,
Expand Down

0 comments on commit 409ad69

Please sign in to comment.