@@ -44,7 +44,7 @@ import { HttpRequests } from './http-requests'
4444import { Task , TaskClient } from './task'
4545import { EnqueuedTask } from './enqueued-task'
4646
47- class Index < D = Record < string , any > > {
47+ class Index < T = Record < string , any > > {
4848 uid : string
4949 primaryKey : string | undefined
5050 createdAt : Date | undefined
@@ -78,11 +78,11 @@ class Index<D = Record<string, any>> {
7878 * @param {Partial<Request> } config? Additional request configuration options
7979 * @returns {Promise<SearchResponse<T>> } Promise containing the search response
8080 */
81- async search < T = D > (
81+ async search < D = T > (
8282 query ?: string | null ,
8383 options ?: SearchParams ,
8484 config ?: Partial < Request >
85- ) : Promise < SearchResponse < T > > {
85+ ) : Promise < SearchResponse < D > > {
8686 const url = `indexes/${ this . uid } /search`
8787
8888 return await this . httpRequest . post (
@@ -103,11 +103,11 @@ class Index<D = Record<string, any>> {
103103 * @param {Partial<Request> } config? Additional request configuration options
104104 * @returns {Promise<SearchResponse<T>> } Promise containing the search response
105105 */
106- async searchGet < T = D > (
106+ async searchGet < D = T > (
107107 query ?: string | null ,
108108 options ?: SearchParams ,
109109 config ?: Partial < Request >
110- ) : Promise < SearchResponse < T > > {
110+ ) : Promise < SearchResponse < D > > {
111111 const url = `indexes/${ this . uid } /search`
112112
113113 const parseFilter = ( filter ?: Filter ) : string | undefined => {
0 commit comments