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

Open
tgdn opened this issue Apr 28, 2024 · 0 comments
Open

Invalid types in ESM project #178

tgdn opened this issue Apr 28, 2024 · 0 comments

Comments

@tgdn
Copy link

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

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