TypeScript Version: Version 5.4.5
Example
a simple example with three project are main,module and type. main project rederences module,and module project references type.
project type
type/a.ts
interface GetMedia {}
export const get: GetMedia = null as any;
type/index.ts
import { get } from "./a";
export type Get = typeof get;
project module
module/index.ts
import type { Get } from "../type";
const get: Get = null as any;
export const api = {
get,
};
config files
tsconfig.json
{
"references": [
{
"path": "./tsconfig.module.json"
}
]
}
tsconfig.type.json
{
"include": [
"type/**/*"
],
"compilerOptions": {
"composite": true
}
}
tsconfig.type.json
{
"include": [
"type/**/*"
],
"compilerOptions": {
"composite": true
}
}
What happen
Exported variable ‘api’ has or is using name ‘GetMedia’ from external module “f:/now now now/t/type/a” but cannot be named.ts(4023)
I have read issues #5711 #9944 24666.It looks like a old problems .
Is this expected behavior or a bug?
zihahahaha wang is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.