Fix - Type definitions
Browse files- types/index.d.ts +42 -27
types/index.d.ts
CHANGED
@@ -149,7 +149,7 @@ declare module 'driver.js' {
|
|
149 |
/**
|
150 |
* Options representing popover for this step
|
151 |
*/
|
152 |
-
popover
|
153 |
}
|
154 |
|
155 |
class Element {
|
@@ -439,10 +439,6 @@ declare module 'driver.js' {
|
|
439 |
}
|
440 |
|
441 |
class Stage extends Element {
|
442 |
-
private options: Driver.StageOptions;
|
443 |
-
private window: Window;
|
444 |
-
private document: Document;
|
445 |
-
|
446 |
/**
|
447 |
* @param {Driver.StageOptions} options
|
448 |
* @param {Window} window
|
@@ -475,16 +471,11 @@ declare module 'driver.js' {
|
|
475 |
}
|
476 |
|
477 |
class Position {
|
478 |
-
top: number;
|
479 |
-
left: number;
|
480 |
-
right: number;
|
481 |
-
bottom: number;
|
482 |
-
|
483 |
constructor({
|
484 |
-
left
|
485 |
-
top
|
486 |
-
bottom
|
487 |
-
right
|
488 |
});
|
489 |
|
490 |
/**
|
@@ -525,31 +516,55 @@ declare module 'driver.js' {
|
|
525 |
* Whether to show control buttons or not
|
526 |
* @default true
|
527 |
*/
|
528 |
-
showButtons
|
529 |
|
530 |
/**
|
531 |
* Text on the button in the final step
|
532 |
* @default 'Done'
|
533 |
*/
|
534 |
-
doneBtnText
|
535 |
|
536 |
/**
|
537 |
* Text on the close button
|
538 |
* @default 'Close'
|
539 |
*/
|
540 |
-
closeBtnText
|
541 |
|
542 |
/**
|
543 |
* Text on the next button
|
544 |
* @default 'Next'
|
545 |
*/
|
546 |
-
nextBtnText
|
547 |
|
548 |
/**
|
549 |
* Text on the previous button
|
550 |
* @default 'Previous'
|
551 |
*/
|
552 |
-
prevBtnText
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
553 |
}
|
554 |
|
555 |
interface DriverOptions {
|
@@ -594,52 +609,52 @@ declare module 'driver.js' {
|
|
594 |
* Whether to show control buttons or not
|
595 |
* @default true
|
596 |
*/
|
597 |
-
showButtons
|
598 |
|
599 |
/**
|
600 |
* Text on the button in the final step
|
601 |
* @default 'Done'
|
602 |
*/
|
603 |
-
doneBtnText
|
604 |
|
605 |
/**
|
606 |
* Text on the close button
|
607 |
* @default 'Close'
|
608 |
*/
|
609 |
-
closeBtnText
|
610 |
|
611 |
/**
|
612 |
* Text on the next button
|
613 |
* @default 'Next'
|
614 |
*/
|
615 |
-
nextBtnText
|
616 |
|
617 |
/**
|
618 |
* Text on the previous button
|
619 |
* @default 'Previous'
|
620 |
*/
|
621 |
-
prevBtnText
|
622 |
|
623 |
/**
|
624 |
* Callback to be called when element is about to be highlighted
|
625 |
* @param {Driver.Element} element
|
626 |
* @returns any
|
627 |
*/
|
628 |
-
onHighlightStarted
|
629 |
|
630 |
/**
|
631 |
* Callback to be called when element has been highlighted
|
632 |
* @param {Driver.Element} element
|
633 |
* @returns any
|
634 |
*/
|
635 |
-
onHighlighted
|
636 |
|
637 |
/**
|
638 |
* Callback to be called when element has been deselected
|
639 |
* @param {Driver.Element} element
|
640 |
* @returns any
|
641 |
*/
|
642 |
-
onDeselected
|
643 |
}
|
644 |
|
645 |
interface ElementOptions extends Driver.DriverOptions {
|
|
|
149 |
/**
|
150 |
* Options representing popover for this step
|
151 |
*/
|
152 |
+
popover?: Driver.PopoverOptions;
|
153 |
}
|
154 |
|
155 |
class Element {
|
|
|
439 |
}
|
440 |
|
441 |
class Stage extends Element {
|
|
|
|
|
|
|
|
|
442 |
/**
|
443 |
* @param {Driver.StageOptions} options
|
444 |
* @param {Window} window
|
|
|
471 |
}
|
472 |
|
473 |
class Position {
|
|
|
|
|
|
|
|
|
|
|
474 |
constructor({
|
475 |
+
left,
|
476 |
+
top,
|
477 |
+
bottom,
|
478 |
+
right,
|
479 |
});
|
480 |
|
481 |
/**
|
|
|
516 |
* Whether to show control buttons or not
|
517 |
* @default true
|
518 |
*/
|
519 |
+
showButtons?: boolean;
|
520 |
|
521 |
/**
|
522 |
* Text on the button in the final step
|
523 |
* @default 'Done'
|
524 |
*/
|
525 |
+
doneBtnText?: string;
|
526 |
|
527 |
/**
|
528 |
* Text on the close button
|
529 |
* @default 'Close'
|
530 |
*/
|
531 |
+
closeBtnText?: string;
|
532 |
|
533 |
/**
|
534 |
* Text on the next button
|
535 |
* @default 'Next'
|
536 |
*/
|
537 |
+
nextBtnText?: string;
|
538 |
|
539 |
/**
|
540 |
* Text on the previous button
|
541 |
* @default 'Previous'
|
542 |
*/
|
543 |
+
prevBtnText?: string;
|
544 |
+
|
545 |
+
/**
|
546 |
+
* Total number of elements with popovers
|
547 |
+
* @default 0
|
548 |
+
*/
|
549 |
+
totalCount?: number;
|
550 |
+
|
551 |
+
/**
|
552 |
+
* Counter for the current popover
|
553 |
+
* @default 0
|
554 |
+
*/
|
555 |
+
currentIndex?: number;
|
556 |
+
|
557 |
+
/**
|
558 |
+
* If the current popover is the first one
|
559 |
+
* @default true
|
560 |
+
*/
|
561 |
+
isFirst?: boolean;
|
562 |
+
|
563 |
+
/**
|
564 |
+
* If the current popover is the last one
|
565 |
+
* @default true
|
566 |
+
*/
|
567 |
+
isLast?: boolean;
|
568 |
}
|
569 |
|
570 |
interface DriverOptions {
|
|
|
609 |
* Whether to show control buttons or not
|
610 |
* @default true
|
611 |
*/
|
612 |
+
showButtons?: boolean;
|
613 |
|
614 |
/**
|
615 |
* Text on the button in the final step
|
616 |
* @default 'Done'
|
617 |
*/
|
618 |
+
doneBtnText?: string;
|
619 |
|
620 |
/**
|
621 |
* Text on the close button
|
622 |
* @default 'Close'
|
623 |
*/
|
624 |
+
closeBtnText?: string;
|
625 |
|
626 |
/**
|
627 |
* Text on the next button
|
628 |
* @default 'Next'
|
629 |
*/
|
630 |
+
nextBtnText?: string;
|
631 |
|
632 |
/**
|
633 |
* Text on the previous button
|
634 |
* @default 'Previous'
|
635 |
*/
|
636 |
+
prevBtnText?: string;
|
637 |
|
638 |
/**
|
639 |
* Callback to be called when element is about to be highlighted
|
640 |
* @param {Driver.Element} element
|
641 |
* @returns any
|
642 |
*/
|
643 |
+
onHighlightStarted?: (element: Driver.Element) => void;
|
644 |
|
645 |
/**
|
646 |
* Callback to be called when element has been highlighted
|
647 |
* @param {Driver.Element} element
|
648 |
* @returns any
|
649 |
*/
|
650 |
+
onHighlighted?: (element: Driver.Element) => void,
|
651 |
|
652 |
/**
|
653 |
* Callback to be called when element has been deselected
|
654 |
* @param {Driver.Element} element
|
655 |
* @returns any
|
656 |
*/
|
657 |
+
onDeselected?: (element: Driver.Element) => void,
|
658 |
}
|
659 |
|
660 |
interface ElementOptions extends Driver.DriverOptions {
|