@finos/legend-data-cube
Version:
78 lines • 3.78 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 { DataCubeViewState } from '../DataCubeViewState.js';
import type { DisplayState } from '../../services/DataCubeLayoutService.js';
import { ActionState, type PlainObject } from '@finos/legend-shared';
import { DataCubeColumnKind } from '../../core/DataCubeQueryEngine.js';
import type { DataCubeExtendManagerState } from './DataCubeExtendManagerState.js';
import { EngineError, V1_Lambda } from '@finos/legend-graph';
import type { DataCubeColumnConfiguration } from '../../core/model/DataCubeConfiguration.js';
import type { DataCubeSnapshotExtendedColumn } from '../../core/DataCubeSnapshot.js';
import { DataCubeCodeEditorState } from '../../../components/view/extend/DataCubeCodeEditorState.js';
import type { DataCubeSource } from '../../core/model/DataCubeSource.js';
export declare abstract class DataCubeColumnBaseEditorState extends DataCubeCodeEditorState {
protected readonly uuid: string;
protected readonly _manager: DataCubeExtendManagerState;
readonly view: DataCubeViewState;
private readonly _name;
readonly display: DisplayState;
readonly validationState: ActionState;
name: string;
expectedType: string;
isGroupLevel: boolean;
columnKind?: DataCubeColumnKind | undefined;
codeSuffix: string;
model: DataCubeSource;
queryLambda: () => V1_Lambda;
constructor(manager: DataCubeExtendManagerState, name: string, expectedType: string, isGroupLevel: boolean, columnKind: DataCubeColumnKind | undefined);
alertHandler: (error: Error) => void;
abstract getInitialCode(): Promise<string>;
initialize(): Promise<void>;
protected abstract newDisplay(state: DataCubeColumnBaseEditorState): DisplayState;
setName(value: string): void;
get isNameValid(): boolean;
setExpectedType(value: string): void;
get isTypeValid(): boolean;
setColumnKind(isGroupLevel: boolean, columnKind: DataCubeColumnKind | undefined): void;
showError(error: EngineError): void;
buildExtendBaseQuery: () => V1_Lambda;
getReturnType(): Promise<string | undefined>;
abstract applyChanges(): Promise<void>;
close(): void;
}
export declare class DataCubeNewColumnState extends DataCubeColumnBaseEditorState {
private initialCode;
constructor(manager: DataCubeExtendManagerState, referenceColumn?: DataCubeColumnConfiguration | undefined);
getInitialCode(): Promise<string>;
newDisplay(state: DataCubeColumnBaseEditorState): DisplayState;
applyChanges(): Promise<void>;
}
export declare class DataCubeExistingColumnEditorState extends DataCubeColumnBaseEditorState {
readonly initialData: {
name: string;
type: string;
kind: DataCubeColumnKind;
isGroupLevel: boolean;
mapFn: PlainObject<V1_Lambda>;
};
constructor(manager: DataCubeExtendManagerState, column: DataCubeSnapshotExtendedColumn, kind: DataCubeColumnKind, isGroupLevel: boolean);
get isNameValid(): boolean;
getInitialCode(): Promise<string>;
newDisplay(state: DataCubeColumnBaseEditorState): DisplayState;
reset(): Promise<void>;
applyChanges(): Promise<void>;
}
//# sourceMappingURL=DataCubeColumnEditorState.d.ts.map