mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
24 lines
559 B
TypeScript
24 lines
559 B
TypeScript
import { CustomVariableModel, LoadingState, VariableHide } from '@grafana/data';
|
|
|
|
export function makeVariable(id: string, name: string, attributes?: Partial<CustomVariableModel>): CustomVariableModel {
|
|
return {
|
|
multi: false,
|
|
type: 'custom',
|
|
includeAll: false,
|
|
current: {},
|
|
options: [],
|
|
query: '',
|
|
rootStateKey: null,
|
|
global: false,
|
|
hide: VariableHide.dontHide,
|
|
skipUrlSync: false,
|
|
index: -1,
|
|
state: LoadingState.NotStarted,
|
|
error: null,
|
|
description: null,
|
|
...attributes,
|
|
id,
|
|
name,
|
|
};
|
|
}
|