File size: 22,096 Bytes
9195358
22bd475
9195358
 
 
 
 
 
 
 
 
 
 
 
 
 
 
492d0ff
 
 
 
 
 
9195358
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
06b9aa0
 
 
 
 
 
 
 
435367b
06b9aa0
9195358
 
 
22bd475
9195358
 
 
 
 
 
22bd475
9195358
 
 
 
 
22bd475
9195358
c95a54d
 
 
 
 
9195358
 
 
 
22bd475
9195358
492d0ff
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9195358
 
 
 
22bd475
9195358
 
 
 
 
22bd475
9195358
492d0ff
 
 
 
 
 
9195358
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b449fec
9195358
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22bd475
9195358
 
 
 
 
 
 
22bd475
9195358
 
 
 
 
22bd475
9195358
 
 
 
 
22bd475
9195358
 
 
7440231
9195358
 
 
e492ddc
9195358
 
 
 
 
 
 
 
 
 
dfbe206
140aae9
 
 
 
492d0ff
140aae9
 
 
 
492d0ff
9195358
 
7440231
9195358
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22bd475
9195358
 
 
 
 
 
 
 
 
 
22bd475
9195358
 
 
 
 
22bd475
9195358
 
 
 
22bd475
9195358
 
 
 
22bd475
9195358
 
 
 
22bd475
9195358
 
 
 
22bd475
9195358
 
 
 
22bd475
9195358
 
 
 
 
 
 
 
 
 
22bd475
9195358
 
 
 
 
 
 
 
 
 
 
 
fcd0eab
0faac17
 
 
 
 
 
fcd0eab
 
 
 
 
 
 
 
 
727f927
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9195358
 
7440231
9195358
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ad0769b
9195358
 
 
 
 
22bd475
9195358
 
 
 
22bd475
9195358
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22bd475
9195358
 
 
 
22bd475
9195358
 
 
 
 
22bd475
9195358
 
7440231
9195358
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ad0769b
9195358
 
 
 
22bd475
9195358
 
 
 
22bd475
9195358
 
 
 
 
22bd475
9195358
 
 
 
ad0769b
9195358
 
 
 
 
22bd475
9195358
9085f04
 
 
 
 
 
 
 
 
 
 
 
9195358
 
 
 
22bd475
9195358
9085f04
 
 
 
 
 
 
 
 
 
 
 
9195358
 
 
 
22bd475
9195358
9085f04
 
 
 
 
 
 
 
 
 
 
 
9195358
 
 
 
22bd475
9195358
9085f04
 
 
 
 
 
 
 
 
 
 
 
88eeb96
 
 
 
 
 
9195358
 
 
 
22bd475
0faac17
 
 
 
 
 
 
 
 
 
 
 
9195358
 
7440231
9195358
 
 
 
 
 
 
 
 
 
 
 
ad0769b
9195358
 
 
 
22bd475
9195358
 
 
 
22bd475
9195358
 
 
 
 
22bd475
9195358
 
7440231
9195358
dfbe206
 
 
 
6cc831a
 
 
 
 
22bd475
9195358
 
 
 
 
 
 
 
 
 
 
22bd475
9195358
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dfbe206
9195358
 
 
 
 
dfbe206
9195358
 
 
 
 
dfbe206
9195358
 
 
 
 
dfbe206
9195358
 
 
 
 
dfbe206
 
 
 
 
 
 
 
da9a4c9
 
 
 
 
 
dfbe206
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2dce84e
 
 
 
 
 
e5e57cf
 
 
 
 
9195358
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7ee7519
 
 
 
 
 
ce979ce
 
 
 
ddf993e
ce979ce
9195358
 
 
 
 
 
 
 
 
 
dfbe206
9195358
 
 
 
 
dfbe206
9195358
 
 
 
 
dfbe206
9195358
 
 
 
 
dfbe206
9195358
 
 
 
 
dfbe206
9195358
e5e57cf
 
 
 
 
9195358
 
 
 
 
dfbe206
9195358
 
 
 
 
 
dfbe206
9195358
 
 
 
 
 
dfbe206
864b5fe
 
 
 
140aae9
 
 
 
 
492d0ff
140aae9
 
 
 
492d0ff
9195358
 
 
 
 
 
 
 
22bd475
 
b449fec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
declare module 'driver.js' {
  class Driver {
    /**
     * Refers to the global document object
     */
    private document: Document;

    /**
     * Refers to the global window object
     */
    private window: Window;

