1526
1526
return e ;
1527
1527
} ) ;
1528
1528
} ) ( ) ;
1529
- var __extends =
1529
+ var typedoc ,
1530
+ __extends =
1530
1531
( this && this . __extends ) ||
1531
1532
( function ( ) {
1532
1533
var extendStatics = function ( d , b ) {
@@ -1550,19 +1551,7 @@ var __extends =
1550
1551
? Object . create ( b )
1551
1552
: ( ( __ . prototype = b . prototype ) , new __ ( ) ) ) ;
1552
1553
} ;
1553
- } ) ( ) ,
1554
- typedoc ,
1555
- typedoc ,
1556
- typedoc ,
1557
- typedoc ,
1558
- typedoc ,
1559
- typedoc ,
1560
- typedoc ,
1561
- typedoc ,
1562
- typedoc ,
1563
- typedoc ,
1564
- typedoc ,
1565
- typedoc ;
1554
+ } ) ( ) ;
1566
1555
! ( function ( typedoc ) {
1567
1556
var services = [ ] ,
1568
1557
components = [ ] ;
@@ -2035,7 +2024,6 @@ var __extends =
2035
2024
typedoc . registerComponent ( MenuHighlight , '.menu-highlight' ) ;
2036
2025
} ) ( typedoc || ( typedoc = { } ) ) ,
2037
2026
( function ( typedoc ) {
2038
- var search ;
2039
2027
! ( function ( search ) {
2040
2028
var SearchLoadingState ;
2041
2029
! ( function ( SearchLoadingState ) {
@@ -2070,56 +2058,32 @@ var __extends =
2070
2058
}
2071
2059
return (
2072
2060
__extends ( Search , _super ) ,
2073
- ( Search . prototype . createIndex = function ( data ) {
2074
- var _this = this ,
2075
- builder = new lunr . Builder ( ) ;
2076
- builder . pipeline . add ( lunr . trimmer ) ,
2077
- builder . field ( 'name' , { boost : 10 } ) ,
2078
- builder . field ( 'parent' ) ,
2079
- builder . ref ( 'id' ) ;
2080
- var rows = data . rows ,
2081
- pos = 0 ,
2082
- length = rows . length ,
2083
- batch = function ( ) {
2084
- for ( var cycles = 0 ; cycles ++ < 100 ; )
2085
- if ( ( builder . add ( rows [ pos ] ) , ++ pos == length ) )
2086
- return (
2087
- ( _this . index = builder . build ( ) ) ,
2088
- _this . setLoadingState ( SearchLoadingState . Ready )
2089
- ) ;
2090
- setTimeout ( batch , 10 ) ;
2091
- } ;
2092
- batch ( ) ;
2093
- } ) ,
2094
2061
( Search . prototype . loadIndex = function ( ) {
2095
2062
var _this = this ;
2096
- if ( this . loadingState == SearchLoadingState . Idle )
2097
- if (
2098
- ( setTimeout ( function ( ) {
2099
- _this . loadingState == SearchLoadingState . Idle &&
2100
- _this . setLoadingState ( SearchLoadingState . Loading ) ;
2101
- } , 500 ) ,
2102
- this . data )
2103
- )
2104
- this . createIndex ( this . data ) ;
2105
- else {
2106
- var url = this . el . dataset . index ;
2107
- if ( ! url )
2108
- return void this . setLoadingState ( SearchLoadingState . Failure ) ;
2109
- fetch ( url )
2110
- . then ( function ( response ) {
2111
- if ( ! response . ok )
2112
- throw new Error ( 'The source is not found' ) ;
2113
- return response . text ( ) ;
2114
- } )
2115
- . then ( function ( source ) {
2116
- ( _this . data = eval ( source ) ) ,
2117
- _this . data && _this . createIndex ( _this . data ) ;
2118
- } )
2119
- . catch ( function ( ) {
2120
- _this . setLoadingState ( SearchLoadingState . Failure ) ;
2121
- } ) ;
2122
- }
2063
+ if ( this . loadingState == SearchLoadingState . Idle && ! this . data ) {
2064
+ setTimeout ( function ( ) {
2065
+ _this . loadingState == SearchLoadingState . Idle &&
2066
+ _this . setLoadingState ( SearchLoadingState . Loading ) ;
2067
+ } , 500 ) ;
2068
+ var url = this . el . dataset . index ;
2069
+ url
2070
+ ? fetch ( url )
2071
+ . then ( function ( response ) {
2072
+ if ( ! response . ok )
2073
+ throw new Error ( 'The search index is missing' ) ;
2074
+ return response . json ( ) ;
2075
+ } )
2076
+ . then ( function ( source ) {
2077
+ ( _this . data = source ) ,
2078
+ ( _this . index = lunr . Index . load ( source . index ) ) ,
2079
+ _this . setLoadingState ( SearchLoadingState . Ready ) ;
2080
+ } )
2081
+ . catch ( function ( error ) {
2082
+ console . error ( error ) ,
2083
+ _this . setLoadingState ( SearchLoadingState . Failure ) ;
2084
+ } )
2085
+ : this . setLoadingState ( SearchLoadingState . Failure ) ;
2086
+ }
2123
2087
} ) ,
2124
2088
( Search . prototype . updateResults = function ( ) {
2125
2089
if (
@@ -2260,7 +2224,7 @@ var __extends =
2260
2224
} ) ( typedoc . Component ) ;
2261
2225
( search . Search = Search ) ,
2262
2226
typedoc . registerComponent ( Search , '#tsd-search' ) ;
2263
- } ) ( ( search = typedoc . search || ( typedoc . search = { } ) ) ) ;
2227
+ } ) ( typedoc . search || ( typedoc . search = { } ) ) ;
2264
2228
} ) ( typedoc || ( typedoc = { } ) ) ,
2265
2229
( function ( typedoc ) {
2266
2230
var SignatureGroup = ( function ( ) {
@@ -2294,16 +2258,14 @@ var __extends =
2294
2258
_this . createGroups ( ) ,
2295
2259
_this . container &&
2296
2260
( _this . el . classList . add ( 'active' ) ,
2297
- _this . el
2298
- . querySelectorAll ( '.tsd-signature' )
2299
- . forEach ( function ( signature ) {
2300
- signature . addEventListener ( 'touchstart' , function ( event ) {
2301
- return _this . onClick ( event ) ;
2302
- } ) ,
2303
- signature . addEventListener ( 'click' , function ( event ) {
2304
- return _this . onClick ( event ) ;
2305
- } ) ;
2261
+ Array . from ( _this . el . children ) . forEach ( function ( signature ) {
2262
+ signature . addEventListener ( 'touchstart' , function ( event ) {
2263
+ return _this . onClick ( event ) ;
2306
2264
} ) ,
2265
+ signature . addEventListener ( 'click' , function ( event ) {
2266
+ return _this . onClick ( event ) ;
2267
+ } ) ;
2268
+ } ) ,
2307
2269
_this . container . classList . add ( 'active' ) ,
2308
2270
_this . setIndex ( 0 ) ) ,
2309
2271
_this
@@ -2333,19 +2295,15 @@ var __extends =
2333
2295
}
2334
2296
} ) ,
2335
2297
( Signature . prototype . createGroups = function ( ) {
2336
- var _this = this ,
2337
- signatures = this . el . querySelectorAll ( '.tsd-signature' ) ;
2298
+ var signatures = this . el . children ;
2338
2299
if ( ! ( signatures . length < 2 ) ) {
2339
2300
this . container = this . el . nextElementSibling ;
2340
- var descriptions = this . container . querySelectorAll (
2341
- '.tsd-description'
2342
- ) ;
2343
- ( this . groups = [ ] ) ,
2344
- signatures . forEach ( function ( el , index ) {
2345
- _this . groups . push (
2346
- new SignatureGroup ( el , descriptions [ index ] )
2347
- ) ;
2348
- } ) ;
2301
+ var descriptions = this . container . children ;
2302
+ this . groups = [ ] ;
2303
+ for ( var index = 0 ; index < signatures . length ; index ++ )
2304
+ this . groups . push (
2305
+ new SignatureGroup ( signatures [ index ] , descriptions [ index ] )
2306
+ ) ;
2349
2307
}
2350
2308
} ) ,
2351
2309
( Signature . prototype . onClick = function ( e ) {
0 commit comments