Take following folder structure as an example:
example.ts
outer/
|--- inner/
|--- index.ts
|--- file1.ts
|--- file2.ts
|--- index.ts
Content of file1.ts
export class FileOneClass{/**/}
export interface IFileOneInterface{/**/}
Content of file2.ts
:
export class FileTwoClass{/**/}
export interface IFileTwoInterface{/**/}
Content of outer/inner/index.ts
:
export { FileOneClass, IFileOneInterface } from "./file1.ts"
export { FileTwoClass, IFileTwoInterface } from "./file2.ts"
Content of outer/index.ts
:
import * as InnerImport from "./inner";
export const Inner = InnerImport;
Content of example.ts
:
import { Inner } from "./outer"
function exampleUsage(){
console.log(Inner.FileOneClass)
console.log(Inner.FileOneInterface)
console.log(Inner.FileTwoClass)
console.log(Inner.FileTwoInterface)
}
My Question:
Is there a way to write the export statement in outer/index.ts
into one single line?
// Ugly:
import * as InnerImport from "./inner";
export const Inner = InnerImport;
// Desired is something like this:
export * as Inner from "./inner"; // This line leads to a error!