UNPKG

@finos/legend-data-cube

Version:
69 lines 3.88 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 DebouncedFunc } from '@finos/legend-shared'; import type { CellDoubleClickedEvent, GridApi } from 'ag-grid-community'; import type { DataCubeViewState } from '../DataCubeViewState.js'; import { DataCubeGridClientServerSideDataSource } from './DataCubeGridClientEngine.js'; import { DataCubeSnapshotController } from '../../services/DataCubeSnapshotService.js'; import type { DataCubeSnapshot } from '../../core/DataCubeSnapshot.js'; import { DataCubeConfiguration } from '../../core/model/DataCubeConfiguration.js'; import { DataCubeGridControllerState } from './DataCubeGridControllerState.js'; import { DataCubeGridClientExportEngine } from './DataCubeGridClientExportEngine.js'; import { type DataCubeDimensionalMetadata } from './DataCubeGridDimensionalTree.js'; /** * This query editor state is responsible for syncing the internal state of ag-grid * server-side row model data source with the data cube query state. When new snapshot * is published, this editor will translate parts of the snapshot into ag-grid grid * configuration to update; on the other hand, when the grid is interacted with in a way * that impacts the data state of the server-side row model datasource (e.g. filter, sort * pivot, etc.), getRows() is called, a new snapshot is published. * See https://www.ag-grid.com/javascript-data-grid/server-side-model-datasource/#implementing-the-server-side-datasource * * NOTE: The server-side row model data source state is not 1-1 with data cube query state * so we need the {@link DataCubeGridControllerState} to bridge this gap. For example, * interactions like column pinning, column resizing, etc. are not handled by server-side * row model datasource, so without the companion grid controller, these changes will not * trigger publishing a new snapshot, hence not propagated. */ export declare class DataCubeGridState extends DataCubeSnapshotController { private readonly _view; readonly controller: DataCubeGridControllerState; readonly exportEngine: DataCubeGridClientExportEngine; private _client?; clientDataSource: DataCubeGridClientServerSideDataSource; configuration: DataCubeConfiguration; rowLimit?: number | undefined; isPaginationEnabled: boolean; isCachingEnabled: boolean; scrollHintText?: string | undefined; debouncedAutoResizeColumns?: DebouncedFunc<() => void>; constructor(view: DataCubeViewState); setPaginationEnabled(val: boolean): void; setCachingEnabled(val: boolean, options?: { suppressWarning?: boolean | undefined; }): Promise<void>; setScrollHintText(val: string | undefined): void; get isClientConfigured(): boolean; get client(): GridApi<any>; configureClient(val: GridApi | undefined): Promise<void>; configureDimensionGridClient(val: GridApi | undefined): Promise<void>; retrieveDrilloutData(metadata: Map<string, DataCubeDimensionalMetadata>, dimension: string): Promise<void>; retrieveDrilldownData(data?: CellDoubleClickedEvent): Promise<void>; private _applyDimensionalSnapshot; getSnapshotSubscriberName(): string; applySnapshot(snapshot: DataCubeSnapshot, previousSnapshot: DataCubeSnapshot | undefined): Promise<void>; } //# sourceMappingURL=DataCubeGridState.d.ts.map