import { type DataSourceApi, type DataSourceInstanceListItem, type DataSourceInstanceSettings, type DataSourceRef } from '@grafana/data'; import { type GetDataSourceInstanceListFilters } from './settings'; /** * @public */ export interface UseDataSourceInstanceSettingsResult { isLoading: boolean; error?: Error; settings?: DataSourceInstanceSettings; } /** * @public */ export interface UseDataSourceInstanceListResult { isLoading: boolean; error?: Error; items: DataSourceInstanceListItem[]; } /** * @public */ export interface UseDataSourceInstanceResult { isLoading: boolean; error?: Error; dataSource?: DataSourceApi; } /** * @public */ export interface UseDefaultDataSourceInstanceResult { isLoading: boolean; error?: Error; item?: DataSourceInstanceListItem; } /** * @public */ export interface UseHasDataSourceInstanceResult { isLoading: boolean; error?: Error; hasInstance: boolean; } /** * React hook wrapping {@link getDataSourceInstanceSettings}. Re-fetches when `ref` * changes (compared by value, so inline objects are safe). * * Template variable strings (e.g. `$ds` or `${ds}`) are not supported — interpolate * them before passing the resolved uid or name to this hook. * * @public */ export declare function useDataSourceInstanceSettings(ref?: DataSourceRef | string | null): UseDataSourceInstanceSettingsResult; /** * React hook wrapping {@link getDataSourceInstanceList}. Re-fetches when * `filters` changes (compared by value, so inline objects are safe). * When `filters.filter` (a callback) is set, the hook re-fetches when the * function reference changes. Wrap inline filter callbacks in `useCallback` * to avoid unnecessary re-fetches. * * @public */ export declare function useDataSourceInstanceList(filters?: GetDataSourceInstanceListFilters): UseDataSourceInstanceListResult; /** * React hook wrapping {@link getDataSourceInstance}. Re-fetches when `ref` * changes (compared by value, so inline objects are safe). * * Template variable strings (e.g. `$ds` or `${ds}`) are not supported — interpolate * them before passing the resolved uid or name to this hook. * * @public */ export declare function useDataSourceInstance(ref?: DataSourceRef | string | null): UseDataSourceInstanceResult; /** * React hook wrapping {@link getDefaultDataSourceInstance}. Re-fetches when * `type` changes. * * @public */ export declare function useDefaultDataSourceInstance(type: string): UseDefaultDataSourceInstanceResult; /** * React hook wrapping {@link hasDataSourceInstance}. Re-fetches when `type` changes. * * @public */ export declare function useHasDataSourceInstance(type: string): UseHasDataSourceInstanceResult;