Consider the following example.
In typings_module:
vars.d.ts:
interfaceUserProperties{}declare global {constvariable: UserProperties;}index.d.ts:
exportasnamespaceModuleNamespace;export*from"./vars"
Now, we want to specify properties for the UserProperties interface.
a_project_file.d.ts:
declare module "typings_module"{exportinterfaceUserProperties{test: number;}}export{}The bug is the type merging works only if the "typings_module" files are inside "node_modules/@types/" and does not work if the same files are referenced from another location via the "typeRoots" TSC option in "tsconfig.json".
TypeScript Version: 3.9.6
Search Terms: "type merging", "declaration files"
Consider the following example.
In typings_module:
vars.d.ts:
index.d.ts:
Now, we want to specify properties for the
UserPropertiesinterface.a_project_file.d.ts:
The bug is the type merging works only if the "typings_module" files are inside "node_modules/@types/" and does not work if the same files are referenced from another location via the "typeRoots" TSC option in "tsconfig.json".
TypeScript Version: 3.9.6
Search Terms: "type merging", "declaration files"