wiki
wiki copied to clipboard
Invalid types in ESM project
Declaration files are generated automatically and override the root declaration file index.d.ts
which breaks TypeScript support.
Generated file in node_modules
:
Result:
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: