UNPKG

@finos/legend-data-cube

Version:
76 lines 3.08 kB
/** * Copyright (c) 2020-present, Goldman Sachs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import type { DataCubeOptions } from '../DataCubeOptions.js'; import type { DataCubeLayoutService, DisplayState } from './DataCubeLayoutService.js'; import type { DataCubeEngine } from '../core/DataCubeEngine.js'; import type { DataCubeAPI } from '../DataCubeAPI.js'; import type { DataCubeLogService } from './DataCubeLogService.js'; export type DataCubeSettingValue = string | number | boolean | object | undefined; export type DataCubeSettingValues = { [key: string]: DataCubeSettingValue; }; export declare enum DataCubeSettingGroup { DEBUG = "Debug", EDITOR = "Editor", GRID = "Grid" } export declare enum DataCubeSettingType { BOOLEAN = "boolean", NUMERIC = "numeric", STRING = "string", ACTION = "action" } export type DataCubeSetting<T extends DataCubeSettingValue = any> = { key: string; title: string; group: string; type: DataCubeSettingType; defaultValue: T; action?: ((api: DataCubeAPI, newValue: T) => void) | undefined; description?: string | undefined; valueOptional?: boolean | undefined; requiresReload?: boolean | undefined; numericValueMin?: number | undefined; numericValueMax?: number | undefined; numericValueStep?: number | undefined; }; export declare class DataCubeSettingService { private readonly _engine; private readonly _logService; private readonly _layoutService; private readonly _options?; readonly display: DisplayState; readonly configurations: Map<string, DataCubeSetting<any>>; readonly defaultValues: Map<string, DataCubeSettingValue>; private readonly _defaultValuesHashCode; readonly values: Map<string, DataCubeSettingValue>; readonly currentValues: Map<string, DataCubeSettingValue>; constructor(engine: DataCubeEngine, logService: DataCubeLogService, layoutService: DataCubeLayoutService, options?: DataCubeOptions | undefined); private setValue; private getConfiguration; getBooleanValue(key: string): boolean; getNumericValue(key: string): number; getStringValue(key: string): string; private computeValuesHashCode; private get valuesHashCode(); private get currentValuesHashCode(); get allowRestoreDefaultValues(): boolean; restoreDefaultValues(): void; private getCurrentSettingValues; updateValue(api: DataCubeAPI, key: string, value: DataCubeSettingValue): void; save(api: DataCubeAPI): void; } //# sourceMappingURL=DataCubeSettingService.d.ts.map