如何在Kotlin中声明外部打字类型
我需要访问kotlin-js的打字稿库(react-admin) 特别是此类型定义
例如,如何在Kotlinjs中声明以下类型?
export type AuthProvider = {
login: (params: any) => Promise<any>;
logout: (params: any) => Promise<void | false | string>;
checkAuth: (params: any) => Promise<void>;
checkError: (error: any) => Promise<void>;
getIdentity?: () => Promise<UserIdentity>;
getPermissions: (params: any) => Promise<any>;
[key: string]: any;
};
export type DataProvider<ResourceType extends string = string> = {
getList: <RecordType extends RaRecord = any>(
resource: ResourceType,
params: GetListParams
) => Promise<GetListResult<RecordType>>;
getOne: <RecordType extends RaRecord = any>(
resource: ResourceType,
params: GetOneParams
) => Promise<GetOneResult<RecordType>>;
// etc etc ...
}
谢谢
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论