import type { AgEvent } from 'ag-grid-enterprise'; import type { AgStudioCommon } from './agStudioCommon'; import type { AgReportState } from './state/agReportState'; export type AgStudioEventType = 'stateUpdated' | 'apiReady' | 'studioReady' | 'studioPreDestroyed' | 'errorRaised'; export interface AgStudioEvent extends AgEvent, AgStudioCommon { /** Event identifier */ type: TEventType; } export interface AgStudioStateUpdatedEvent extends AgStudioEvent<'stateUpdated', TContext> { /** Current state. */ state: AgReportState; } export interface AgStudioApiReadyEvent extends AgStudioEvent<'apiReady', TContext> { } export interface AgStudioReadyEvent extends AgStudioEvent<'studioReady', TContext> { } export interface AgStudioPreDestroyedEvent extends AgStudioEvent<'studioPreDestroyed', TContext> { /** Current state. */ state: AgReportState; } export interface AgStudioErrorRaisedEvent extends AgStudioEvent<'errorRaised', TContext> { /** Type of error. */ errorType: 'state' | 'validation'; /** Error details (one per error). */ errorDetails: string[]; /** * Is the error fatal. For fatal errors, the report cannot be loaded properly in Studio, * and it is recommended that the application takes action * (e.g. hide the report or load a different one). */ fatal: boolean; }