    /**
     * If the driver is active or not
     */
    public isActivated: boolean;

    /**
     * Flag for if the current move was prevented. It is used in
     * onNext() or onPrevious() callbacks to stop the current transition
     */
    private currentMovePrevented: boolean;

    /**
     * Refers to the array of steps to be presented if any
     */
    private steps: Array<Driver.Step>;

    /**
     * Refers to step index that is currently active
     */
    private currentStep: number;

    /**
     * Refers to the overlay for the screen
     */
    private overlay: Driver.Overlay;

    /**
     * @param {DriverOptions} options
     */
    public constructor(options?: Driver.DriverOptions);

    /**
     * Public getter for steps property
     */
    public getSteps(): Array<Driver.Step>;

    /**
     * Public setter for steps property
     */
    public setSteps(): void;

    /**
     * Does the required bindings for DOM Events
     */
    private bind(): void;

    /**
     * Listener for the click event, to decide if
     * to next/previous step, reset the overlay etc
     * @param {Event} e
     */
    private onClick(e: Event): void;

    /**
     * Refreshes the driver and resets the position for stage
     * and popover on resizing the window
     */
    private onResize(): void;

    /**
     * Refreshes and repositions the popover and the overlay
     */
    private refresh(): void;

    /**
     * Makes it operable with keyboard
     * @param {Event} e
     */
    private onKeyUp(e: Event): void;

    /**
     * Handles the internal next event
     */
    private handleNext(): void;

    /**
     * Handles the internal previous event
     */
    private handlePrevious(): void;

    /**
     * Prevents the current move. Useful in `onNext` if you want to
     * perform some asynchronous task and manually move to next step
     */
    public preventMove(): void;

    /**
     * Moves to the previous step if possible
     * otherwise resets the overlay
     */
    public movePrevious(): void;

    /**
     * Moves to the next step if possible
     * otherwise resets the overlay
     */
    public moveNext(): void;

    /**
     * Prevents the current move. Useful in `onNext` if you want to
     * perform some asynchronous task and manually move to next step
     */
    preventMove(): void;

    /**
     * Checks if can be moved to next step
     * @return {boolean}
     */
    public hasNextStep(): boolean;

    /**
     * Checks if can be moved to previous step
     * @return {boolean}
     */
    public hasPreviousStep(): boolean;

    /**
     * Resets the steps and clears the overlay
     */
    public reset(immediate?: boolean): void;

    /**
     * Checks if there is any highlighted element or not
     * @return {boolean}
     */
    public hasHighlightedElement(): boolean;

    /**
     * Gets the currently highlighted element if any
     * @return {Driver.Element}
     */
    public getHighlightedElement(): Driver.Element | null;

    /**
     * Gets the last highlighted element if any
     * @return {Driver.Element}
     */
    public getLastHighlightedElement(): Driver.Element | null;

    /**
     * Defines the steps to be used in multi-step driver
     * @param {Array<Driver.Step>} steps
     */
    public defineSteps(steps: Array<Driver.Step>): void;

    /**
     * Prepares {Driver.Element} from the given step definition
     * @param {Driver.Step | string} step query selector or step definition for the step
     * @param {Array<Driver.Step>} allSteps all the given steps
     * @param {number} stepIndex array index for the current step
     */
    private prepareElementFromStep(step: Driver.Step | string, allSteps: Array<Driver.Step>, stepIndex: number): void;

    /**
     * Starts presenting the set steps from the given index
     * @param {number} index
     */
    public start(index?: number): void;

    /**
     * Highlights the given element. Element can be a query selector or a step definition
     * @param {string | Driver.Step} element
     */
    public highlight(element: string | Driver.Step): void;
  }

  namespace Driver {
    interface Step {
      /**
       * Query selector representing the DOM Element
       */
      element: string | HTMLElement | Node;

      /**
       * Color of stage when this step is active
       * @default #ffffff
       */
      stageBackground?: string;

      /**
       * Options representing popover for this step
       */
      popover?: Driver.PopoverOptions;

      /**
       * Is called when the next element is about to be highlighted
       */
      onNext?: (element: Driver.Element) => void;

      /**
       * Is called when the previous element is about to be highlighted
       */
      onPrevious?: (element: Driver.Element) => void;
    }

