import type { dh as DhType } from '@deephaven/jsapi-types'; import { type UriVariableDescriptor } from './useObjectFetcher'; /** * Function to fetch an API based on a provided descriptor object. * Depending on the context there may be more properties on the descriptor, * providing more information about the object, such as a session ID. * @param descriptor Descriptor object or URI to fetch the API from. * @returns A promise that resolves to the API instance for the provided variable descriptor. */ export type DeferredApiFetcher = (descriptor: DhType.ide.VariableDescriptor | UriVariableDescriptor) => Promise; export declare const DeferredApiContext: import("react").Context; /** * Retrieve the API for the current context, given the widget provided. * The API may need to be loaded, and will return `null` until it is ready. * @param widget The widget descriptor or URI to use to fetch the API * @returns A tuple with the API instance, and an error if one occurred. */ export declare function useDeferredApi(widget: DhType.ide.VariableDescriptor | UriVariableDescriptor | null): [dh: typeof DhType | null, error: NonNullable | null]; export default useDeferredApi; //# sourceMappingURL=useDeferredApi.d.ts.map