We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
export {}; declare global { namespace ConfigTable { interface Iassist_contact { readonly id: number; readonly info: string; } } } 当我在全局扩展ConfigTable的命名空间,但是在tsrpc中好像是不被允许的,我始终没法在其他业务中获取到这个命名空间
export {}; declare global { namespace ConfigTable { interface Iassist_contact { readonly id: number; readonly info: string; } } }
The text was updated successfully, but these errors were encountered:
是,这是为了方便 TSRPC 协议所依赖的所有类型都可以收敛在一个文件夹内,方便同步到其它项目。 如果你确实需要全局类型,可以在 TSRPC 中定义一份,然后在全局 namespace 中建立一个别名来在代码中实现全局可用。
而 TSRPC 中的类型定义,需要每一个引用的类型都有明确的 import 位置。
例如:
interface ProtocolType { ... }
declare global { type GlobalType = ProtocolType }
Sorry, something went wrong.
好的,感谢你的回答
No branches or pull requests
export {}; declare global { namespace ConfigTable { interface Iassist_contact { readonly id: number; readonly info: string; } } }
当我在全局扩展ConfigTable的命名空间,但是在tsrpc中好像是不被允许的,我始终没法在其他业务中获取到这个命名空间
The text was updated successfully, but these errors were encountered: