是否有任何一种简单的方法可以导入整个库并忽略其类型?
这不起作用。为什么不呢?
更新
这个定义有效,但我仍然想要一个我们不需要的单行版本:
declare module 'joi' {
export const validate: any;
export const object: any;
export const string: any;
export const required: any;
export type ValidationOptions = any;
export type ValidationResult<any> = any;
export type ObjectSchema = any;
}