grafana/public/app/features/scenes/core/SceneTimeRange.tsx
Torkel Ödegaard 1fb37b54b3
Scenes: Enforce explicit accessibility modifiers (ESLint) (#58331)
* Public test

* Update

* Update

* revert

* Added some public accessability modifiers

* Force public acessability only for scenes/* folder

* Fixes
2022-11-07 15:32:02 +01:00

30 lines
810 B
TypeScript

import { TimeRange, UrlQueryMap } from '@grafana/data';
import { SceneObjectBase } from './SceneObjectBase';
import { SceneObjectWithUrlSync, SceneTimeRangeState } from './types';
export class SceneTimeRange extends SceneObjectBase<SceneTimeRangeState> implements SceneObjectWithUrlSync {
public onTimeRangeChange = (timeRange: TimeRange) => {
this.setState(timeRange);
};
public onRefresh = () => {
// TODO re-eval time range
this.setState({ ...this.state });
};
public onIntervalChanged = (_: string) => {};
/** These url sync functions are only placeholders for something more sophisticated */
public getUrlState() {
return {
from: this.state.raw.from,
to: this.state.raw.to,
} as any;
}
public updateFromUrl(values: UrlQueryMap) {
// TODO
}
}