    class Element {
      /**
       * Refers to the DOM element that this class wraps
       */
      private node: Node | HTMLElement;
      /**
       * Refers to the global Document object
       */
      private document: Document;
      /**
       * Refers to the global window object
       */
      private window: Window;
      /**
       * Options for this element
       */
      private options: Driver.ElementOptions;
      /**
       * Refers to the overlay that wraps the body
       */
      private overlay: Driver.Overlay;
      /**
       * Refers to the Popover object to be displayed against this element
       */
      private popover: Driver.Popover;
      /**
       * Refers to the stage that will be displayed behind this element
       */
      private stage: Driver.Stage;

      /**
       * @param {HTMLElement | Node} node
       * @param {Driver.DriverOptions} options
       * @param {Driver.Popover} popover
       * @param {Driver.Stage} stage
       * @param {Driver.Overlay} overlay
       * @param {Window} window
       * @param {Document} document
       */
      constructor(node: HTMLElement | Node,
                  options: Driver.DriverOptions,
                  popover: Driver.Popover,
                  stage: Driver.Stage,
                  overlay: Driver.Overlay,
                  window: Window,
                  document: Document);

      /**
       * Checks if the give element is in view port or not
       * @return {boolean}
       */
      public isInView(): boolean;

      /**
       * Brings the current DOMElement in view
       */
      public bringInView(): void;

      /**
       * Gets the position of element on screen
       * @return {Driver.Position}
       */
      public getCalculatedPosition(): Driver.Position;

      /**
       * Manually scrolls to current element if scrollInToView is not supported
       */
      private scrollManually(): void;

      /**
       * Is called when the current element is deselected
       * @param {boolean} hideStage
       */
      private onDeselected(hideStage?: boolean): void;

      /**
       * Is called when element is about to be highlighted
       */
      private onHighlightStarted(): void;

      /**
       * Is called when element has been successfully highlighted
       */
      private onHighlighted(): void;

      /**
       * Shows the stage on the current element
       */
      private showStage(): void;

      /**
       * Hides the popover from the current element if visible
       */
      private hidePopover(): void;

      /**
       * Shows the popover on current element if possible
       */
      private showPopover(): void;

      /**
       * Gets the full page size
       */
      private getFullPageSize(): Driver.ElementSize;

      /**
       * Checks if the current element is same as passed element
       * @param {Driver.Element} element
       */
      private isSame(element: Driver.Element): void;

      /**
       * Gets the node that this element refers to
       * @return {Node | HTMLElement}
       */
      public getNode(): Node | HTMLElement;

      /**
       * Gets the size of current element
       * @return {Driver.ElementSize}
       */
      public getSize(): Driver.ElementSize;

      /**
       * Gets the popover on current element if any
       * @returns {Driver.Popover}
       */
      public getPopover(): Driver.Popover;

      /**
       * Removes the highlight classes from current element if any
       */
      private removeHighlightClasses(): void;

      /**
       * Adds the highlight classes to current element if required
       */
      private addHighlightClasses(): void;

      /**
       * Walks through the parents of the current element and fixes
       * the stacking context
       */
      private fixStackingContext(): void;

      /**
       * Checks if we can make the current element relative or not
       * @return {boolean}
       */
      private canMakeRelative(): boolean;

      /**
       * Get current element's CSS attribute value
       * @return {string}
       */
      private getStyleProperty(): string;
    }

    class Overlay {
      /**
       * Options to modify the overlay behavior
       */
      private options: Driver.DriverOptions;

      /**
       * Refers to currently highlighted element
       */
      private highlightedElement: Driver.Element | null;

      /**
       * Refers to element highlighted before currently highlighted element
       */
      private lastHighlightedElement: Driver.Element | null;

      /**
       * Refers to timeout handler used to animate while resetting
       */
      private hideTimer: number | null;

      /**
       * Refers to global object Window
       */
      private window: Window;

      /**
       * Refers to global object Document
       */
      private document: Document;

      /**
       * Prepares the DOM element for overlay and appends to body
       */
      private attachNode(): void;

      /**
       * Highlights the given Element while resetting the existing one
       * @param {Driver.Element} element
       */
      public highlight(element: Driver.Element): void;

      /**
       * Shows the overlay while appending to body if it is not there already
       */
      public show(): void;

      /**
       * Gets the highlighted element in overlay if any
       * @return {Driver.Element | null}
       */
      public getHighlightedElement(): Driver.Element | null;

      /**
       * Gets the element highlighted before current element if any
       * @return {Driver.Element | null}
       */
      public getLastHighlightedElement(): Driver.Element | null;

      /**
       * Removes the overlay and deselects the highlighted element. Does that with animation
       * by default or without animation if immediate is set to false
       * @param {boolean} immediate
       */
      public clear(immediate?: boolean): void;

