'Declare types from file with `export .. from` to global interface

I have the file with a lot of export { default as NAME } from './PATH_TO_FILE';

And I want to declare types to global @vue/runtime-core inside GlobalComponents. But my try isn't working.

import * as atoms from './shared/components/UI/atoms';

declare module '@vue/runtime-core' {
  export interface GlobalComponents {
    [key: keyof typeof atoms]: typeof atoms[typeof key];
  }
}

Does Typescript have any maping tool for map types inside an interface?

I can't declare type instead of interface because vue using interface and I have a conflicts.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source