import * as _grafana_schema from '@grafana/schema'; import { VariableType, VariableHide, LoadingState, TimeZone, DataQuery, DataTopic, DataSourceRef, VariableRefresh, DashboardCursorSync, MatcherConfig, TableFieldOptions } from '@grafana/schema'; import * as _grafana_data from '@grafana/data'; import { BusEventWithPayload, EventBus, BusEvent, BusEventType, BusEventHandler, PanelMenuItem, DataQueryRequest, FieldConfigSource, PanelPlugin, AbsoluteTimeRange, PanelData, InterpolateFunction, PanelModel, TimeRange, DataTransformContext, DataFrame, DataSourceGetTagKeysOptions, DataSourceGetTagValuesOptions, IconName, PageLayoutType, UrlQueryMap, DataQuery as DataQuery$1, DataSourceApi, Registry, RegistryItem, ScopedVars, AdHocVariableFilter, SelectableValue, GetTagResponse, MetricFindValue, DrilldownsApplicability, VariableRegexApplyTo, VariableRefresh as VariableRefresh$1, VariableSort, Scope, EventFilterOptions, AnnotationEvent, AnnotationQuery, DataTransformerConfig, TimeOption, FieldConfig, FieldType, FieldValueMatcherConfig, ScopedVar, RawTimeRange } from '@grafana/data'; import * as React$1 from 'react'; import React__default, { ComponentType, CSSProperties, PointerEvent, ForwardRefExoticComponent } from 'react'; import * as rxjs from 'rxjs'; import { Observable, Subscription, Unsubscribable, MonoTypeOperatorFunction, ReplaySubject } from 'rxjs'; import { PanelContext, WeekStart, IconName as IconName$1 } from '@grafana/ui'; import { LocationService, VariableInterpolation, ScopesContextValue } from '@grafana/runtime'; import { Location } from 'history'; import ReactGridLayout from 'react-grid-layout'; import { Options, FieldConfig as FieldConfig$1 } from '@grafana/schema/dist/esm/raw/composable/barchart/panelcfg/x/BarChartPanelCfg_types.gen'; import { Options as Options$1 } from '@grafana/schema/dist/esm/raw/composable/bargauge/panelcfg/x/BarGaugePanelCfg_types.gen'; import { Options as Options$2 } from '@grafana/schema/dist/esm/raw/composable/gauge/panelcfg/x/GaugePanelCfg_types.gen'; import { Options as Options$3 } from '@grafana/schema/dist/esm/raw/composable/geomap/panelcfg/x/GeomapPanelCfg_types.gen'; import { Options as Options$4, FieldConfig as FieldConfig$2 } from '@grafana/schema/dist/esm/raw/composable/heatmap/panelcfg/x/HeatmapPanelCfg_types.gen'; import { Options as Options$5, FieldConfig as FieldConfig$3 } from '@grafana/schema/dist/esm/raw/composable/histogram/panelcfg/x/HistogramPanelCfg_types.gen'; import { Options as Options$6 } from '@grafana/schema/dist/esm/raw/composable/logs/panelcfg/x/LogsPanelCfg_types.gen'; import { Options as Options$7 } from '@grafana/schema/dist/esm/raw/composable/news/panelcfg/x/NewsPanelCfg_types.gen'; import { Options as Options$8 } from '@grafana/schema/dist/esm/raw/composable/nodegraph/panelcfg/x/NodeGraphPanelCfg_types.gen'; import { Options as Options$9, FieldConfig as FieldConfig$4 } from '@grafana/schema/dist/esm/raw/composable/piechart/panelcfg/x/PieChartPanelCfg_types.gen'; import { Options as Options$a } from '@grafana/schema/dist/esm/raw/composable/stat/panelcfg/x/StatPanelCfg_types.gen'; import { Options as Options$b, FieldConfig as FieldConfig$5 } from '@grafana/schema/dist/esm/raw/composable/statetimeline/panelcfg/x/StateTimelinePanelCfg_types.gen'; import { Options as Options$c, FieldConfig as FieldConfig$6 } from '@grafana/schema/dist/esm/raw/composable/statushistory/panelcfg/x/StatusHistoryPanelCfg_types.gen'; import { Options as Options$d } from '@grafana/schema/dist/esm/raw/composable/table/panelcfg/x/TablePanelCfg_types.gen'; import { Options as Options$e } from '@grafana/schema/dist/esm/raw/composable/text/panelcfg/x/TextPanelCfg_types.gen'; import { Options as Options$f, FieldConfig as FieldConfig$7 } from '@grafana/schema/dist/esm/raw/composable/timeseries/panelcfg/x/TimeSeriesPanelCfg_types.gen'; import { Options as Options$g, FieldConfig as FieldConfig$8 } from '@grafana/schema/dist/esm/raw/composable/trend/panelcfg/x/TrendPanelCfg_types.gen'; import { Options as Options$h } from '@grafana/schema/dist/esm/raw/composable/xychart/panelcfg/x/XYChartPanelCfg_types.gen'; import { ResourceLoader } from '@grafana/i18n'; interface DataSourceControlRef { type: 'datasource'; group: string; } type ControlSourceRef = DataSourceControlRef; interface SceneVariableState extends SceneObjectState { type: VariableType; name: string; label?: string; hide?: VariableHide; skipUrlSync?: boolean; loading?: boolean; error?: any | null; description?: string | null; origin?: ControlSourceRef; } interface SceneVariable extends SceneObject { /** * This function is called on activation or when a dependency changes. */ validateAndUpdate?(): Observable; /** * Should return the value for the given field path */ getValue(fieldPath?: string): VariableValue | undefined | null; /** * Should return the value display text, used by the "text" formatter * Example: ${podId:text} * Useful for variables that have non user friendly values but friendly display text names. */ getValueText?(fieldPath?: string): string; /** * For special edge case senarios. For example local function that locally scoped variables can implement. **/ isAncestorLoading?(): boolean; /** * Allows cancelling variable execution. */ onCancel?(): void; /** * Edge case for variables that are hidden but wants to be render to access react contexts (ScopesVariable) */ UNSAFE_renderAsHidden?: boolean; /** * @experimental * Indicates that a variable loads values lazily when user interacts with the variable dropdown. */ isLazy?: boolean; } type VariableValue = VariableValueSingle | VariableValueSingle[]; type VariableValueSingle = string | boolean | number | CustomVariableValue; /** * This is for edge case values like the custom "allValue" that should not be escaped/formatted like other values * The custom all value usually contain wildcards that should not be escaped. */ interface CustomVariableValue { /** * The format name or function used in the expression */ formatter(formatNameOrFn?: string | VariableCustomFormatterFn): string; } interface ValidateAndUpdateResult { } type VariableValueOptionProperties = Record; interface VariableValueOption { label: string; value: VariableValueSingle; group?: string; properties?: VariableValueOptionProperties; } interface SceneVariableSetState extends SceneObjectState { variables: SceneVariable[]; } interface SceneVariables extends SceneObject { /** * Will look for and return variable matching name */ getByName(name: string): SceneVariable | undefined; /** * Will return true if the variable is loading or waiting for an update to complete. */ isVariableLoadingOrWaitingToUpdate(variable: SceneVariable): boolean; } declare class SceneVariableValueChangedEvent extends BusEventWithPayload { static type: string; } interface SceneVariableDependencyConfigLike { /** Return all variable names this object depend on */ getNames(): Set; /** Used to check for dependency on a specific variable */ hasDependencyOn(name: string): boolean; /** * Will be called when the VariableSet have completed an update process or when a variable has changed value. **/ variableUpdateCompleted(variable: SceneVariable, hasChanged: boolean): void; } /** * Used in CustomFormatterFn */ interface CustomFormatterVariable { name: string; type: VariableType; multi?: boolean; includeAll?: boolean; } type VariableCustomFormatterFn = (value: unknown, legacyVariableModel: Partial, legacyDefaultFormatter?: VariableCustomFormatterFn) => string; type InterpolationFormatParameter = string | VariableCustomFormatterFn | undefined; declare function isCustomVariableValue(value: VariableValue): value is CustomVariableValue; declare class SceneObjectRef { #private; constructor(ref: T); resolve(): T; } declare abstract class SceneObjectBase implements SceneObject { static RENDER_BEFORE_ACTIVATION_DEFAULT: boolean; private _isActive; private _state; private _activationHandlers; private _deactivationHandlers; private _ref?; protected _events?: EventBus; protected _parent?: SceneObject; protected _subs: Subscription; protected _refCount: number; protected _renderBeforeActivation: boolean; protected _variableDependency: SceneVariableDependencyConfigLike | undefined; protected _urlSync: SceneObjectUrlSyncHandler | undefined; constructor(state: TState); /** Current state */ get state(): TState; /** True if currently being active (ie displayed for visual objects) */ get isActive(): boolean; get renderBeforeActivation(): boolean; /** Returns the parent, undefined for root object */ get parent(): SceneObject | undefined; /** Returns variable dependency config */ get variableDependency(): SceneVariableDependencyConfigLike | undefined; /** Returns url sync config */ get urlSync(): SceneObjectUrlSyncHandler | undefined; /** * Used in render functions when rendering a SceneObject. * Wraps the component in an EditWrapper that handles edit mode */ get Component(): SceneComponent; private _setParent; /** * Sometimes you want to move one instance to another parent. * This is a way to do that without getting the console warning. */ clearParent(): void; /** * Subscribe to the scene state subject **/ subscribeToState(handler: SceneStateChangedHandler): Unsubscribable; /** * Subscribe to the scene event **/ subscribeToEvent(eventType: BusEventType, handler: BusEventHandler): Unsubscribable; setState(update: Partial): void; /** * This handles activation and deactivation of $data, $timeRange and $variables when they change * during the active phase of the scene object. */ private _handleActivationOfChangedStateProps; private _handleChangedStateActivation; private _handleChangedBehaviors; publishEvent(event: BusEvent, bubble?: boolean): void; getRoot(): SceneObject; private _internalActivate; private _activateBehavior; /** * This is primarily called from SceneComponentWrapper when the SceneObject's Component is mounted. * But in some scenarios this can also be called directly from another scene object. When called manually from another scene object * make sure to call the returned function when the source scene object is deactivated. */ activate(): CancelActivationHandler; /** * Called by the SceneComponentWrapper when the react component is unmounted. * Don't override this, instead use addActivationHandler. The activation handler can return a deactivation handler. */ private _internalDeactivate; /** * Utility hook to get and subscribe to state */ useState(): TState; /** Force a re-render, should only be needed when variable values change */ forceRender(): void; /** * Will create new SceneObject with shallow-cloned state, but all state items of type SceneObject are deep cloned */ clone(withState?: Partial): this; /** * Allows external code to register code that is executed on activate and deactivate. This allow you * to wire up scene objects that need to respond to state changes in other objects from the outside. **/ addActivationHandler(handler: SceneActivationHandler): void; /** * Loop through state and call callback for each direct child scene object. * Checks 1 level deep properties and arrays. So a scene object hidden in a nested plain object will not be detected. * Return false to exit loop early. */ forEachChild(callback: (child: SceneObjectBase) => void): void; /** Returns a SceneObjectRef that will resolve to this object */ getRef(): SceneObjectRef; toJSON(): { type: any; isActive: boolean; state: TState; }; } /** * This hook is always returning model.state instead of a useState that remembers the last state emitted on the subject * The reason for this is so that if the model instance change this function will always return the latest state. */ declare function useSceneObjectState(model: SceneObject, options?: UseStateHookOptions): TState; declare function VizPanelRenderer({ model }: SceneComponentProps): React__default.JSX.Element; interface VizPanelMenuState extends SceneObjectState { items?: PanelMenuItem[]; } declare class VizPanelMenu extends SceneObjectBase { static Component: typeof VizPanelMenuRenderer; addItem(item: PanelMenuItem): void; setItems(items: PanelMenuItem[]): void; } declare function VizPanelMenuRenderer({ model }: SceneComponentProps): React__default.JSX.Element; interface VariableDependencyConfigOptions { /** * State paths to scan / extract variable dependencies from. Leave empty to scan all paths. */ statePaths?: Array; /** * Explicit list of variable names to depend on. Leave empty to scan state for dependencies. */ variableNames?: string[]; /** * Optional way to customize how to handle when a dependent variable changes * If not specified the default behavior is to trigger a re-render */ onReferencedVariableValueChanged?: (variable: SceneVariable) => void; /** * Two scenarios trigger this callback to be called. * 1. When any direct dependency changed value * 2. In case hasDependencyInLoadingState was called and returned true we really care about any variable update. So in this scenario this callback is called * after any variable update completes. This is to cover scenarios where an object is waiting for indirect dependencies to complete. */ onVariableUpdateCompleted?: () => void; /** * Optional way to subscribe to all variable value changes, even to variables that are not dependencies. */ onAnyVariableChanged?: (variable: SceneVariable) => void; /** * Handle time macros. */ handleTimeMacros?: boolean; /** * Will add ScopesVariable as a dependency which will cause updates when the scopes change. */ dependsOnScopes?: boolean; } declare class VariableDependencyConfig implements SceneVariableDependencyConfigLike { private _sceneObject; private _options; private _state; private _dependencies; private _statePaths?; private _isWaitingForVariables; scanCount: number; constructor(_sceneObject: SceneObject, _options: VariableDependencyConfigOptions); /** * Used to check for dependency on a specific variable */ hasDependencyOn(name: string): boolean; /** * This is called whenever any set of variables have new values. It is up to this implementation to check if it's relevant given the current dependencies. */ variableUpdateCompleted(variable: SceneVariable, hasChanged: boolean): void; hasDependencyInLoadingState(): boolean; getNames(): Set; /** * Update variableNames */ setVariableNames(varNames: string[]): void; setPaths(paths: Array): void; private scanStateForDependencies; private extractVariablesFrom; private handleTimeMacros; } interface LongFrameEvent { duration: number; timestamp: number; method: 'manual' | 'loaf'; } type LongFrameCallback = (event: LongFrameEvent) => void; interface QueryResultWithState { state: LoadingState; } interface SceneQueryControllerEntry { request?: DataQueryRequest; type: SceneQueryControllerEntryType; origin: SceneObject; cancel?: () => void; } type SceneQueryControllerEntryType = 'data' | 'annotations' | 'variable' | 'alerts' | 'plugin' | string; interface SceneComponentInteractionEvent { origin: string; duration: number; networkDuration: number; startTs: number; endTs: number; } interface SceneInteractionTrackerState extends SceneObjectState { enableInteractionTracking?: boolean; onInteractionComplete?(event: SceneComponentInteractionEvent): void; } interface SceneQueryStateControllerState extends SceneObjectState { isRunning: boolean; enableProfiling?: boolean; } interface SceneQueryControllerLike extends SceneObject { isQueryController: true; cancelAll(): void; queryStarted(entry: SceneQueryControllerEntry): void; queryCompleted(entry: SceneQueryControllerEntry): void; startProfile(name: string): void; cancelProfile(): void; runningQueriesCount(): number; } /** * Performance tracking callback types */ type QueryCompletionCallback = (endTimestamp: number, error?: any) => void; type PluginLoadCompletionCallback = (plugin: any, fromCache?: boolean) => void; type FieldConfigCompletionCallback = (endTimestamp: number, dataPointsCount?: number, seriesCount?: number) => void; type RenderCompletionCallback = (endTimestamp: number, duration: number) => void; type DataTransformCompletionCallback = (endTimestamp: number, duration: number, success: boolean, result?: { error?: string; }) => void; interface QueryProfilerLike { onQueryStarted(timestamp: number, entry: SceneQueryControllerEntry, queryId: string): QueryCompletionCallback | null; } /** * Will look for a scene object with a behavior that is a SceneQueryController and register the query with it. * Optionally accepts a panel profiler for direct query tracking callbacks. */ declare function registerQueryWithController(entry: SceneQueryControllerEntry, profiler?: QueryProfilerLike): (queryStream: Observable) => Observable; interface VizPanelRenderProfilerState extends SceneObjectState { } /** * Tracks performance metrics for individual VizPanel instances using observer pattern. * * Performance events are sent to ScenePerformanceTracker observers, which are consumed * by Grafana's ScenePerformanceLogger and DashboardAnalyticsAggregator. */ declare class VizPanelRenderProfiler extends SceneObjectBase implements QueryProfilerLike { private _panelKey?; private _panelId?; private _pluginId?; private _pluginVersion?; private _isTracking; private _loadPluginStartTime?; private _applyFieldConfigStartTime?; private _activeQueries; constructor(state?: Partial); private _onActivate; private _handlePanelStateChange; /** * Track query execution with operation ID correlation */ onQueryStarted(timestamp: number, entry: SceneQueryControllerEntry, queryId: string): QueryCompletionCallback | null; /** * Track plugin loading with operation ID correlation */ onPluginLoadStart(pluginId: string): PluginLoadCompletionCallback | null; /** * Track field config processing with operation ID correlation */ onFieldConfigStart(timestamp: number): FieldConfigCompletionCallback | null; /** * Get panel info for logging - truncates long titles for readability */ private _getPanelInfo; /** * Track simple render timing with operation ID correlation */ onSimpleRenderStart(timestamp: number): RenderCompletionCallback | undefined; /** Handle plugin changes */ private _onPluginChange; /** Start tracking this panel */ private _startTracking; /** Cleanup when behavior is deactivated */ private _cleanup; /** * Track data transformation with operation ID correlation */ onDataTransformStart(timestamp: number, transformationId: string, metrics: { transformationCount: number; seriesTransformationCount: number; annotationTransformationCount: number; }): DataTransformCompletionCallback | null; } interface VizPanelState extends SceneObjectState { /** * This is usually a plugin id that references a core plugin or an external plugin. But this can also reference a * runtime registered PanelPlugin registered via function registerScenePanelPlugin. */ pluginId: string; title: string; description?: string; options: DeepPartial; fieldConfig: FieldConfigSource>; pluginVersion?: string; displayMode?: 'default' | 'transparent'; /** * Only shows header on hover, absolutly positioned above the panel. */ hoverHeader?: boolean; /** * Offset hoverHeader position on the y axis */ hoverHeaderOffset?: number; /** * Allows adding elements to the subheader of the panel. */ subHeader?: React.ReactNode | SceneObject | SceneObject[]; /** * Only shows vizPanelMenu on hover if false, otherwise the menu is always visible in the header */ showMenuAlways?: boolean; /** * Defines a menu in the top right of the panel. The menu object is only activated when the dropdown menu itself is shown. * So the best way to add dynamic menu actions and links is by adding them in a behavior attached to the menu. */ menu?: VizPanelMenu; /** * Defines a menu that renders panel link. **/ titleItems?: React.ReactNode | SceneObject | SceneObject[]; seriesLimit?: number; seriesLimitShowAll?: boolean; /** * Add action to the top right panel header */ headerActions?: React.ReactNode | SceneObject | SceneObject[]; /** * Mainly for advanced use cases that need custom handling of PanelContext callbacks. */ extendPanelContext?: (vizPanel: VizPanel, context: PanelContext) => void; /** * @internal * experimental / temporary * * clears field.values arrays of previous/stale/retained series and annotations frames in PanelData * * see https://github.com/facebook/react/issues/36176 * see https://github.com/grafana/grafana/pull/121682 * see https://github.com/grafana/grafana/pull/120190 **/ _UNSAFE_clearPreviousFieldValues?: boolean; /** * Sets panel chrome collapsed state */ collapsible?: boolean; collapsed?: boolean; /** Marks object as a repeated object and a key pointer to source object */ repeatSourceKey?: string; /** * @internal * Only for use from core to handle migration from old angular panels **/ _UNSAFE_customMigrationHandler?: (panel: PanelModel, plugin: PanelPlugin) => void; /** Internal */ _pluginLoadError?: string; /** Internal */ _pluginInstanceState?: any; _renderCounter?: number; } declare class VizPanel extends SceneObjectBase> { static Component: typeof VizPanelRenderer; protected _variableDependency: VariableDependencyConfig>; protected _panelContext?: PanelContext; private _plugin?; private _prevData?; private _dataWithFieldConfig?; private _structureRev; constructor(state: Partial>); /** * Get the VizPanelRenderProfiler behavior if attached */ getProfiler(): VizPanelRenderProfiler | undefined; private _onActivate; forceRender(): void; private _loadPlugin; getLegacyPanelId(): number; /** * Unique id string that includes local variable values (for repeated panels) */ getPathId(): string; private _pluginLoaded; private _getPluginVersion; getPlugin(): PanelPlugin | undefined; getPanelContext(): PanelContext; onTimeRangeChange: (timeRange: AbsoluteTimeRange) => void; getTimeRange: (data?: PanelData) => _grafana_data.TimeRange; changePluginType(pluginId: string, newOptions?: DeepPartial<{}>, newFieldConfig?: FieldConfigSource): Promise; onTitleChange: (title: string) => void; onDescriptionChange: (description: string) => void; onDisplayModeChange: (displayMode: "default" | "transparent") => void; onToggleCollapse: (collapsed: boolean) => void; onOptionsChange: (optionsUpdate: DeepPartial, replace?: boolean, isAfterPluginChange?: boolean) => void; onFieldConfigChange: (fieldConfigUpdate: FieldConfigSource>, replace?: boolean) => void; interpolate: InterpolateFunction; getDescription: () => string; clearFieldConfigCache(): void; /** * Called from the react render path to apply the field config to the data provided by the data provider */ applyFieldConfig(rawData?: PanelData): PanelData; onCancelQuery: () => void; onStatusMessageClick: () => void; /** * Panel context functions */ private _onSeriesColorChange; private _onSeriesVisibilityChange; private _onInstanceStateChange; private _onToggleLegendSort; clone(withState?: Partial): this; private buildPanelContext; } interface SceneObjectState { key?: string; $timeRange?: SceneTimeRangeLike; $data?: SceneDataProvider; $variables?: SceneVariables; /** * @experimental * Can be used to add extra behaviors to a scene object. * These are activated when the their parent scene object is activated. */ $behaviors?: Array; } interface SceneLayoutChildOptions { width?: number | string; height?: number | string; xSizing?: 'fill' | 'content'; ySizing?: 'fill' | 'content'; x?: number; y?: number; minWidth?: number | string; minHeight?: number | string; isDraggable?: boolean; isResizable?: boolean; } interface SceneComponentProps { model: T; } type SceneComponent = (props: SceneComponentProps) => React__default.ReactElement | null; interface SceneDataState extends SceneObjectState { data?: PanelData; } interface SceneObject { /** The current state */ readonly state: TState; /** True when there is a React component mounted for this Object */ readonly isActive: boolean; /** Controls if activation blocks rendering */ readonly renderBeforeActivation: boolean; /** SceneObject parent */ readonly parent?: SceneObject; /** This abtractions declares what variables the scene object depends on and how to handle when they change value. **/ readonly variableDependency?: SceneVariableDependencyConfigLike; /** This abstraction declares URL sync dependencies of a scene object. **/ readonly urlSync?: SceneObjectUrlSyncHandler; /** Subscribe to state changes */ subscribeToState(handler: SceneStateChangedHandler): Unsubscribable; /** Subscribe to a scene event */ subscribeToEvent(typeFilter: BusEventType, handler: BusEventHandler): Unsubscribable; /** Publish an event and optionally bubble it up the scene */ publishEvent(event: BusEvent, bubble?: boolean): void; /** Utility hook that wraps useObservable. Used by React components to subscribes to state changes */ useState(): TState; /** How to modify state */ setState(state: Partial): void; /** * Called when the Component is mounted. This will also activate any $data, $variables or $timeRange scene object on this level. * Don't override this in your custom SceneObjects, instead use addActivationHandler from the constructor. **/ activate(): CancelActivationHandler; /** Get the scene root */ getRoot(): SceneObject; /** Returns a deep clone this object and all its children */ clone(state?: Partial): this; /** A React component to use for rendering the object */ Component(props: SceneComponentProps>): React__default.ReactElement | null; /** Force a re-render, should only be needed when variable values change */ forceRender(): void; /** Returns a SceneObjectRef that will resolve to this object */ getRef(): SceneObjectRef; /** * Allows external code to register code that is executed on activate and deactivate. This allow you * to wire up scene objects that need to respond to state changes in other objects from the outside. **/ addActivationHandler(handler: SceneActivationHandler): void; /** * Loop through state and call callback for each direct child scene object. * Checks 1 level deep properties and arrays. So a scene object hidden in a nested plain object will not be detected. * Return false to exit loop early. */ forEachChild(callback: (child: SceneObject) => void): void | false; /** * Useful for edge cases when you want to move a scene object to another parent. */ clearParent(): void; } type SceneActivationHandler = () => SceneDeactivationHandler | void; type SceneDeactivationHandler = () => void; /** * Function returned by activate() that when called will deactivate the object if it's the last activator **/ type CancelActivationHandler = () => void; interface SceneLayoutState extends SceneObjectState { children: SceneObject[]; } interface SceneLayout extends SceneObject { isDraggable(): boolean; getDragClass?(): string; getDragClassCancel?(): string; getDragHooks?(): { onDragStart?: (e: React__default.PointerEvent, panel: VizPanel) => void; }; } interface SceneTimeRangeState extends SceneObjectState { from: string; to: string; fiscalYearStartMonth?: number; value: TimeRange; timeZone?: TimeZone; /** weekStart will change the global date locale so having multiple different weekStart values is not supported */ weekStart?: WeekStart; /** * @internal * To enable feature parity with the old time range picker, not sure if it will be kept. * Override the now time by entering a time delay. Use this option to accommodate known delays in data aggregation to avoid null values. * */ UNSAFE_nowDelay?: string; refreshOnActivate?: { /** * When set, the time range will invalidate relative ranges after the specified interval has elapsed */ afterMs?: number; /** * When set, the time range will invalidate relative ranges after the specified percentage of the current interval has elapsed. * If both invalidate values are set, the smaller value will be used for the given interval. */ percent?: number; }; } interface SceneTimeRangeLike extends SceneObject { onTimeZoneChange(timeZone: TimeZone): void; onTimeRangeChange(timeRange: TimeRange): void; onRefresh(): void; getTimeZone(): TimeZone; } declare function isSceneObject(obj: any): obj is SceneObject; interface SceneObjectWithUrlSync extends SceneObject { getUrlState(): SceneObjectUrlValues; updateFromUrl(values: SceneObjectUrlValues): void; } interface SceneObjectUrlSyncHandler { getKeys(): string[]; getUrlState(): SceneObjectUrlValues; updateFromUrl(values: SceneObjectUrlValues): void; shouldCreateHistoryStep?(values: SceneObjectUrlValues): boolean; performBrowserHistoryAction?(callback: () => void): void; } interface DataRequestEnricher { enrichDataRequest(source: SceneObject): Partial | null; } interface FiltersRequestEnricher { enrichFiltersRequest(source: SceneObject): Partial | null; } declare function isDataRequestEnricher(obj: any): obj is DataRequestEnricher; declare function isFiltersRequestEnricher(obj: any): obj is FiltersRequestEnricher; type SceneObjectUrlValue = string | string[] | undefined | null; type SceneObjectUrlValues = Record; type CustomTransformOperator = (context: DataTransformContext) => MonoTypeOperatorFunction; type CustomTransformerDefinition = { operator: CustomTransformOperator; topic: DataTopic; } | CustomTransformOperator; type SceneStateChangedHandler = (newState: TState, prevState: TState) => void; type DeepPartial = { [K in keyof T]?: T[K] extends object ? DeepPartial : T[K]; }; interface SceneDataProviderResult { data: PanelData; origin: SceneDataProvider; } interface SceneDataProvider extends SceneObject { setContainerWidth?: (width: number) => void; isDataReadyToDisplay?: () => boolean; cancelQuery?: () => void; getResultsStream(): Observable; /** * Can be used to disable query execution for scene elements that are out of view */ isInViewChanged?(isInView: boolean): void; /** * Allow activating or deactivating the isInView behavior * This is useful for external consumers of a data provider (i.e., the Dashboard datasource) */ bypassIsInViewChanged?(bypassIsInView: boolean): void; } interface SceneDataLayerProviderState extends SceneDataState { name: string; description?: string; isEnabled?: boolean; isHidden?: boolean; placement?: 'inControlsMenu'; } interface SceneDataLayerProvider extends SceneDataProvider { isDataLayer: true; } declare function isDataLayer(obj: SceneObject): obj is SceneDataLayerProvider; interface DataLayerFilter { panelId: number; } interface SceneStatelessBehavior { (sceneObject: T): CancelActivationHandler | void; } type ControlsLayout = 'horizontal' | 'vertical'; interface UseStateHookOptions { /** * For some edge cases other scene objects want to subscribe to scene object state for objects * that are not active, or whose main React Component can be un-mounted. Set this to true * to keep the scene object active even if the React component is unmounted. * * Normally you would not need this but this can be useful in some edge cases. * * @experimental */ shouldActivateOrKeepAlive?: boolean; } interface SceneDataQuery extends DataQuery { [key: string]: any; timeRangeCompare?: boolean; } interface SceneUrlSyncOptions { /** * This will update the url to contain all scene url state * when the scene is initialized. Important for browser history "back" actions. */ updateUrlOnInit?: boolean; /** * This is only supported by some objects if they implement * shouldCreateHistoryStep where they can control what changes * url changes should add a new browser history entry. */ createBrowserHistorySteps?: boolean; /** * This will automatically prefix url search parameters when syncing. * Can be used to prevent collisions when multiple Scene apps are embedded in the page. */ namespace?: string; /** * When `namespace` is provided, this prevents some url search parameters to be automatically prefixed. * Defaults to the timerange parameters (["from", "to", "timezone"]) */ excludeFromNamespace?: string[]; } interface EmbeddedSceneState extends SceneObjectState { /** * The main content of the scene (usually a SceneFlexLayout) */ body: SceneObject; /** * Top row of variable selectors, filters, time pickers and custom actions. */ controls?: SceneObject[]; /** * For interoperability (used from EmbeddedSceneWithContext) */ context?: SceneObject; } declare class EmbeddedScene extends SceneObjectBase { static Component: typeof EmbeddedSceneRenderer; constructor(state: EmbeddedSceneState); } declare function EmbeddedSceneRenderer({ model }: SceneComponentProps): React__default.JSX.Element; interface SceneRouteMatch { params: Params; isExact: boolean; path: string; url: string; } interface SceneAppState extends SceneObjectState { pages: SceneAppPageLike[]; name?: string; urlSyncOptions?: SceneUrlSyncOptions; } interface SceneAppRoute { path: string; page?: SceneAppPageLike; drilldown?: SceneAppDrilldownView; } interface SceneAppPageState extends SceneObjectState { /** Page title or tab label */ title: string; /** Page subTitle */ subTitle?: string | React.ReactNode; /** * Customize title rendering. * Please return an unstyled h1 tag here + any additional elements you need. **/ renderTitle?: (title: string) => React.ReactNode; /** For an image before title */ titleImg?: string; /** For an icon before title or tab label */ titleIcon?: IconName; /** For a tab label suffix */ tabSuffix?: ComponentType<{ className?: string; }>; url: string; routePath: string; /** Array of scene object to be rendered at the top right of the page, inline with the page title */ controls?: SceneObject[]; hideFromBreadcrumbs?: boolean; tabs?: SceneAppPageLike[]; getScene?: (routeMatch: SceneRouteMatch) => EmbeddedScene; drilldowns?: SceneAppDrilldownView[]; getParentPage?: () => SceneAppPageLike; preserveUrlKeys?: string[]; /** * The current initialized scene, this is set by the framework after scene url initialization **/ initializedScene?: SceneObject; /** * Function that returns a fallback scene app page, * to be rendered when url does not match current page exactly or any of tabs or drilldowns. */ getFallbackPage?: () => SceneAppPageLike; layout?: PageLayoutType; } interface SceneAppPageLike extends SceneObject, DataRequestEnricher { initializeScene(scene: SceneObject): void; /** * @internal. Please don't call this from plugin code. * Will call the state.getScene function with the current routeMatch and will cache the resulting Scene using the routeMatch.url as key. */ getScene(routeMatch: SceneRouteMatch): EmbeddedScene; /** * @internal. Please don't call this from plugin code. * Get drilldown scene. Will call the drilldown.getPage function with the current routeMatch and will cache the resulting page using the routeMatch.url as key. */ getDrilldownPage(drilldown: SceneAppDrilldownView, routeMatch: SceneRouteMatch): SceneAppPageLike; } interface SceneAppDrilldownView { routePath: string; defaultRoute?: boolean; getPage: (routeMatch: SceneRouteMatch, parent: SceneAppPageLike) => SceneAppPageLike; } /** * * @param path Url to append query params to * @param searchObject Query params of the URL * @param preserveParams Query params to preserve * @returns Url with query params */ declare function getUrlWithAppState(path: string, searchObject: UrlQueryMap, preserveParams?: string[]): string; interface RuntimePanelPluginOptions { /** * Please specify a pluginId that is unlikely to collide with other plugins. */ pluginId: string; plugin: PanelPlugin; } /** * Provides a way to register runtime panel plugins. * Please use a pluginId that is unlikely to collide with other plugins. */ declare function registerRuntimePanelPlugin({ pluginId, plugin }: RuntimePanelPluginOptions): void; declare function cloneSceneObjectState(sceneState: TState, withState?: Partial): TState; declare abstract class RuntimeDataSource extends DataSourceApi { constructor(pluginId: string, uid: string); testDatasource(): Promise; } interface RuntimeDataSourceOptions { dataSource: RuntimeDataSource; } /** * Provides a way to register runtime panel plugins. * Please use a pluginId that is unlikely to collide with other plugins. */ declare function registerRuntimeDataSource({ dataSource }: RuntimeDataSourceOptions): void; interface UniqueUrlKeyMapperOptions { namespace?: string; excludeFromNamespace?: string[]; } /** * @param root * @returns the full scene url state as a object with keys and values */ declare function getUrlState(root: SceneObject, uniqueUrlKeyMapperOptions?: UniqueUrlKeyMapperOptions): SceneObjectUrlValues; /** * Exported util function to sync state from an initial url state. * Useful for initializing an embedded scenes with a url state string. */ declare function syncStateFromSearchParams(root: SceneObject, urlParams: URLSearchParams, uniqueUrlKeyMapperOptions?: UniqueUrlKeyMapperOptions): void; declare const PATH_ID_SEPARATOR = "$"; /** * Returns a unique path for a given VizPanel based on the panels peristance id and any local variable value contexts. * This is used to create a unique URL key identifiers for panels and repeated panels. */ declare function buildPathIdFor(panel: VizPanel): string; declare function isRepeatCloneOrChildOf(scene: SceneObject): boolean; interface FormatRegistryItem extends RegistryItem { formatter(value: VariableValue, args: string[], variable: FormatVariable, fieldPath?: string): string; } /** * Slimmed down version of the SceneVariable interface so that it only contains what the formatters actually use. * This is useful as we have some implementations of this interface that does not need to be full scene objects. * For example ScopedVarsVariable and LegacyVariableWrapper. */ interface FormatVariable { state: { name: string; type: VariableType | string; isMulti?: boolean; includeAll?: boolean; }; getValue(fieldPath?: string): VariableValue | undefined | null; getValueText?(fieldPath?: string): string; urlSync?: SceneObjectUrlSyncHandler; } declare const formatRegistry: Registry; interface MacroVariableConstructor { new (name: string, sceneObject: SceneObject, fullMatch: string, scopedVars?: ScopedVars): FormatVariable; } /** * Allows you to register a variable expression macro that can then be used in strings with syntax ${.} * Call this on app activation and unregister the macro on deactivation. * @param replace WARNING! If true, this will replace the existing macro with the same name. This is global and will affect all apps. Unregistering the macro will restore the original macro. * @returns a function that unregisters the macro */ declare function registerVariableMacro(name: string, macro: MacroVariableConstructor, replace?: boolean): () => void; declare function renderPrometheusLabelFilters(filters: AdHocVariableFilter[]): string; declare function escapeLabelValueInExactSelector(labelValue: string): string; declare function escapeLabelValueInRegexSelector(labelValue: string): string; /** * Get all queries in the scene that have the same datasource as provided source object */ declare function getQueriesForVariables(sourceObject: SceneObject): SceneDataQuery[]; declare function escapeUrlPipeDelimiters(value: string | undefined): string; declare function escapeURLDelimiters(value: string | undefined): string; declare class AdHocFiltersVariableUrlSyncHandler implements SceneObjectUrlSyncHandler { private _variable; constructor(_variable: AdHocFiltersVariable); private getKey; getKeys(): string[]; getUrlState(): SceneObjectUrlValues; updateFromUrl(values: SceneObjectUrlValues): void; } interface AdHocFiltersRecommendationsState extends SceneObjectState { recentFilters?: AdHocFilterWithLabels[]; recommendedFilters?: AdHocFilterWithLabels[]; recentGrouping?: Array>; recommendedGrouping?: Array>; datasourceSupportsRecommendations?: boolean; } declare class AdHocFiltersRecommendations extends SceneObjectBase { static Component: typeof AdHocFiltersRecommendationsRenderer; constructor(state?: Partial); get _adHocFilter(): AdHocFiltersVariable; private get _scopedVars(); private get _isGroupByEnabled(); private _activationHandler; private _reloadStoredFilters; private _reloadStoredGroupings; private _getFiltersStorageKey; private _getGroupingStorageKey; private _fetchRecommendedDrilldowns; private _verifyRecentFiltersApplicability; private _verifyRecentGroupingsApplicability; /** * Stores a recent filter in localStorage and updates state. * No-op for filters that are not yet complete (key/operator/value all set) */ storeRecentFilter(filter: AdHocFilterWithLabels): void; /** * Stores a recent grouping key in localStorage and updates state. * No-op when enableGroupBy is false or when the key is empty. */ storeRecentGrouping(groupByKey: string): void; addFilterToParent(filter: AdHocFilterWithLabels): void; addGroupByToParent(key: string): void; } declare function AdHocFiltersRecommendationsRenderer({ model }: SceneComponentProps): React__default.JSX.Element; interface AdHocFilterWithLabels = {}> extends AdHocVariableFilter { keyLabel?: string; valueLabels?: string[]; forceEdit?: boolean; hidden?: boolean; meta?: M; origin?: FilterOrigin; matchAllFilter?: boolean; readOnly?: boolean; restorable?: boolean; dismissedGroupBy?: boolean; nonApplicable?: boolean; nonApplicableReason?: string; } type AdHocControlsLayout = ControlsLayout | 'combobox'; type FilterOrigin = 'dashboard' | 'scope' | string; interface AdHocFiltersVariableState extends SceneVariableState { /** Optional text to display on the 'add filter' button */ addFilterButtonText?: string; /** Optional placeholder text for the filter input field */ inputPlaceholder?: string; /** Optional placeholder for the group-by key input */ groupByInputPlaceholder?: string; /** The visible filters */ filters: AdHocFilterWithLabels[]; /** Base filters to always apply when looking up keys*/ baseFilters?: AdHocFilterWithLabels[]; /** Filters originated from a source */ originFilters?: AdHocFilterWithLabels[]; /** Datasource to use for getTagKeys and getTagValues and also controls which scene queries the filters should apply to */ datasource: DataSourceRef | null; /** Controls if the filters can be changed */ readOnly?: boolean; /** * @experimental * Controls the layout and design of the label. * @deprecated The `layout` property is deprecated and scheduled for removal before grafana v14. * The `'horizontal'` and `'vertical'` options are no longer supported. * Use `'combobox'` instead or remove this property entirely. */ layout?: AdHocControlsLayout; /** * Defaults to automatic which means filters will automatically be applied to all queries with the same data source as this AdHocFilterSet. * In manual mode you either have to use the filters programmatically or as a variable inside query expressions. */ applyMode: 'auto' | 'manual'; /** * Filter out the keys that do not match the regex. */ tagKeyRegexFilter?: RegExp; /** * Extension hook for customizing the key lookup. * Return replace: true if you want to override the default lookup * Return replace: false if you want to combine the results with the default lookup */ getTagKeysProvider?: getTagKeysProvider$1; /** * Extension hook for customizing the group-by key lookup. * Return replace: true to override the default lookup (ds.getGroupByKeys or ds.getTagKeys). * Return replace: false to combine the results with the default lookup. */ getGroupByKeysProvider?: getGroupByKeysProvider; /** * Extension hook for customizing the value lookup. * Return replace: true if you want to override the default lookup. * Return replace: false if you want to combine the results with the default lookup */ getTagValuesProvider?: getTagValuesProvider; /** * Optionally provide an array of static keys that override getTagKeys */ defaultKeys?: MetricFindValue[]; /** * This is the expression that the filters resulted in. Defaults to * Prometheus / Loki compatible label filter expression */ filterExpression?: string; /** * The default builder creates a Prometheus/Loki compatible filter expression, * this can be overridden to create a different expression based on the current filters. */ expressionBuilder?: AdHocVariableExpressionBuilderFn; /** * Whether the filter supports new multi-value operators like =| and !=| */ supportsMultiValueOperators?: boolean; /** * When querying the datasource for label names and values to determine keys and values * for this ad hoc filter, consider the queries in the scene and use them as a filter. * This queries filter can be used to ensure that only ad hoc filter options that would * impact the current queries are presented to the user. */ useQueriesAsFilterForOptions?: boolean; /** * Flag that decides whether custom values can be added to the filter */ allowCustomValue?: boolean; /** * @internal state of the new filter being added */ _wip?: AdHocFilterWithLabels; /** * Allows custom formatting of a value before saving to filter state */ onAddCustomValue?: OnAddCustomValueFn; /** * state for checking whether drilldown applicability is enabled */ applicabilityEnabled?: boolean; /** * When true, enables a collapse button that appears when filters wrap to multiple lines. * Allows users to collapse the filter UI to save vertical space. */ collapsible?: boolean; /** * enables drilldown recommendations */ drilldownRecommendationsEnabled?: boolean; /** * When true, the "groupBy" operator is available and filters can be used as group-by dimensions. */ enableGroupBy?: boolean; } type AdHocVariableExpressionBuilderFn = (filters: AdHocFilterWithLabels[]) => string; type OnAddCustomValueFn = (item: SelectableValue & { isCustom?: boolean; }, filter: AdHocFilterWithLabels) => { value: string | undefined; valueLabels: string[]; }; type getTagKeysProvider$1 = (variable: AdHocFiltersVariable, currentKey: string | null, operators?: OperatorDefinition[]) => Promise<{ replace?: boolean; values: GetTagResponse | MetricFindValue[]; }>; type getTagValuesProvider = (variable: AdHocFiltersVariable, filter: AdHocFilterWithLabels) => Promise<{ replace?: boolean; values: GetTagResponse | MetricFindValue[]; }>; type getGroupByKeysProvider = (variable: AdHocFiltersVariable, currentKey?: string | null) => Promise<{ replace?: boolean; values: GetTagResponse | MetricFindValue[]; }>; type OperatorDefinition = { value: string; description?: string; isMulti?: Boolean; isRegex?: Boolean; }; declare const OPERATORS: OperatorDefinition[]; declare class AdHocFiltersVariable extends SceneObjectBase implements SceneVariable { static Component: typeof AdHocFiltersVariableRenderer; private _scopedVars; private _dataSourceSrv; private _originalValues; private _prevScopes; /** Needed for scopes dependency */ protected _variableDependency: VariableDependencyConfig; protected _urlSync: AdHocFiltersVariableUrlSyncHandler; private _debouncedVerifyApplicability; private _recommendations; constructor(state: Partial); private _activationHandler; getRecommendations(): AdHocFiltersRecommendations | undefined; private _updateScopesFilters; private verifyApplicabilityAndStoreRecentFilter; setState(update: Partial): void; private _resolveOriginFlags; validateOriginFilters(filters: AdHocFilterWithLabels[]): AdHocFilterWithLabels[]; /** * Updates the variable's `filters` and `filterExpression` state. * If `skipPublish` option is true, this will not emit the `SceneVariableValueChangedEvent`, * allowing consumers to update the filters without triggering dependent data providers. */ updateFilters(filters: AdHocFilterWithLabels[], options?: { skipPublish?: boolean; forcePublish?: boolean; }): void; /** * Add a group-by filter (key only, operator 'groupBy', no value). * No-op when enableGroupBy is false. */ _addGroupByFilter(item: SelectableValue): void; restoreOriginalFilter(filter: AdHocFilterWithLabels): void; /** * Get the original value for an origin filter before any user modifications. * Returns undefined if no original is tracked for this filter. */ getOriginalValue(filter: AdHocFilterWithLabels): { value: string[]; operator: string; valueLabels?: string[]; keyLabel?: string; } | undefined; /** * Store a snapshot of the filter's current value and operator so it can be restored later. */ private _setOriginalValue; /** * Get original filters from original values. * Returns filters from _originalValues map. */ getOriginalFilters(): AdHocFilterWithLabels[]; /** * Replace all stored original values from the given filters array. */ setOriginalFilters(filters: AdHocFilterWithLabels[]): void; /** * Whether the groupBy state has diverged from defaults (any dismissed or user-added groupBys). */ isGroupByRestorable(): boolean; /** * Restore all original group by filters. */ restoreOriginalGroupBy(): void; /** * Clear all user-added filters and restore origin filters to their original values. */ clearAll(): void; getValue(fieldPath?: string): VariableValue | undefined; _updateFilter(filter: AdHocFilterWithLabels, update: Partial): void; updateToMatchAll(filter: AdHocFilterWithLabels): void; _removeFilter(filter: AdHocFilterWithLabels): void; _removeLastFilter(): void; _handleComboboxBackspace(filter: AdHocFilterWithLabels): void; getFiltersApplicabilityForQueries(filters: AdHocFilterWithLabels[], queries: SceneDataQuery[], groupByKeys?: string[]): Promise; _verifyApplicability(): Promise; /** * Get possible keys given current filters. Do not call from plugins directly */ _getKeys(currentKey: string | null): Promise>>; /** * Get possible group-by keys. * @param currentKey - The current key being edited (excluded from filters) * @param queries - Optional queries to scope the key lookup. When provided, these are used * instead of discovering all queries in the scene via getQueriesForVariables. */ _getGroupByKeys(currentKey: string | null, queries?: SceneDataQuery[]): Promise>>; /** * Get possible key values for a specific key given current filters. Do not call from plugins directly */ _getValuesFor(filter: AdHocFilterWithLabels): Promise>>; _addWip(): void; _getOperators(): SelectableValue[]; } declare function AdHocFiltersVariableRenderer({ model }: SceneComponentProps): React__default.JSX.Element; declare const GROUP_BY_OPERATOR = "groupBy"; declare function isGroupByFilter(filter: AdHocFilterWithLabels): boolean; interface ConstantVariableState extends SceneVariableState { value: VariableValue; } declare class ConstantVariable extends SceneObjectBase implements SceneVariable { protected _variableDependency: VariableDependencyConfig; private _prevValue; constructor(initialState: Partial); /** * This function is called on when SceneVariableSet is activated or when a dependency changes. */ validateAndUpdate(): Observable; getValue(): VariableValue; } interface MultiValueVariableState extends SceneVariableState { value: VariableValue; text: VariableValue; options: VariableValueOption[]; allowCustomValue?: boolean; isMulti?: boolean; includeAll?: boolean; defaultToAll?: boolean; allValue?: string; placeholder?: string; /** * For multi value variables, this option controls how many values to show before they are collapsed into +N. * Defaults to 5 */ maxVisibleValues?: number; noValueOnClear?: boolean; isReadOnly?: boolean; } interface VariableGetOptionsArgs { searchFilter?: string; } declare abstract class MultiValueVariable extends SceneObjectBase implements SceneVariable { private static fieldAccessorCache; protected _urlSync: SceneObjectUrlSyncHandler; /** * Set to true to skip next value validation to maintain the current value even it it's not among the options (ie valid values) */ skipNextValidation?: boolean; /** * The source of value options. */ abstract getValueOptions(args: VariableGetOptionsArgs): Observable; /** * This function is called on when SceneVariableSet is activated or when a dependency changes. */ validateAndUpdate(): Observable; onCancel(): void; /** * Check if current value is valid given new options. If not update the value. */ private updateValueGivenNewOptions; private getStateUpdateGivenNewOptions; /** * Values set by initial URL sync needs to survive the next validation and update. * This function can intercept and make sure those values are preserved. */ protected interceptStateUpdateAfterValidation(stateUpdate: Partial): void; getValue(fieldPath?: string): VariableValue; getValueText(fieldPath?: string): string; private getFieldAtPath; private getFieldAccessor; hasAllValue(): boolean; getDefaultMultiState(options: VariableValueOption[]): { value: string[]; text: string[]; properties?: undefined; } | { value: VariableValueSingle[]; text: string[]; properties: (VariableValueOptionProperties | undefined)[]; }; protected getDefaultSingleState(options: VariableValueOption[]): VariableValueOption; /** * Change the value and publish SceneVariableValueChangedEvent event. */ changeValueTo(value: VariableValue, text?: VariableValue, isUserAction?: boolean): void; private findLabelTextForValue; /** * This helper function is to counter the contravariance of setState */ private setStateHelper; getOptionsForSelect(includeCurrentValue?: boolean): VariableValueOption[]; refreshOptions(): void; /** * Can be used by subclasses to do custom handling of option search based on search input */ onSearchChange?(searchFilter: string): void; } interface CustomVariableState extends MultiValueVariableState { query: string; valuesFormat?: 'csv' | 'json'; } declare class CustomVariable extends MultiValueVariable { protected _variableDependency: VariableDependencyConfig; constructor(initialState: Partial); transformCsvStringToOptions(str: string, interpolate?: boolean): VariableValueOption[]; transformJsonToOptions(json: string): VariableValueOption[]; getValueOptions(args: VariableGetOptionsArgs): Observable; static Component: ({ model }: SceneComponentProps) => React__default.JSX.Element; } interface DataSourceVariableState extends MultiValueVariableState { /** * Include all data source instances with this plugin id */ pluginId: string; /** * Filter data source instances based on name */ regex: string; /** * For backwards compatability with old dashboards, will likely be removed */ defaultOptionEnabled?: boolean; } declare class DataSourceVariable extends MultiValueVariable { protected _variableDependency: VariableDependencyConfig; constructor(initialState: Partial); getValueOptions(args: VariableGetOptionsArgs): Observable; static Component: ({ model }: SceneComponentProps) => React__default.JSX.Element; } interface IntervalVariableState extends SceneVariableState { intervals: string[]; value: string; autoEnabled: boolean; autoMinInterval: string; autoStepCount: number; refresh: VariableRefresh; } declare class IntervalVariable extends SceneObjectBase implements SceneVariable { constructor(initialState: Partial); private getKey; getUrlState(): { [x: string]: string; }; updateFromUrl(values: SceneObjectUrlValues): void; getOptionsForSelect(): Array>; getValue(): VariableValue; private getAutoRefreshInteval; _onChange: (value: SelectableValue) => void; validateAndUpdate(): Observable; static Component: ({ model }: SceneComponentProps) => React__default.JSX.Element; } interface TextBoxVariableState extends SceneVariableState { value: string; } declare class TextBoxVariable extends SceneObjectBase implements SceneVariable { constructor(initialState: Partial); getValue(): VariableValue; setValue(newValue: string): void; private getKey; getKeys(): string[]; getUrlState(): { [x: string]: string; }; updateFromUrl(values: SceneObjectUrlValues): void; static Component: ({ model }: SceneComponentProps) => React__default.JSX.Element; } interface QueryVariableState extends MultiValueVariableState { type: 'query'; datasource: DataSourceRef | null; query: string | SceneDataQuery; regex: string; regexApplyTo: VariableRegexApplyTo; refresh: VariableRefresh$1; sort: VariableSort; staticOptions?: VariableValueOption[]; staticOptionsOrder?: 'before' | 'after' | 'sorted'; /** @internal Only for use inside core dashboards */ definition?: string; } declare class QueryVariable extends MultiValueVariable { protected _variableDependency: VariableDependencyConfig; constructor(initialState: Partial); getValueOptions(args: VariableGetOptionsArgs): Observable; private getRequest; onSearchChange: (searchFilter: string) => void; private _updateOptionsBasedOnSearchFilter; static Component: ({ model }: SceneComponentProps) => React__default.JSX.Element; } interface GroupByRecommendationsState extends SceneObjectState { recentGrouping?: Array>; recommendedGrouping?: Array>; datasourceSupportsRecommendations?: boolean; } declare class GroupByRecommendations extends SceneObjectBase { static Component: typeof GroupByRecommendationsRenderer; constructor(state?: Partial); private get _groupBy(); private get _scopedVars(); private _activationHandler; private _getStorageKey; private _fetchRecommendedDrilldowns; private _verifyRecentGroupingsApplicability; /** * Stores recent groupings in localStorage and updates state. * Should be called by the parent variable when a grouping is added/updated. */ storeRecentGrouping(applicableValues: string[]): void; /** * Add a grouping value to the parent variable */ addValueToParent(newValue: VariableValueSingle, newText?: string): void; } declare function GroupByRecommendationsRenderer({ model }: SceneComponentProps): React__default.JSX.Element; interface GroupByVariableState extends MultiValueVariableState { /** Defaults to "Group" */ name: string; /** The visible keys to group on */ defaultOptions?: MetricFindValue[]; /** Base filters to always apply when looking up keys */ baseFilters?: AdHocVariableFilter[]; /** Datasource to use for getTagKeys and also controls which scene queries the group by should apply to */ datasource: DataSourceRef | null; /** Default value set for this groupBy. When this field is set, changing value will allow the user to restore back to this default value */ defaultValue?: { text: VariableValue; value: VariableValue; }; /** Needed for url sync when passing flag to another dashboard */ restorable?: boolean; /** Controls if the group by can be changed */ readOnly?: boolean; /** * @experimental * Controls the layout and design of the label. * Vertical layout does not yet support operator selector. */ layout?: ControlsLayout; /** * Defaults to same-datasource which means group by will automatically be applied to all queries with the same data source as this GroupBySet. * In manual mode no queries are re-run on changes, and you have to manually apply the filter to whatever queries you want. */ applyMode?: 'auto' | 'manual'; /** * Filter out the keys that do not match the regex. */ tagKeyRegexFilter?: RegExp; /** * Extension hook for customizing the key lookup. * Return replace: true if you want to override the default lookup * Return replace: false if you want to combine the results with the default lookup */ getTagKeysProvider?: getTagKeysProvider; /** * Holds the applicability for each of the selected keys */ keysApplicability?: DrilldownsApplicability[]; /** * state for checking whether drilldown applicability is enabled */ applicabilityEnabled?: boolean; /** * enables drilldown recommendations */ drilldownRecommendationsEnabled?: boolean; } type getTagKeysProvider = (set: GroupByVariable, currentKey: string | null) => Promise<{ replace?: boolean; values: MetricFindValue[] | GetTagResponse; }>; declare class GroupByVariable extends MultiValueVariable { static Component: typeof GroupByVariableRenderer; isLazy: boolean; protected _urlSync: SceneObjectUrlSyncHandler; private _scopedVars; private _recommendations; validateAndUpdate(): Observable; private _updateValueGivenNewOptions; getValueOptions(args: VariableGetOptionsArgs): Observable; constructor(initialState: Partial); private _activationHandler; /** * Gets the GroupByRecommendations behavior if it exists in $behaviors */ getRecommendations(): GroupByRecommendations | undefined; getApplicableKeys(): string[]; getGroupByApplicabilityForQueries(value: VariableValue, queries: SceneDataQuery[]): Promise; _verifyApplicability(): Promise; checkIfRestorable(values: VariableValue): boolean; restoreDefaultValues(): void; /** * Get possible keys given current filters. Do not call from plugins directly. * @param ds - The datasource to use for fetching keys * @param queries - Optional queries to scope the key lookup. When provided, these are used * instead of discovering all queries in the scene via getQueriesForVariables. */ _getKeys: (ds: DataSourceApi, queries?: SceneDataQuery[]) => Promise; _verifyApplicabilityAndStoreRecentGrouping(): Promise; /** * Allows clearing the value of the variable to an empty value. Overrides default behavior of a MultiValueVariable */ getDefaultMultiState(options: VariableValueOption[]): { value: never[]; text: never[]; }; } declare function GroupByVariableRenderer({ model }: SceneComponentProps): React__default.JSX.Element; interface SwitchVariableState extends SceneVariableState { value: string; enabledValue: string; disabledValue: string; } declare class SwitchVariable extends SceneObjectBase implements SceneVariable { static Component: typeof SwitchVariableRenderer; private _prevValue; constructor(initialState: Partial); /** * This function is called on when SceneVariableSet is activated or when a dependency changes. */ validateAndUpdate(): Observable; setValue(newValue: string): void; getValue(): VariableValue; isEnabled(): boolean; isDisabled(): boolean; private getKey; getKeys(): string[]; getUrlState(): SceneObjectUrlValues; updateFromUrl(values: SceneObjectUrlValues): void; } declare function SwitchVariableRenderer({ model }: SceneComponentProps): React__default.JSX.Element; declare function isAdHocVariable(variable: SceneVariable): variable is AdHocFiltersVariable; declare function isConstantVariable(variable: SceneVariable): variable is ConstantVariable; declare function isCustomVariable(variable: SceneVariable): variable is CustomVariable; declare function isDataSourceVariable(variable: SceneVariable): variable is DataSourceVariable; declare function isIntervalVariable(variable: SceneVariable): variable is IntervalVariable; declare function isQueryVariable(variable: SceneVariable): variable is QueryVariable; declare function isTextBoxVariable(variable: SceneVariable): variable is TextBoxVariable; declare function isGroupByVariable(variable: SceneVariable): variable is GroupByVariable; declare function isSwitchVariable(variable: SceneVariable): variable is SwitchVariable; interface SceneObjectStateChangedPayload { prevState: TState; newState: TState; partialUpdate: Partial; changedObject: SceneObject; } declare class SceneObjectStateChangedEvent extends BusEventWithPayload { static readonly type = "scene-object-state-change"; } type UserActionEventType = 'panel-description-shown' | 'panel-status-message-clicked' | 'panel-cancel-query-clicked' | 'panel-menu-shown'; interface UserActionEventPayload { origin: SceneObject; interaction: UserActionEventType; } declare class UserActionEvent extends BusEventWithPayload { static readonly type = "scene-object-user-action"; } /** * Will walk the scene object graph up to the root looking for the first variable with the specified name */ declare function lookupVariable(name: string, sceneObject: SceneObject): SceneVariable | null; /** * Returns the closest query controller undefined if none found */ declare function getQueryController(sceneObject: SceneObject): SceneQueryControllerLike | undefined; /** * Will walk up the scene object graph to the closest $timeRange scene object */ declare function getTimeRange(sceneObject: SceneObject): SceneTimeRangeLike; interface UrlSyncManagerLike { initSync(root: SceneObject): void; cleanUp(root: SceneObject): void; handleNewLocation(location: Location): void; handleNewObject(sceneObj: SceneObject): void; } /** * Notify the url sync manager of a new object that has been added to the scene * that needs to init state from URL. */ declare class NewSceneObjectAddedEvent extends BusEventWithPayload { static readonly type = "new-scene-object-added"; } declare class UrlSyncManager implements UrlSyncManagerLike { private _urlKeyMapper; private _lastSyncedObjectKeys; private _sceneRoot?; private _subs; private _lastLocation; private _locationService; private _paramsCache; private _options; constructor(_options?: SceneUrlSyncOptions, locationService?: LocationService); /** * Updates the current scene state to match URL state. */ initSync(root: SceneObject): void; cleanUp(root: SceneObject): void; handleNewLocation(location: Location): void; handleNewObject(sceneObj: SceneObject): void; private handleSceneObjectStateChanged; getUrlState(root: SceneObject): SceneObjectUrlValues; private cacheObjectUrlKeys; } /** * Get the closest node with variables */ declare function getVariables(sceneObject: SceneObject): SceneVariables; /** * Will walk up the scene object graph to the closest $data scene object */ declare function getData(sceneObject: SceneObject): SceneDataProvider; /** * Will walk up the scene object graph to the closest $layout scene object */ declare function getLayout(scene: SceneObject): SceneLayout | null; /** * Interpolates the given string using the current scene object as context. * * * Note: the interpolations array will be mutated by adding information about variables that * have been interpolated during replacement. Variables that were specified in the target but not found in * the list of available variables are also added to the array. See {@link VariableInterpolation} for more details. * * @param {VariableInterpolation[]} interpolations an optional array that is updated with interpolated variables. */ declare function interpolate(sceneObject: SceneObject, value: string | undefined | null, scopedVars?: ScopedVars, format?: string | VariableCustomFormatterFn, interpolations?: VariableInterpolation[]): string; /** * Checks if the variable is currently loading or waiting to update. * It also returns true if a dependency of the variable is loading. * * For example if C depends on variable B which depends on variable A and A is loading this returns true for variable C and B. */ declare function hasVariableDependencyInLoadingState(sceneObject: SceneObject): boolean; /** * Returns a scene object from the scene graph with the requested key. * * Throws error if no key-matching scene object found. */ declare function findByKey(sceneObject: SceneObject, key: string): SceneObject; /** * Returns a scene object from the scene graph with the requested key and type. * * Throws error if no key-matching scene object found. * Throws error if the given type does not match. */ declare function findByKeyAndType(sceneObject: SceneObject, key: string, targetType: { new (...args: never[]): TargetType; }): TargetType; /** * This will search the full scene graph, starting with the scene node passed in, then walking up the parent chain. * */ declare function findObject(scene: SceneObject, check: (obj: SceneObject) => boolean): SceneObject | null; /** * This will search down the full scene graph, looking for objects that match the provided predicate. */ declare function findAllObjects(scene: SceneObject, check: (obj: SceneObject) => boolean): SceneObject[]; /** * Will walk up the scene object graph up until the root and collect all SceneDataLayerProvider objects. * When localOnly set to true, it will only collect the closest layers. */ declare function getDataLayers(sceneObject: SceneObject, localOnly?: boolean): SceneDataLayerProvider[]; interface SceneType extends Function { new (...args: never[]): T; } /** * A utility function to find the closest ancestor of a given type. This function expects * to find it and will throw an error if it does not. */ declare function getAncestor(sceneObject: SceneObject, ancestorType: SceneType): ParentType; /** * This will search down the full scene graph, looking for objects that match the provided descendentType type. */ declare function findDescendents(scene: SceneObject, descendentType: SceneType): T[]; /** * Will return the scopes from the scopes variable if available. */ declare function getScopes(sceneObject: SceneObject): Scope[] | undefined; declare const sceneGraph: { getVariables: typeof getVariables; getData: typeof getData; getTimeRange: typeof getTimeRange; getLayout: typeof getLayout; getDataLayers: typeof getDataLayers; interpolate: typeof interpolate; lookupVariable: typeof lookupVariable; hasVariableDependencyInLoadingState: typeof hasVariableDependencyInLoadingState; findByKey: typeof findByKey; findByKeyAndType: typeof findByKeyAndType; findObject: typeof findObject; findAllObjects: typeof findAllObjects; getAncestor: typeof getAncestor; getQueryController: typeof getQueryController; findDescendents: typeof findDescendents; getScopes: typeof getScopes; }; /** Walks up the scene graph, returning the first non-undefined result of `extract` */ declare function getClosest(sceneObject: SceneObject, extract: (s: SceneObject) => T | undefined): T | undefined; interface ActWhenVariableChangedState extends SceneObjectState { variableName: string; /** * The handler to run when a variable changes. * @param variable The variable that changed * @param behavior The behavior instance where this onChange handler added to. * You can use this to access the parent SceneObject where this behavior exists. * You can also use this with the sceneGraph util functions to find objects from this scene graph location. * @returns Return a cancellation function if you do anything async like issue a query. */ onChange: (variable: SceneVariable, behavior: ActWhenVariableChanged) => (() => void) | void; } /** * This behavior will run an effect function when specified variables change */ declare class ActWhenVariableChanged extends SceneObjectBase { private _runningEffect; protected _variableDependency: VariableDependencyConfig; private _onVariableChanged; } interface CursorSyncState extends SceneObjectState { sync: DashboardCursorSync; } /** * This behavior will provide a cursor sync context within a scene. */ declare class CursorSync extends SceneObjectBase { constructor(state: Partial); getEventsBus: (panel: SceneObject) => PanelContextEventBus; getEventsScope(): string; } declare class PanelContextEventBus implements EventBus { private _source; private _eventsOrigin; constructor(_source: SceneObject, _eventsOrigin: SceneObject); publish(event: T): void; getStream(eventType: BusEventType): Observable; subscribe(eventType: BusEventType, handler: BusEventHandler): Unsubscribable; removeAllListeners(): void; newScopedBus(key: string, filter: EventFilterOptions): EventBus; } interface PanelProfilingConfig { watchStateKey?: string; } /** * SceneRenderProfiler tracks dashboard interaction performance including: * - Total interaction duration * - Network time * - Long frame detection (50ms threshold) during interaction using LoAF API (default) or manual tracking (fallback) * - Slow frame detection (30ms threshold) for tail recording after interaction * * Long frame detection during interaction: * - 50ms threshold aligned with LoAF API default * - LoAF API preferred (Chrome 123+) with manual fallback * - Provides script attribution when using LoAF API * * Slow frame detection for tail recording: * - 30ms threshold for post-interaction monitoring * - Manual frame timing measurement * - Captures rendering delays after user interaction completes */ declare class SceneRenderProfiler { #private; private metadata; private _panelProfilingManager?; private queryController?; constructor(panelProfilingConfig?: PanelProfilingConfig); /** Set generic metadata for observer notifications */ setMetadata(metadata: Record): void; setQueryController(queryController: SceneQueryControllerLike): void; /** Attach panel profiling to a scene object */ attachPanelProfiling(sceneObject: SceneObject): void; /** Attach profiler to a specific panel */ attachProfilerToPanel(panel: VizPanel): void; setInteractionCompleteHandler(handler?: (event: SceneComponentInteractionEvent) => void): void; private setupVisibilityChangeHandler; cleanup(): void; startProfile(name: string): void; startInteraction(interaction: string): void; stopInteraction(): void; getCurrentInteraction(): string | null; /** * Start new performance profile * @param name - Profile trigger (e.g., 'time_range_change') * @param force - True if canceling existing profile, false if starting clean */ private _startNewProfile; private recordProfileTail; private measureTrailingFrames; tryCompletingProfile(): void; isTailRecording(): boolean; cancelTailRecording(): void; cancelProfile(): void; addCrumb(crumb: string): void; } declare class SceneQueryController extends SceneObjectBase implements SceneQueryControllerLike { #private; private profiler?; isQueryController: true; constructor(state?: Partial, profiler?: SceneRenderProfiler | undefined); runningQueriesCount: () => number; startProfile(name: string): void; cancelProfile(): void; queryStarted(entry: SceneQueryControllerEntry): void; queryCompleted(entry: SceneQueryControllerEntry): void; private changeRunningQueryCount; cancelAll(): void; } declare class SceneInteractionTracker extends SceneObjectBase { private renderProfiler?; isInteractionTracker: true; constructor(state?: Partial, renderProfiler?: SceneRenderProfiler | undefined); startInteraction(name: string): void; stopInteraction(): void; } interface LiveNowTimerState extends SceneObjectState { enabled: boolean; } declare class LiveNowTimer extends SceneObjectBase { private timerId; private static REFRESH_RATE; constructor({ enabled }: { enabled?: boolean | undefined; }); private _activationHandler; enable(): void; disable(): void; get isEnabled(): boolean; } type index$2_ActWhenVariableChanged = ActWhenVariableChanged; declare const index$2_ActWhenVariableChanged: typeof ActWhenVariableChanged; type index$2_CursorSync = CursorSync; declare const index$2_CursorSync: typeof CursorSync; type index$2_LiveNowTimer = LiveNowTimer; declare const index$2_LiveNowTimer: typeof LiveNowTimer; type index$2_SceneInteractionTracker = SceneInteractionTracker; declare const index$2_SceneInteractionTracker: typeof SceneInteractionTracker; type index$2_SceneQueryController = SceneQueryController; declare const index$2_SceneQueryController: typeof SceneQueryController; declare namespace index$2 { export { index$2_ActWhenVariableChanged as ActWhenVariableChanged, index$2_CursorSync as CursorSync, index$2_LiveNowTimer as LiveNowTimer, index$2_SceneInteractionTracker as SceneInteractionTracker, index$2_SceneQueryController as SceneQueryController, }; } /** Base interface for all performance events */ interface BasePerformanceEvent { operationId: string; timestamp: number; duration?: number; error?: string; } interface DashboardInteractionStartData extends BasePerformanceEvent { interactionType: string; metadata?: Record; } interface DashboardInteractionMilestoneData extends BasePerformanceEvent { interactionType: string; milestone: string; metadata?: Record; } interface DashboardInteractionCompleteData extends BasePerformanceEvent { interactionType: string; networkDuration?: number; longFramesCount: number; longFramesTotalTime: number; metadata?: Record; } /** Metadata interface for transform operations */ interface TransformMetadata { transformationId: string; transformationCount: number; seriesTransformationCount: number; annotationTransformationCount: number; success?: boolean; error?: string; } /** Metadata interface for query operations */ interface QueryMetadata { queryId: string; queryType: string; } /** Metadata interface for render operations */ interface RenderMetadata { } /** Metadata interface for plugin load operations */ interface PluginLoadMetadata { pluginId: string; fromCache?: boolean; pluginLoadTime?: number; } /** Metadata interface for field config operations */ interface FieldConfigMetadata { } /** Base interface for panel performance events */ interface BasePanelPerformanceData extends BasePerformanceEvent { panelId: string; panelKey: string; pluginId: string; pluginVersion?: string; panelTitle?: string; } /** Transform operation performance data */ interface PanelTransformPerformanceData extends BasePanelPerformanceData { operation: 'transform'; metadata: TransformMetadata; } /** Query operation performance data */ interface PanelQueryPerformanceData extends BasePanelPerformanceData { operation: 'query'; metadata: QueryMetadata; } /** Render operation performance data */ interface PanelRenderPerformanceData extends BasePanelPerformanceData { operation: 'render'; metadata: RenderMetadata; } /** Plugin load operation performance data */ interface PanelPluginLoadPerformanceData extends BasePanelPerformanceData { operation: 'plugin-load'; metadata: PluginLoadMetadata; } /** Field config operation performance data */ interface PanelFieldConfigPerformanceData extends BasePanelPerformanceData { operation: 'fieldConfig'; metadata: FieldConfigMetadata; } /** Discriminated union of all panel performance data types */ type PanelPerformanceData = PanelTransformPerformanceData | PanelQueryPerformanceData | PanelRenderPerformanceData | PanelPluginLoadPerformanceData | PanelFieldConfigPerformanceData; /** Non-panel query performance data for dashboard queries (annotations, variables, etc.) */ interface QueryPerformanceData extends BasePerformanceEvent { queryId: string; queryType: string; origin: string; } /** * Observer interface for performance monitoring * External systems implement this to receive performance notifications */ interface ScenePerformanceObserver { onDashboardInteractionStart?(data: DashboardInteractionStartData): void; onDashboardInteractionMilestone?(data: DashboardInteractionMilestoneData): void; onDashboardInteractionComplete?(data: DashboardInteractionCompleteData): void; onPanelOperationStart?(data: PanelPerformanceData): void; onPanelOperationComplete?(data: PanelPerformanceData): void; onQueryStart?(data: QueryPerformanceData): void; onQueryComplete?(data: QueryPerformanceData): void; } /** * Centralized performance tracker * Manages observers and provides methods for scene objects to report performance events */ declare class ScenePerformanceTracker { private static instance; private observers; static getInstance(): ScenePerformanceTracker; /** * Register a performance observer */ addObserver(observer: ScenePerformanceObserver): () => void; /** * Remove all observers (for testing) */ clearObservers(): void; /** * Get current observer count (for debugging) */ getObserverCount(): number; private notifyObservers; notifyDashboardInteractionStart(data: DashboardInteractionStartData): void; notifyDashboardInteractionMilestone(data: DashboardInteractionMilestoneData): void; notifyDashboardInteractionComplete(data: DashboardInteractionCompleteData): void; notifyPanelOperationStart(data: PanelPerformanceData): void; notifyPanelOperationComplete(data: PanelPerformanceData): void; notifyQueryStart(data: QueryPerformanceData): void; notifyQueryComplete(data: QueryPerformanceData): void; } /** * Get the global performance tracker instance */ declare function getScenePerformanceTracker(): ScenePerformanceTracker; type index$1_DashboardInteractionCompleteData = DashboardInteractionCompleteData; type index$1_DashboardInteractionMilestoneData = DashboardInteractionMilestoneData; type index$1_DashboardInteractionStartData = DashboardInteractionStartData; type index$1_PanelPerformanceData = PanelPerformanceData; type index$1_QueryPerformanceData = QueryPerformanceData; type index$1_ScenePerformanceObserver = ScenePerformanceObserver; type index$1_SceneRenderProfiler = SceneRenderProfiler; declare const index$1_SceneRenderProfiler: typeof SceneRenderProfiler; declare const index$1_getScenePerformanceTracker: typeof getScenePerformanceTracker; declare namespace index$1 { export { index$1_SceneRenderProfiler as SceneRenderProfiler, index$1_getScenePerformanceTracker as getScenePerformanceTracker }; export type { index$1_DashboardInteractionCompleteData as DashboardInteractionCompleteData, index$1_DashboardInteractionMilestoneData as DashboardInteractionMilestoneData, index$1_DashboardInteractionStartData as DashboardInteractionStartData, index$1_PanelPerformanceData as PanelPerformanceData, index$1_QueryPerformanceData as QueryPerformanceData, index$1_ScenePerformanceObserver as ScenePerformanceObserver }; } declare function writePerformanceLog(logger: string, message: string, ...rest: unknown[]): void; /** * Base class for data layer. Handles common implementation including enabling/disabling layer and publishing results. */ declare abstract class SceneDataLayerBase extends SceneObjectBase implements SceneDataLayerProvider { /** * Subscription to query results. Should be set when layer runs a query. */ protected querySub?: Unsubscribable; /** * Subject to emit results to. */ private _results; /** * Implement logic for enabling the layer. This is called when layer is enabled or when layer is enabled when activated. * Use i.e. to setup subscriptions that will trigger layer updates. */ abstract onEnable(): void; /** * Implement logic for disabling the layer. This is called when layer is disabled. * Use i.e. to unsubscribe from subscriptions that trigger layer updates. */ abstract onDisable(): void; /** * Implement logic running the layer and setting up the querySub subscription. */ protected abstract runLayer(): void; /** * Mark data provider as data layer */ isDataLayer: true; private _variableValueRecorder; protected _variableDependency: VariableDependencyConfig; /** * For variables support in data layer provide variableDependencyStatePaths with keys of the state to be scanned for variables. */ constructor(initialState: T, variableDependencyStatePaths?: Array); protected onActivate(): CancelActivationHandler; protected onDeactivate(): void; protected onVariableUpdateCompleted(): void; cancelQuery(): void; protected publishResults(data: PanelData): void; getResultsStream(): ReplaySubject; private shouldRunLayerOnActivate; /** * This helper function is to counter the contravariance of setState */ private setStateHelper; } interface AnnotationQueryResults { state: LoadingState; events: AnnotationEvent[]; } interface AnnotationsDataLayerState extends SceneDataLayerProviderState { query: AnnotationQuery; } declare class AnnotationsDataLayer extends SceneDataLayerBase implements SceneDataLayerProvider { static Component: typeof AnnotationsDataLayerRenderer; private _scopedVars; private _timeRangeSub; private _drilldownDependenciesManager; constructor(initialState: AnnotationsDataLayerState); onEnable(): void; onDisable(): void; runLayer(): void; private runWithTimeRange; protected resolveDataSource(query: AnnotationQuery): Promise<_grafana_data.DataSourceApi<_grafana_data.DataQuery, _grafana_data.DataSourceJsonData, {}>>; protected processEvents(query: AnnotationQuery, events: AnnotationQueryResults): PanelData; } declare function AnnotationsDataLayerRenderer({ model }: SceneComponentProps): React__default.JSX.Element | null; type index_AnnotationsDataLayer = AnnotationsDataLayer; declare const index_AnnotationsDataLayer: typeof AnnotationsDataLayer; declare namespace index { export { index_AnnotationsDataLayer as AnnotationsDataLayer, }; } interface SceneDataNodeState extends SceneDataState { data: PanelData; } declare class SceneDataNode extends SceneObjectBase implements SceneDataProvider { constructor(state?: Partial); getResultsStream(): rxjs.Observable; } interface SceneObjectUrlSyncConfigOptions { keys: string[] | (() => string[]); } declare class SceneObjectUrlSyncConfig implements SceneObjectUrlSyncHandler { private _sceneObject; private _keys; private _nextChangeShouldAddHistoryStep; constructor(_sceneObject: SceneObjectWithUrlSync, _options: SceneObjectUrlSyncConfigOptions); getKeys(): string[]; getUrlState(): SceneObjectUrlValues; updateFromUrl(values: SceneObjectUrlValues): void; shouldCreateHistoryStep(values: SceneObjectUrlValues): boolean; performBrowserHistoryAction(callback: () => void): void; } declare class SceneTimeRange extends SceneObjectBase implements SceneTimeRangeLike { protected _urlSync: SceneObjectUrlSyncConfig; constructor(state?: Partial); private _onActivate; private refreshIfStale; /** * Will traverse up the scene graph to find the closest SceneTimeRangeLike with time zone set */ private getTimeZoneSource; /** * Refreshes time range if it is older than the invalidation interval * @param refreshAfterMs invalidation interval (milliseconds) * @private */ private refreshRange; private calculatePercentOfInterval; getTimeZone(): TimeZone; onTimeRangeChange: (timeRange: TimeRange) => void; onTimeZoneChange: (timeZone: TimeZone) => void; onRefresh: () => void; getUrlState(): SceneObjectUrlValues; updateFromUrl(values: SceneObjectUrlValues): void; } /** * @internal * Used by SceneTimeZoneOverride and main repo PanelTimeRange. * Not recommened to be used by plugins directly. */ declare abstract class SceneTimeRangeTransformerBase extends SceneObjectBase implements SceneTimeRangeLike { constructor(state: T); protected getAncestorTimeRange(): SceneTimeRangeLike; private _activationHandler; protected abstract ancestorTimeRangeChanged(timeRange: SceneTimeRangeState): void; getTimeZone(): TimeZone; onTimeRangeChange(timeRange: TimeRange): void; onTimeZoneChange(timeZone: string): void; onRefresh(): void; } interface SceneTimeZoneOverrideState extends SceneTimeRangeState { timeZone: TimeZone; } declare class SceneTimeZoneOverride extends SceneTimeRangeTransformerBase implements SceneTimeRangeLike { constructor(state: Omit); protected ancestorTimeRangeChanged(timeRange: SceneTimeRangeState): void; getTimeZone(): TimeZone; onTimeZoneChange(timeZone: string): void; } interface QueryRunnerState extends SceneObjectState { data?: PanelData; queries: SceneDataQuery[]; datasource?: DataSourceRef; minInterval?: string; maxDataPoints?: number; liveStreaming?: boolean; maxDataPointsFromWidth?: boolean; cacheTimeout?: DataQueryRequest['cacheTimeout']; queryCachingTTL?: DataQueryRequest['queryCachingTTL']; /** * When set to auto (the default) query runner will issue queries on activate (when variable dependencies are ready) or when time range change. * Set to manual to have full manual control over when queries are issued. Try not to set this. This is mainly useful for unit tests, or special edge case workflows. */ runQueriesMode?: 'auto' | 'manual'; dataLayerFilter?: DataLayerFilter; /** * Optional prefix for the requestId. When set, request IDs will be formatted as `{requestIdPrefix}{counter}`. * Useful for identifying requests from specific panels or components. */ requestIdPrefix?: string; _hasFetchedData?: boolean; } declare class SceneQueryRunner extends SceneObjectBase implements SceneDataProvider { private _querySub?; private _dataLayersSub?; private _dataLayersMerger; private _timeSub?; private _timeSubRange?; private _containerWidth?; private _variableValueRecorder; private _results; private _scopedVars; private _layerAnnotations?; private _resultAnnotations?; private _isInView; private _bypassIsInView; private _queryNotExecutedWhenOutOfView; getResultsStream(): ReplaySubject; protected _variableDependency: VariableDependencyConfig; private _drilldownDependenciesManager; constructor(initialState: QueryRunnerState); private _onActivate; private _handleDataLayers; private _onLayersReceived; /** * This tries to start a new query whenever a variable completes or is changed. * * We care about variable update completions even when the variable has not changed and even when it is not a direct dependency. * Example: Variables A and B (B depends on A). A update depends on time range. So when time change query runner will * find that variable A is loading which is a dependency on of variable B so will set _isWaitingForVariables to true and * not issue any query. * * When A completes it's loading (with no value change, so B never updates) it will cause a call of this function letting * the query runner know that A has completed, and in case _isWaitingForVariables we try to run the query. The query will * only run if all variables are in a non loading state so in other scenarios where a query depends on many variables this will * be called many times until all dependencies are in a non loading state. * */ private onVariableUpdatesCompleted; /** * Check if value changed is an adhoc filter or group by variable that did not exist when we issued the last query */ private onAnyVariableChanged; private _isRelevantAutoVariable; private shouldRunQueriesOnActivate; private _isDataTimeRangeStale; private _onDeactivate; setContainerWidth(width: number): void; isDataReadyToDisplay(): boolean; private subscribeToTimeRangeChanges; runQueries(): void; private getMaxDataPoints; cancelQuery(): void; private runWithTimeRange; clone(withState?: Partial): this; private prepareRequests; private onDataReceived; private _combineDataLayers; private _setNoDataState; /** * Walk up the scene graph and find any ExtraQueryProviders. * * This will return an array of the closest provider of each type. */ private getClosestExtraQueryProviders; private isQueryModeAuto; isInViewChanged(isInView: boolean): void; bypassIsInViewChanged(bypassIsInView: boolean): void; } interface DataProviderSharerState extends SceneDataState { source: SceneObjectRef; } declare class DataProviderProxy extends SceneObjectBase implements SceneDataProvider { constructor(state: DataProviderSharerState); setContainerWidth(width: number): void; isDataReadyToDisplay(): boolean; cancelQuery(): void; getResultsStream(): Observable; } type ExtraQueryDataProcessor = (primary: PanelData, secondary: PanelData) => Observable; interface ExtraQueryDescriptor { req: DataQueryRequest; processor?: ExtraQueryDataProcessor; } interface ExtraQueryProvider extends SceneObjectBase { getExtraQueries(request: DataQueryRequest): ExtraQueryDescriptor[]; shouldRerun(prev: T, next: T, queries: SceneDataQuery[]): boolean; } declare abstract class SceneDataLayerSetBase extends SceneObjectBase implements SceneDataLayerProvider { /** Mark it as a data layer */ isDataLayer: true; /** * Subscription to query results. Should be set when layer runs a query. */ protected querySub?: Unsubscribable; /** * Subject to emit results to. */ private _results; private _dataLayersMerger; protected subscribeToAllLayers(layers: SceneDataLayerProvider[]): void; private _onLayerUpdateReceived; getResultsStream(): Observable; cancelQuery(): void; /** * This helper function is to counter the contravariance of setState */ private setStateHelper; } interface SceneDataLayersSetState extends SceneDataLayerProviderState { layers: SceneDataLayerProvider[]; } declare class SceneDataLayerSet extends SceneDataLayerSetBase implements SceneDataLayerProvider { constructor(state: Partial); private _onActivate; static Component: ({ model }: SceneComponentProps) => React__default.JSX.Element; } interface SceneDataLayerControlsState extends SceneObjectState { } declare class SceneDataLayerControls extends SceneObjectBase { static Component: typeof SceneDataLayerControlsRenderer; constructor(); } declare function SceneDataLayerControlsRenderer({ model }: SceneComponentProps): React__default.JSX.Element | null; interface SceneDataTransformerState extends SceneDataState { /** * Array of standard transformation configs and custom transform operators */ transformations: Array; } /** * You can use this as a $data object. It can either transform an inner $data DataProvider or if that is not set it will * subscribe to a DataProvider higher up in the scene graph and transform its data. * * The transformations array supports custom (runtime defined) transformation as well as declarative core transformations. * You can manually re-process the transformations by calling reprocessTransformations(). This is useful if you have * transformations that depend on other scene object states. */ declare class SceneDataTransformer extends SceneObjectBase implements SceneDataProvider { private _transformSub?; private _results; private _prevDataFromSource?; /** * Scan transformations for variable usage and re-process transforms when a variable values change */ protected _variableDependency: VariableDependencyConfig; constructor(state: SceneDataTransformerState); private activationHandler; private getSourceData; setContainerWidth(width: number): void; isDataReadyToDisplay(): boolean; reprocessTransformations(): void; /** * S3.1: Calculate transformation complexity metrics */ private _calculateTransformationMetrics; cancelQuery(): void; getResultsStream(): ReplaySubject; clone(withState?: Partial): this; isInViewChanged(isInView: boolean): void; bypassIsInViewChanged(bypassIsInView: boolean): void; private haveAlreadyTransformedData; private transform; private _interpolateVariablesInTransformationConfigs; private _filterAndPrepareTransformationsByTopic; } interface AdHocFilterInteractionHandler { isAdHocFilterInteractionHandler: true; onFilterAdded?(payload: { key: string; operator: string; }): void; onFilterRemoved?(payload: { key: string; }): void; onFilterMatchAll?(payload: { key: string; origin?: string; }): void; onFilterRestored?(payload: { key: string; origin?: string; }): void; onGroupByAdded?(payload: { key: string; }): void; onGroupByRemoved?(payload: { key: string; origin?: string; }): void; onGroupByRestored?(): void; onClearAll?(payload: { filtersCleared: number; originsRestored: number; }): void; onRecentFilterApplied?(payload: { key: string; operator: string; }): void; onRecommendedFilterApplied?(payload: { key: string; operator: string; }): void; onRecentGroupByApplied?(payload: { key: string; }): void; onRecommendedGroupByApplied?(payload: { key: string; }): void; } interface VariableValueSelectorsState extends SceneObjectState { layout?: ControlsLayout; } declare class VariableValueSelectors extends SceneObjectBase { static Component: typeof VariableValueSelectorsRenderer; } declare function VariableValueSelectorsRenderer({ model }: SceneComponentProps): React__default.JSX.Element; interface VariableSelectProps { layout?: ControlsLayout; variable: SceneVariable; /** To override hide from VariableValueSelectByName */ showAlways?: boolean; /** To provide an option to hide the label in the variable value selector */ hideLabel?: boolean; } declare function VariableValueSelectWrapper({ variable, layout, showAlways, hideLabel }: VariableSelectProps): React__default.JSX.Element | null; interface VariableValueControlState extends SceneObjectState { layout?: ControlsLayout; /** Render the specific select control for a variable */ variableName: string; /** Hide the label in the variable value controller */ hideLabel?: boolean; } declare class VariableValueControl extends SceneObjectBase { static Component: typeof VariableValueControlRenderer; } declare function VariableValueControlRenderer({ model }: SceneComponentProps): React__default.JSX.Element | null; declare class SceneVariableSet extends SceneObjectBase implements SceneVariables { /** Variables that are scheduled to be validated and updated */ private _variablesToUpdate; /** Variables currently updating */ private _updating; private _variableValueRecorder; /** * This makes sure SceneVariableSet's higher up in the chain notify us when parent level variables complete update batches. **/ protected _variableDependency: SceneVariableSetVariableDependencyHandler; getByName(name: string): SceneVariable | undefined; constructor(state: SceneVariableSetState); /** * Subscribes to child variable value changes, and starts the variable value validation process */ private _onActivate; /** * Add all variables that depend on the changed variable to the update queue */ private _refreshTimeRangeBasedVariables; /** * Cancel all currently running updates */ private _onDeactivate; /** * Look for new variables that need to be initialized */ private _onStateChanged; /** * If variables changed while in in-active state we don't get any change events, so we need to check for that here. */ private _checkForVariablesThatChangedWhileInactive; private _variableNeedsUpdate; /** * This loops through variablesToUpdate and update all that can. * If one has a dependency that is currently in variablesToUpdate it will be skipped for now. */ private _updateNextBatch; /** * A variable has completed its update process. This could mean that variables that depend on it can now be updated in turn. */ private _validateAndUpdateCompleted; cancel(variable: SceneVariable): void; private _handleVariableError; private _handleVariableValueChanged; /** * This is called by any parent level variable set to notify scene that an update batch is completed. * This is the main mechanism lower level variable set's react to changes on higher levels. */ private _handleParentVariableUpdatesCompleted; private _addDependentVariablesToUpdateQueue; /** * Walk scene object graph and update all objects that depend on variables that have changed */ private _notifyDependentSceneObjects; /** * Recursivly walk the full scene object graph and notify all objects with dependencies that include any of changed variables */ private _traverseSceneAndNotify; /** * Return true if variable is waiting to update or currently updating. * It also returns true if a dependency of the variable is loading. * * For example if C depends on variable B which depends on variable A and A is loading this returns true for variable C and B. */ isVariableLoadingOrWaitingToUpdate(variable: SceneVariable): boolean; } declare class SceneVariableSetVariableDependencyHandler implements SceneVariableDependencyConfigLike { private _variableUpdatesCompleted; constructor(_variableUpdatesCompleted: (variable: SceneVariable, hasChanged: boolean) => void); private _emptySet; getNames(): Set; hasDependencyOn(name: string): boolean; variableUpdateCompleted(variable: SceneVariable, hasChanged: boolean): void; } interface TestVariableState extends MultiValueVariableState { query: string; delayMs?: number; issuedQuery?: string; refresh?: VariableRefresh$1; throwError?: string; optionsToReturn?: VariableValueOption[]; updateOptions?: boolean; } /** * This variable is only designed for unit tests and potentially e2e tests. */ declare class TestVariable extends MultiValueVariable { private completeUpdate; isGettingValues: boolean; getValueOptionsCount: number; isLazy: boolean; protected _variableDependency: VariableDependencyConfig; constructor(initialState: Partial, isLazy?: boolean); getValueOptions(args: VariableGetOptionsArgs): Observable; cancel(): void; private getOptions; /** Useful from tests */ signalUpdateCompleted(): void; static Component: ({ model }: SceneComponentProps) => React__default.JSX.Element; } interface ScopesVariableState extends SceneVariableState { /** * Last captured state from ScopesContext */ scopes: Scope[]; /** * Set to true if you want to the variable to enable / disable scopes when activated / deactivated */ enable?: boolean; } declare class ScopesVariable extends SceneObjectBase implements SceneVariable { protected _renderBeforeActivation: boolean; protected _context: ScopesContextValue | undefined; UNSAFE_renderAsHidden: boolean; static Component: typeof ScopesVariableRenderer; private _validateAndUpdateObs?; constructor(state: Partial); validateAndUpdate(): Observable; /** * Temporary simple implementation to stringify the scopes. */ getValue(): VariableValue; getScopes(): Scope[] | undefined; /** * This method is used to keep the context up to date with the scopes context received from React * 1) Subscribes to ScopesContext state changes and synchronizes it with the variable state * 2) Handles enable / disabling of scopes based on variable enable option. */ setContext(context: ScopesContextValue | undefined): (() => void) | undefined; updateStateFromContext(state: { loading: boolean; value: Scope[]; }): void; } declare function ScopesVariableRenderer({ model }: SceneComponentProps): null; interface LocalValueVariableState extends SceneVariableState { value: VariableValue; text: VariableValue; properties?: VariableValueOptionProperties; isMulti?: boolean; includeAll?: boolean; } /** * This is a special type of variable that is used for repeating panels and layouts to create a local scoped value for a variable * that exists in a ancestor SceneVariableSet. */ declare class LocalValueVariable extends SceneObjectBase implements SceneVariable { private static fieldAccessorCache; constructor(initialState: Partial); getValue(fieldPath?: string): VariableValue; private getFieldAccessor; getValueText(fieldPath?: string): string; /** * Checks the ancestor of our parent SceneVariableSet for loading state of a variable with the same name * This function is unit tested from SceneVariableSet tests. */ isAncestorLoading(): boolean; } /** * Controller state returned by useState hook */ interface AdHocFiltersControllerState { filters: AdHocFilterWithLabels[]; originFilters?: AdHocFilterWithLabels[]; readOnly?: boolean; allowCustomValue?: boolean; supportsMultiValueOperators?: boolean; onAddCustomValue?: OnAddCustomValueFn; wip?: AdHocFilterWithLabels; inputPlaceholder?: string; groupByInputPlaceholder?: string; /** * When true, enables a collapse button that appears when filters wrap to multiple lines. */ collapsible?: boolean; valueRecommendations?: AdHocFiltersRecommendations; drilldownRecommendationsEnabled?: boolean; enableGroupBy?: boolean; groupByRestorable?: boolean; } /** * Controller interface for adhoc filters combobox UI. * Decouples the UI from AdHocFiltersVariable, allowing usage with or without a variable. */ interface AdHocFiltersController { /** * React hook to access controller state. * Components should call this to get current filters and configuration. */ useState(): AdHocFiltersControllerState; /** * Get possible keys given current filters. * @param currentKey - The key being edited (to exclude from filter context) */ getKeys(currentKey: string | null): Promise>>; /** * Get possible keys for the group-by dropdown. * Only relevant when enableGroupBy is true. * @param currentKey - The key being edited (to exclude from filter context), if any */ getGroupByKeys?(currentKey: string | null): Promise>>; /** * Get possible values for a specific filter key. * @param filter - The filter to get values for */ getValuesFor(filter: AdHocFilterWithLabels): Promise>>; /** * Get available operators based on configuration. */ getOperators(): Array>; /** * Update a filter with partial changes. * @param filter - The filter to update * @param update - Partial filter properties to update */ updateFilter(filter: AdHocFilterWithLabels, update: Partial): void; /** * Get id for the form control. Used for accessibility. */ getControlId?(): string; /** * Update filters list * @param filters * @param options */ updateFilters?(filters: AdHocFilterWithLabels[], options?: { skipPublish?: boolean; forcePublish?: boolean; }): void; /** * Update a filter to match all values (=~ .*) * @param filter - The filter to update */ updateToMatchAll(filter: AdHocFilterWithLabels): void; /** * Remove a filter. * @param filter - The filter to remove */ removeFilter(filter: AdHocFilterWithLabels): void; /** * Remove the last filter in the list. */ removeLastFilter(): void; /** * Handle backspace key in combobox (removes filter or navigates to previous). * @param filter - The filter where backspace was pressed */ handleComboboxBackspace(filter: AdHocFilterWithLabels): void; /** * Add a new work-in-progress filter. */ addWip(): void; /** * Add a group-by filter (key only, operator 'groupBy', no value). * Only relevant when enableGroupBy is true. */ addGroupByFilter?(item: SelectableValue): void; /** * Restore an origin filter to its original value. * @param filter - The filter to restore */ restoreOriginalFilter(filter: AdHocFilterWithLabels): void; /** * Restore all original group by filters and remove user-added group by filters. */ restoreOriginalGroupBy?(): void; /** * Clear all user-added filters and restore origin filters to original values. */ clearAll?(): void; /** * Optional: Start profiling an interaction (for performance tracking). * @param name - The interaction name */ startProfile?(name: string): void; /** * Optional: Start tracking an interaction (for analytics). * @param name - The interaction name */ startInteraction?(name: string): void; /** * Optional: Stop tracking the current interaction. */ stopInteraction?(): void; } /** * Adapter that wraps AdHocFiltersVariable to implement the AdHocFiltersController interface. * This allows the combobox UI to work with the variable while keeping the UI decoupled. */ declare class AdHocFiltersVariableController implements AdHocFiltersController { private model; constructor(model: AdHocFiltersVariable); useState(): AdHocFiltersControllerState; getKeys(currentKey: string | null): Promise>>; getGroupByKeys(currentKey: string | null): Promise>>; getValuesFor(filter: AdHocFilterWithLabels): Promise>>; getOperators(): Array>; updateFilter(filter: AdHocFilterWithLabels, update: Partial): void; updateFilters(filters: AdHocFilterWithLabels[], options?: { skipPublish?: boolean; forcePublish?: boolean; }): void; updateToMatchAll(filter: AdHocFilterWithLabels): void; removeFilter(filter: AdHocFilterWithLabels): void; removeLastFilter(): void; handleComboboxBackspace(filter: AdHocFilterWithLabels): void; addWip(): void; addGroupByFilter(item: SelectableValue): void; restoreOriginalFilter(filter: AdHocFilterWithLabels): void; restoreOriginalGroupBy(): void; clearAll(): void; startProfile(name: string): void; startInteraction(name: string): void; stopInteraction(): void; getControlId(): string; } interface Props$2 { controller: AdHocFiltersController; } declare const AdHocFiltersComboboxRenderer: React__default.NamedExoticComponent; declare function useUrlSync(sceneRoot: SceneObject, options?: SceneUrlSyncOptions): boolean; interface UrlSyncContextProviderProps extends SceneUrlSyncOptions { scene: SceneObject; children: React.ReactNode; } /** * Right now this is actually not defining a context, but think it might in the future (with UrlSyncManager as the context value) */ declare function UrlSyncContextProvider({ children, scene, updateUrlOnInit, createBrowserHistorySteps, namespace, excludeFromNamespace, }: UrlSyncContextProviderProps): React$1.ReactNode; interface ExploreButtonOptions { onClick?: () => void; transform?: (query: DataQuery) => DataQuery; returnToPrevious?: { title: string; href?: string; }; } interface ExploreButtonState extends SceneObjectState { options: ExploreButtonOptions; } declare class VizPanelExploreButton extends SceneObjectBase { static Component: typeof VizPanelExploreButtonComponent; constructor(options?: ExploreButtonOptions); } declare function VizPanelExploreButtonComponent({ model }: SceneComponentProps): React__default.JSX.Element | null; interface NestedSceneState extends SceneObjectState { title: string; isCollapsed?: boolean; canCollapse?: boolean; canRemove?: boolean; body: SceneLayout; controls?: SceneObject[]; } /** * @internal * POC status, don't use this yet */ declare class NestedScene extends SceneObjectBase { static Component: typeof NestedSceneRenderer; onToggle: () => void; /** Removes itself from its parent's children array */ onRemove: () => void; } declare function NestedSceneRenderer({ model }: SceneComponentProps): React__default.JSX.Element; interface SceneCanvasTextState extends SceneObjectState { text: string; fontSize?: number; align?: 'left' | 'center' | 'right'; spacing?: number; } /** * Not a really useful component, just an example of how to create one * @internal */ declare class SceneCanvasText extends SceneObjectBase { protected _variableDependency: VariableDependencyConfig; static Component: typeof SceneCanvasTextRenderer; } declare function SceneCanvasTextRenderer({ model }: SceneComponentProps): React__default.JSX.Element; interface ToolbarButtonState extends SceneObjectState { icon: IconName$1; onClick: () => void; } declare class SceneToolbarButton extends SceneObjectBase { static Component: ({ model }: SceneComponentProps) => React__default.JSX.Element; } interface SceneToolbarInputState extends SceneObjectState { value?: string; label?: string; onChange: (value: number) => void; } declare class SceneToolbarInput extends SceneObjectBase { static Component: ({ model }: SceneComponentProps) => React__default.JSX.Element; } interface SceneTimePickerState extends SceneObjectState { hidePicker?: boolean; isOnCanvas?: boolean; quickRanges?: TimeOption[]; defaultQuickRanges?: TimeOption[]; } declare class SceneTimePicker extends SceneObjectBase { static Component: typeof SceneTimePickerRenderer; onZoom: () => void; onChangeFiscalYearStartMonth: (month: number) => void; toAbsolute: () => void; onMoveBackward: () => void; onMoveForward: () => void; } declare function SceneTimePickerRenderer({ model }: SceneComponentProps): React__default.JSX.Element | null; interface SceneRefreshPickerState extends SceneObjectState { /** * Refresh interval, e.g. 5s, 1m, 2h */ refresh: string; autoEnabled?: boolean; autoMinInterval?: string; autoValue?: string; /** * List of allowed refresh intervals, e.g. ['5s', '1m'] */ intervals?: string[]; isOnCanvas?: boolean; primary?: boolean; withText?: boolean; /** * Overrides the default minRefreshInterval from the grafana config. Can be set to "0s" to remove the minimum refresh interval. */ minRefreshInterval?: string; } declare class SceneRefreshPicker extends SceneObjectBase { static Component: typeof SceneRefreshPickerRenderer; protected _urlSync: SceneObjectUrlSyncConfig; private _intervalTimer; private _autoTimeRangeListener; private _autoRefreshBlocked; constructor(state: Partial); onRefresh: () => void; onIntervalChanged: (interval: string) => void; getUrlState(): { refresh: string | undefined; }; updateFromUrl(values: SceneObjectUrlValues): void; private setupAutoTimeRangeListener; private calculateAutoRefreshInterval; private isTabVisible; private setupIntervalTimer; } declare function SceneRefreshPickerRenderer({ model }: SceneComponentProps): React__default.JSX.Element; interface SceneTimeRangeCompareState extends SceneObjectState { compareWith?: string; compareOptions: Array<{ label: string; value: string; }>; hideCheckbox?: boolean; } declare class SceneTimeRangeCompare extends SceneObjectBase implements ExtraQueryProvider { static Component: typeof SceneTimeRangeCompareRenderer; protected _urlSync: SceneObjectUrlSyncConfig; constructor(state: Partial); private _onActivate; getCompareOptions: (timeRange: TimeRange) => { label: string; value: string; }[]; onCompareWithChanged: (compareWith: string) => void; onClearCompare: () => void; getExtraQueries(request: DataQueryRequest): ExtraQueryDescriptor[]; shouldRerun(prev: SceneTimeRangeCompareState, next: SceneTimeRangeCompareState, queries: SceneDataQuery[]): boolean; getCompareTimeRange(timeRange: TimeRange): TimeRange | undefined; getUrlState(): SceneObjectUrlValues; updateFromUrl(values: SceneObjectUrlValues): void; } declare function SceneTimeRangeCompareRenderer({ model }: SceneComponentProps): React__default.JSX.Element; interface SceneByFrameRepeaterState extends SceneObjectState { body: SceneLayout; getLayoutChild(data: PanelData, frame: DataFrame, frameIndex: number): SceneObject; } declare class SceneByFrameRepeater extends SceneObjectBase { constructor(state: SceneByFrameRepeaterState); private performRepeat; static Component: ({ model }: SceneComponentProps) => React__default.JSX.Element; } interface SceneByVariableRepeaterState extends SceneObjectState { body: SceneLayout; variableName: string; getLayoutChild(option: VariableValueOption): SceneObject; } declare class SceneByVariableRepeater extends SceneObjectBase { protected _variableDependency: VariableDependencyConfig; constructor(state: SceneByVariableRepeaterState); private performRepeat; static Component: ({ model }: SceneComponentProps) => React__default.JSX.Element; } declare class SceneControlsSpacer extends SceneObjectBase { constructor(); static Component: (_props: SceneComponentProps) => React__default.JSX.Element; } interface SceneFlexItemStateLike extends SceneFlexItemPlacement, SceneObjectState { } interface SceneFlexItemLike extends SceneObject { } interface SceneFlexLayoutState extends SceneObjectState, SceneFlexItemPlacement { children: SceneFlexItemLike[]; } declare class SceneFlexLayout extends SceneObjectBase implements SceneLayout { static Component: typeof SceneFlexLayoutRenderer; toggleDirection(): void; isDraggable(): boolean; } declare function SceneFlexLayoutRenderer({ model, parentState }: SceneFlexItemRenderProps$1): React__default.JSX.Element | null; interface SceneFlexItemPlacement { wrap?: CSSProperties['flexWrap']; direction?: CSSProperties['flexDirection']; width?: CSSProperties['width']; height?: CSSProperties['height']; minWidth?: CSSProperties['minWidth']; minHeight?: CSSProperties['minHeight']; maxWidth?: CSSProperties['maxWidth']; maxHeight?: CSSProperties['maxHeight']; xSizing?: 'fill' | 'content'; ySizing?: 'fill' | 'content'; /** * True when the item should rendered but not visible. * Useful for conditional display of layout items */ isHidden?: boolean; /** * Set direction for smaller screens. This defaults to column. * This equals media query theme.breakpoints.down('md') */ md?: SceneFlexItemPlacement; } interface SceneFlexItemState extends SceneFlexItemPlacement, SceneObjectState { body: SceneObject | undefined; } interface SceneFlexItemRenderProps$1 extends SceneComponentProps { parentState?: SceneFlexItemPlacement; } declare class SceneFlexItem extends SceneObjectBase { static Component: typeof SceneFlexItemRenderer; } declare function SceneFlexItemRenderer({ model, parentState }: SceneFlexItemRenderProps$1): React__default.JSX.Element | null; interface SceneCSSGridLayoutState extends SceneObjectState, SceneCSSGridLayoutOptions { children: Array; /** * True when the item should rendered but not visible. * Useful for conditional display of layout items */ isHidden?: boolean; /** * For media query for sceens smaller than md breakpoint */ md?: SceneCSSGridLayoutOptions; /** True when the items should be lazy loaded */ isLazy?: boolean; } interface SceneCSSGridLayoutOptions { /** * Useful for setting a height on items without specifying how many rows there will be. * Defaults to 320px */ autoRows?: CSSProperties['gridAutoRows']; /** * This overrides the autoRows with a specific row template. */ templateRows?: CSSProperties['gridTemplateRows']; /** * Defaults to repeat(auto-fit, minmax(400px, 1fr)). This pattern us useful for equally sized items with a min width of 400px * and dynamic max width split equally among columns. */ templateColumns: CSSProperties['gridTemplateColumns']; /** In Grafana design system grid units (8px) */ rowGap: number; /** In Grafana design system grid units (8px) */ columnGap: number; justifyItems?: CSSProperties['justifyItems']; alignItems?: CSSProperties['alignItems']; justifyContent?: CSSProperties['justifyContent']; } declare class SceneCSSGridLayout extends SceneObjectBase implements SceneLayout { static Component: typeof SceneCSSGridLayoutRenderer; constructor(state: Partial); isDraggable(): boolean; } declare function SceneCSSGridLayoutRenderer({ model }: SceneCSSGridItemRenderProps): React__default.JSX.Element | null; interface SceneCSSGridItemPlacement { /** * True when the item should rendered but not visible. * Useful for conditional display of layout items */ isHidden?: boolean; /** * Useful for making content span across multiple rows or columns */ gridColumn?: CSSProperties['gridColumn']; gridRow?: CSSProperties['gridRow']; } interface SceneCSSGridItemState extends SceneCSSGridItemPlacement, SceneObjectState { body: SceneObject | undefined; } interface SceneCSSGridItemRenderProps extends SceneComponentProps { parentState?: SceneCSSGridItemPlacement; } declare class SceneCSSGridItem extends SceneObjectBase { static Component: typeof SceneCSSGridItemRenderer; } declare function SceneCSSGridItemRenderer({ model, parentState }: SceneCSSGridItemRenderProps): React__default.JSX.Element | null; declare function SceneGridLayoutRenderer({ model }: SceneComponentProps): React__default.JSX.Element; interface SceneGridItemPlacement { x?: number; y?: number; width?: number; height?: number; } interface SceneGridItemStateLike extends SceneGridItemPlacement, SceneObjectState { isResizable?: boolean; isDraggable?: boolean; } interface SceneGridItemLike extends SceneObject { /** * Provide a custom CSS class name for the underlying DOM element when special styling (i.e. for mobile breakpoint) is required. **/ getClassName?(): string; /** * Get the number of grid item children (eg. original panel with all repeats) **/ getChildCount?(): number; } declare class SceneGridLayoutDragStartEvent extends BusEventWithPayload<{ evt: PointerEvent; panel: VizPanel; }> { static readonly type = "scene-grid-layout-drag-start"; } interface SceneGridRowState extends SceneGridItemStateLike { title: string; isCollapsible?: boolean; isCollapsed?: boolean; actions?: SceneObject; children: SceneGridItemLike[]; /** Marks object as a repeated object and a key pointer to source object */ repeatSourceKey?: string; } declare class SceneGridRow extends SceneObjectBase { static Component: typeof SceneGridRowRenderer; protected _variableDependency: VariableDependencyConfig; constructor(state: Partial); getGridLayout(): SceneGridLayout; onCollapseToggle: () => void; getUrlState(): { rowc: string; }; updateFromUrl(values: SceneObjectUrlValues): void; getPanelCount(children: SceneGridItemLike[]): number; } declare function SceneGridRowRenderer({ model }: SceneComponentProps): React__default.JSX.Element; interface SceneGridLayoutState extends SceneObjectState { /** * Turn on or off dragging for all items. Individual items can still disabled via isDraggable property **/ isDraggable?: boolean; /** Enable or disable item resizing */ isResizable?: boolean; isLazy?: boolean; /** * Fit panels to height of the grid. This will scale down the panels vertically to fit available height. * The row height is not changed, only the y position and height of the panels. * UNSAFE: This feature is experimental and it might change in the future. */ UNSAFE_fitPanels?: boolean; children: SceneGridItemLike[]; } declare class SceneGridLayout extends SceneObjectBase implements SceneLayout { static Component: typeof SceneGridLayoutRenderer; private _skipOnLayoutChange; private _oldLayout; private _loadOldLayout; constructor(state: SceneGridLayoutState); /** * SceneLayout interface. Used for example by VizPanelRenderer */ isDraggable(): boolean; getDragClass(): string; getDragClassCancel(): string; getDragHooks(): { onDragStart: (evt: PointerEvent, panel: VizPanel) => void; }; adjustYPositions(after: number, amount: number): void; toggleRow(row: SceneGridRow): void; ignoreLayoutChange(shouldIgnore: boolean): void; onLayoutChange: (layout: ReactGridLayout.Layout[]) => void; /** * Will also scan row children and return child of the row */ getSceneLayoutChild(key: string): SceneGridItemLike; onResizeStop: ReactGridLayout.ItemCallback; private pushChildDown; /** * We assume the layout array is sorted according to y pos, and walk upwards until we find a row. * If it is collapsed there is no row to add it to. The default is then to return the SceneGridLayout itself */ private findGridItemSceneParent; /** * Helper func to check if we are dropping a row in between panels of another row */ private isRowDropValid; /** * This likely needs a slightly different approach. Where we clone or deactivate or and re-activate the moved child */ moveChildTo(child: SceneGridItemLike, target: SceneGridLayout | SceneGridRow): SceneGridItemLike[]; onDragStart: ReactGridLayout.ItemCallback; onDragStop: ReactGridLayout.ItemCallback; private toGridCell; buildGridLayout(width: number, height: number): ReactGridLayout.Layout[]; } declare const GRID_CELL_HEIGHT = 30; declare const GRID_COLUMN_COUNT = 24; interface SceneGridItemState extends SceneGridItemStateLike { body: SceneObject | undefined; } declare class SceneGridItem extends SceneObjectBase implements SceneGridItemLike { static Component: typeof SceneGridItemRenderer; } declare function SceneGridItemRenderer({ model }: SceneComponentProps): React__default.JSX.Element | null; declare function SplitLayoutRenderer({ model }: SceneFlexItemRenderProps): React__default.JSX.Element | null; interface SceneFlexItemRenderProps extends SceneComponentProps { parentState?: SceneFlexItemPlacement; } interface SplitLayoutState extends SceneObjectState, SceneFlexItemPlacement { primary: SceneFlexItemLike; secondary?: SceneFlexItemLike; direction: 'row' | 'column'; initialSize?: number; primaryPaneStyles?: CSSProperties; secondaryPaneStyles?: CSSProperties; } declare class SplitLayout extends SceneObjectBase { static Component: typeof SplitLayoutRenderer; toggleDirection(): void; isDraggable(): boolean; } interface Props$1 extends Omit, 'onChange' | 'children'> { children: React__default.ReactNode; key: string; onLoad?: () => void; onChange?: (isInView: boolean) => void; /** * mount (default) = mounts/renders children when they are first in view. * query = children is always rendered. Only sets the LazyLoaderInViewContext which is used to block query execution for panels out of view */ mode?: LazyLoaderMode; } /** * mount (default) = mounts children when they are first in view. * query = children is always rendered. Only sets the LazyLoaderInViewContext which is used to block query execution for panels out of view */ type LazyLoaderMode = 'mount' | 'query'; interface LazyLoaderType extends ForwardRefExoticComponent { addCallback: (id: string, c: (e: IntersectionObserverEntry) => void) => void; callbacks: Record void>; observer: IntersectionObserver; } declare const LazyLoader: LazyLoaderType; /** * Responsible for top level pages routing */ declare class SceneApp extends SceneObjectBase implements DataRequestEnricher { protected _renderBeforeActivation: boolean; enrichDataRequest(): { app: string; }; static Component: ({ model }: SceneComponentProps) => React__default.JSX.Element; } /** * Caches the the resulting SceneApp returned by the factory function so that it's only called once during the lifetime of the browser tab */ declare function useSceneApp(factory: () => SceneApp): SceneApp; /** * Responsible for page's drilldown & tabs routing */ declare class SceneAppPage extends SceneObjectBase implements SceneAppPageLike { static Component: typeof SceneAppPageRenderer; private _sceneCache; private _drilldownCache; initializeScene(scene: EmbeddedScene): void; getScene(routeMatch: SceneRouteMatch): EmbeddedScene; getDrilldownPage(drilldown: SceneAppDrilldownView, routeMatch: SceneRouteMatch<{}>): SceneAppPageLike; enrichDataRequest(source: SceneObject): Partial<_grafana_data.DataQueryRequest<_grafana_data.DataQuery>> | null; } declare function SceneAppPageRenderer({ model }: SceneComponentProps): React__default.JSX.Element; interface SceneReactObjectState extends SceneObjectState { /** * React component to render */ component?: React__default.ComponentType; /** * Props to pass to the component */ props?: TProps; /** * Alternative to component and props is just to pass a React node */ reactNode?: React__default.ReactNode; } /** * A utility object that can be used to render any React component or ReactNode */ declare class SceneReactObject extends SceneObjectBase> { static Component: ({ model }: SceneComponentProps) => string | number | true | React__default.JSX.Element | Iterable | null; } type StandardFieldConfigInterface = { [K in keyof T as `${Prefix}${Capitalize}`]: (value: T[K]) => C; } & { [K in Exclude as `${Prefix}${Capitalize}`]: (value: T[K]) => C; }; type StandardFieldConfig = Pick; interface VizConfig { pluginId: string; pluginVersion: string; options: DeepPartial; fieldConfig: FieldConfigSource>; } declare class StandardFieldConfigOverridesBuilder> implements StandardFieldConfigInterface { protected _overrides: Array<{ matcher: MatcherConfig; properties: Array<{ id: string; value: unknown; }>; }>; overrideColor(value: StandardFieldConfig['color']): T; overrideDecimals(value: StandardFieldConfig['decimals']): T; overrideDisplayName(value: StandardFieldConfig['displayName']): T; overrideFilterable(value: StandardFieldConfig['filterable']): T; overrideLinks(value: StandardFieldConfig['links']): T; overrideMappings(value: StandardFieldConfig['mappings']): T; overrideMax(value: StandardFieldConfig['max']): T; overrideMin(value: StandardFieldConfig['min']): T; overrideNoValue(value: StandardFieldConfig['noValue']): T; overrideThresholds(value: StandardFieldConfig['thresholds']): T; overrideUnit(value: StandardFieldConfig['unit']): T; } declare class FieldConfigOverridesBuilder extends StandardFieldConfigOverridesBuilder> { match(matcher: MatcherConfig): this; matchFieldsWithName(name: string): this; matchFieldsWithNameByRegex(regex: string): this; matchFieldsByType(fieldType: FieldType): this; matchFieldsByQuery(refId: string): this; matchFieldsByValue(options: FieldValueMatcherConfig): this; matchComparisonQuery(refId: string): this; overrideCustomFieldConfig(id: K, value: T[K]): this; build(): { matcher: MatcherConfig; properties: Array<{ id: string; value: unknown; }>; }[]; } declare class VizPanelBuilder implements StandardFieldConfigInterface, 'set'> { private _state; private _fieldConfigBuilder; private _panelOptionsBuilder; constructor(pluginId: string, pluginVersion: string, defaultOptions?: () => Partial, defaultFieldConfig?: () => TFieldConfig); /** * Set panel title. */ setTitle(title: VizPanelState['title']): this; /** * Set panel description. */ setDescription(description: VizPanelState['description']): this; /** * Set panel display mode. */ setDisplayMode(displayMode: VizPanelState['displayMode']): this; /** * Set if panel header should be shown on hover. */ setHoverHeader(hoverHeader: VizPanelState['hoverHeader']): this; /** * Set if VizPanelMenu "kebab" icon is shown on panel hover for desktop devices. Set true to always show menu icon. * @param showMenuAlways */ setShowMenuAlways(showMenuAlways: VizPanelState['showMenuAlways']): this; /** * Set panel menu scene object. */ setMenu(menu: VizPanelState['menu']): this; /** * Set scene object or react component to use as panel header actions. */ setHeaderActions(headerActions: VizPanelState['headerActions']): this; setCollapsible(collapsible: VizPanelState['collapsible']): this; setCollapsed(collapsed: VizPanelState['collapsed']): this; /** * Set color. */ setColor(color: StandardFieldConfig['color']): this; /** * Set number of decimals to show. */ setDecimals(decimals: StandardFieldConfig['decimals']): this; /** * Set field display name. */ setDisplayName(displayName: StandardFieldConfig['displayName']): this; /** * Set the standard field config property filterable. */ setFilterable(filterable: StandardFieldConfig['filterable']): this; /** * Set data links. */ setLinks(links: StandardFieldConfig['links']): this; /** * Set value mappings. */ setMappings(mappings: StandardFieldConfig['mappings']): this; /** * Set the standard field config property max. */ setMax(max: StandardFieldConfig['max']): this; /** * Set the standard field config property min. */ setMin(min: StandardFieldConfig['min']): this; /** * Set the standard field config property noValue. */ setNoValue(noValue: StandardFieldConfig['noValue']): this; /** * Set the standard field config property thresholds. */ setThresholds(thresholds: StandardFieldConfig['thresholds']): this; /** * Set the standard field config property unit. */ setUnit(unit: StandardFieldConfig['unit']): this; setCustomFieldConfig(id: K, value: DeepPartial): this; setOverrides(builder: (b: FieldConfigOverridesBuilder) => void): this; /** * Set an individual panel option. This will merge the value with the existing options. */ setOption(id: K, value: DeepPartial): this; /** * Set data provider for the panel. */ setData(data: VizPanelState['$data']): this; /** * Set time range for the panel. */ setTimeRange(timeRange: VizPanelState['$timeRange']): this; /** * Set variables for the panel. */ setVariables(variables: VizPanelState['$variables']): this; /** * Set behaviors for the panel. */ setBehaviors(behaviors: VizPanelState['$behaviors']): this; /** * Sets the default series limit for the panel. */ setSeriesLimit(seriesLimit: VizPanelState['seriesLimit']): this; /** * Makes it possible to shared config between different builders */ applyMixin(mixin: (builder: this) => void): this; /** * Build the panel. */ build(): VizPanel; } declare class PanelOptionsBuilder { private defaultOptions?; private _options; constructor(defaultOptions?: (() => Partial) | undefined); private setDefaults; /** * Set an individual panel option. This will merge the value with the existing options. */ setOption(id: K, value: DeepPartial): this; build(): DeepPartial; } declare const PanelOptionsBuilders: { barchart(): PanelOptionsBuilder; bargauge(): PanelOptionsBuilder; flamegraph(): PanelOptionsBuilder<{}>; gauge(): PanelOptionsBuilder; geomap(): PanelOptionsBuilder; heatmap(): PanelOptionsBuilder; histogram(): PanelOptionsBuilder; logs(): PanelOptionsBuilder; news(): PanelOptionsBuilder; nodegraph(): PanelOptionsBuilder; piechart(): PanelOptionsBuilder; stat(): PanelOptionsBuilder; statetimeline(): PanelOptionsBuilder; statushistory(): PanelOptionsBuilder; table(): PanelOptionsBuilder; text(): PanelOptionsBuilder; timeseries(): PanelOptionsBuilder; trend(): PanelOptionsBuilder<{}>; traces(): PanelOptionsBuilder; xychart(): PanelOptionsBuilder; }; declare class FieldConfigBuilder implements StandardFieldConfigInterface, 'set'> { private defaultFieldConfig?; private _fieldConfig; private _overridesBuilder; constructor(defaultFieldConfig?: (() => TFieldConfig) | undefined); private setDefaults; /** * Set color. */ setColor(color: StandardFieldConfig['color']): this; /** * Set number of decimals to show. */ setDecimals(decimals: StandardFieldConfig['decimals']): this; /** * Set field display name. */ setDisplayName(displayName: StandardFieldConfig['displayName']): this; /** * Set the standard field config property filterable. */ setFilterable(filterable: StandardFieldConfig['filterable']): this; /** * Set data links. */ setLinks(links: StandardFieldConfig['links']): this; /** * Set value mappings. */ setMappings(mappings: StandardFieldConfig['mappings']): this; /** * Set the standard field config property max. */ setMax(max: StandardFieldConfig['max']): this; /** * Set the standard field config property min. */ setMin(min: StandardFieldConfig['min']): this; /** * Set the standard field config property noValue. */ setNoValue(noValue: StandardFieldConfig['noValue']): this; /** * Set the standard field config property thresholds. */ setThresholds(thresholds: StandardFieldConfig['thresholds']): this; /** * Set the standard field config property unit. */ setUnit(unit: StandardFieldConfig['unit']): this; /** * Set an individual custom field config value. This will merge the value with the existing custom field config. */ setCustomFieldConfig(id: K, value: DeepPartial): this; /** * Configure overrides for the field config. This will merge the overrides with the existing overrides. */ setOverrides(builder: (b: FieldConfigOverridesBuilder) => void): this; setFieldConfigDefaults(key: T, value: StandardFieldConfig[T]): this; build(): { defaults: _grafana_data.FieldConfig>; overrides: { matcher: _grafana_schema.MatcherConfig; properties: Array<{ id: string; value: unknown; }>; }[]; }; } declare const FieldConfigBuilders: { barchart(): FieldConfigBuilder; bargauge(): FieldConfigBuilder<{}>; flamegraph(): FieldConfigBuilder<{}>; gauge(): FieldConfigBuilder<{}>; geomap(): FieldConfigBuilder<{}>; heatmap(): FieldConfigBuilder; histogram(): FieldConfigBuilder; logs(): FieldConfigBuilder<{}>; news(): FieldConfigBuilder<{}>; nodegraph(): FieldConfigBuilder<{}>; piechart(): FieldConfigBuilder; stat(): FieldConfigBuilder<{}>; statetimeline(): FieldConfigBuilder; statushistory(): FieldConfigBuilder; table(): FieldConfigBuilder; text(): FieldConfigBuilder<{}>; timeseries(): FieldConfigBuilder; trend(): FieldConfigBuilder<{}>; traces(): FieldConfigBuilder; xychart(): FieldConfigBuilder<{}>; }; declare const PanelBuilders: { barchart(): VizPanelBuilder; bargauge(): VizPanelBuilder; flamegraph(): VizPanelBuilder<{}, {}>; gauge(): VizPanelBuilder; geomap(): VizPanelBuilder; heatmap(): VizPanelBuilder; histogram(): VizPanelBuilder; logs(): VizPanelBuilder; news(): VizPanelBuilder; nodegraph(): VizPanelBuilder; piechart(): VizPanelBuilder; stat(): VizPanelBuilder; statetimeline(): VizPanelBuilder; statushistory(): VizPanelBuilder; table(): VizPanelBuilder; text(): VizPanelBuilder; timeseries(): VizPanelBuilder; trend(): VizPanelBuilder<{}, {}>; traces(): VizPanelBuilder; xychart(): VizPanelBuilder; }; interface Props { scene: SceneObject; } /** * @internal * Please don't use from plugins directly. * This is already exposed via SceneAppPage and the ?scene-debugger query parameter. * * This is only exported so that core dashboards can use it. */ declare function SceneDebugger({ scene }: Props): React__default.JSX.Element; interface ControlsLabelProps { label: string; htmlFor?: string; description?: string; isLoading?: boolean; error?: string; icon?: IconName; layout?: ControlsLayout; prefix?: React__default.ReactNode; suffix?: React__default.ReactNode; className?: string; onCancel?: () => void; onRemove?: () => void; } declare function ControlsLabel(props: ControlsLabelProps): JSX.Element; declare function MultiOrSingleValueSelect({ model }: { model: MultiValueVariable; }): React__default.JSX.Element; declare class VizConfigBuilder implements StandardFieldConfigInterface, 'set'> { private _fieldConfigBuilder; private _panelOptionsBuilder; private _pluginId; private _pluginVersion; constructor(pluginId: string, pluginVersion: string, defaultOptions?: () => Partial, defaultFieldConfig?: () => TFieldConfig); /** * Set color. */ setColor(color: StandardFieldConfig['color']): this; /** * Set number of decimals to show. */ setDecimals(decimals: StandardFieldConfig['decimals']): this; /** * Set field display name. */ setDisplayName(displayName: StandardFieldConfig['displayName']): this; /** * Set the standard field config property filterable. */ setFilterable(filterable: StandardFieldConfig['filterable']): this; /** * Set data links. */ setLinks(links: StandardFieldConfig['links']): this; /** * Set value mappings. */ setMappings(mappings: StandardFieldConfig['mappings']): this; /** * Set the standard field config property max. */ setMax(max: StandardFieldConfig['max']): this; /** * Set the standard field config property min. */ setMin(min: StandardFieldConfig['min']): this; /** * Set the standard field config property noValue. */ setNoValue(noValue: StandardFieldConfig['noValue']): this; /** * Set the standard field config property thresholds. */ setThresholds(thresholds: StandardFieldConfig['thresholds']): this; /** * Set the standard field config property unit. */ setUnit(unit: StandardFieldConfig['unit']): this; setCustomFieldConfig(id: K, value: DeepPartial): this; setOverrides(builder: (b: FieldConfigOverridesBuilder) => void): this; /** * Set an individual panel option. This will merge the value with the existing options. */ setOption(id: K, value: DeepPartial): this; /** * Build the panel. */ build(): VizConfig; } declare const VizConfigBuilders: { barchart(): VizConfigBuilder; bargauge(): VizConfigBuilder; flamegraph(): VizConfigBuilder<{}, {}>; gauge(): VizConfigBuilder; geomap(): VizConfigBuilder; heatmap(): VizConfigBuilder; histogram(): VizConfigBuilder; logs(): VizConfigBuilder; news(): VizConfigBuilder; nodegraph(): VizConfigBuilder; piechart(): VizConfigBuilder; stat(): VizConfigBuilder; statetimeline(): VizConfigBuilder; statushistory(): VizConfigBuilder; table(): VizConfigBuilder; text(): VizConfigBuilder; timeseries(): VizConfigBuilder; trend(): VizConfigBuilder<{}, {}>; traces(): VizConfigBuilder; xychart(): VizConfigBuilder; }; declare class SafeSerializableSceneObject implements ScopedVar { #private; text: string; constructor(value: SceneObject); toString(): undefined; valueOf: () => SceneObject; get value(): this; } /** * Returns URL to Grafana explore for the queries in the given panel data and time range. */ declare function getExploreURL(data: PanelData, model: SceneObject, timeRange: RawTimeRange, transform?: (query: DataQuery) => DataQuery): Promise; /** * Loads the translation resources for the given language and returns them. */ declare const loadResources: ResourceLoader; declare const sceneUtils: { getUrlWithAppState: typeof getUrlWithAppState; registerRuntimePanelPlugin: typeof registerRuntimePanelPlugin; registerRuntimeDataSource: typeof registerRuntimeDataSource; registerVariableMacro: typeof registerVariableMacro; cloneSceneObjectState: typeof cloneSceneObjectState; syncStateFromSearchParams: typeof syncStateFromSearchParams; getUrlState: typeof getUrlState; renderPrometheusLabelFilters: typeof renderPrometheusLabelFilters; escapeLabelValueInRegexSelector: typeof escapeLabelValueInRegexSelector; escapeLabelValueInExactSelector: typeof escapeLabelValueInExactSelector; escapeURLDelimiters: typeof escapeURLDelimiters; getVariableControlId: (variableType: _grafana_schema.VariableType, key?: string) => string; isAdHocVariable: typeof isAdHocVariable; isConstantVariable: typeof isConstantVariable; isCustomVariable: typeof isCustomVariable; isDataSourceVariable: typeof isDataSourceVariable; isIntervalVariable: typeof isIntervalVariable; isQueryVariable: typeof isQueryVariable; isTextBoxVariable: typeof isTextBoxVariable; isGroupByVariable: typeof isGroupByVariable; isSwitchVariable: typeof isSwitchVariable; isRepeatCloneOrChildOf: typeof isRepeatCloneOrChildOf; buildPathIdFor: typeof buildPathIdFor; }; export { AdHocFiltersComboboxRenderer, AdHocFiltersVariable, AdHocFiltersVariableController, ConstantVariable, ControlsLabel, CustomVariable, DataProviderProxy, DataSourceVariable, EmbeddedScene, FieldConfigBuilder, FieldConfigBuilders, FieldConfigOverridesBuilder, GRID_CELL_HEIGHT, GRID_COLUMN_COUNT, GROUP_BY_OPERATOR, GroupByVariable, IntervalVariable, LazyLoader, LocalValueVariable, MultiOrSingleValueSelect, MultiValueVariable, NestedScene, NewSceneObjectAddedEvent, OPERATORS, PATH_ID_SEPARATOR, PanelBuilders, PanelOptionsBuilders, QueryVariable, RuntimeDataSource, SafeSerializableSceneObject, SceneApp, SceneAppPage, SceneByFrameRepeater, SceneByVariableRepeater, SceneCSSGridItem, SceneCSSGridLayout, SceneCanvasText, SceneControlsSpacer, SceneDataLayerBase, SceneDataLayerControls, SceneDataLayerSet, SceneDataLayerSetBase, SceneDataNode, SceneDataTransformer, SceneDebugger, SceneFlexItem, SceneFlexLayout, SceneGridItem, SceneGridLayout, SceneGridLayoutDragStartEvent, SceneGridRow, SceneObjectBase, SceneObjectRef, SceneObjectStateChangedEvent, SceneObjectUrlSyncConfig, SceneQueryRunner, SceneReactObject, SceneRefreshPicker, SceneTimePicker, SceneTimeRange, SceneTimeRangeCompare, SceneTimeRangeTransformerBase, SceneTimeZoneOverride, SceneToolbarButton, SceneToolbarInput, SceneVariableSet, SceneVariableValueChangedEvent, ScopesVariable, SplitLayout, SwitchVariable, TestVariable, TextBoxVariable, UrlSyncContextProvider, UrlSyncManager, UserActionEvent, VariableDependencyConfig, VariableValueControl, VariableValueSelectWrapper, VariableValueSelectors, VizConfigBuilder, VizConfigBuilders, VizPanel, VizPanelBuilder, VizPanelExploreButton, VizPanelMenu, index$2 as behaviors, index as dataLayers, escapeUrlPipeDelimiters, formatRegistry, getClosest, getExploreURL, getQueriesForVariables, isCustomVariableValue, isDataLayer, isDataRequestEnricher, isFiltersRequestEnricher, isGroupByFilter, isSceneObject, loadResources, index$1 as performanceUtils, registerQueryWithController, registerRuntimeDataSource, sceneGraph, sceneUtils, useSceneApp, useSceneObjectState, useUrlSync, writePerformanceLog }; export type { AdHocFilterInteractionHandler, AdHocFilterWithLabels, AdHocFiltersController, AdHocFiltersControllerState, CancelActivationHandler, ControlSourceRef, ControlsLayout, CustomFormatterVariable, CustomTransformOperator, CustomTransformerDefinition, CustomVariableValue, DataLayerFilter, DataRequestEnricher, DataSourceControlRef, DeepPartial, EmbeddedSceneState, ExtraQueryDataProcessor, ExtraQueryDescriptor, ExtraQueryProvider, FiltersRequestEnricher, FormatVariable, InterpolationFormatParameter, LazyLoaderMode, MacroVariableConstructor, MultiValueVariableState, OperatorDefinition, QueryRunnerState, SceneActivationHandler, SceneAppDrilldownView, SceneAppPageLike, SceneAppPageState, SceneAppRoute, SceneComponent, SceneComponentProps, SceneDataLayerProvider, SceneDataLayerProviderState, SceneDataProvider, SceneDataProviderResult, SceneDataQuery, SceneDataState, SceneDataTransformerState, SceneDeactivationHandler, SceneFlexItemLike, SceneFlexItemPlacement, SceneFlexItemState, SceneGridItemLike, SceneGridItemStateLike, SceneLayout, SceneLayoutChildOptions, SceneLayoutState, SceneObject, SceneObjectState, SceneObjectStateChangedPayload, SceneObjectUrlSyncHandler, SceneObjectUrlValue, SceneObjectUrlValues, SceneObjectWithUrlSync, SceneQueryControllerEntry, SceneQueryControllerEntryType, SceneQueryControllerLike, SceneRefreshPickerState, SceneRouteMatch, SceneStateChangedHandler, SceneStatelessBehavior, SceneTimeRangeLike, SceneTimeRangeState, SceneUrlSyncOptions, SceneVariable, SceneVariableDependencyConfigLike, SceneVariableSetState, SceneVariableState, SceneVariables, UrlSyncManagerLike, UseStateHookOptions, ValidateAndUpdateResult, VariableCustomFormatterFn, VariableGetOptionsArgs, VariableValue, VariableValueOption, VariableValueOptionProperties, VariableValueSingle, VizConfig, VizPanelState };