fix: 补回被合成入口丢掉的 default 导出
button/container/data-converter/data-list/grid-layout/grid-layout-form/
res-ws/virtual-fs 这几个入口的 index.js 都用 export { default as X } from './xxx'
转发了 default 导出,但同级有手写 types/ 目录时会触发合成入口逻辑,用
export * from './index' 拼入口文件,而 export * 在 ES 模块语义里不会带出 default,
导致这些包的 default 导出(部分甚至连实现本身,如 DataConverter、ResWs 整个类)
被 tree-shake 掉,没有出现在最终产物里。
This commit is contained in:
Vendored
+28
@@ -1,5 +1,32 @@
|
||||
import { WidgetType, WidgetContainerProps } from './button';
|
||||
|
||||
declare const _default: ResWs;
|
||||
|
||||
/**
|
||||
* 基于 SharedWorker 的资源状态 WebSocket 单例;多个页面/标签页共用同一条连接,
|
||||
* 按资源 uuid 把服务端推送的状态变化分发给各自的订阅回调
|
||||
*/
|
||||
declare class ResWs {
|
||||
/** @type {ResWs} */
|
||||
static "__#private@#instance": ResWs;
|
||||
/** @returns {ResWs} 单例实例 */
|
||||
static getInstance: () => ResWs;
|
||||
/**
|
||||
* 订阅资源状态变化
|
||||
* @param {(data: *) => void} cb 状态变化时的回调,收到服务端推送的原始数据
|
||||
* @param {string|string[]} [res] 要订阅的资源 uuid,不传/空数组表示订阅全部('*')
|
||||
* @returns {() => void} 取消订阅的函数
|
||||
*/
|
||||
subscribe: (cb: (data: any) => void, res?: string | string[]) => () => void;
|
||||
/**
|
||||
* 取消订阅
|
||||
* @param {Function} cb 订阅时传入的回调
|
||||
* @returns {boolean} 是否成功移除
|
||||
*/
|
||||
unsubscribe: (cb: Function) => boolean;
|
||||
#private;
|
||||
}
|
||||
|
||||
// ===== 用户数据结构(复用类型,JSDoc 无法跨文件引用,放 .d.ts) =====
|
||||
|
||||
interface UserRoleBinding {
|
||||
@@ -109,4 +136,5 @@ interface WorkerPipeInstance {
|
||||
clear: (session: string) => void
|
||||
}
|
||||
|
||||
export { _default as default };
|
||||
export type { HttpHeaders, MenuItem, RouteItem, UserInfo, UserRoleBinding, WorkerPipeInstance };
|
||||
|
||||
Reference in New Issue
Block a user