4
4
5
5
/* eslint-disable */
6
6
declare global {
7
+ /** Search engine data used by main.js and search.js */
8
+ declare var searchState : rustdoc . SearchState ;
7
9
/** Defined and documented in `storage.js` */
8
10
declare function nonnull ( x : T | null , msg : string | undefined ) ;
9
11
/** Defined and documented in `storage.js` */
@@ -17,8 +19,6 @@ declare global {
17
19
RUSTDOC_TOOLTIP_HOVER_MS : number ;
18
20
/** Used by the popover tooltip code. */
19
21
RUSTDOC_TOOLTIP_HOVER_EXIT_MS : number ;
20
- /** Search engine data used by main.js and search.js */
21
- searchState : rustdoc . SearchState ;
22
22
/** Global option, with a long list of "../"'s */
23
23
rootPath : string | null ;
24
24
/**
@@ -102,20 +102,22 @@ declare namespace rustdoc {
102
102
currentTab : number ;
103
103
focusedByTab : [ number | null , number | null , number | null ] ;
104
104
clearInputTimeout : function ;
105
- outputElement : function ( ) : HTMLElement | null ;
106
- focus: function ( ) ;
107
- defocus: function ( ) ;
108
- showResults: function ( HTMLElement | null | undefined ) ;
109
- removeQueryParameters: function ( ) ;
110
- hideResults: function ( ) ;
111
- getQueryStringParams: function ( ) : Object . < any , string > ;
105
+ outputElement ( ) : HTMLElement | null ;
106
+ focus ( ) ;
107
+ defocus ( ) ;
108
+ // note: an optional param is not the same as
109
+ // a nullable/undef-able param.
110
+ showResults ( elem ?: HTMLElement | null ) ;
111
+ removeQueryParameters ( ) ;
112
+ hideResults ( ) ;
113
+ getQueryStringParams ( ) : Object . < any , string > ;
112
114
origPlaceholder : string ;
113
115
setup : function ( ) ;
114
- setLoadingSearch: function ( ) ;
116
+ setLoadingSearch ( ) ;
115
117
descShards : Map < string , SearchDescShard [ ] > ;
116
118
loadDesc : function ( { descShard : SearchDescShard , descIndex : number } ) : Promise < string | null > ;
117
- loadedDescShard: function ( string , number , string ) ;
118
- isDisplayed: function ( ) : boolean ,
119
+ loadedDescShard ( string , number , string ) ;
120
+ isDisplayed ( ) : boolean,
119
121
}
120
122
121
123
interface SearchDescShard {
@@ -237,7 +239,7 @@ declare namespace rustdoc {
237
239
query : ParsedQuery ,
238
240
}
239
241
240
- type Results = Map < String , ResultObject > ;
242
+ type Results = { max_dist ?: number } & Map < number , ResultObject >
241
243
242
244
/**
243
245
* An annotated `Row`, used in the viewmodel.
0 commit comments