import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next/types';
import type { EditorState, PluginKey } from '@atlaskit/editor-prosemirror/state';
import type { NewCollabSyncUpErrorAttributes } from '../../collab';
import type { UnsupportedContentPayload, UnsupportedContentTooltipPayload, UserBrowserExtensionResults } from '../../utils';
import type { FireAnalyticsEventOptions } from '../api';
import type { ActiveSessionEventPayload } from './activity-session-events';
import type { AICommandPaletteEventPayload } from './ai-command-palette-events';
import type { AIDefinitionsEventPayload } from './ai-definitions-events';
import type { AIEventPayload } from './ai-events';
import type { AIInlineSuggestionPayload } from './ai-inline-suggestion-events';
import type { AIProactiveEventPayload } from './ai-proactive-events';
import type { AIStreamingEventPayload } from './ai-streaming';
import type { AIUnifiedEventPayload } from './ai-unified-events';
import type { AlignmentEventPayload } from './alignment-events';
import type { AvatarEventPayload } from './avatar';
import type { BlockMenuEventPayload, ElementTransformErrorAEP } from './block-menu-events';
import type { BreakoutEventPayload } from './breakout-events';
import type { TextColorEventPayload } from './color-events';
import type { ConfigPanelEventPayload } from './config-panel-events';
import type { CutCopyEventPayload } from './cut-copy-events';
import type { DatasourceClickedPayload } from './datasource-clicked-events';
import type { DateEventPayload } from './date-events';
import type { ElementBrowserEventPayload } from './element-browser-events';
import type { ElementEventPayload } from './element-events';
import type { EngagementPlatformEventPayload } from './engagement-platform-events';
import type { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, CONTENT_COMPONENT, FLOATING_CONTROLS_TITLE, INPUT_METHOD } from './enums';
import type { ExperienceEventPayload } from './experience-events';
import type { ExtensionEventPayload } from './extension-events';
import type { FindReplaceEventPayload } from './find-replace-events';
import type { FloatingToolbarEventPayload } from './floating-toolbar-events';
import type { FloatingToolbarOverflowEventPayload } from './floating-toolbar-overflow-events';
import type { FormatEventPayload } from './format-events';
import type { GeneralEventPayload } from './general-events';
import type { HighlightActionsEventPayload } from './highlight-actions-menu-events';
import type { HighlightEventPayload } from './highlight-events';
import type { InsertEventPayload } from './insert-events';
import type { VisitedLinkAEP } from './link-events';
import type { CreateLinkInlineDialogEventPayload, EditLinkToolbarAEP, PreviewItemClickedAEP, OpenSettingsToolbarAEP, UnlinkToolbarAEP } from './link-tool-bar-events';
import type { ListEventPayload } from './list-events';
import type { LoomEventPayload } from './loom-events';
import type { MediaEventPayload } from './media-events';
import type { MentionEventPayload } from './mention-events';
import type { MoveContentEventPayload } from './move-content-events';
import type { NcsSessionStepEventAEP } from './ncs-session-step-events';
import type { NestedTableActionsEventPayload } from './nested-table-events';
import type { NodeEventPayload } from './node-events';
import type { OfflineEditingEventPayload } from './offline-editing-event';
import type { PasteEventPayload } from './paste-events';
import type { ReferentialityEventPayload } from './referentiality-events';
import type { SelectionEventPayload } from './selection-events';
import type { SelectionExtensionEventPayload } from './selection-extension-events';
import type { SelectionToolbarEventPayload } from './selection-toolbar-events';
import type { SubstituteEventPayload } from './substitute-events';
import type { SyncBlockEventPayload } from './sync-block-events';
import type { TableEventPayload } from './table-events';
import type { TelepointerClickPayload } from './telepointer-events';
import type { TypeAheadPayload } from './type-ahead';
import type { MediaUploadEventPayload } from './upload-media-events';
import type { OperationalAEP, OperationalExposureAEP, TrackAEP } from './utils';
import type { ViewEventPayload } from './view-events';
type Dispatch<T = any> = (eventName: PluginKey | string, data: T) => void;
export type SimplifiedNode = {
    content?: SimplifiedNode[];
    marks?: string[];
    nodeSize: number;
    pos: number;
    type: string;
};
export type AnalyticsEventPayload<T = void> = AvatarEventPayload | GeneralEventPayload<T> | FormatEventPayload | SubstituteEventPayload | InsertEventPayload | NodeEventPayload | MoveContentEventPayload | MediaEventPayload | TableEventPayload | PasteEventPayload | CutCopyEventPayload | ErrorEventPayload | TextColorEventPayload | FindReplaceEventPayload | DateEventPayload | SelectionEventPayload | ListEventPayload | ConfigPanelEventPayload | ElementBrowserEventPayload | CreateLinkInlineDialogEventPayload | HighlightActionsEventPayload | UnsupportedContentPayload | ExtensionEventPayload | TransactionEventPayload | TypeAheadPayload | UnlinkToolbarAEP | EditLinkToolbarAEP | PreviewItemClickedAEP | OpenSettingsToolbarAEP | CustomPanelEventPayload | FeatureExposureAEP | NewCollabSyncUpErrorAEP | UnsupportedContentTooltipPayload | ReferentialityEventPayload | LoomEventPayload | MBEEventPayload | HighlightEventPayload | DatasourceClickedPayload | ElementEventPayload | VisitedLinkAEP | ViewEventPayload | MediaUploadEventPayload | MentionEventPayload | EngagementPlatformEventPayload | NestedTableActionsEventPayload | AICommandPaletteEventPayload | AIDefinitionsEventPayload | AIEventPayload | AIStreamingEventPayload | AIProactiveEventPayload | AIUnifiedEventPayload | BreakoutEventPayload | BlockMenuEventPayload | ActiveSessionEventPayload | AIInlineSuggestionPayload | SelectionExtensionEventPayload | TelepointerClickPayload | SelectionToolbarEventPayload | ExperienceEventPayload | AlignmentEventPayload | UndoRedoAEP | OfflineEditingEventPayload | NcsSessionStepEventAEP | FloatingToolbarOverflowEventPayload | SyncBlockEventPayload | FloatingToolbarEventPayload;
type CustomPanelEventPayload = TrackAEP<ACTION.CHANGED_BACKGROUND_COLOR | ACTION.CHANGED_ICON | ACTION.REMOVE_ICON, ACTION_SUBJECT.PANEL, ACTION_SUBJECT_ID.PANEL, {
    newColor: string;
    previousColor: string;
} | {
    newIcon: string;
    previousIcon: string;
} | {
    icon: string;
}, undefined>;
type MBEEventPayload = TrackAEP<ACTION.ADD_CHILD | ACTION.CHANGE_ACTIVE | ACTION.DELETED | ACTION.REMOVE_CHILD | ACTION.UPDATE_PARAMETERS | ACTION.GET_CHILDREN | ACTION.GET_CHILDREN_CONTAINER, ACTION_SUBJECT.MULTI_BODIED_EXTENSION, undefined, {
    currentFramesCount: number;
    extensionKey: string;
    extensionType: string;
    inputMethod?: INPUT_METHOD.TOOLBAR | INPUT_METHOD.FLOATING_TB;
    localId: string;
}, undefined>;
type UndoRedoAEP = TrackAEP<ACTION.UNDO_PERFORMED | ACTION.REDO_PERFORMED, ACTION_SUBJECT.EDITOR, undefined, {
    affectedNodes?: {
        attributes: string[];
        type: string;
    }[];
    hasChanged?: boolean;
    inputMethod: INPUT_METHOD.KEYBOARD | INPUT_METHOD.TOOLBAR | INPUT_METHOD.EXTERNAL;
}, undefined>;
export type AnalyticsEventPayloadWithChannel = {
    channel: string;
    payload: AnalyticsEventPayload;
};
export type AnalyticsDispatch = Dispatch<{
    channel?: string;
    payload: AnalyticsEventPayload;
}>;
export type FeatureExposureAEP = OperationalExposureAEP<ACTION.EXPOSED, ACTION_SUBJECT.FEATURE, undefined, {
    flagKey: string;
    value: string | boolean;
}>;
type InvalidTransactionErrorAEP = OperationalAEP<ACTION.DISPATCHED_INVALID_TRANSACTION, ACTION_SUBJECT.EDITOR, undefined, {
    analyticsEventPayloads: AnalyticsEventPayloadWithChannel[];
    invalidNodes: (SimplifiedNode | string)[];
    isRemoteReplaceDocumentTransaction?: boolean;
}>;
type DispatchedValidTransactionAEP = OperationalAEP<ACTION.DISPATCHED_VALID_TRANSACTION, ACTION_SUBJECT.EDITOR, undefined, undefined>;
type InvalidTransactionStepErrorAEP = OperationalAEP<ACTION.DISCARDED_INVALID_STEPS_FROM_TRANSACTION, ACTION_SUBJECT.EDITOR, undefined, {
    analyticsEventPayloads: AnalyticsEventPayloadWithChannel[];
}>;
export type TransactionEventPayload = DispatchedValidTransactionAEP;
type FailedToUnmountErrorAEP = OperationalAEP<ACTION.FAILED_TO_UNMOUNT, ACTION_SUBJECT.EDITOR, ACTION_SUBJECT_ID.REACT_NODE_VIEW, {
    domNodes: {
        child?: string;
        container?: string;
    };
    error: Error;
}>;
type SynchronyErrorAEP = OperationalAEP<ACTION.SYNCHRONY_ERROR, ACTION_SUBJECT.EDITOR, undefined, {
    browserExtensions?: UserBrowserExtensionResults;
    docStructure?: string | SimplifiedNode;
    error: Error;
}>;
type NewCollabSyncUpErrorAEP = OperationalAEP<ACTION.NEW_COLLAB_SYNC_UP_ERROR_NO_STEPS, ACTION_SUBJECT.EDITOR, undefined, NewCollabSyncUpErrorAttributes>;
type InvalidDocumentEncounteredAEP = OperationalAEP<ACTION.INVALID_DOCUMENT_ENCOUNTERED, ACTION_SUBJECT.EDITOR, undefined, {
    nodeType: string;
    reason: string;
    spanValue: number;
    tableLocalId: string;
}>;
type SynchronyEntityErrorAEP = OperationalAEP<ACTION.SYNCHRONY_ENTITY_ERROR | ACTION.SYNCHRONY_DISCONNECTED, ACTION_SUBJECT.EDITOR, undefined, {
    onLine: boolean;
    visibilityState: string;
}>;
type ContentComponentErrorAEP = OperationalAEP<ACTION.ERRORED, ACTION_SUBJECT.CONTENT_COMPONENT, undefined, {
    component: CONTENT_COMPONENT;
    docSize: number;
    error: string;
    position: number;
    selection: {
        [key: string]: string;
    };
}>;
type PickerErrorAEP = OperationalAEP<ACTION.ERRORED, ACTION_SUBJECT.PICKER, ACTION_SUBJECT_ID, {
    error: string;
}>;
export type ErrorEventAttributes = {
    browserExtensions?: UserBrowserExtensionResults;
    browserInfo?: string;
    docStructure?: string | SimplifiedNode;
    error: Error;
    errorId?: string;
    errorInfo: React.ErrorInfo;
    errorRethrown?: boolean;
    outdatedBrowser?: boolean;
    product?: string;
};
type ComponentCrashErrorAEP = OperationalAEP<ACTION.EDITOR_CRASHED, ACTION_SUBJECT.FLOATING_CONTEXTUAL_BUTTON | ACTION_SUBJECT.PLUGIN_SLOT | ACTION_SUBJECT.REACT_NODE_VIEW | ACTION_SUBJECT.TABLES_PLUGIN | ACTION_SUBJECT.FLOATING_TOOLBAR_PLUGIN | ACTION_SUBJECT.EDITOR | ACTION_SUBJECT.BLOCK_MENU | ACTION_SUBJECT.SYNCED_BLOCK | ACTION_SUBJECT.TOOLBAR, ACTION_SUBJECT_ID | FLOATING_CONTROLS_TITLE, ErrorEventAttributes>;
type ComponentCrashAdditionalInfoErrorAEP = OperationalAEP<ACTION.EDITOR_CRASHED_ADDITIONAL_INFORMATION, ACTION_SUBJECT.EDITOR, undefined, {
    errorId: string;
}>;
type SmartLinkErrorAEP = OperationalAEP<ACTION.ERRORED, ACTION_SUBJECT.SMART_LINK, undefined, {
    error: string;
    errorStack?: string;
}>;
export type ErrorEventPayload = InvalidTransactionErrorAEP | InvalidTransactionStepErrorAEP | FailedToUnmountErrorAEP | SynchronyErrorAEP | InvalidDocumentEncounteredAEP | SynchronyEntityErrorAEP | ContentComponentErrorAEP | PickerErrorAEP | ComponentCrashErrorAEP | ComponentCrashAdditionalInfoErrorAEP | SmartLinkErrorAEP | ElementTransformErrorAEP;
export type AnalyticsEventPayloadCallback = (state: EditorState) => AnalyticsEventPayload | undefined;
export type FireAnalyticsCallback = <T>(payload: FireAnalyticsEventPayload<T>) => void | undefined;
export type FireAnalyticsEvent = (createAnalyticsEvent?: CreateUIAnalyticsEvent, options?: FireAnalyticsEventOptions) => FireAnalyticsCallback;
export type FireAnalyticsEventPayload<T = void> = {
    channel?: string;
    payload: AnalyticsEventPayload<T>;
};
export {};
