Objects (every value in JavaScript / TypeScript) can contain only values as properties (methods, constants, properties) which interfaces are not. But don't worry, there's the way! Its name is namespaces.
export namespace a { export interface x { x: string; } export interface y{ x: string; }}export namespace b { export interface z { x: string; } export interface i{ x: string; }}
See TypeScript docs for more info.
Secondly
I recommend using ECMAScript modules, not CommonJS. If you use a normal TypeScript compiler, TypeScript automatically compiles to Node.js modules. You used it in the import but not in the export. Don't use export = {}
. See TypeScript Docs for more.
In tsconfig.json:
{"compilerOptions": { // ..."moduleResolution": "node","module": "commonjs" }}
And then import {a, b} from "./x.ts"