      /**
       * Removes the overlay node if it exists
       */
      private removeNode(): void;

      /**
       * Refreshes the overlay i.e. sets the size according to current window size
       * And moves the highlight around if necessary
       */
      public refresh(): void;
    }

    class Popover {
      private node: Node | HTMLElement;
      private tipNode: Node | HTMLElement;
      private titleNode: Node | HTMLElement;
      private descriptionNode: Node | HTMLElement;
      private footerNode: Node | HTMLElement;
      private nextBtnNode: Node | HTMLElement;
      private prevBtnNode: Node | HTMLElement;
      private closeBtnNode: Node | HTMLElement;
      private window: Window;
      private document: Document;

      /**
       * @param {Driver.PopoverOptions} options
       * @param {Window} window
       * @param {Document} document
       */
      constructor(options: Driver.PopoverOptions,
                  window: Window,
                  document: Document);

      /**
       * Prepares the DOM element for popover and appends to the body
       */
      private attachNode(): void;

      /**
       * Hides the popover if visible
       */
      public hide(): void;

      /**
       * Sets the initial state for popover before changing position
       */
      private setInitialState(): void;

      /**
       * Shows the popover at the given position
       * @param {Driver.Position} position
       */
      public show(position: Driver.Position): void;

      /**
       * Renders the buttons in the footer of the popover
       */
      private renderFooter(): void;

      /**
       * Positions the popover to the left of the given element position
       * @param {Driver.Position} position
       */
      private positionOnLeft(position: Driver.Position): void;

      /**
       * Positions the popover to the left-center of the given element position
       * @param {Driver.Position} position
       */
      private positionOnLeftCenter(position: Driver.Position): void;

      /**
       * Positions the popover to the left-bottom of the given element position
       * @param {Driver.Position} position
       */
      private positionOnLeftBottom(position: Driver.Position): void;

      /**
       * Positions the popover to the right of the given element position
       * @param {Driver.Position} position
       */
      private positionOnRight(position: Driver.Position): void;

      /**
       * Positions the popover to the right-center of the given element position
       * @param {Driver.Position} position
       */
      private positionOnRightCenter(position: Driver.Position): void;

      /**
       * Positions the popover to the right-bottom of the given element position
       * @param {Driver.Position} position
       */
      private positionOnRightBottom(position: Driver.Position): void;

      /**
       * Positions the popover to the top of the given element position
       * @param {Driver.Position} position
       */
      private positionOnTop(position: Driver.Position): void;

      /**
       * Positions the popover to the top-center of the given element position
       * @param {Driver.Position} position
       */
      private positionOnTopCenter(position: Driver.Position): void;

      /**
       * Positions the popover to the top-right of the given element position
       * @param {Driver.Position} position
       */
      private positionOnTopRight(position: Driver.Position): void;

      /**
       * Positions the popover to the bottom of the given element position
       * @param {Driver.Position} position
       */
      private positionOnBottom(position: Driver.Position): void;

      /**
       * Positions the popover to the bottom-center of the given element position
       * @param {Driver.Position} position
       */
      private positionOnBottomCenter(position: Driver.Position): void;

      /**
       * Positions the popover to the bottom-right of the given element position
       * @param {Driver.Position} position
       */
      private positionOnBottomRight(position: Driver.Position): void;

      /**
       * Positions the popover to the middle center of the given element position
       * @param {Driver.Position} position
       */
      private positionOnMidCenter(position: Driver.Position): void;

      /**
       * Positions the popover automatically around the element position
       * @param {Driver.Position} position
       */
      private autoPosition(position: Driver.Position): void;

      /**
       * Gets the title node for popover
       * @returns {Node | HTMLElement}
       */
      public getTitleNode(): Node | HTMLElement;

      /**
       * Gets the description node for popover
       * @returns {Node | HTMLElement}
       */
      public getDescriptionNode(): Node | HTMLElement;
    }

    class Stage extends Element {
      /**
       * @param {Driver.StageOptions} options
       * @param {Window} window
       * @param {Document} document
       */
      constructor(options: Driver.StageOptions,
                  window: Window,
                  document: Document);

      /**
       * Prepares the node and appends to body if not there already
       */
      private attachNode(): void;

      /**
       * Hides the stage by removing the node
       */
      public hide(): void;

      /**
       * Sets the default properties on the node
       */
      private setInitialStyle(): void;

      /**
       * Shows the stage at provided position
       * @param {Driver.Position} position
       */
      public show(position: Driver.Position): void;
    }

