import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
import type { Step } from '@atlaskit/editor-prosemirror/transform';
import type { CollabEditPlugin } from '../collabEditPluginType';
export type SanitizedStep = {
    attr?: string;
    markType?: string;
    stepType: string;
};
export type StepMetadataAnalytics = {
    endedAt: number;
    startedAt: number;
    stepTypesAmount: {
        [key: string]: number;
    };
};
/**
 * Sanitizes a given ProseMirror step by extracting its type and non-UCG relevant attributes.
 *
 * @param {Step} step - The ProseMirror step to be sanitized.
 * @returns {SanitizedStep} - The sanitized step with only necessary information.
 *
 * @example
 * ```
 * const step = new AttrStep(10, 'colwidth', [123, 451] );
 * const sanitized = sanitizeStep(step);
 *
 * // Output: { stepType: 'attr', attr: 'example' }
 * ```
 */
export declare const sanitizeStep: (step: Step) => SanitizedStep;
/**
 * Groups sanitized steps by their type and counts their occurrences.
 *
 * @param {SanitizedStep[]} sanitizedSteps - An array of sanitized steps.
 * @returns {Record<string, number>} - An object where keys are step types and values are their counts.
 *
 * @example
 * ```
 * const input = [
 *   { stepType: 'attr', attr: 'colwidth' },
 *   { stepType: 'mark', markType: 'bold' },
 *   { stepType: 'attr', attr: 'colwidth' }
 * ];
 *
 * const grouped = groupSteps(input);
 * // Output: { 'attr_example': 2, 'mark_bold': 1 }
 * ```
 */
export declare const groupSteps: (sanitizedSteps: SanitizedStep[]) => Record<string, number>;
/**
 * Processes the steps metadata from the cache and calls the callback function with the processed data.
 *
 * @param {CacheType} cache - A cache containing steps metadata.
 * @param {(data: StepMetadataAnalytics[]) => void} onTrackDataProcessed - Callback function to be called with the processed data.
 */
export declare const task: (cache: CacheType, onTrackDataProcessed: (data: StepMetadataAnalytics[]) => void) => void;
export type CacheType = Map<number, {
    endedAt: number;
    startedAt: number;
    steps: ReadonlyArray<Step>;
}>;
type TrackProps = {
    api: ExtractInjectionAPI<CollabEditPlugin> | undefined;
    newEditorState: EditorState;
    onTrackDataProcessed: (data: StepMetadataAnalytics[]) => void;
    transactions: Readonly<Transaction[]>;
};
/**
 * Tracks the steps sent by the client by storing them in a cache and scheduling a task to process them. Once the steps are processed, the onTrackDataProcessed callabck will be called.
 *
 * This is a non-critical code. If the browser doesn't support the Scheduler API https://developer.mozilla.org/en-US/docs/Web/API/Scheduler/
 *
 * @param {TrackProps} props - The properties required for tracking steps.
 * @param {ExtractInjectionAPI<CollabEditPlugin> | undefined} props.api - The API for the CollabEdit plugin.
 * @param {EditorState} props.newEditorState - The new editor state.
 * @param {Readonly<Transaction[]>} props.transactions - The transactions that contain the steps.
 * @param {(data: StepMetadataAnalytics[]) => void} props.onTrackDataProcessed - Callback function to be called with the processed data.
 */
export declare const track: ({ api, newEditorState, transactions, onTrackDataProcessed, }: TrackProps) => void;
export {};
