Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expose types #861

Merged
merged 2 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export const html = (text: string, opts = {}) => {
unimplemented('html export');
};

export const mdast = (text: string, opts = {}) => {
export const mdast: any = (text: string, opts = {}) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ts can't infer this type because it would require exporting types from remark. This was my lazy way of fixing it, but we should improve this.

const processor = remark().use(remarkMdx);

try {
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"dist"
],
"scripts": {
"build": "webpack --mode production",
"build": "webpack --mode production && npm run build-types",
"build-types": "npx tsc --declaration --emitDeclarationOnly --declarationDir ./dist --skipLibCheck",
"lint": "eslint . --ext .jsx --ext .js --ext .ts --ext .tsx",
"release": "npx semantic-release",
"release.dry": "npx semantic-release --dry-run",
Expand Down
Loading