1 | import { Node as PMNode } from 'prosemirror-model';
|
2 | import { Step, StepResult, StepMap, ReplaceStep, Mappable } from 'prosemirror-transform';
|
3 | export declare const analyticsStepType = "atlaskit-analytics";
|
4 | export declare const analyticsInvertStepType = "atlaskit-analytics-invert";
|
5 | export interface AnalyticsPayload {
|
6 | action: string;
|
7 | actionSubject: string;
|
8 | actionSubjectId?: string | null;
|
9 | attributes?: Record<string, any>;
|
10 | eventType: string;
|
11 | }
|
12 | export interface AnalyticsWithChannel<P extends AnalyticsPayload> {
|
13 | payload: P;
|
14 | channel: string;
|
15 | }
|
16 | declare enum HISTORY_ACTIONS {
|
17 | UNDID = "undid",
|
18 | REDID = "redid"
|
19 | }
|
20 | interface UndoAnalyticsEventPayload {
|
21 | action: HISTORY_ACTIONS.UNDID;
|
22 | actionSubject: string;
|
23 | actionSubjectId?: string;
|
24 | attributes?: Record<string, any>;
|
25 | eventType: string;
|
26 | }
|
27 | interface RedoAnalyticsEventPayload {
|
28 | action: HISTORY_ACTIONS.REDID;
|
29 | actionSubject: string;
|
30 | actionSubjectId?: string;
|
31 | attributes?: Record<string, any>;
|
32 | eventType: string;
|
33 | }
|
34 | declare type AnalyticsInvertPayload = UndoAnalyticsEventPayload | RedoAnalyticsEventPayload;
|
35 | export declare type AnalyticsInvertStep = AnalyticsStep<AnalyticsInvertPayload>;
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 | export declare class AnalyticsStep<P extends AnalyticsPayload> extends Step {
|
42 | analyticsEvents: AnalyticsWithChannel<P>[];
|
43 | pos?: number;
|
44 | private actionsToIgnore;
|
45 | constructor(analyticsEvents: AnalyticsWithChannel<P>[], actionsToIgnore?: string[], pos?: number);
|
46 | /**
|
47 | * Generate new undo/redo analytics event when step is inverted
|
48 | */
|
49 | invert(): AnalyticsStep<AnalyticsInvertPayload>;
|
50 | apply(doc: PMNode): StepResult<any>;
|
51 | map(mapping: Mappable): AnalyticsStep<P>;
|
52 | getMap(): StepMap;
|
53 | merge(other: Step): AnalyticsStep<P> | null;
|
54 | toJSON(): {
|
55 | stepType: string;
|
56 | };
|
57 | static fromJSON(): ReplaceStep<any>;
|
58 | }
|
59 | export {};
|