import { type IDataView } from "@gooddata/sdk-backend-spi";
import { type IExecutionDefinition, type ObjRef } from "@gooddata/sdk-model";
import { type GoodDataSdkError } from "@gooddata/sdk-ui";
import { type DashboardEventBody, type IDashboardEvent } from "./base.js";
/**
 * Payload of the {@link IDashboardWidgetExecutionStarted} event.
 * @beta
 */
export interface IDashboardWidgetExecutionStartedPayload {
    /**
     * Reference to the widget that this event relates to.
     */
    widgetRef: ObjRef;
    /**
     * Instance of {@link @gooddata/sdk-model#IExecutionDefinition} that the widget executed.
     */
    executionDefinition: IExecutionDefinition;
}
/**
 * This event is emitted after execution of an insight widget starts.
 *
 * @beta
 */
export interface IDashboardWidgetExecutionStarted extends IDashboardEvent {
    readonly type: "GDC.DASH/EVT.WIDGET.EXECUTION_STARTED";
    readonly payload: IDashboardWidgetExecutionStartedPayload;
}
/**
 * @beta
 */
export declare function widgetExecutionStarted(widgetRef: ObjRef, executionDefinition: IExecutionDefinition, correlationId?: string): DashboardEventBody<IDashboardWidgetExecutionStarted>;
/**
 * Tests whether the provided object is an instance of {@link IDashboardWidgetExecutionStarted}.
 *
 * @param obj - object to test
 * @beta
 */
export declare const isDashboardWidgetExecutionStarted: (obj: unknown) => obj is IDashboardWidgetExecutionStarted;
/**
 * Payload of the {@link IDashboardWidgetExecutionFailed} event.
 * @beta
 */
export interface IDashboardWidgetExecutionFailedPayload {
    /**
     * Instance of {@link @gooddata/sdk-ui#GoodDataSdkError} with the information about the error the related execution failed with.
     */
    error: GoodDataSdkError;
    /**
     * Reference to the widget that this event relates to.
     */
    widgetRef: ObjRef;
}
/**
 * This event is emitted after execution of an insight widget fails.
 *
 * @beta
 */
export interface IDashboardWidgetExecutionFailed extends IDashboardEvent {
    readonly type: "GDC.DASH/EVT.WIDGET.EXECUTION_FAILED";
    readonly payload: IDashboardWidgetExecutionFailedPayload;
}
/**
 * @beta
 */
export declare function widgetExecutionFailed(widgetRef: ObjRef, error: GoodDataSdkError, correlationId?: string): DashboardEventBody<IDashboardWidgetExecutionFailed>;
/**
 * Tests whether the provided object is an instance of {@link IDashboardWidgetExecutionFailed}.
 *
 * @param obj - object to test
 * @beta
 */
export declare const isDashboardWidgetExecutionFailed: (obj: unknown) => obj is IDashboardWidgetExecutionFailed;
/**
 * Payload of the {@link IDashboardWidgetExecutionSucceeded} event.
 * @beta
 */
export interface IDashboardWidgetExecutionSucceededPayload {
    /**
     * Instance of {@link @gooddata/sdk-backend-spi#IDataView} with the data the widget first requested.
     */
    dataView: IDataView;
    /**
     * Reference to the widget that this event relates to.
     */
    widgetRef: ObjRef;
}
/**
 * This event is emitted after execution of an insight widget succeeds.
 *
 * @beta
 */
export interface IDashboardWidgetExecutionSucceeded extends IDashboardEvent {
    readonly type: "GDC.DASH/EVT.WIDGET.EXECUTION_SUCCEEDED";
    readonly payload: IDashboardWidgetExecutionSucceededPayload;
}
/**
 * @beta
 */
export declare function widgetExecutionSucceeded(widgetRef: ObjRef, dataView: IDataView, correlationId?: string): DashboardEventBody<IDashboardWidgetExecutionSucceeded>;
/**
 * Tests whether the provided object is an instance of {@link IDashboardWidgetExecutionSucceeded}.
 *
 * @param obj - object to test
 * @beta
 */
export declare const isDashboardWidgetExecutionSucceeded: (obj: unknown) => obj is IDashboardWidgetExecutionSucceeded;
//# sourceMappingURL=widget.d.ts.map