You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected behavior: TypeScript should merge two separate declarations of the ParsedPath interface.
Actual behavior: TypeScript overrides the declaration of the ParsedPath interface. This behavior can be fixed by uncommenting the line export type Foo = ""; in types.ts file.
I'm not too sure about the internal details, but you see this behavior because types.ts is not a module. You can only augment modules within modules or declaration files. Once you add an import or export statement it's a module. Alternatively you can make types.ts a decaration file by renaming it to types.d.ts.
TypeScript Version: 4.1.0-dev.20201031
Search Terms: "declare module", "module augmentation"
Code
codesandbox
Expected behavior: TypeScript should merge two separate declarations of the
ParsedPath
interface.Actual behavior: TypeScript overrides the declaration of the
ParsedPath
interface. This behavior can be fixed by uncommenting the lineexport type Foo = "";
intypes.ts
file.Playground Link: codesandbox
Related Issues:
The text was updated successfully, but these errors were encountered: