import type { dh } from '@deephaven/jsapi-types'; /** * Descriptor for a variable by name. Used when needed to fetch an object. */ export type NameVariableDescriptor = { /** Type of the variable */ type: string; /** Name of the variable */ name: string; }; /** * Descriptor for a variable by id. Used when needed to fetch an object. */ export type IdVariableDescriptor = { /** Type of the variable */ type: string; /** Id of the variable */ id: string; }; export type UriVariableDescriptor = string; export declare function isNameVariableDescriptor(value: unknown): value is NameVariableDescriptor; export declare function isIdVariableDescriptor(value: unknown): value is IdVariableDescriptor; export declare function isVariableDescriptor(value: unknown): value is dh.ide.VariableDescriptor; /** * Function to fetch an object based on a provided descriptor object. * @param descriptor Descriptor object or URI to fetch the object from. Can be extended by a specific implementation to * include additional fields (such as a session ID) to uniquely identify an object. */ export type ObjectFetcher = (descriptor: dh.ide.VariableDescriptor | UriVariableDescriptor) => Promise; export declare const ObjectFetcherContext: import("react").Context; /** * Gets a descriptor that only has the ID or name set, but not both. * API will throw an error if both are set when fetching from the connection. * @param descriptor Variable descriptor to sanitize * @returns Descriptor object that has either the ID or name set, but not both. */ export declare function sanitizeVariableDescriptor(descriptor: Partial): NameVariableDescriptor | IdVariableDescriptor; /** * Get the variable descriptor for a definition. * @param definition Definition to get the variable descriptor from * @returns Serializable VariableDescriptor object */ export declare function getVariableDescriptor(definition: dh.ide.VariableDescriptor & { title?: string; }): dh.ide.VariableDescriptor; /** * Use a function to fetch an object based on provided metadata * @returns Function to asynchronously fetch an object based on provided metadata */ export declare function useObjectFetcher(): ObjectFetcher; //# sourceMappingURL=useObjectFetcher.d.ts.map