    class Position {
      constructor({
                    left,
                    top,
                    bottom,
                    right,
                  }: {
                    left: number,
                    top: number,
                    bottom: number,
                    right: number
                  });

      /**
       * Checks if the given position is valid and can be highlighted
       * @return {boolean}
       */
      canHighlight(): boolean;

      /**
       * Checks if the given position is same as the passed position
       * @param {Driver.Position} position
       */
      equals(position: Driver.Position): void;
    }

    interface ScreenCoordinates {
      x: number;
      y: number;
    }

    interface ElementSize {
      width: number;
      height: number;
    }

    interface PopoverOptions {
      /**
       * Title for the popover
       */
      title?: string;

      /**
       * Description for the popover
       */
      description: string;

      /**
       * Whether to show control buttons or not
       * @default true
       */
      showButtons?: boolean;

      /**
       * Text on the button in the final step
       * @default 'Done'
       */
      doneBtnText?: string;

      /**
       * Text on the close button
       * @default 'Close'
       */
      closeBtnText?: string;

      /**
       * Text on the next button
       * @default 'Next'
       */
      nextBtnText?: string;

      /**
       * Text on the previous button
       * @default 'Previous'
       */
      prevBtnText?: string;

      /**
       * Total number of elements with popovers
       * @default 0
       */
      totalCount?: number;

      /**
       * Additional offset of the popover
       * @default 0
       */
      offset?: number;

      /**
       * Counter for the current popover
       * @default 0
       */
      currentIndex?: number;

      /**
       * If the current popover is the first one
       * @default true
       */
      isFirst?: boolean;

      /**
       * If the current popover is the last one
       * @default true
       */
      isLast?: boolean;

      /**
       * Position for the popover on element
       * @default auto
       */
      position?: string;

      /**
       * className for the popover on element
       */
      className?: string;
    }

    interface DriverOptions {
      /**
       * Whether to animate while transitioning from one highlighted
       * element to another
       * @default true
       */
      animate?: boolean;

      /**
       * Opacity for the overlay
       * @default 0.75
       */
      opacity?: number,

      /**
       * Distance of elements corner from the edges of the overlay
       * @default 10
       */
      padding?: number,

      /**
       * Options to be passed to scrollIntoView if supported by browser
       * @default { behavior: 'instant', block: 'center' }
       */
      scrollIntoViewOptions?: ScrollIntoViewOptions,

      /**
       * Clicking outside the highlighted element should reset driver or not
       * @default true
       */
      allowClose?: boolean,

      /**
       * Whether to allow controlling steps through keyboard
       * @default true
       */
      keyboardControl?: boolean,

      /**
       * Clicking outside the highlighted element should move next
       * @default false
       */
      overlayClickNext?: boolean,

      /**
       * Background color for the stage behind the highlighted element
       * @default '#ffffff'
       */
      stageBackground?: string,

      /**
       * Whether to show control buttons or not
       * @default true
       */
      showButtons?: boolean;

      /**
       * Text on the button in the final step
       * @default 'Done'
       */
      doneBtnText?: string;

      /**
       * Text on the close button
       * @default 'Close'
       */
      closeBtnText?: string;

      /**
       * Text on the next button
       * @default 'Next'
       */
      nextBtnText?: string;

      /**
       * Text on the previous button
       * @default 'Previous'
       */
      prevBtnText?: string;

      /**
       * className for the driver popovers
       */
      className?: string;

      /**
       * Callback to be called when element is about to be highlighted
       * @param {Driver.Element} element
       * @returns any
       */
      onHighlightStarted?: (element: Driver.Element) => void;

      /**
       * Callback to be called when element has been highlighted
       * @param {Driver.Element} element
       * @returns any
       */
      onHighlighted?: (element: Driver.Element) => void,

      /**
       * Callback to be called when element has been deselected
       * @param {Driver.Element} element
       * @returns any
       */
      onDeselected?: (element: Driver.Element) => void,

      /**
       * Is called when the overlay is about to reset
       */
      onReset?: (element: Driver.Element) => void,

      /**
       * Is called when the next element is about to be highlighted
       */
      onNext?: (element: Driver.Element) => void;

      /**
       * Is called when the previous element is about to be highlighted
       */
      onPrevious?: (element: Driver.Element) => void;
    }

    interface ElementOptions extends Driver.DriverOptions {
    }

    interface StageOptions extends ElementOptions {
    }
  }

  export = Driver;
}