@@ -1477,73 +1477,61 @@ class DocSearch {
1477
1477
* Special type name IDs for searching by array.
1478
1478
* @type {number }
1479
1479
*/
1480
- // @ts -expect-error
1481
1480
this . typeNameIdOfArray = this . buildTypeMapIndex ( "array" ) ;
1482
1481
/**
1483
1482
* Special type name IDs for searching by slice.
1484
1483
* @type {number }
1485
1484
*/
1486
- // @ts -expect-error
1487
1485
this . typeNameIdOfSlice = this . buildTypeMapIndex ( "slice" ) ;
1488
1486
/**
1489
1487
* Special type name IDs for searching by both array and slice (`[]` syntax).
1490
1488
* @type {number }
1491
1489
*/
1492
- // @ts -expect-error
1493
1490
this . typeNameIdOfArrayOrSlice = this . buildTypeMapIndex ( "[]" ) ;
1494
1491
/**
1495
1492
* Special type name IDs for searching by tuple.
1496
1493
* @type {number }
1497
1494
*/
1498
- // @ts -expect-error
1499
1495
this . typeNameIdOfTuple = this . buildTypeMapIndex ( "tuple" ) ;
1500
1496
/**
1501
1497
* Special type name IDs for searching by unit.
1502
1498
* @type {number }
1503
1499
*/
1504
- // @ts -expect-error
1505
1500
this . typeNameIdOfUnit = this . buildTypeMapIndex ( "unit" ) ;
1506
1501
/**
1507
1502
* Special type name IDs for searching by both tuple and unit (`()` syntax).
1508
1503
* @type {number }
1509
1504
*/
1510
- // @ts -expect-error
1511
1505
this . typeNameIdOfTupleOrUnit = this . buildTypeMapIndex ( "()" ) ;
1512
1506
/**
1513
1507
* Special type name IDs for searching `fn`.
1514
1508
* @type {number }
1515
1509
*/
1516
- // @ts -expect-error
1517
1510
this . typeNameIdOfFn = this . buildTypeMapIndex ( "fn" ) ;
1518
1511
/**
1519
1512
* Special type name IDs for searching `fnmut`.
1520
1513
* @type {number }
1521
1514
*/
1522
- // @ts -expect-error
1523
1515
this . typeNameIdOfFnMut = this . buildTypeMapIndex ( "fnmut" ) ;
1524
1516
/**
1525
1517
* Special type name IDs for searching `fnonce`.
1526
1518
* @type {number }
1527
1519
*/
1528
- // @ts -expect-error
1529
1520
this . typeNameIdOfFnOnce = this . buildTypeMapIndex ( "fnonce" ) ;
1530
1521
/**
1531
1522
* Special type name IDs for searching higher order functions (`->` syntax).
1532
1523
* @type {number }
1533
1524
*/
1534
- // @ts -expect-error
1535
1525
this . typeNameIdOfHof = this . buildTypeMapIndex ( "->" ) ;
1536
1526
/**
1537
1527
* Special type name IDs the output assoc type.
1538
1528
* @type {number }
1539
1529
*/
1540
- // @ts -expect-error
1541
1530
this . typeNameIdOfOutput = this . buildTypeMapIndex ( "output" , true ) ;
1542
1531
/**
1543
1532
* Special type name IDs for searching by reference.
1544
1533
* @type {number }
1545
1534
*/
1546
- // @ts -expect-error
1547
1535
this . typeNameIdOfReference = this . buildTypeMapIndex ( "reference" ) ;
1548
1536
1549
1537
/**
@@ -1596,11 +1584,17 @@ class DocSearch {
1596
1584
* This is effectively string interning, so that function matching can be
1597
1585
* done more quickly. Two types with the same name but different item kinds
1598
1586
* get the same ID.
1599
- *
1600
- * @param {string } name
1587
+ *
1588
+ * @template T extends string
1589
+ * @overload
1590
+ * @param {T } name
1601
1591
* @param {boolean= } isAssocType - True if this is an assoc type
1602
- *
1603
- * @returns {number? }
1592
+ * @returns {T extends "" ? null : number }
1593
+ *
1594
+ * @param {string } name
1595
+ * @param {boolean= } isAssocType
1596
+ * @returns {number | null }
1597
+ *
1604
1598
*/
1605
1599
buildTypeMapIndex ( name , isAssocType ) {
1606
1600
if ( name === "" || name === null ) {
0 commit comments