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

Invalid types in ESM project #178

Closed
tgdn opened this issue Apr 28, 2024 · 1 comment
Closed

Invalid types in ESM project #178

tgdn opened this issue Apr 28, 2024 · 1 comment

Comments

@tgdn
Copy link
Contributor

tgdn commented Apr 28, 2024

Declaration files are generated automatically and override the root declaration file index.d.ts which breaks TypeScript support.

Generated file in node_modules:
image

Result:
image

Alternative solution

The way around this is creating a file overrides.d.ts in src (or within your root directory), copy-pasting the content of index.d.ts within it but replacing the part declare module 'wikijs' { with

declare global {
  module "wikijs" {
	/* content of index.d.ts within "declare module 'wikijs'" { */

	/**
     * Default Options
     *
     * @interface Options
     */
    interface Options /* etc */
  }
}

Which solves it:
image

@tgdn
Copy link
Contributor Author

tgdn commented Sep 4, 2024

Solved by #177

@tgdn tgdn closed this as completed Sep 4, 2024
This issue was closed.
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

No branches or pull requests

1 participant