import { WidgetData, WidgetParams } from "@widget-js/core";
import { ComputedRef, Ref } from "@vue/reactivity";
interface UseWidgetOption<T extends WidgetData> {
    onDataLoaded?: (data?: T) => void;
    /**
     * 在使用浏览器调试时使用，必传参数有：id,name,widthPx,heightPx
     */
    debugParams?: WidgetParams;
    defaultData?: T;
    /**
     * 预览模式下显示的数据
     */
    previewData?: T;
    /**
     * 是否忽略组件id，只通过组件名获取数据
     */
    loadDataByWidgetName?: boolean;
}
interface UseWidgetReturn<T extends WidgetData> {
    widgetParams: WidgetParams;
    widgetData: Ref<T>;
    dataLoaded: Ref<boolean>;
    sizeStyle: ComputedRef<{
        width: string;
        height: string;
    }>;
}
export declare function useWidget<T extends WidgetData>(type: {
    new (name: string, id?: string): T;
}, option?: UseWidgetOption<T>): UseWidgetReturn<T>;
export {};
