angular - TypeScript'te belirli türleri takma adla içe aktarma


Belirli türleri şu şekilde içe aktarabilirim

import { Type1, Type2 } from '../../my-file';

Bir dosyadan tüm türleri takma ad ile içe aktarabilirim

import * as fromApp from '../../../store/app.reducers';

Belirli türleri takma adla nasıl içe aktarabilirim, something like

import { Type1, Type2 } as MyTypes from '../../my-file'; // of-course, this does not work

Cevap #1

Yapabileceğiniz en yakın şey:

import {Type1, Type2} from '../../my-file';

const MyTypes = {Type1, Type2};