@finos/legend-data-cube
Version:
78 lines • 3.12 kB
TypeScript
/**
* 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 { DataCubeSpecification } from './core/model/DataCubeSpecification.js';
import type { DataCubeSource } from './core/model/DataCubeSource.js';
import type { DataCubeState } from './DataCubeState.js';
import type { DataCubeViewState } from './view/DataCubeViewState.js';
/**
* This is the API exposed externally by DataCube to restrict access to certain
* internal components and functionalities.
*/
export interface DataCubeAPI {
/**
* Get the processed source of the DataCube.
*/
getProcessedSource(): DataCubeSource | undefined;
/**
* Generates the specification (including the query, configuration, and source)
* from the latest state of the DataCube.
*/
generateSpecification(): Promise<DataCubeSpecification>;
/**
* Updates the name of the DataCube main view.
*/
updateName(name: string): void;
/**
* Applies the specification to the DataCube, i.e. update the query, configuration.
*
* Note that source cannot be updated via this method, providing a different source
* than the one the DataCube has will result in an error.
*/
applySpecification(specification: DataCubeSpecification): Promise<void>;
/**
* Retries all failed data fetches and rerender the grid.
*/
retryFailedDataFetches(): void;
/**
* (Force) reload/rerender the DataCube component.
*
* This is often used when updating settings that requires a restart.
*/
reload(): void;
/**
* Get the caching enabled state of the underlying grid.
*/
isCachingEnabled(): boolean;
}
/**
* This implementation wraps around DataCube state to expose a cleaner API to clients.
* It also provides a typing-hack for core components to access advanced functionalities,
* e.g. access to the internals of DataCube view state, grid client, etc., which should
* not be exposed externally via the public interface.
*/
export declare class INTERNAL__DataCubeAPI implements DataCubeAPI {
private readonly _dataCube;
constructor(dataCube: DataCubeState);
_runTaskForEachView(runner: (view: DataCubeViewState) => void): void;
getProcessedSource(): DataCubeSource | undefined;
generateSpecification(): Promise<DataCubeSpecification>;
updateName(name: string): void;
applySpecification(specification: DataCubeSpecification): Promise<void>;
retryFailedDataFetches(): void;
reload(): void;
isCachingEnabled(): boolean;
}
//# sourceMappingURL=DataCubeAPI.d.ts.map