import type { dh } from '@deephaven/jsapi-types'; import { type UriVariableDescriptor } from './useObjectFetcher'; /** * Types of widgets that can be fetched with this hook. */ export type WidgetTypes = dh.Table | dh.TreeTable | dh.PartitionedTable | dh.plot.Figure | dh.Widget; /** * Wrapper object for a widget and error status. Both widget and error will be `null` if it is still loading. */ export type WidgetWrapper = { /** Widget object to retrieve */ widget: T | null; /** Deephaven JS API to use for this widget */ api: typeof dh | null; /** Error status if there was an issue fetching the widget */ error: NonNullable | null; }; /** * Retrieve a widget for the given variable descriptor. Note that if the widget is successfully fetched, ownership of the widget is passed to the consumer and will need to close the object as well. * @param descriptor Descriptor or URI to get the widget for. Should be stable to avoid infinite re-fetching. * @returns A WidgetWrapper object that contains the widget and JS API, or an error status if there was an issue fetching the widget. Will contain nulls if still loading. */ export declare function useWidget(descriptor: dh.ide.VariableDescriptor | UriVariableDescriptor): WidgetWrapper; export default useWidget; //# sourceMappingURL=useWidget.d.ts.map