demoghost 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,745 @@
1
+ export declare class AccessibilityManager {
2
+ private liveRegion;
3
+ private previousActiveElement;
4
+ private keydownHandler;
5
+ private announcementTimer;
6
+ constructor();
7
+ private initLiveRegion;
8
+ saveFocus(): void;
9
+ restoreFocus(): void;
10
+ announce(message: string): void;
11
+ bindKeyboardControls(options: {
12
+ onStop: () => void;
13
+ onTogglePause: () => void;
14
+ }): void;
15
+ destroy(): void;
16
+ }
17
+
18
+ export declare interface ActionExecutionContext {
19
+ step: DemoStep;
20
+ stepIndex: number;
21
+ totalSteps: number;
22
+ targetResolver: TargetResolverInterface;
23
+ cursor: CursorEngineInterface;
24
+ scrollEngine: ScrollEngineInterface;
25
+ spotlightEngine: SpotlightEngineInterface;
26
+ options: PlaybackOptions;
27
+ signal: AbortSignal;
28
+ isPaused: () => boolean;
29
+ waitIfPaused: () => Promise<void>;
30
+ log: (msg: string, ...args: any[]) => void;
31
+ }
32
+
33
+ export declare interface ActionHandler {
34
+ execute(context: ActionExecutionContext): Promise<void>;
35
+ }
36
+
37
+ export declare class ActionRegistry {
38
+ private handlers;
39
+ register(type: ActionType, handler: ActionHandler | ((context: ActionExecutionContext) => Promise<void>)): void;
40
+ get(type: ActionType): ActionHandler;
41
+ has(type: ActionType): boolean;
42
+ }
43
+
44
+ export declare type ActionType = "move" | "click" | "doubleClick" | "rightClick" | "type" | "clear" | "focus" | "blur" | "wait" | "scroll" | "scrollTo" | "select" | "check" | "uncheck" | "hover" | "press" | "highlight" | "caption" | "drag" | string;
45
+
46
+ export declare interface BaseStep {
47
+ type: ActionType;
48
+ caption?: string | CaptionOptions;
49
+ waitForTarget?: number;
50
+ delayBefore?: number;
51
+ delayAfter?: number;
52
+ [key: string]: any;
53
+ }
54
+
55
+ declare function blur_2(target: DemoTarget, options?: Partial<BlurStep>): BlurStep;
56
+ export { blur_2 as blur }
57
+
58
+ export declare interface BlurStep extends BaseStep {
59
+ type: "blur";
60
+ target: DemoTarget;
61
+ }
62
+
63
+ export declare function caption(textOrOptions: string | CaptionOptions, target?: DemoTarget): CaptionStep;
64
+
65
+ export declare interface CaptionOptions {
66
+ title?: string;
67
+ text: string;
68
+ position?: "top" | "bottom" | "left" | "right" | "auto";
69
+ duration?: number;
70
+ }
71
+
72
+ export declare interface CaptionStep extends BaseStep {
73
+ type: "caption";
74
+ options: CaptionOptions;
75
+ target?: DemoTarget;
76
+ }
77
+
78
+ export declare function check(target: DemoTarget, options?: Partial<CheckStep>): CheckStep;
79
+
80
+ export declare interface CheckStep extends BaseStep {
81
+ type: "check";
82
+ target: DemoTarget;
83
+ }
84
+
85
+ export declare function clear(target: DemoTarget, options?: Partial<ClearStep>): ClearStep;
86
+
87
+ export declare interface ClearStep extends BaseStep {
88
+ type: "clear";
89
+ target: DemoTarget;
90
+ }
91
+
92
+ export declare function click(target: DemoTarget, options?: Partial<ClickStep>): ClickStep;
93
+
94
+ export declare interface ClickStep extends BaseStep {
95
+ type: "click";
96
+ target: DemoTarget;
97
+ button?: "left" | "right" | "middle";
98
+ clickCount?: number;
99
+ }
100
+
101
+ export declare interface CursorConfig {
102
+ style?: CursorStyle;
103
+ customSvg?: string;
104
+ customElement?: HTMLElement;
105
+ size?: number;
106
+ color?: string;
107
+ }
108
+
109
+ export declare class CursorEngine implements CursorEngineInterface {
110
+ private element;
111
+ private pointerMode;
112
+ private config;
113
+ private position;
114
+ private activeAnimation;
115
+ private activeAnimationResolve;
116
+ private pendingTimers;
117
+ private ripples;
118
+ private container;
119
+ private deterministic;
120
+ private prefersReducedMotion;
121
+ constructor(options?: {
122
+ pointerMode?: PointerMode;
123
+ cursor?: CursorConfig;
124
+ container?: HTMLElement;
125
+ deterministic?: boolean;
126
+ });
127
+ private mount;
128
+ private renderCursorGraphic;
129
+ moveTo(x: number, y: number, duration?: number): Promise<void>;
130
+ click(_button?: string): Promise<void>;
131
+ doubleClick(): Promise<void>;
132
+ private createRipple;
133
+ private wait;
134
+ private schedule;
135
+ private removeRipple;
136
+ private finishActiveAnimation;
137
+ show(): void;
138
+ hide(): void;
139
+ setState(state: "default" | "pointer" | "text" | "active" | "hidden"): void;
140
+ getPosition(): Point;
141
+ private updatePosition;
142
+ destroy(): void;
143
+ }
144
+
145
+ export declare interface CursorEngineInterface {
146
+ moveTo(x: number, y: number, duration?: number): Promise<void>;
147
+ click(button?: string): Promise<void>;
148
+ doubleClick(): Promise<void>;
149
+ show(): void;
150
+ hide(): void;
151
+ setState(state: "default" | "pointer" | "text" | "active" | "hidden"): void;
152
+ getPosition(): {
153
+ x: number;
154
+ y: number;
155
+ };
156
+ destroy(): void;
157
+ }
158
+
159
+ export declare type CursorStyle = "classic" | "pointer" | "dot" | "minimal" | "custom";
160
+
161
+ export declare interface CustomTheme {
162
+ accent?: string;
163
+ cursor?: string;
164
+ glassBg?: string;
165
+ border?: string;
166
+ text?: string;
167
+ shadow?: string;
168
+ zIndexCursor?: number;
169
+ zIndexOverlay?: number;
170
+ }
171
+
172
+ export declare interface DemoGhostConfig extends PlaybackOptions {
173
+ defaultTimeout?: number;
174
+ typingSpeed?: TypingSpeed;
175
+ }
176
+
177
+ export declare class DemoGhostConfigurationError extends DemoGhostError {
178
+ constructor(message: string);
179
+ }
180
+
181
+ export declare class DemoGhostCore {
182
+ private static globalConfig;
183
+ static actions: ActionRegistry;
184
+ private static globalEmitter;
185
+ private static activeController;
186
+ static configure(config: DemoGhostConfig): void;
187
+ static play(scenarioOrSteps: DemoScenario | DemoStep[], options?: PlaybackOptions): PlaybackController;
188
+ static create(scenario: DemoScenario, defaultOptions?: PlaybackOptions): {
189
+ play: (options?: PlaybackOptions) => PlaybackController;
190
+ };
191
+ static on<K extends keyof PlaybackEvents>(event: K, listener: (data: PlaybackEvents[K]) => void): () => void;
192
+ static off<K extends keyof PlaybackEvents>(event: K, listener: (data: PlaybackEvents[K]) => void): void;
193
+ }
194
+
195
+ export declare class DemoGhostError extends Error {
196
+ constructor(message: string);
197
+ }
198
+
199
+ export declare class DemoGhostPlaybackError extends DemoGhostError {
200
+ readonly stepIndex?: number;
201
+ constructor(message: string, stepIndex?: number);
202
+ }
203
+
204
+ export declare class DemoGhostRecordingError extends DemoGhostError {
205
+ constructor(message: string);
206
+ }
207
+
208
+ export declare class DemoGhostTargetNotFoundError extends DemoGhostError {
209
+ readonly target: string;
210
+ readonly timeout: number;
211
+ readonly stepIndex?: number;
212
+ constructor(target: string, timeout: number, stepIndex?: number);
213
+ }
214
+
215
+ export declare class DemoGhostTimeoutError extends DemoGhostError {
216
+ readonly condition: string;
217
+ readonly timeout: number;
218
+ constructor(condition: string, timeout: number);
219
+ }
220
+
221
+ export declare interface DemoScenario {
222
+ id?: string;
223
+ name?: string;
224
+ description?: string;
225
+ version?: number;
226
+ tags?: string[];
227
+ steps: DemoStep[];
228
+ }
229
+
230
+ export declare type DemoStep = MoveStep | ClickStep | DoubleClickStep | RightClickStep | TypeStep | ClearStep | FocusStep | BlurStep | WaitStep | ScrollStep | ScrollToStep | SelectStep | CheckStep | UncheckStep | HoverStep | PressStep | HighlightStep | CaptionStep | DragStep | BaseStep;
231
+
232
+ export declare type DemoTarget = TargetSelector | TargetOptions;
233
+
234
+ export declare type DemoTheme = ThemeName | CustomTheme;
235
+
236
+ export declare function doubleClick(target: DemoTarget, options?: Partial<DoubleClickStep>): DoubleClickStep;
237
+
238
+ export declare interface DoubleClickStep extends BaseStep {
239
+ type: "doubleClick";
240
+ target: DemoTarget;
241
+ }
242
+
243
+ export declare function drag(source: DemoTarget, target: DemoTarget, options?: Partial<DragStep>): DragStep;
244
+
245
+ export declare interface DragStep extends BaseStep {
246
+ type: "drag";
247
+ source: DemoTarget;
248
+ target: DemoTarget;
249
+ duration?: number;
250
+ }
251
+
252
+ export declare class EventEmitter<Events extends Record<string, any>> {
253
+ private listeners;
254
+ on<K extends keyof Events>(event: K, listener: (data: Events[K]) => void): () => void;
255
+ off<K extends keyof Events>(event: K, listener: (data: Events[K]) => void): void;
256
+ emit<K extends keyof Events>(event: K, data: Events[K]): void;
257
+ removeAllListeners(): void;
258
+ }
259
+
260
+ declare function focus_2(target: DemoTarget, options?: Partial<FocusStep>): FocusStep;
261
+ export { focus_2 as focus }
262
+
263
+ export declare interface FocusStep extends BaseStep {
264
+ type: "focus";
265
+ target: DemoTarget;
266
+ }
267
+
268
+ export declare function highlight(target: DemoTarget, options?: Partial<HighlightStep>): HighlightStep;
269
+
270
+ export declare interface HighlightStep extends BaseStep {
271
+ type: "highlight";
272
+ target: DemoTarget;
273
+ duration?: number;
274
+ style?: "glow" | "spotlight" | "outline" | "pulse";
275
+ }
276
+
277
+ export declare function hover(target: DemoTarget, duration?: number, options?: Partial<HoverStep>): HoverStep;
278
+
279
+ export declare interface HoverStep extends BaseStep {
280
+ type: "hover";
281
+ target: DemoTarget;
282
+ duration?: number;
283
+ }
284
+
285
+ export declare function move(target: DemoTarget, options?: Partial<MoveStep>): MoveStep;
286
+
287
+ export declare interface MoveStep extends BaseStep {
288
+ type: "move";
289
+ target: DemoTarget;
290
+ duration?: number;
291
+ }
292
+
293
+ export declare class PlaybackController implements PlaybackControllerInterface {
294
+ private scenario;
295
+ private options;
296
+ private actionRegistry;
297
+ private emitter;
298
+ private _state;
299
+ private _currentStep;
300
+ private _speed;
301
+ private abortController;
302
+ private pauseResolver;
303
+ private runPromise;
304
+ private enginesInitialized;
305
+ private finishResolver;
306
+ private finishRejecter;
307
+ finished: Promise<void>;
308
+ private targetResolver;
309
+ private cursorEngine;
310
+ private scrollEngine;
311
+ private spotlightEngine;
312
+ private a11y;
313
+ constructor(scenario: DemoScenario, options: PlaybackOptions | undefined, actionRegistry: ActionRegistry, emitter?: EventEmitter<PlaybackEvents>);
314
+ private initEngines;
315
+ private resetFinishedPromise;
316
+ get state(): PlaybackState;
317
+ get currentStep(): number;
318
+ get totalSteps(): number;
319
+ get speed(): number;
320
+ set speed(val: number);
321
+ play(): Promise<void>;
322
+ private runPlayback;
323
+ private executeStep;
324
+ pause(): void;
325
+ resume(): void;
326
+ stop(): void;
327
+ restart(): Promise<void>;
328
+ next(): Promise<void>;
329
+ previous(): Promise<void>;
330
+ private waitIfPaused;
331
+ private waitForDuration;
332
+ private cleanup;
333
+ then<TResult1 = void, TResult2 = never>(onfulfilled?: ((value: void) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>;
334
+ private log;
335
+ on<K extends keyof PlaybackEvents>(event: K, listener: (data: PlaybackEvents[K]) => void): () => void;
336
+ off<K extends keyof PlaybackEvents>(event: K, listener: (data: PlaybackEvents[K]) => void): void;
337
+ }
338
+
339
+ export declare interface PlaybackControllerInterface extends PromiseLike<void> {
340
+ readonly state: PlaybackState;
341
+ readonly currentStep: number;
342
+ readonly totalSteps: number;
343
+ readonly finished: Promise<void>;
344
+ speed: number;
345
+ play(): Promise<void>;
346
+ pause(): void;
347
+ resume(): void;
348
+ stop(): void;
349
+ restart(): Promise<void>;
350
+ next(): Promise<void>;
351
+ previous(): Promise<void>;
352
+ on<K extends keyof PlaybackEvents>(event: K, listener: (data: PlaybackEvents[K]) => void): () => void;
353
+ off<K extends keyof PlaybackEvents>(event: K, listener: (data: PlaybackEvents[K]) => void): void;
354
+ }
355
+
356
+ export declare interface PlaybackEvents {
357
+ start: {
358
+ scenario: DemoScenario;
359
+ };
360
+ "step:start": {
361
+ step: DemoStep;
362
+ index: number;
363
+ total: number;
364
+ };
365
+ "step:complete": {
366
+ step: DemoStep;
367
+ index: number;
368
+ total: number;
369
+ };
370
+ pause: void;
371
+ resume: void;
372
+ complete: {
373
+ scenario: DemoScenario;
374
+ };
375
+ stop: void;
376
+ error: {
377
+ error: Error;
378
+ stepIndex?: number;
379
+ };
380
+ "record:start": void;
381
+ "record:stop": {
382
+ scenario: DemoScenario;
383
+ };
384
+ }
385
+
386
+ export declare interface PlaybackOptions {
387
+ speed?: number;
388
+ typingSpeed?: TypingSpeed;
389
+ defaultTimeout?: number;
390
+ pointer?: PointerMode;
391
+ cursor?: CursorConfig;
392
+ scroll?: ScrollConfig;
393
+ theme?: DemoTheme;
394
+ controls?: boolean;
395
+ debug?: boolean;
396
+ autoStart?: boolean;
397
+ loop?: boolean;
398
+ deterministic?: boolean;
399
+ container?: HTMLElement;
400
+ }
401
+
402
+ export declare type PlaybackState = "idle" | "playing" | "paused" | "completed" | "stopped" | "error";
403
+
404
+ declare interface Point {
405
+ x: number;
406
+ y: number;
407
+ }
408
+
409
+ export declare type PointerMode = "cursor" | "touch";
410
+
411
+ export declare function press(key: string, options?: Partial<PressStep>): PressStep;
412
+
413
+ export declare interface PressStep extends BaseStep {
414
+ type: "press";
415
+ key: string;
416
+ target?: DemoTarget;
417
+ }
418
+
419
+ export declare function rightClick(target: DemoTarget, options?: Partial<RightClickStep>): RightClickStep;
420
+
421
+ export declare interface RightClickStep extends BaseStep {
422
+ type: "rightClick";
423
+ target: DemoTarget;
424
+ }
425
+
426
+ declare function scroll_2(targetOrOptions?: DemoTarget | Partial<ScrollStep>, options?: Partial<ScrollStep>): ScrollStep;
427
+ export { scroll_2 as scroll }
428
+
429
+ export declare interface ScrollConfig {
430
+ behavior?: ScrollBehavior;
431
+ offset?: number;
432
+ }
433
+
434
+ export declare class ScrollEngine implements ScrollEngineInterface {
435
+ private config;
436
+ private activeScroll;
437
+ constructor(config?: ScrollConfig);
438
+ scrollIntoView(element: HTMLElement, customOffset?: number): Promise<void>;
439
+ scrollTo(x: number, y: number, behavior?: ScrollBehavior): Promise<void>;
440
+ private finishActiveScroll;
441
+ destroy(): void;
442
+ }
443
+
444
+ export declare interface ScrollEngineInterface {
445
+ scrollIntoView(element: HTMLElement, offset?: number): Promise<void>;
446
+ scrollTo(x: number, y: number, behavior?: ScrollBehavior): Promise<void>;
447
+ destroy(): void;
448
+ }
449
+
450
+ export declare interface ScrollStep extends BaseStep {
451
+ type: "scroll";
452
+ target?: DemoTarget;
453
+ x?: number;
454
+ y?: number;
455
+ offset?: number;
456
+ behavior?: ScrollBehavior;
457
+ }
458
+
459
+ declare function scrollTo_2(x: number, y: number, behavior?: ScrollBehavior): ScrollToStep;
460
+ export { scrollTo_2 as scrollTo }
461
+
462
+ export declare interface ScrollToStep extends BaseStep {
463
+ type: "scrollTo";
464
+ x: number;
465
+ y: number;
466
+ behavior?: ScrollBehavior;
467
+ }
468
+
469
+ export declare function select(target: DemoTarget, value: string | string[], options?: Partial<SelectStep>): SelectStep;
470
+
471
+ export declare interface SelectStep extends BaseStep {
472
+ type: "select";
473
+ target: DemoTarget;
474
+ value: string | string[];
475
+ }
476
+
477
+ export declare class SpotlightEngine implements SpotlightEngineInterface {
478
+ private container;
479
+ private overlayEl;
480
+ private captionEl;
481
+ private activeElement;
482
+ private activeStyle;
483
+ private activeTimer;
484
+ private activeTimerResolve;
485
+ constructor(container?: HTMLElement);
486
+ highlight(element: HTMLElement, options?: {
487
+ duration?: number;
488
+ style?: string;
489
+ caption?: CaptionOptions | string;
490
+ }): Promise<void>;
491
+ clearHighlight(): void;
492
+ private renderSpotlightOverlay;
493
+ showCaption(options: CaptionOptions, targetEl?: HTMLElement): void;
494
+ hideCaption(): void;
495
+ private escapeHtml;
496
+ destroy(): void;
497
+ }
498
+
499
+ export declare interface SpotlightEngineInterface {
500
+ highlight(element: HTMLElement, options?: {
501
+ duration?: number;
502
+ style?: string;
503
+ caption?: CaptionOptions | string;
504
+ }): Promise<void>;
505
+ clearHighlight(): void;
506
+ showCaption(options: CaptionOptions, targetEl?: HTMLElement): void;
507
+ hideCaption(): void;
508
+ destroy(): void;
509
+ }
510
+
511
+ export declare interface TargetOptions {
512
+ selector: TargetSelector;
513
+ timeout?: number;
514
+ waitForTarget?: number;
515
+ offset?: {
516
+ x?: number;
517
+ y?: number;
518
+ };
519
+ }
520
+
521
+ export declare class TargetResolver implements TargetResolverInterface {
522
+ private defaultTimeout;
523
+ constructor(defaultTimeout?: number);
524
+ resolve(target: DemoTarget, stepIndex?: number, signal?: AbortSignal): Promise<HTMLElement>;
525
+ resolveOptional(target: DemoTarget, signal?: AbortSignal): Promise<HTMLElement | null>;
526
+ private normalizeTarget;
527
+ private find;
528
+ querySingle(selector: string): HTMLElement | null;
529
+ private queryByText;
530
+ private pierceShadow;
531
+ }
532
+
533
+ export declare interface TargetResolverInterface {
534
+ resolve(target: DemoTarget, stepIndex?: number, signal?: AbortSignal): Promise<HTMLElement>;
535
+ resolveOptional(target: DemoTarget, signal?: AbortSignal): Promise<HTMLElement | null>;
536
+ }
537
+
538
+ export declare type TargetSelector = string | HTMLElement;
539
+
540
+ export declare class ThemeManager {
541
+ static apply(theme?: DemoTheme, container?: HTMLElement): void;
542
+ }
543
+
544
+ export declare type ThemeName = "auto" | "light" | "dark" | "glass";
545
+
546
+ export declare function type(target: DemoTarget, value: string, options?: Partial<TypeStep>): TypeStep;
547
+
548
+ export declare interface TypeStep extends BaseStep {
549
+ type: "type";
550
+ target: DemoTarget;
551
+ value: string;
552
+ speed?: TypingSpeed;
553
+ clearFirst?: boolean;
554
+ }
555
+
556
+ export declare type TypingSpeed = "instant" | "fast" | "normal" | "slow" | "human" | number;
557
+
558
+ export declare function uncheck(target: DemoTarget, options?: Partial<UncheckStep>): UncheckStep;
559
+
560
+ export declare interface UncheckStep extends BaseStep {
561
+ type: "uncheck";
562
+ target: DemoTarget;
563
+ }
564
+
565
+ export declare function wait(durationOrCondition: number | (() => boolean | Promise<boolean>), options?: Partial<WaitStep>): WaitStep;
566
+
567
+ export declare function waitFor(targetOrSelectorOrCondition: string | (() => boolean | Promise<boolean>) | {
568
+ selector: string;
569
+ state?: "visible" | "hidden" | "attached" | "detached";
570
+ timeout?: number;
571
+ }, options?: Partial<WaitStep>): WaitStep;
572
+
573
+ export declare interface WaitStep extends BaseStep {
574
+ type: "wait";
575
+ duration?: number;
576
+ condition?: () => boolean | Promise<boolean>;
577
+ selector?: string;
578
+ state?: "visible" | "hidden" | "attached" | "detached";
579
+ timeout?: number;
580
+ }
581
+
582
+
583
+
584
+
585
+ export declare class DemoGhostRecorder {
586
+ static record(options?: RecorderOptions): EventRecorder;
587
+ static serialize(scenario: DemoScenario): string;
588
+ static deserialize(json: string): DemoScenario;
589
+ static toTypeScript(scenario: DemoScenario): string;
590
+ static toJavaScript(scenario: DemoScenario): string;
591
+ }
592
+
593
+ export declare class EventRecorder {
594
+ private options;
595
+ private selectorGen;
596
+ private privacyMasker;
597
+ private steps;
598
+ private isRecording;
599
+ private lastActionTime;
600
+ private activeInputTimer;
601
+ private activeInputElement;
602
+ private activeInputValue;
603
+ private clickListener;
604
+ private inputListener;
605
+ private changeListener;
606
+ private scrollListener;
607
+ private keydownListener;
608
+ constructor(options?: RecorderOptions);
609
+ start(): void;
610
+ stop(): DemoScenario;
611
+ private bindEvents;
612
+ private unbindEvents;
613
+ private appendWaitIfNecessary;
614
+ private handleClick;
615
+ private handleInput;
616
+ private flushActiveInput;
617
+ private handleChange;
618
+ private handleKeydown;
619
+ private isTextEntryElement;
620
+ private handleScroll;
621
+ }
622
+
623
+ export declare class PrivacyMasker {
624
+ private maskPasswords;
625
+ private maskSelectors;
626
+ private ignoreSelectors;
627
+ constructor(options?: PrivacyOptions);
628
+ shouldIgnore(element: HTMLElement): boolean;
629
+ isSensitive(element: HTMLElement): boolean;
630
+ maskValue(element: HTMLElement, originalValue: string): string;
631
+ }
632
+
633
+ export declare interface PrivacyOptions {
634
+ maskPasswords?: boolean;
635
+ maskSelectors?: string[];
636
+ ignoreSelectors?: string[];
637
+ }
638
+
639
+ export declare interface RecorderOptions {
640
+ selector?: SelectorOptions;
641
+ privacy?: PrivacyOptions;
642
+ maskPasswords?: boolean;
643
+ maskSelectors?: string[];
644
+ ignoreSelectors?: string[];
645
+ captureScroll?: boolean;
646
+ captureKeyboard?: boolean;
647
+ minWaitDuration?: number;
648
+ }
649
+
650
+ export declare class ScenarioSerializer {
651
+ static serialize(scenario: DemoScenario): string;
652
+ static deserialize(json: string): DemoScenario;
653
+ static toTypeScript(scenario: DemoScenario): string;
654
+ static toJavaScript(scenario: DemoScenario): string;
655
+ private static formatStepCode;
656
+ private static formatOptions;
657
+ private static pickOptions;
658
+ private static formatValue;
659
+ }
660
+
661
+ export declare class SelectorGenerator {
662
+ private preferredAttributes;
663
+ private ignoreClasses;
664
+ private maxDepth;
665
+ constructor(options?: SelectorOptions);
666
+ generate(element: HTMLElement): string;
667
+ private getContextualSelector;
668
+ private isValidId;
669
+ private isUnique;
670
+ private getUniqueClassSelector;
671
+ private getHierarchicalPath;
672
+ }
673
+
674
+ export declare interface SelectorOptions {
675
+ preferredAttributes?: string[];
676
+ ignoreClasses?: string[];
677
+ maxDepth?: number;
678
+ }
679
+
680
+
681
+
682
+
683
+ export declare function attachControls(controller: PlaybackControllerInterface, options?: ControlsOptions): DemoGhostControls;
684
+
685
+ export declare interface ControlsOptions {
686
+ container?: HTMLElement;
687
+ showStepBadge?: boolean;
688
+ showProgress?: boolean;
689
+ showSpeed?: boolean;
690
+ }
691
+
692
+ export declare class DemoGhostControls {
693
+ private controller;
694
+ private options;
695
+ private rootElement;
696
+ private unsubs;
697
+ constructor(controller: PlaybackControllerInterface, options?: ControlsOptions);
698
+ private mount;
699
+ private render;
700
+ private attachListeners;
701
+ private bindEvents;
702
+ destroy(immediate?: boolean): void;
703
+ }
704
+
705
+
706
+
707
+
708
+ export declare class DemoGhost {
709
+ static actions: ActionRegistry;
710
+ static configure(config: DemoGhostConfig): void;
711
+ static play(scenarioOrSteps: DemoScenario | DemoStep[], options?: PlaybackOptions): PlaybackController;
712
+ static record(options?: RecorderOptions): EventRecorder;
713
+ static create(scenario: DemoScenario, defaultOptions?: PlaybackOptions): {
714
+ play: (options?: PlaybackOptions) => PlaybackController;
715
+ };
716
+ static serialize(scenario: DemoScenario): string;
717
+ static deserialize(json: string): DemoScenario;
718
+ static toTypeScript(scenario: DemoScenario): string;
719
+ static toJavaScript(scenario: DemoScenario): string;
720
+ static export(scenario: DemoScenario, format?: "json" | "ts" | "js"): string;
721
+ static on<K extends keyof PlaybackEvents>(event: K, listener: (data: PlaybackEvents[K]) => void): () => void;
722
+ static off<K extends keyof PlaybackEvents>(event: K, listener: (data: PlaybackEvents[K]) => void): void;
723
+ static move: typeof move;
724
+ static click: typeof click;
725
+ static doubleClick: typeof doubleClick;
726
+ static rightClick: typeof rightClick;
727
+ static type: typeof type;
728
+ static clear: typeof clear;
729
+ static focus: typeof focus;
730
+ static blur: typeof blur;
731
+ static wait: typeof wait;
732
+ static waitFor: typeof waitFor;
733
+ static scroll: typeof scroll;
734
+ static scrollTo: typeof scrollTo;
735
+ static select: typeof select;
736
+ static check: typeof check;
737
+ static uncheck: typeof uncheck;
738
+ static hover: typeof hover;
739
+ static press: typeof press;
740
+ static highlight: typeof highlight;
741
+ static caption: typeof caption;
742
+ static drag: typeof drag;
743
+ }
744
+
745
+ export default DemoGhost;