import type { AgChartTheme } from 'ag-charts-enterprise'; import type { AgEvent } from 'ag-grid-enterprise'; import type { DataQuery } from '../shared/query/dataQuery'; import type { AgDefaultRegistry } from './agDefaultRegistry'; import type { AgFormat } from './agFieldDefinition'; import type { AgFormats } from './agFormats'; import type { AgBaseRegistry } from './agRegistry'; import type { AgStudioProperties } from './agStudioProperties'; import type { ManagedStudioProperties, ManagedStudioPropertyKey } from './agStudioPropertiesInitial'; import type { AgResultShape } from './engine/agDataEngine'; import type { AgExecuteResult, AgStudioQuery } from './engine/agStudioQuery'; import type { AgReportState } from './state/agReportState'; import type { AgTranslate } from './studioLocaleKey'; export interface AgStudioApi { /** * Get the current state of Studio. * Can be used in conjunction with the `initialState` Studio property * or `api.setState()` to save and restore Studio state. */ getState(): AgReportState; /** * Set the current state of Studio. * Can be used in conjunction with `api.getState()` or `onStateUpdated` * to save and restore Studio state. * The state is expected to be a full state object, not a partial state object. * State must be updated immutably as Studio uses reference equality * to determine which parts of state have changed. */ setState(state: AgReportState): void; /** * Will destroy the Studio instance and release resources. * If you are using a framework you do not need to call this, * as Studio links in with the framework lifecycle. * However if you are using native JavaScript, * you need to call this to avoid a memory leak in your application. */ destroy(): void; /** * Returns the Studio properties value for a provided key. */ getProperty>(property: TKey): AgStudioProperties[TKey]; /** * Updates a single Studio property to the new value provided. * (Cannot be used on `Initial` properties.) * If updating multiple options, it is recommended to instead use `api.updateProperties()` * which batches update logic. */ setProperty>(property: TKey, value: AgStudioProperties[TKey]): void; /** * Updates the provided subset of Studio properties with the provided values. * (Cannot be used on `Initial` properties.) */ updateProperties(properties: ManagedStudioProperties): void; /** * Returns the `studioId` for the current Studio instance as specified via the Studio property * `studioId` or the auto assigned Studio ID if none was provided. */ getStudioId(): string; /** Reload all data from the data sources. */ reload(): void; } export interface StudioApiInternals { translate: AgTranslate; dispatchEvent(event: AgEvent): void; getFormat(format: TFormat): AgFormats[TFormat]; execute(...requests: { query: DataQuery | AgStudioQuery; options?: { shape?: AgResultShape; }; }[]): Promise; getChartTheme(): Pick; }