| 1645 | } |
| 1646 | |
| 1647 | const makeCount = < |
| 1648 | Table extends IndexedDbTable.AnyWithProps, |
| 1649 | Index extends IndexedDbDatabase.IndexFromTable<Table> |
| 1650 | >(options: { |
| 1651 | readonly from: IndexedDbQuery.From<Table> |
| 1652 | readonly index: Index | undefined |
| 1653 | readonly only?: IndexedDbQuery.ExtractIndexType<Table, Index> | undefined |
| 1654 | readonly lowerBound?: |
| 1655 | | IndexedDbQuery.ExtractIndexType<Table, Index> |
| 1656 | | undefined |
| 1657 | readonly upperBound?: |
| 1658 | | IndexedDbQuery.ExtractIndexType<Table, Index> |
| 1659 | | undefined |
| 1660 | readonly excludeLowerBound?: boolean | undefined |
| 1661 | readonly excludeUpperBound?: boolean | undefined |
| 1662 | }): IndexedDbQuery.Count<Table, Index> => { |
| 1663 | const self = Object.create(CountProto) |
| 1664 | self.from = options.from |
| 1665 | self.index = options.index |
| 1666 | self.only = options.only |
| 1667 | self.lowerBound = options.lowerBound |
| 1668 | self.upperBound = options.upperBound |
| 1669 | self.excludeLowerBound = options.excludeLowerBound |
| 1670 | self.excludeUpperBound = options.excludeUpperBound |
| 1671 | return self |
| 1672 | } |
| 1673 | |
| 1674 | const SelectProto: Omit< |
| 1675 | IndexedDbQuery.Select<any, never>, |