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

The function simple is missing from type definitions #9

Closed
illright opened this issue Jun 23, 2024 · 2 comments · Fixed by #10
Closed

The function simple is missing from type definitions #9

illright opened this issue Jun 23, 2024 · 2 comments · Fixed by #10

Comments

@illright
Copy link

Hi! Glad you made this project, I've been looking for something to walk an SWC tree myself and was frustrated not to find anything.

When I install this package and try to import { simple } from it, VS Code doesn't suggest it. Clicking into the dependency revealed that the main .d.ts file only exports types and not functions:

// node_modules/.pnpm/swc-walk@1.0.0-rc.1/node_modules/swc-walk/dist/esm/types.d.ts

// ... a bunch of exported types ...

export {};

Am I missing something, or are the type defintions?

@illright
Copy link
Author

For now I worked around it by doing this in my code:

import { simple } from 'swc-walk'

declare module 'swc-walk' {
  export const simple: Simple
}

@morganney
Copy link
Owner

Thanks for reporting this. The project is still a work in progress. This should be fixed in v1.0.0-rc.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants