Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typo3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Typescript:使用不同名称导出接口_Typescript - Fatal编程技术网

Typescript:使用不同名称导出接口

Typescript:使用不同名称导出接口,typescript,Typescript,我需要导入接口,将属性添加到id,并导出与原始接口同名的新接口。然后在所有使用此接口的地方,我只能更改导入位置 import { Routes, Route } from '@angular/router'; interface Route2 extends Route { description: string; } export declare type Routes = Route2[]; 然后我想去,虽然这是不可能的 export Route2 as Route; 以其他名

我需要导入接口,将属性添加到id,并导出与原始接口同名的新接口。然后在所有使用此接口的地方,我只能更改导入位置

import { Routes, Route } from '@angular/router';
interface Route2 extends Route {
    description: string;
}

export declare type Routes = Route2[];
然后我想去,虽然这是不可能的

export Route2 as Route;
以其他名称导入原始路由,并将新路由导出为路由

import { Route as OriginalRoute } from '@angular/router';
export interface Route extends OriginalRoute {
    description: string;
}