@@ -924,6 +924,72 @@ export namespace Ace {
924
924
prefix : string ,
925
925
callback : CompleterCallback ) : void ;
926
926
}
927
+
928
+ export class AceInline {
929
+ show ( editor : Editor , completion : Completion , prefix : string ) : void ;
930
+ isOpen ( ) : void ;
931
+ hide ( ) : void ;
932
+ destroy ( ) : void ;
933
+ }
934
+
935
+ interface CompletionOptions {
936
+ matches ?: Completion [ ] ;
937
+ }
938
+
939
+ type CompletionProviderOptions = {
940
+ exactMatch ?: boolean ;
941
+ ignoreCaption ?: boolean ;
942
+ }
943
+
944
+ type CompletionRecord = {
945
+ all : Completion [ ] ;
946
+ filtered : Completion [ ] ;
947
+ filterText : string ;
948
+ } | CompletionProviderOptions
949
+
950
+ type GatherCompletionRecord = {
951
+ prefix : string ;
952
+ matches : Completion [ ] ;
953
+ finished : boolean ;
954
+ }
955
+
956
+ type CompletionCallbackFunction = ( err : Error | undefined , data : GatherCompletionRecord ) => void ;
957
+ type CompletionProviderCallback = ( err : Error | undefined , completions : CompletionRecord , finished : boolean ) => void ;
958
+
959
+ export class CompletionProvider {
960
+ insertByIndex ( editor : Editor , index : number , options : CompletionProviderOptions ) : boolean ;
961
+ insertMatch ( editor : Editor , data : Completion , options : CompletionProviderOptions ) : boolean ;
962
+ completions : CompletionRecord ;
963
+ gatherCompletions ( editor : Editor , callback : CompletionCallbackFunction ) : boolean ;
964
+ provideCompletions ( editor : Editor , options : CompletionProviderOptions , callback : CompletionProviderCallback ) : void ;
965
+ detach ( ) : void ;
966
+ }
967
+
968
+ export class Autocomplete {
969
+ constructor ( ) ;
970
+ autoInsert ?: boolean ;
971
+ autoSelect ?: boolean ;
972
+ exactMatch ?: boolean ;
973
+ inlineEnabled ?: boolean ;
974
+ getPopup ( ) : AcePopup ;
975
+ showPopup ( editor : Editor , options : CompletionOptions ) : void ;
976
+ detach ( ) : void ;
977
+ destroy ( ) : void ;
978
+ }
979
+
980
+ type AcePopupNavigation = "up" | "down" | "start" | "end" ;
981
+
982
+ export class AcePopup {
983
+ constructor ( parentNode : HTMLElement ) ;
984
+ setData ( list : Completion [ ] , filterText : string ) : void ;
985
+ getData ( row : number ) : Completion ;
986
+ getRow ( ) : number ;
987
+ getRow ( line : number ) : void ;
988
+ hide ( ) : void ;
989
+ show ( pos : Point , lineHeight : number , topdownOnly : boolean ) : void ;
990
+ tryShow ( pos : Point , lineHeight : number , anchor : "top" | "bottom" | undefined , forceShow ?: boolean ) : boolean ;
991
+ goTo ( where : AcePopupNavigation ) : void ;
992
+ }
927
993
}
928
994
929
995
@@ -946,3 +1012,43 @@ export const Range: {
946
1012
fromPoints ( start : Ace . Point , end : Ace . Point ) : Ace . Range ;
947
1013
comparePoints ( p1 : Ace . Point , p2 : Ace . Point ) : number ;
948
1014
} ;
1015
+
1016
+
1017
+ type InlineAutocompleteAction = "prev" | "next" | "first" | "last" ;
1018
+
1019
+ type TooltipCommandEnabledFunction = ( editor : Ace . Editor ) => boolean ;
1020
+
1021
+ interface TooltipCommand extends Ace . Command {
1022
+ enabled : TooltipCommandEnabledFunction | boolean ,
1023
+ position ?: number ;
1024
+ }
1025
+
1026
+ export class InlineAutocomplete {
1027
+ constructor ( ) ;
1028
+ getInlineRenderer ( ) : Ace . AceInline ;
1029
+ getInlineTooltip ( ) : InlineTooltip ;
1030
+ getCompletionProvider ( ) : Ace . CompletionProvider ;
1031
+ show ( editor : Ace . Editor ) : void ;
1032
+ isOpen ( ) : boolean ;
1033
+ detach ( ) : void ;
1034
+ destroy ( ) : void ;
1035
+ goTo ( action : InlineAutocompleteAction ) : void ;
1036
+ tooltipEnabled : boolean ;
1037
+ commands : Record < string , TooltipCommand >
1038
+ getIndex ( ) : number ;
1039
+ setIndex ( value : number ) : void ;
1040
+ getLength ( ) : number ;
1041
+ getData ( index ?: number ) : Ace . Completion | undefined ;
1042
+ updateCompletions ( options : Ace . CompletionOptions ) : void ;
1043
+ }
1044
+
1045
+ export class InlineTooltip {
1046
+ constructor ( parentElement : HTMLElement ) ;
1047
+ setCommands ( commands : Record < string , TooltipCommand > ) : void ;
1048
+ show ( editor : Ace . Editor ) : void ;
1049
+ updatePosition ( ) : void ;
1050
+ updateButtons ( force ?: boolean ) : void ;
1051
+ isShown ( ) : boolean ;
1052
+ detach ( ) : void ;
1053
+ destroy ( ) : void ;
1054
+ }
0 commit comments