@@ -523,90 +523,275 @@ declare module 'vscode' {
523
523
524
524
export namespace window {
525
525
526
+ /**
527
+ * A back button for [QuickPick](#QuickPick) and [InputBox](#InputBox).
528
+ *
529
+ * When a navigation 'back' button is needed this one should be used for consistency.
530
+ * It comes with a predefined icon, tooltip and location.
531
+ */
526
532
export const quickInputBackButton : QuickInputButton ;
527
533
534
+ /**
535
+ * Creates a [QuickPick](#QuickPick) to let the user pick an item from a list
536
+ * of items of type T.
537
+ *
538
+ * Note that in many cases the more convenient [window.showQuickPick](#window.showQuickPick)
539
+ * is easier to use.
540
+ *
541
+ * @return A new [QuickPick](#QuickPick).
542
+ */
528
543
export function createQuickPick < T extends QuickPickItem > ( ) : QuickPick < T > ;
529
544
545
+ /**
546
+ * Creates a [InputBox](#InputBox) to let the user enter some text input.
547
+ *
548
+ * Note that in many cases the more convenient [window.showInputBox](#window.showInputBox)
549
+ * is easier to use.
550
+ *
551
+ * @return A new [InputBox](#InputBox).
552
+ */
530
553
export function createInputBox ( ) : InputBox ;
531
554
}
532
555
556
+ /**
557
+ * A light-weight user input UI that is intially not visible. After
558
+ * configuring it through its properties the extension can make it
559
+ * visible by calling [QuickInput.show](#QuickInput.show).
560
+ *
561
+ * There are several reasons why this UI might have to be hidden and
562
+ * the extension will be notified through [QuickInput.onDidHide](#QuickInput.onDidHide).
563
+ * (Examples include: an explict call to [QuickInput.hide](#QuickInput.hide),
564
+ * the user pressing Esc, some other input UI opening, etc.)
565
+ *
566
+ * A user pressing Enter or some other gesture implying acceptance
567
+ * of the current state does not automatically hide this UI component.
568
+ * It is up to the extension to decide whether to accept the user's input
569
+ * and if the UI should indeed be hidden through a call to [QuickInput.hide](#QuickInput.hide).
570
+ *
571
+ * When the extension no longer needs this input UI, it should
572
+ * [QuickInput.dispose](#QuickInput.dispose) it to allow for freeing up
573
+ * any resources associated with it.
574
+ *
575
+ * See [QuickPick](#QuickPick) and [InputBox](#InputBox) for concrete UIs.
576
+ */
533
577
export interface QuickInput {
534
578
579
+ /**
580
+ * An optional title.
581
+ */
535
582
title : string | undefined ;
536
583
584
+ /**
585
+ * An optional current step count.
586
+ */
537
587
step : number | undefined ;
538
588
589
+ /**
590
+ * An optional total step count.
591
+ */
539
592
totalSteps : number | undefined ;
540
593
594
+ /**
595
+ * If the UI should allow for user input. Defaults to true.
596
+ *
597
+ * Change this to false, e.g., while validating user input or
598
+ * loading data for the next step in user input.
599
+ */
541
600
enabled : boolean ;
542
601
602
+ /**
603
+ * If the UI should show a progress indicator. Defaults to false.
604
+ *
605
+ * Change this to true, e.g., while loading more data or validating
606
+ * user input.
607
+ */
543
608
busy : boolean ;
544
609
610
+ /**
611
+ * If the UI should stay open even when loosing UI focus. Defaults to false.
612
+ */
545
613
ignoreFocusOut : boolean ;
546
614
615
+ /**
616
+ * Makes the input UI visible in its current configuration. Any other input
617
+ * UI will first fire an [QuickInput.onDidHide](#QuickInput.onDidHide) event.
618
+ */
547
619
show ( ) : void ;
548
620
621
+ /**
622
+ * Hides this input UI. This will also fire an [QuickInput.onDidHide](#QuickInput.onDidHide)
623
+ * event.
624
+ */
549
625
hide ( ) : void ;
550
626
627
+ /**
628
+ * An event signaling when this input UI is hidden.
629
+ *
630
+ * There are several reasons why this UI might have to be hidden and
631
+ * the extension will be notified through [QuickInput.onDidHide](#QuickInput.onDidHide).
632
+ * (Examples include: an explict call to [QuickInput.hide](#QuickInput.hide),
633
+ * the user pressing Esc, some other input UI opening, etc.)
634
+ */
551
635
onDidHide : Event < void > ;
552
636
637
+ /**
638
+ * Dispose of this input UI and any associated resources. If it is still
639
+ * visible, it is first hidden. After this call the input UI is no longer
640
+ * functional and no additional methods or properties on it should be
641
+ * accessed. Instead a new input UI should be created.
642
+ */
553
643
dispose ( ) : void ;
554
644
}
555
645
646
+ /**
647
+ * A concrete [QuickInput](#QuickInput) to let the user pick an item from a
648
+ * list of items of type T. The items can be filtered through a filter text field and
649
+ * there is an option [canSelectMany](#QuickPick.canSelectMany) to allow for
650
+ * selecting multiple items.
651
+ *
652
+ * Note that in many cases the more convenient [window.showQuickPick](#window.showQuickPick)
653
+ * is easier to use.
654
+ */
556
655
export interface QuickPick < T extends QuickPickItem > extends QuickInput {
557
656
657
+ /**
658
+ * Current value of the filter text.
659
+ */
558
660
value : string ;
559
661
662
+ /**
663
+ * Optional placeholder in the filter text.
664
+ */
560
665
placeholder : string | undefined ;
561
666
667
+ /**
668
+ * An event signaling when the value of the filter text has changed.
669
+ */
562
670
readonly onDidChangeValue : Event < string > ;
563
671
672
+ /**
673
+ * An event signaling when the user indicated acceptance of the selected item(s).
674
+ */
564
675
readonly onDidAccept : Event < void > ;
565
676
677
+ /**
678
+ * Buttons for actions in the UI.
679
+ */
566
680
buttons : ReadonlyArray < QuickInputButton > ;
567
681
682
+ /**
683
+ * An event signaling when a button was triggered.
684
+ */
568
685
readonly onDidTriggerButton : Event < QuickInputButton > ;
569
686
687
+ /**
688
+ * Items to pick from.
689
+ */
570
690
items : ReadonlyArray < T > ;
571
691
692
+ /**
693
+ * If multiple items can be selected at the same time. Defaults to false.
694
+ */
572
695
canSelectMany : boolean ;
573
696
697
+ /**
698
+ * If the filter text should also be matched against the description of the items. Defaults to false.
699
+ */
574
700
matchOnDescription : boolean ;
575
701
702
+ /**
703
+ * If the filter text should also be matched against the detail of the items. Defaults to false.
704
+ */
576
705
matchOnDetail : boolean ;
577
706
707
+ /**
708
+ * Active items. This can be read and updated by the extension.
709
+ */
578
710
activeItems : ReadonlyArray < T > ;
579
711
712
+ /**
713
+ * An event signaling when the active items have changed.
714
+ */
580
715
readonly onDidChangeActive : Event < T [ ] > ;
581
716
717
+ /**
718
+ * Selected items. This can be read and updated by the extension.
719
+ */
582
720
selectedItems : ReadonlyArray < T > ;
583
721
722
+ /**
723
+ * An event signaling when the selected items have changed.
724
+ */
584
725
readonly onDidChangeSelection : Event < T [ ] > ;
585
726
}
586
727
728
+ /**
729
+ * A concrete [QuickInput](#QuickInput) to let the user input a text value.
730
+ *
731
+ * Note that in many cases the more convenient [window.showInputBox](#window.showInputBox)
732
+ * is easier to use.
733
+ */
587
734
export interface InputBox extends QuickInput {
588
735
736
+ /**
737
+ * Current input value.
738
+ */
589
739
value : string ;
590
740
741
+ /**
742
+ * Optional placeholder in the filter text.
743
+ */
591
744
placeholder : string | undefined ;
592
745
746
+ /**
747
+ * If the input value should be hidden. Defaults to false.
748
+ */
593
749
password : boolean ;
594
750
751
+ /**
752
+ * An event signaling when the value has changed.
753
+ */
595
754
readonly onDidChangeValue : Event < string > ;
596
755
756
+ /**
757
+ * An event signaling when the user indicated acceptance of the input value.
758
+ */
597
759
readonly onDidAccept : Event < void > ;
598
760
761
+ /**
762
+ * Buttons for actions in the UI.
763
+ */
599
764
buttons : ReadonlyArray < QuickInputButton > ;
600
765
766
+ /**
767
+ * An event signaling when a button was triggered.
768
+ */
601
769
readonly onDidTriggerButton : Event < QuickInputButton > ;
602
770
771
+ /**
772
+ * An optional prompt text providing some ask or explanation to the user.
773
+ */
603
774
prompt : string | undefined ;
604
775
776
+ /**
777
+ * An optional validation message indicating a problem with the current input value.
778
+ */
605
779
validationMessage : string | undefined ;
606
780
}
607
781
782
+ /**
783
+ * Button for an action in a [QuickPick](#QuickPick) or [InputBox](#InputBox).
784
+ */
608
785
export interface QuickInputButton {
786
+
787
+ /**
788
+ * Icon for the button.
789
+ */
609
790
readonly iconPath : string | Uri | { light : string | Uri ; dark : string | Uri } | ThemeIcon ;
791
+
792
+ /**
793
+ * An optional tooltip.
794
+ */
610
795
readonly tooltip ?: string | undefined ;
611
796
}
612
797
0 commit comments